// JavaScript Document
	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 getContent(strUrl,objId){
		xmlHttp=GetXmlHttpObject();
		
		if (xmlHttp==null){
			alert ("Browser does not support HTTP Request");
			return;
		}
		
		xmlHttp.onreadystatechange=function(){	
			if (xmlHttp.readyState==4 && xmlHttp.status == 200){				
				document.getElementById(objId).innerHTML = xmlHttp.responseText;				
			} 
		}
		xmlHttp.open("GET",strUrl,true);
		xmlHttp.send(null);
	}
	//load the city
	function CheckCityDetail(){		
		xmlHttp=GetXmlHttpObject();
		var id = document.getElementById('CbCountry').value;
		var strUrl = "ajax.php?page=provin&id="+id;
		if (xmlHttp==null){
			alert ("Browser does not support HTTP Request");
			return;
		}		
		xmlHttp.onreadystatechange=function(){	
			if (xmlHttp.readyState==4 && xmlHttp.status == 200){		
				document.getElementById('Cbprovince').innerHTML = xmlHttp.responseText;				
			} 
		}
		xmlHttp.open("GET",strUrl,true);
		xmlHttp.send(null);	
	}
	//check username
	function CheckUser(msg,act,idmsg){
		xmlHttp=GetXmlHttpObject();
		var name = document.getElementById(idmsg).value;
		var strUrl = "ajax.php?page=check&act="+act+"&name="+name;
		if (xmlHttp==null){
			alert ("Browser does not support HTTP Request");
			return;
		}		
		xmlHttp.onreadystatechange=function(){	
			if (xmlHttp.readyState==4 && xmlHttp.status == 200){		
				if(xmlHttp.responseText > 0){
					alert(msg);
					document.getElementById(idmsg).focus();
					document.getElementById(idmsg).value = '';
				}else{							 
				  return true;
				}			
			} 
		}
		xmlHttp.open("GET",strUrl,true);
		xmlHttp.send(null);		
	}
	
	
	
