// JavaScript Document
var xmlHttp
function search_course(name,date)
{
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_search_course.php";
	url=url+"?name="+name+"&date="+date;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged1;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged1()
{
	if (xmlHttp.readyState==4)
	{
		document.getElementById("result").innerHTML=xmlHttp.responseText;
	}
}

function check(name)
{
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_check.php";
	url=url+"?name="+name;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged2;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged2()
{
	if (xmlHttp.readyState==4)
	{
		document.getElementById("checkid").innerHTML=xmlHttp.responseText;
		dicument.getElementById("uname").focus();
	}
}




function next_image(name,cnt)
{
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_next_image.php";
	url=url+"?name="+name+"&cnt="+cnt;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged3;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged3()
{
	if (xmlHttp.readyState==4)
	{
		document.getElementById("pro_img").innerHTML=xmlHttp.responseText;
	}
}


function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
	    {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  catch (e)
	    {
	    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	  }
	return xmlHttp;
}


function checkid(id)
{
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_id.php";
	url=url+"?id="+id;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged4;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged4()
{
	if (xmlHttp.readyState==4)
	{
		document.getElementById("check_id").innerHTML=xmlHttp.responseText;
		dicument.getElementById("uname").focus();
	}
}

function check_name(name)
{
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_name.php";
	url=url+"?name="+name;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged5;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged5()
{
	if (xmlHttp.readyState==4)
	{
		document.getElementById("check").innerHTML=xmlHttp.responseText;
		dicument.getElementById("uname").focus();
	}
}


function check_affname(name)
{
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_affname.php";
	url=url+"?name="+name;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged6;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged6()
{
	if (xmlHttp.readyState==4)
	{
		document.getElementById("check_affname").innerHTML=xmlHttp.responseText;
		dicument.getElementById("uname").focus();
	}
}



function check_affid(id)
{
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_affid.php";
	url=url+"?id="+id;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged7;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged7()
{
	if (xmlHttp.readyState==4)
	{
		document.getElementById("check_affid").innerHTML=xmlHttp.responseText;
		dicument.getElementById("uname").focus();
	}
}


