	function alerte(x, y){
		k = document.getElementById('memory' + x.charAt(0)).innerHTML;
		i = document.getElementById('memory' + x.charAt(0)).innerHTML.indexOf(x.charAt(1));
		if (i > 1 && y > 0){
			j = document.getElementById('memory' + x.charAt(0)).innerHTML.replace(x.charAt(1), '');
			k = j.slice(0, i-y) +  + x.charAt(1) + j.slice(i-y);
			document.getElementById('memory' + x.charAt(0)).innerHTML = k;
		}
		if (i < k.length && y < 0){
			j = document.getElementById('memory' + x.charAt(0)).innerHTML.replace(x.charAt(1), '');
			k = j.slice(0, i-y) +  + x.charAt(1) + j.slice(i-y);
			document.getElementById('memory' + x.charAt(0)).innerHTML = k;
		}
		document.getElementById('pop' + x.charAt(0)).innerHTML = '';
		for (a = 1; a < k.length; a++){
			document.getElementById('pop' + x.charAt(0)).innerHTML += '<div>' + document.getElementById('hide' + x.charAt(0) + k.charAt(a)).innerHTML + '</div>';
		}
		//alert(k);
	}
	function addArticle(x){
		k = document.getElementById('memory0').innerHTML;
		if (k.indexOf(x) < 0) { 
			document.getElementById('memory0').innerHTML += x;
			
			document.getElementById('col0').innerHTML += '<div id="hide03" onclick="alerte(\'03\', -1);">Div 3</div>';
		}
		else {
			document.getElementById('memory0').innerHTML = document.getElementById('memory0').innerHTML.replace(x, '');
		}
	}
	function changeArtVideox(newKey, ref){
		document.getElementById('vidTitle').innerHTML = ref.innerHTML;
		document.getElementById('vidpanel').innerHTML = '<embed src="http://www.cagefilm.com/nvplayer.swf?config=http://www.cagefilm.com/nuevo/econfig.php?key=' + newKey + '" height="315px" width="550px" /></embed>';

	}
	function changeArtVideo(newKey, ref){
		document.getElementById('vidTitle').innerHTML = ref.innerHTML;
//		document.getElementById('vidpanel').innerHTML = '<embed src="http://www.cagefilm.com/nvplayer.swf?config=http://www.cagefilm.com/nuevo/econfig.php?key=' + newKey + '" height="315px" width="550px" /></embed>';
		document.getElementById('vidpanel').innerHTML = "<object width=\"550px\" height=\"315px\"><param name=\"movie\" value=\"http://www.cagefilm.com/nvp/player/nvplayer.swf?config=http://www.cagefilm.com/nvp/econfig.php?key=" + newKey + "\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.cagefilm.com/nvp/player/nvplayer.swf?config=http://www.cagefilm.com/nvp/econfig.php?key=" + newKey + "\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" wmode=\"transparent\" width=\"550px\" height=\"315px\"></embed></object>";
	}
	function changeVideo(newKey, ref){
		document.getElementById('vidTitle').innerHTML = ref.innerHTML;
//		document.getElementById('vidpanel').innerHTML = '<embed src="http://www.cagefilm.com/nvplayer.swf?config=http://www.cagefilm.com/nuevo/econfig.php?key=' + newKey + '" width="320" height="247" wmode="transparent" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" /></embed>';
		document.getElementById('vidpanel').innerHTML = "<object width=\"320px\" height=\"247px\"><param name=\"movie\" value=\"http://www.cagefilm.com/nvp/player/nvplayer.swf?config=http://www.cagefilm.com/nvp/econfig.php?key=" + newKey + "\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.cagefilm.com/nvp/player/nvplayer.swf?config=http://www.cagefilm.com/nvp/econfig.php?key=" + newKey + "\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" wmode=\"transparent\" width=\"320px\" height=\"247px\"></embed></object>";
	}
	function jJax(run, bear){
		var xmlhttp;
		if (window.XMLHttpRequest)
		  {
		  // code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		  }
		else if (window.ActiveXObject)
		  {
		  // code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		else
		  {
		  alert("Your browser does not support XMLHTTP!");
		  }
		xmlhttp.onreadystatechange=function()
		{
		if(xmlhttp.readyState==4)
		  {
			if (run == 17) {
				document.getElementById('flvList').innerHTML = xmlhttp.responseText;
			}
			if (run == 20) {
				document.getElementById('flvList').innerHTML = xmlhttp.responseText;
			}

		  }
		}
		if (run == 17) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+bear,true);
		}
		if (run == 20) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+bear,true);
		}
		xmlhttp.send(null);
	}
	function ajaxFunction(get, run, art){
		var xmlhttp;
		if (window.XMLHttpRequest)
		  {
		  // code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		  }
		else if (window.ActiveXObject)
		  {
		  // code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		else
		  {
		  alert("Your browser does not support XMLHTTP!");
		  }
		xmlhttp.onreadystatechange=function()
		{
		if(xmlhttp.readyState==4)
		  {
			if (run == 0) {
				document.getElementById('imLister').innerHTML = xmlhttp.responseText;
			}
			else if (run == 1) {
				document.getElementById('activeIms').innerHTML = xmlhttp.responseText;
			}
			else if (run == 2) {
				document.getElementById('activeIms').innerHTML = xmlhttp.responseText;
			}
			else if (run == 3) {
				document.getElementById('activeIms').innerHTML = xmlhttp.responseText;
			}
			else if (run == 4) {
				document.getElementById('selectArt').innerHTML = xmlhttp.responseText;
			}
			else if (run == 5) {
				document.getElementById('selectTeach').innerHTML = xmlhttp.responseText;
			}
			else if (run == 6) {
				document.getElementById('hpItems').innerHTML = xmlhttp.responseText;
			}
			else if (run == 7) {
				document.getElementById('hvItems').innerHTML = xmlhttp.responseText;
			}
			else if (run == 8) {
				document.getElementById('report').innerHTML = "";//xmlhttp.responseText;
			}
			else if (run == 9) {
				document.getElementById('report').innerHTML = xmlhttp.responseText;
			}
			else if (run == 10) {
				document.getElementById('report').innerHTML = xmlhttp.responseText;
			}
			else if (run == 11) {
				document.getElementById('hvItems').innerHTML = xmlhttp.responseText;
			}
			else if (run == 12) {
				io = xmlhttp.responseText.split("|");
				document.getElementById('UNClear').style.backgroundColor = io[0];
				document.getElementById('UNClear').value = io[1];
			}
			else if (run == 13) {
				document.getElementById('episodeInfo').innerHTML = xmlhttp.responseText;
			}
			else if (run == 14) {
				io = xmlhttp.responseText.split("|");
				document.getElementById('emailClear').style.backgroundColor = io[0];
				document.getElementById('emailClear').value = io[1];
			}
			else if (run == 15) {
				document.getElementById('flvList').innerHTML = xmlhttp.responseText;
			}
			else if (run == 16) {
				document.getElementById('flvList').innerHTML = xmlhttp.responseText;
			}
			else if (run == 18) {
				document.getElementById('flvList').innerHTML = xmlhttp.responseText;
			}
			else if (run == 19) {
				document.getElementById('flvList').innerHTML = xmlhttp.responseText;
			}

		  }
		}
		if (run == 0) {
			xmlhttp.open("GET","/ajax/index.php?act=0&art="+art+"&arr="+get,true);
		}
		else if (run == 1) {
			xmlhttp.open("GET","/ajax/index.php?act=1&art="+art+"&AID="+get,true);
		}
		else if (run == 2) {
			xmlhttp.open("GET","/ajax/index.php?act=2&art="+art+"&AID="+get,true);
		}
		else if (run == 3) {
			xmlhttp.open("GET","/ajax/index.php?act=3&art="+art+"&AID="+get,true);
		}
		else if (run == 4) {
			xmlhttp.open("GET","/ajax/index.php?act=4&art="+get,true);
		}
		else if (run == 5) {
			xmlhttp.open("GET","/ajax/index.php?act=5&art="+get,true);
		}
		else if (run == 6) {
			xmlhttp.open("GET","/ajax/index.php?act=6&art="+art+"&shift="+get,true);
		}
		else if (run == 7) {
			xmlhttp.open("GET","/ajax/index.php?act=7&art="+art+"&shift="+get,true);
		}
		else if (run == 8) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&refID="+art+"&newVal="+get,true);
		}
		else if (run == 9) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&refID="+get,true);
		}
		else if (run == 10) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&refID="+get,true);
		}
		else if (run == 11) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&series="+get+"&key="+art,true);
		}
		else if (run == 12) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&UN="+get,true);
		}
		else if (run == 13) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&eID="+get+"&sID="+art,true);
		}
		else if (run == 14) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&email="+get,true);
		}
		else if (run == 15) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&slID="+get+"&flvID="+art,true);
		}
		else if (run == 16) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&slID="+get+"&flvID="+art+"&del=true",true);
		}
		else if (run == 18) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&cseID="+get+"&slID="+art,true);
		}
		else if (run == 19) {
			xmlhttp.open("GET","/ajax/index.php?act="+run+"&cseID="+get+"&slID="+art+"&del=true",true);
		}
		xmlhttp.send(null);
	}
	function conify(a,b,c){
		if (confirm("Delete this item?")){
			document.getElementById('report').innerHTML = '<input type="hidden" name="condemn" value="'+c+'"/><input type="hidden" name="typeOfDeath" value="'+a+'"/>'//ajaxFunction(a, b, c);
			document.formx.formID.value = "9";
			document.formx.submit();
		}
	}
	function vidDel(a,b){
		if (confirm("Delete this item?")){
			document.getElementById('report').innerHTML = '<input type="hidden" name="condemnA" value="'+a+'"/><input type="hidden" name="condemnB" value="'+b+'"/>'//ajaxFunction(a, b, c);
			document.formx.formID.value = "11";
			document.formx.submit();
		}
	}	
	function popUp(target,w, h){
		newWindow = window.open(target, 'popD','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width='+ w +',height=' + h);
	}
