var hostname=window.location.hostname;
if(hostname=="localhost"){
	var weburl="http://localhost/campus";
}else{
	var weburl="http://"+hostname+"";
}


function getRequest(action,value,siteUrl){
	try{
			ob1=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
				ob1=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e2){
				ob1=false;
		}
	}
	if(!ob1 && typeof XMLHttpRequest!='undefined'){
			ob1=new XMLHttpRequest();
	}
	
	var url=weburl+"/ajax.php?val="+value+"&action="+action;
    
	ob1.open("GET",url,true);
	if(action=='get_city'){
		ob1.onreadystatechange=show_city;
	}else if(action=='get_front_city'){
		ob1.onreadystatechange=show_front_city;
	}else if(action=='get_address'){
		ob1.onreadystatechange=show_address;
	}else{
		ob1.onreadystatechange=show_form;
	}
	ob1.send(null);
}

function show_front_city(){
	if(ob1.readyState==4){
	 	var resp=ob1.responseText;
		document.getElementById("show_address").innerHTML="";
		document.getElementById("show_city").innerHTML=resp;
	}
}
function show_city(){
	if(ob1.readyState==4){
	 	var resp=ob1.responseText;
		document.getElementById("show_city").innerHTML=resp;
	}
}
function show_address(){
	if(ob1.readyState==4){
		var resp=ob1.responseText;		
		document.getElementById("show_address").innerHTML=resp;
	}
}

