var xmlHttp;
var tscat;
var tscate;
//var site_url='http://www.advenster.com/';
//var site_url='http://72.167.236.151/';
//var site_url='http://comp12/advenster/';
	
	//##############################################################################################
	function hello()
	{
		alert('hello Satyam');
	}
	
	// TO CHECK BLANK ENTRY*************************************SATYAM ##############
	function trimAll(sString) 
{
while (sString.substring(0,1) == ' ')
{
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ')
{
sString = sString.substring(0,sString.length-1);
}
return sString
}
// TO CHECK BLANK ENTRY******************************************SATYAM #########

	function show_state(id,type)
	{ 
	
	   tscat=id;
		document.getElementById(id).innerHTML="<img src='images/load.gif' height='15' width='15'> <b>Loading ...<b> ";
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="show_school_state1.php?country_id="+type;
		xmlHttp.onreadystatechange=state_show_state
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function state_show_state() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		
		 document.getElementById(tscat).innerHTML=xmlHttp.responseText;
		 
		} 
	}

	////////////////////////////////////////////////////////////////////////////////////////////////
	
	function show_city(id,type,country_id)
	{ 
	   tscat=id;
		document.getElementById(id).innerHTML="<img src='images/load.gif' height='15' width='15'> <b>Loading ...<b> ";
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="show_school_city1.php?country_id="+country_id+"&region_code="+type;
		xmlHttp.onreadystatechange=state_show_city
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function state_show_city() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			
		 document.getElementById(tscat).innerHTML=xmlHttp.responseText;
		} 
	}
	
	
	////////////////////////////////////////////////////////////////////////////////////////////////
	
	function delete_profile_photo_video(type) //FOR MEMBER
	{ 
	   
	  // tscat=id;
		if(window.confirm("Do you want to remove this "+type+"?"))
		{
		//document.getElementById(id).innerHTML="<img src='images/load.gif' height='15' width='15'> <b>Loading ...<b> ";
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url=site_url+"delete_profile_photo.php?type="+type ;
		xmlHttp.onreadystatechange=delprofilephoto
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		}
		else
		{
		return false;	
		}
	}	
	
	
	function delprofilephoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		 alert(xmlHttp.responseText);
		 window.location.href=site_url+'changephoto/member';
		} 
	}
	
	////////////////////////////////////////////////////////////////////////////////////////////////
	
	function delete_company_photo_video(type) //FOR Compnay
	{ 
	  // tscat=id;
		if(window.confirm("Do you want to remove this "+type+"?"))
		{
		//document.getElementById(id).innerHTML="<img src='images/load.gif' height='15' width='15'> <b>Loading ...<b> ";
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url=site_url+"delete_company_photo_video.php?type="+type ;
		xmlHttp.onreadystatechange=delcompanyphoto
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		}
		else
		{
		return false;	
		}
	}	
	
	
	function delcompanyphoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		 alert(xmlHttp.responseText);
		 window.location.href=site_url+'updateprofile';
		} 
	}
	
	
	
	//################################################################################################
	
	/*function showPhotoRating(divid,id,val,cat,isLogin)
	{ 

tscat=divid;
	     if(isLogin=='f')
	   {
		   alert('Please login to rate this money shot!');
		   return false;
	   }
	 
		//document.getElementById(divid).innerHTML="<img src='images/load.gif' height='15' width='15'> <b>Loading ...<b> ";
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="photo_rating.php?id="+id+"&val="+val+"&cat="+cat;
		xmlHttp.onreadystatechange=stateshowPhotoRating
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function stateshowPhotoRating() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		
		 document.getElementById(tscat).innerHTML=xmlHttp.responseText;
		 
		} 
	}

	*/

////---------------------------delete video album and related video for member---------------------------------------------------		
//		
//	function del_album_member_video(vaid,mid)
//		{ 
//			
//			//document.getElementById(divid).innerHTML="<img src='images/load.gif' height='20' width='20'> <b>Loading ...<b> ";
//			var response = window.confirm("Do you want to delete it permanently video album related video?");
//     if (response) {
//        xmlHttp=GetXmlHttpObject()
//		if (xmlHttp==null)
//		{
//		alert ("Browser does not support HTTP Request")
//		return
//		}
//		
//		var url=site_url+"delete_member_album.php?vaid="+vaid+"&cpid="+mid;
//		xmlHttp.onreadystatechange=del_album_member_v
//		xmlHttp.open("GET",url,true);
//		xmlHttp.send(null);
//     }
//   else {
//          return false;
//     }
//		}
//		function del_album_member_v() 
//		{ 
//		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
//		{ 
//		
//	 alert (innerHTML=xmlHttp.responseText);
//		
//		} 
//		}	
//		
		
			
		function saved_comapany(cpid)
		{ 
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		alert ("Browser does not support HTTP Request")
		return
		}
		var url="addtofav.php?cpid="+cpid;
		xmlHttp.onreadystatechange=favChanged 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		}
		function favChanged() 
		{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		alert(xmlHttp.responseText); 
		} 
		}
//################################################################
remove_saved_company
	function remove_saved_company(sid)
	{ 
	   
		if(window.confirm("Do you want to remove this company from your listing?"))
		{
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url=site_url+"remove_saved_company.php?sid="+sid ;
		xmlHttp.onreadystatechange=removesavecompany
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		}
		else
		{
		return false;	
		}
	}	
	
	
	function removesavecompany() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		document.getElementById('satyamSavedCompany').innerHTML=xmlHttp.responseText;
		} 
	}
		
		     function allready_exist(val)
	
 {  
		//RID=id;
		//RVAL=val
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="chk_registration.php?val="+val;
		xmlHttp.onreadystatechange=allready_8
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	
	
	
		
		//################################################################################################
	
	 function GetXmlHttpObject()
	{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		try {
		objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
		try{
		objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP")
		}
		catch (e){}
		}
	}
	return objXMLHttp
	}
	
	//########################################FAVICON#################################################