// JavaScript Document
var xmlHttp;
function showAutoState(val,sel)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="index.php?do=showstate&country_id="+val+"&sel="+sel;
	xmlHttp.onreadystatechange=getAutoState;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}

function showJobState(val,sel)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="index.php?do=showstate&country_id="+val+"&sel="+sel;
	xmlHttp.onreadystatechange=getJobState;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function showMerchandiseState(val,sel)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="index.php?do=showstate&country_id="+val+"&sel="+sel;
	xmlHttp.onreadystatechange=getMerchandiseState;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function showPersonalState(val,sel)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="index.php?do=showstate&country_id="+val+"&sel="+sel;
	xmlHttp.onreadystatechange=getPersonalState;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}



function showRealestateState(val,sel)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="index.php?do=showstate&country_id="+val+"&sel="+sel;
	xmlHttp.onreadystatechange=getRealestateState;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}



function showServiceState(val,sel)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	var url="index.php?do=showstate&country_id="+val+"&sel="+sel;
	xmlHttp.onreadystatechange=getServiceState;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function getDatePicker(mon,yr)
{
	if(((mon > 0) && (mon <= 12)) && (yr > 0))
	{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="index.php?do=getcalender&month="+mon+"&year="+yr;
		xmlHttp.onreadystatechange=getCalenderChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
}

function getCalenderChanged()
{
	if(xmlHttp.readyState==1)
	{
		document.getElementById("cal_show").innerHTML="<img src='images/loading.gif' border='0'>";
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("cal_show").innerHTML=xmlHttp.responseText;
	}
}


function getAutoState()
{
	if(xmlHttp.readyState==1)
	{
		document.getElementById("state_auto").innerHTML="<img src='images/loading.gif' border='0'>";
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("state_auto").innerHTML=xmlHttp.responseText;
	}
}

function getJobState()
{
	if(xmlHttp.readyState==1)
	{
		document.getElementById("state_job").innerHTML="<img src='images/loading.gif' border='0'>";
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("state_job").innerHTML=xmlHttp.responseText;
	}
}


function getMerchandiseState()
{
	if(xmlHttp.readyState==1)
	{
		document.getElementById("state_merchandise").innerHTML="<img src='images/loading.gif' border='0'>";
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("state_merchandise").innerHTML=xmlHttp.responseText;
	}
}


function getPersonalState()
{
	if(xmlHttp.readyState==1)
	{
		document.getElementById("state_personal").innerHTML="<img src='images/loading.gif' border='0'>";
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("state_personal").innerHTML=xmlHttp.responseText;
	}
}



function getRealestateState()
{
	if(xmlHttp.readyState==1)
	{
		document.getElementById("state_realestate").innerHTML="<img src='images/loading.gif' border='0'>";
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("state_realestate").innerHTML=xmlHttp.responseText;
	}
}



function getServiceState()
{
	if(xmlHttp.readyState==1)
	{
		document.getElementById("state_service").innerHTML="<img src='images/loading.gif' border='0'>";
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("state_service").innerHTML=xmlHttp.responseText;
	}
}



function GetXmlHttpObject()
{
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}


