function create_object(){
	var obj=null;
	try{
		/************** Firefox, Opera 8.0+, Safari ************* */
		obj=new XMLHttpRequest();
	}catch(e){
		/* ************* Internet Explorer************* */
		try{
			obj=new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			obj=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return obj;
}

htp		=	create_object();
http		=	create_object();
http4		=	create_object();

function cat_drop_down(catID,scatId)
{
	
	var url	=	"ajax_response.php?catId="+catID+"&sbcatId="+scatId;
	//alert(url);
	xmlHttp2	=	create_object();	
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)	
	xmlHttp2.onreadystatechange = function()
	{		
			if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
			{		
			  var txt	 = xmlHttp2.responseText;
			     //alert(txt);
				   if(txt!=""){					
					  //alert("cat_tree1");
					document.getElementById("cat_tree1").innerHTML=txt;							
					 }	
			  }
	
	}
}

function get_city_by_state(stateID,scatId)
{
	
	var url	=	"ajax_response.php?statId="+stateID+"&sbcatId="+scatId+"&ran="+Math.random();;
	//alert(url);
	xmlHttp3	=	create_object();
	xmlHttp3.open("GET",url,true)
	xmlHttp3.send(null)
	xmlHttp3.onreadystatechange = function()
	{		
			if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")
			{		
			  var txt	 = xmlHttp3.responseText;
			     //alert(txt);
					 if(txt!="")
					 {
					document.getElementById("city_link").innerHTML=xmlHttp3.responseText							
					 }	
			  }
	
	}
}

function refreshCaptcha(){
 	 url	=	site_ws_path+"/ajax_response.php?vact=captcha";	
	 htp.open('get',url,false);
	 htp.onreadystatechange	=	function handle_response_captcha(){
		 if(htp.readyState==4){
			var txt	=	htp.responseText;
			if(txt!=""){
				document.getElementById('captcha_div').innerHTML	=	txt;
				
			}
		 }
	 };
	 htp.send(null);
}

function check_user(){
var username = document.frm.user_id.value;
http4=create_object();	
var url	=	"ajax_response.php?chk=user&c="+username;
   //alert(url);
   http4.open("GET",url,true);
   http4.send(null);
   http4.onreadystatechange	= function(){
		if(http4.readyState==4 || http4.readyState=="complete"){	
		var txt	=	http4.responseText;
		//alert(txt);
		document.getElementById("txtHint1").innerHTML=http4.responseText; 
		} 
   }
  
}