// JavaScript Document
/*********** Paging *********************/
function ajaxPaging(urls,list){
	//alert(urls); alert(list);
	retDiv=list;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
	  alert ("Your browser does not support AJAX!");
	  return;
  	}
	var url=urls;
	url=url+"&sid="+Math.random();
	//alert(url);
	//url=url+"&tblname="+tableName+"&idfld="+idField+"&statfld="+statusField+"&id="+id;//alert(url);
	xmlHttp.onreadystatechange=retPage;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function retPage()
{
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById(retDiv).innerHTML=xmlHttp.responseText;
	}
	else
	{ 
	document.getElementById(retDiv).innerHTML="<img src=\"images/003.gif\" height=\"20\" width=\"20\" />";
	}
}
/************************************************************************************/
/**************************************************/
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 check_avail(mail_id)
{

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
  	}
	var url="check_avail.php";
	url=url+"?sid="+Math.random();
	url=url+"&email="+mail_id;
	xmlHttp.onreadystatechange=ret_check_avail;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function ret_check_avail()
{
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById('Avail').innerHTML=xmlHttp.responseText;
	}
	else
	{ 
	document.getElementById('Avail').innerHTML="<img src=\"admin/images/003.gif\" height=\"20\" width=\"20\" />";
	}
}
/*********************************************************************/

/*=========================================Schedule Box============================================*/
function schedule(seledate){
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
  	}
	var url="scheduledetails.php";
	url=url+"?sid="+Math.random();
	url=url+"&dayval="+seledate;
	xmlHttp.onreadystatechange=schedulenext;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function schedulenext()
{
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById('scheduleboxdiv').innerHTML=xmlHttp.responseText;
	}
	else
	{ 
	document.getElementById('scheduleboxdiv').innerHTML="<img src=\"admin/images/003.gif\" height=\"20\" width=\"20\" />";
	}
}


function marquee(val,div)
{
	//alert(val);
	//alert(div);
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
  	}
	/*if(val==4)
	{
		alert("ethi");
		document.getElementById("spncurr").style.display="none";
		
		
	}
	else if(val==3)
	{
		document.getElementById("found1").style.display="none";
	}
	else if(val==2)
	{
		document.getElementById("suurpprrt").style.display="none";
	}
	else if(val==1)
	{
		document.getElementById("pastdic").style.display="none";
	}
	else if(val==5)
	{
		document.getElementById("last").style.display="none";
	}*/
	//var ss=document.getElementById("spncurr");
	//alert(ss);
	//document.getElementById("spncurr").style.display="none"
	//alert("purathu");
	sndval	=	div;
	var url="marquee.php";	
	url=url+"?sid="+Math.random();
	url=url+"&val="+val;	
	//alert(url);
	xmlHttp.onreadystatechange=marq;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function marq()
{
	
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById(sndval).innerHTML=xmlHttp.responseText;
	}
	else
	{ 
	document.getElementById(sndval).innerHTML="<img src=\"admin/images/003.gif\" height=\"20\" width=\"20\" />";
	}
}

