
/*---------------- For rating  ----------------------------*/
var xmlhttp
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	  try {
	  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
	 } catch (e) {
	  try {
	    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  } catch (E) {
	   xmlhttp=false
	  }
	 }
	@else
	 xmlhttp=false
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	 try {
	  xmlhttp = new XMLHttpRequest();
	 } catch (e) {
	  xmlhttp=false
	 }
	}
	function myXMLHttpRequest() {
	  var xmlhttplocal;
	  try {
	    xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
	 } catch (e) {
	  try {
	    xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
	  } catch (E) {
	    xmlhttplocal=false;
	  }
	 }

	if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {
	 try {
	  var xmlhttplocal = new XMLHttpRequest();
	 } catch (e) {
	  var xmlhttplocal=false;
	  alert('couldn\'t create xmlhttp object');
	 }
	}
	return(xmlhttplocal);
}

function change(url)
{	 
	 xmlhttp.open("GET", url, true);
	 xmlhttp.send(null);
	
	 xmlhttp.onreadystatechange=function()
	 {
		if(xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
		{
			if(xmlhttp.status==200)
			{						
				if(xmlhttp.responseText!='')
				{						
					results2 = xmlhttp.responseText.split("^");					
					if(results2.length == 2)
					{						
						document.getElementById('main').innerHTML ='';
						document.getElementById('main').innerHTML = results2[1];
						if(results2[0] == 1)
						{
							setTimeout("changeleft('school_video.php')",2000);
						}
					}
					else
					{
						document.getElementById('main').innerHTML ='';
						document.getElementById('main').innerHTML = results2[0];		
					}
									
				}				
			}
		}
	 };	
}
function changeleft(url)
{	 
	 xmlhttp.open("GET", url, true);	 
	 xmlhttp.send(null);
	 xmlhttp.onreadystatechange=function()
	 {
		if(xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
		{			
			if(xmlhttp.status==200)
			{						
				if(xmlhttp.responseText!='')
				{
					document.getElementById('right_video').innerHTML ='';
					document.getElementById('right_video').innerHTML = xmlhttp.responseText;					
				}				
			}
		}
	 };	
}

function schoolvid(school)
{
	 xmlhttp.open("GET", "school_video.php?school=" + escape(school), true);
	 xmlhttp.send(null);
//	 document.getElementById('right_video').innerHTML = ''+document.getElementById('right_video').innerHTML;
	 xmlhttp.onreadystatechange=function()
	 {
		if(xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
		{
			if(xmlhttp.status==200)
			{						
				if(xmlhttp.responseText!='')
				{						
					document.getElementById('right_video').innerHTML ='';
					document.getElementById('right_video').innerHTML = xmlhttp.responseText;
				}				
			}
		}
	 };	 
}

function srchvid()
{
	 var srch=document.getElementById('srch').value; //document.sfrm.srch.value;
	 xmlhttp.open("GET", "school_video.php?srch=" + escape(srch), true);
	 xmlhttp.send(null);
//	 document.getElementById('right_video').innerHTML = ''+document.getElementById('right_video').innerHTML;
	 xmlhttp.onreadystatechange=function()
	 {
		if(xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
		{
			if(xmlhttp.status==200)
			{						
				if(xmlhttp.responseText!='')
				{						
					document.getElementById('right_video').innerHTML ='';
					document.getElementById('right_video').innerHTML = xmlhttp.responseText;
					return false; 
				}				
			}
		}
	 };	
	 return false; 
}
