// JavaScript Document
 var xmlHttp
 var xmlHttp1
  //#################################################[GET CSS FILE]################################################  
	var css_id;
 	function Get_CssFile(file,id)
	{  
	    css_id=id;
		document.getElementById(css_id).innerHTML="<img src='../../themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="get_cssfile.php?file="+file;
		xmlHttp.onreadystatechange=GetCssFile
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetCssFile() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById(css_id).innerHTML= xmlHttp.responseText;
		}
	}
 //################################################[GET STATE FOR COUNTRY]#################################################
  var country_id;
  function Get_State(cid,id,type)
	{  
	    country_id=id;
		document.getElementById(id).innerHTML="<img src='../../themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="get_state.php?cid="+cid+"&type="+type;;
		xmlHttp.onreadystatechange=GetState
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetState() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById(country_id).innerHTML= xmlHttp.responseText;
		}
	}
 //################################################[GET CITY FOR COUNTRY]#################################################
  var cnt_id;
  function Get_City(cid,id)
	{  
	    cnt_id=id;
		document.getElementById(id).innerHTML="<img src='../../themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="get_city.php?cid="+cid;
		xmlHttp.onreadystatechange=GetCity
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetCity() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById(cnt_id).innerHTML= xmlHttp.responseText;
		}
	}
 //############################################[SHOW BOX FOR ADD NEW STATE]#####################################################
 var sas;
 function Show_Add_State(cid,id)
	{  
	    sas=id;
		document.getElementById(id).innerHTML="<img src='../../themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="show_add_state.php?id="+cid;
		xmlHttp.onreadystatechange=GetShowAddState
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetShowAddState() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById(sas).innerHTML= xmlHttp.responseText;
		}
	}
 //#################################################################################################
 var ses;
 function Show_Edit_State(sid,cid,id)
	{ 	ses=id;
		document.getElementById(id).innerHTML="<img src='../../themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="show_edit_state.php?id="+sid+"&cid="+cid;
		xmlHttp.onreadystatechange=GetShowEditState
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetShowEditState() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById(ses).innerHTML= xmlHttp.responseText;
		}
	}
 //###########################################[SHOW ADD CITY BOX]######################################################
  var sac;
  function Show_Add_City(cid,id)
	{  
	    sac=id;
		document.getElementById(id).innerHTML="<img src='../../themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="show_add_city.php?id="+cid;
		xmlHttp.onreadystatechange=GetShowAddCity
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetShowAddCity() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById(sac).innerHTML= xmlHttp.responseText;
		}
	}
	 //#################################################################################################
 var sec;
 function Show_Edit_City(sid,cid,id)
	{  
	    sec=id;
		document.getElementById(id).innerHTML="<img src='../../themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="show_edit_city.php?sid="+sid+"&cid="+cid;
		xmlHttp.onreadystatechange=GetShowEditCity
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetShowEditCity() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById(sec).innerHTML= xmlHttp.responseText;
		}
	}
 //#################################################################################################

//#########################################[ Save Registration ]########################################################
//var regid;
//function Save_Registration(email,pass,code,id)
//	{  
//	    regid=id;
//		xmlHttp=GetXmlHttpObject()
//		if (xmlHttp==null)
//		{
//			alert ("Browser does not support HTTP Request")
//			return
//		}		
//		var url="save_registration.php?email="+email+"&pass="+pass+"&code="+code;
//		xmlHttp.onreadystatechange=GetShowReg
//		xmlHttp.open("GET",url,true)
//		xmlHttp.send(null)
//	}	
//		
//	function GetShowReg() 
//	{ 
//		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
//		{		 
//		  openDialog(regid);
//		}
//	}
 //#################################################################################################
 	 //############################################[ Registration Step_2 ]#####################################################
 //function Save_Registration_Step2(email,pass,code,name,lname,sex,dd,mm,yy,loc)
//	{  
//	    xmlHttp=GetXmlHttpObject()
//		if (xmlHttp==null)
//		{
//			alert ("Browser does not support HTTP Request")
//			return
//		}		
//		var url="save_registration_step2.php?email="+email+"&pass="+pass+"&code="+code+"&name="+name+"&lname="+lname+"&sex="+sex+"&dd="+dd+"&mm="+mm+"&yy="+yy+"&loc="+loc;
//		xmlHttp.onreadystatechange=GetSaveReg2
//		xmlHttp.open("GET",url,true)
//		xmlHttp.send(null)
//	}	
//		
//	function GetSaveReg2() 
//	{ 
//		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
//		{
//		   Dialog.okCallback();
//		   
//		   window.location="index.php?page=signup_message";
//		   window.reload();
//		}
//	}
 //#################################################################################################
 
 //############################################[ Check  Email Existance ]#####################################################
 var em_val;
 function Chk_Existance(value)
	{ 
	    em_val=value;
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		if(value!=""){
		var url="check_email.php?email="+value;
		xmlHttp.onreadystatechange=getemailexistance
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		}
	}	
		
	function getemailexistance() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			
		    if(m=="1"){
			  document.getElementById("mail_id").value="";	
			  document.getElementById("mail_id").focus();
		      document.getElementById("chk_mail_result").innerHTML=em_val+" already exist!";
			  return false;
			}
			else
			{
			  document.getElementById("chk_mail_result").innerHTML=" Correct email!";	
			  return true;
			}
			
		}
	}
	
	//############################################[ Check  Password Existance ]#####################################################
 var new_val1;
 var new_val2;
 var edit_state;
 var Set_ID;
 function Chk_Password(value,val1,val2,state,id)
	{ 
	    new_val1=val1;
		new_val2=val2;
		edit_state=state;
        Set_ID=id;
        xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="check_password.php?value="+value;
		xmlHttp.onreadystatechange=getpasswordlexistance
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function getpasswordlexistance() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			if(m=="1"){
		     
			 if(edit_state=="login")
			 {
			  document.getElementById(Set_ID).innerHTML=new_val1;
			  Edit_Login_Detail(new_val1,new_val2);
			 }
			 if(edit_state=="page_address")
			 {
			  document.getElementById(Set_ID).innerHTML="http://"+new_val1+".rainbowfix.com";
			  Edit_Page_Address(new_val1,new_val2);
			 }
			}
			else
			{
			  alert("Invalid Current Password !");
			  document.getElementById("curr_pass").focus();
			  return false;
			}
			
		}
	}
 //#################################################################################################
  //############################################[ EDIT LOGIN DETAIL ]#####################################################
 function Edit_Login_Detail(val1,val2)
	{  
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="update_Login_detail.php?val1="+val1+"&val2="+val2;
		xmlHttp.onreadystatechange=GetSaveEmail
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetSaveEmail() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById('Layer1').innerHTML="";
		  scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
 //#################################################################################################
 
 //############################################[ EDIT PAGE ADDRESS ]#####################################################
 function Edit_Page_Address(val1,val2)
	{  
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="update_page_address.php?val1="+val1;
		xmlHttp.onreadystatechange=SavePageAddress
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function SavePageAddress() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById('Layer1').innerHTML="";
		  scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
 //#################################################################################################
  //############################################[ SET PRIVACY ]#####################################################
 var pcontact;
 var pmultiuser;
 var pim;
 var pprofile;
 var pblockuser;
 var pbrowse;
 function Set_Privacy(contact,multiuser,im,profile,blockuser,browse)
	{  
		pcontact=contact
		pmultiuser=multiuser
		pim=im
		pprofile=profile
		pblockuser=blockuser
		pbrowse=browse
		
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="update_contact_privacy.php?contact="+pcontact+"&multiuser="+pmultiuser+"&im="+pim+"&profile="+pprofile+"&blockuser="+pblockuser+"&browse="+pbrowse;
		xmlHttp.onreadystatechange=SavePrivacy
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function SavePrivacy() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  if(pcontact==0){
	        document.getElementById('set_contact').innerHTML="Only users with photos and completed profile (at least 50%)";}
		 
		 if(pcontact==1){
		    document.getElementById('set_contact').innerHTML="Any user";}
		 
		 if(pmultiuser==1){
		    document.getElementById('set_multigender').innerHTML="Enable";}
		 
		 if(pmultiuser==0){
		    document.getElementById('set_multigender').innerHTML="Disabled";}	
		 
		 if(pim==1){
		    document.getElementById('set_im').innerHTML="From public";}	
		  
		 if(pim==2){
		    document.getElementById('set_im').innerHTML="Favorites only";}	
		 
		 if(pim==0){
		    document.getElementById('set_im').innerHTML="IM disabled";}
		 
		 if(pprofile==1){
		    document.getElementById('set_profile').innerHTML="Show";}
		
		 if(pprofile==0){
		    document.getElementById('set_profile').innerHTML="Hide";}
			
		 if(pblockuser==1){
		    document.getElementById('set_blockuser').innerHTML="View";}	
		
		 if(pblockuser==0){
		    document.getElementById('set_blockuser').innerHTML="Unblock";}
			
		 if(pbrowse==0){
		    document.getElementById('set_browsing').innerHTML="Disabled";}	
			
		 if(pbrowse==1){
		    document.getElementById('set_browsing').innerHTML="Enable";}	
			
			
		  document.getElementById('Layer1').innerHTML="";
		  scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
 //#################################################################################################
 
  //############################################[ SET EMAIL NOTIFICATION ]#####################################################
 var nemail;
 var nmessage;
 var nnearmember;
 var nratingreport;
 var nviewedmereport;
 var nmatchreport;
 function Set_Notification(email,message,nearmember,ratingreport,viewedmereport,matchreport)
	{  
		nemail=email
		nmessage=message
		nnearmember=nearmember
		nratingreport=ratingreport
		nviewedmereport=viewedmereport
		nmatchreport=matchreport
		
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="update_notification.php?email="+nemail+"&message="+nmessage+"&nearmember="+nnearmember+"&ratingreport="+nratingreport+"&viewedmereport="+nviewedmereport+"&matchreport="+nmatchreport;
		
		xmlHttp.onreadystatechange=SaveNotificationSetting
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function SaveNotificationSetting() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  if(nemail==1){
	        document.getElementById('set_notification').innerHTML="Enable";}
			
		 if(nemail==0){
	        document.getElementById('set_notification').innerHTML="Disabled";}	
		 
		 if(nmessage==1){
		    document.getElementById('set_allowmessage').innerHTML="Enable";}
			
		 if(nmessage==0){
		    document.getElementById('set_allowmessage').innerHTML="Disabled";}	
		 
		 if(nnearmember==1){
		    document.getElementById('set_nearmember').innerHTML="Daily";}
			
		 if(nnearmember==2){
		    document.getElementById('set_nearmember').innerHTML="Bi Weekly";}
		
		 if(nnearmember==3){
		    document.getElementById('set_nearmember').innerHTML="Weekly";}
			
		 if(nnearmember==4){
		    document.getElementById('set_nearmember').innerHTML="Monthly";}
			
		 if(nnearmember==0){
		    document.getElementById('set_nearmember').innerHTML="Disabled";}
			
		if(nratingreport==1){
		    document.getElementById('set_ratingreport').innerHTML="Daily";}
			
		 if(nratingreport==2){
		    document.getElementById('set_ratingreport').innerHTML="Bi Weekly";}
		
		 if(nratingreport==3){
		    document.getElementById('set_ratingreport').innerHTML="Weekly";}
			
		 if(nratingreport==4){
		    document.getElementById('set_ratingreport').innerHTML="Monthly";}
			
		 if(nratingreport==0){
		    document.getElementById('set_ratingreport').innerHTML="Disabled";}	
		 
		
		if(nviewedmereport==1){
		    document.getElementById('set_viewedme').innerHTML="Daily";}
			
		 if(nviewedmereport==2){
		    document.getElementById('set_viewedme').innerHTML="Bi Weekly";}
		
		 if(nviewedmereport==3){
		    document.getElementById('set_viewedme').innerHTML="Weekly";}
			
		 if(nviewedmereport==4){
		    document.getElementById('set_viewedme').innerHTML="Monthly";}
			
		 if(nviewedmereport==0){
		    document.getElementById('set_viewedme').innerHTML="Disabled";}
		  
		if(nmatchreport==1){
		    document.getElementById('set_matchreport').innerHTML="Daily";}
			
		 if(nmatchreport==2){
		    document.getElementById('set_matchreport').innerHTML="Bi Weekly";}
		
		 if(nmatchreport==3){
		    document.getElementById('set_matchreport').innerHTML="Weekly";}
			
		 if(nmatchreport==4){
		    document.getElementById('set_matchreport').innerHTML="Monthly";}
			
		 if(nmatchreport==0){
		    document.getElementById('set_matchreport').innerHTML="Disabled";}	
		 
		
		  document.getElementById('Layer1').innerHTML="";
		 // scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
//			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
//			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
//			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
 //#################################################################################################
  //############################################[ SET MAIL PRIVACY ]#####################################################
 var Cont_MailVal;
 function Set_MailPrivacy(val)
	{  
	    Cont_MailVal=val;
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="update_mail_setting.php?val1="+val;
		xmlHttp.onreadystatechange=SaveMailPrivacy
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function SaveMailPrivacy() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById('Layer1').innerHTML="";
		  scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		  scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
		  document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
		  document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
 //#################################################################################################
 //############################################[ Check  Email Existance ]#####################################################
 var SPUID;
 var pgname;
 function Show_Popup(page,id,val3)
	{     
		SPUID=id;
		pgname=page;
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="get_popup.php?page="+page+"&id="+val3;
		xmlHttp.onreadystatechange=stategetpopup
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stategetpopup() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(SPUID).innerHTML=m;	
			scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			//document.getElementById(SPUID).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(SPUID).style.width)/2)+"px";
		    //document.getElementById(SPUID).style.top=(((parseInt(document.body.clientHeight)+parseInt(scrolltop))/2-parseInt(document.getElementById(SPUID).style.width)/2))+"px";
			document.getElementById(SPUID).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(SPUID).style.width)/2)+"px";
		    document.getElementById(SPUID).style.top=(scrolltop+150)+"px";
			
			if(pgname=='privacy')
			{
			  document.getElementById(SPUID).style.width='700px';	
			}
			if(pgname=='notification')
			{
			  document.getElementById(SPUID).style.width='700px';	
			}
			if(pgname=='vote')
			{
			  document.getElementById(SPUID).style.width='700px';	
			}
			if(pgname=='invite')
			{
			  document.getElementById(SPUID).style.width='700px';	
			}
		}
	}
 //#################################################################################################
 //############################################[ LOGIN MEMBER ]#####################################################
 function Login_Member(em,pass)
	{ 
	  // document.getElementById("Loding").innerHTML="<img src='../themes/rainbowfix/front_images/load.gif' width='20' height='20' />";  
        document.getElementById("Loding").style.display="";
	  	xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="check_login.php?em="+em+"&pass="+pass;
		xmlHttp.onreadystatechange=getlogin
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function getlogin() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{  
		    document.getElementById("Loding").style.display="none";
		    m=xmlHttp.responseText;
			if(m==0)
			{
			  document.getElementById("message").innerHTML="Invalid User e-mail Or Password, Try again!";
			}
			if(m==2)
			{
			  document.getElementById("message").innerHTML="Your Account is not Activate!";
			}
			else
			{
			  window.location="index.php";
			  window.submit();
			}
		}
	}
 //#################################################################################################
 //############################################[ SEND MAIL MESSAGE ]#####################################################
 function Send_Mail_Message(r_id,m_sub,m_msg)
	{ 
	    document.getElementById("mail_message").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='24' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="send_mail_message.php?rid="+r_id+"&sub="+m_sub+"&msg="+m_msg;
		xmlHttp.onreadystatechange=sendmailmessage
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function sendmailmessage() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    mm=xmlHttp.responseText;
			
		    document.getElementById("mail_message").innerHTML=mm;	
		}
	}
 //#################################################################################################
 //############################################[ SEND MESSAGE ]#####################################################
 function Send_Message(mid,type)
	{ 
	   // document.getElementById("mail_message").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='24' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="send_message.php?mid="+mid+"&type="+type;
		xmlHttp.onreadystatechange=sendmessage
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function sendmessage() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    mm=xmlHttp.responseText;
			document.getElementById("Layer1").innerHTML=mm;	
			scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
 //#################################################################################################
 //############################################[ SEND SHARE PROFILE ]#####################################################
 function Send_Share_Profile(s_mail,s_msg,url,val)
	{ 
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="send_share_message.php?to="+s_mail+"&msg="+s_msg+"&url="+url+"&val="+val;
		xmlHttp.onreadystatechange=sendsharemessage
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function sendsharemessage() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    mm=xmlHttp.responseText;
			
		    document.getElementById("mail_message").innerHTML=mm;	
		}
	}
 //#################################################################################################
  //############################################[ SHOW PHOTO ]#####################################################
var showid;
function Show_Photo(seq,sid,mid)
	{ 
	    showid=sid;
		document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="get_photo.php?sequence="+seq+"&mid="+mid;
		xmlHttp.onreadystatechange=getmemphoto
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function getmemphoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    mm=xmlHttp.responseText;
			document.getElementById(showid).innerHTML=mm;	
		}
	}
 //#################################################################################################
//############################################[ MEMBER MAILS ]#####################################################
function Member_Mail(mailid,type)
	{ 
	    //document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="set_maildetails.php?mailid="+mailid+"&type="+type;
		xmlHttp.onreadystatechange=setmembermail
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function setmembermail() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     mm=xmlHttp.responseText;
			 document.getElementById("Layer1").innerHTML=mm;	
			 scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
 //#################################################################################################
 //############################################[ MEMBER MAILS DELETE ]#####################################################
function Member_Mail_Delete(mailid,type)
	{ 
	    //document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="set_maildetails.php?mailid="+mailid+"&type="+type;
		xmlHttp.onreadystatechange=setmembermaildel
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function setmembermaildel() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     mm=xmlHttp.responseText;
			 
			 document.getElementById("Layer1").innerHTML=mm;	
			 scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
			
		}
	}
 //#################################################################################################
//############################################[ UNBLOCK USER ]#####################################################
function Unblock_User(userid,type)
{ 
	    //document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="set_maildetails.php?mailid="+userid+"&type="+type;
		xmlHttp.onreadystatechange=setmembermaildelunblock
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function setmembermaildelunblock() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     mm=xmlHttp.responseText;
			 document.getElementById("unblocked").innerHTML=mm;	
		}
	}
 //#################################################################################################
 //############################################[ CHECKE IS BLOCKED USER ]#####################################################
function IsBlockedUser(uid,mid,type)
{ 
	    //document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="chk_isblockedmember.php?mid="+mid+"&uid="+uid+"&type="+type;
		xmlHttp.onreadystatechange=getblockeduser
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function getblockeduser() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     mm=xmlHttp.responseText;
			if(mm==1)
			{
			  window.location="index.php?page=message&status=block";
			  window.reload();
			}
			// document.getElementById("unblocked").innerHTML=mm;	
		}
	}
 //#################################################################################################

 //############################################[ GET MAIL TYPE ]#####################################################
//function Add_To_Favorite(mid,type)
//	{ 
//	    favtype=type;
//	    //document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
//		xmlHttp=GetXmlHttpObject()
//		if (xmlHttp==null)
//		{
//			alert ("Browser does not support HTTP Request")
//			return
//		}
//		var url="set_addtofavorite.php?mid="+mid+"&type="+type;
//		xmlHttp.onreadystatechange=stateaddtofavorite
//		xmlHttp.open("GET",url,true)
//		xmlHttp.send(null)
//		
//	}	
//		
//	function stateaddtofavorite() 
//	{ 
//		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
//		{   
//		     mm=xmlHttp.responseText;
//			 if(favtype=="add"){
//			    document.getElementById("favoriteid").innerHTML="Remove favorites";
//			 }
//			 if(favtype=="remove")
//			 {
//				document.getElementById("favoriteid").innerHTML="Add to favorites"; 
//			 }
//			 document.getElementById("Layer1").innerHTML=mm;	
//			 scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
//			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
//			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
//			 document.getElementById('Layer1').style.top=(((parseInt(document.body.clientHeight)+parseInt(scrolltop))/2-parseInt(document.getElementById('Layer1').style.width)/2))+"px";
//		}
//	}
 //#################################################################################################
  //############################################[ GET MAIL TYPE ]#####################################################
var mlid;

function GetMail(id,type,mid,smid)
	{ 
	    mlid=id;
		document.getElementById(mlid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var val;
		if(mid!=""){
		  val="?type="+type+"&mid="+mid;	
		}
		if(mid!="" && smid!="")
		{
		   val="?type="+type+"&mid="+mid+"&senmid="+smid;	 
		}
		else{
		  val="?type="+type;
		}
		var url="get_mails.php"+val;
		xmlHttp.onreadystatechange=stategetmembermail
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stategetmembermail() 
	{		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		  document.getElementById(mlid).innerHTML=xmlHttp.responseText; 
		}
	}
 //#################################################################################################
   //############################################[ GET MAIL MESSAGE ]#####################################################
var msgid;
function GetMessage(id,mailid,type,mid)
	{ 
	    msgid=id;
		document.getElementById(msgid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="get_mailmessage.php?mailid="+mailid+"&type="+type+"&id="+id+"&mid="+mid;
		xmlHttp.onreadystatechange=stategetmailmsg
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stategetmailmsg() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ document.getElementById(msgid).style.display="";
		  document.getElementById(msgid).innerHTML=xmlHttp.responseText; 
		}
	}
 //#################################################################################################
  //############################################[ SEND MAIL REPLY ]#####################################################
var repid;
function Send_Mail_Reply(id,m_msg,mid,mailid)
	{ 
	    repid=id;
		document.getElementById(repid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="send_reply.php?m_msg="+m_msg+"&mid="+mid+"&mailid="+mailid;
		xmlHttp.onreadystatechange=statereplymailmsg
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function statereplymailmsg() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(repid).style.display="";
		  document.getElementById(repid).innerHTML=xmlHttp.responseText; 
		}
	}
 //#################################################################################################
//############################################[ GET NEXT MAIL ]#####################################################
function GetNext(page,start,end,st,val)
	{ 
	    document.getElementById("showrecords").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url=page+"?start="+start+"&end="+end+"&st="+st+"&val="+val;
		xmlHttp.onreadystatechange=statenext
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function statenext() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById("showrecords").innerHTML=xmlHttp.responseText; 
		}
	}
 //#################################################################################################
 //############################################[ GET NEXT MAIL ]#####################################################
function GetNext_1(page,start,end,st,val)
	{ 
	    document.getElementById("showrecords").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url=page+"&start="+start+"&end="+end+"&st="+st+"&val="+val;
		xmlHttp.onreadystatechange=statenext_1
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function statenext_1() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById("showrecords").innerHTML=xmlHttp.responseText; 
		}
	}
 //#################################################################################################
 //########################### [ GET MEMBER ] ###################################################
 var memid;
function GetMember(id,srch)
	{ 
	
	
	    memid=id;
		document.getElementById(memid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="get_members.php?type="+srch;
		xmlHttp.onreadystatechange=stategetmember
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stategetmember() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(memid).innerHTML=xmlHttp.responseText; 
		}
	}
 //#####################################################################################################
  //########################### [ DISCONNECT FAVOURITE MEMBER ] ###################################################
 var did;
function memberdiss(id,srch)
	{ 
	   did=srch;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="disconnect_members.php?mid="+id+"&type="+srch;
		xmlHttp.onreadystatechange=statediconnectmember
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function statediconnectmember() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(did).innerHTML=xmlHttp.responseText; 
		}
	}
 //#####################################################################################################
//########################### [ GET UPLOAD PHOTO ] ###################################################
var pid;
function Get_UploadPhoto(id)
	{ 
	   pid=id;
	    document.getElementById(pid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="upload_images.php";
		xmlHttp.onreadystatechange=stategetphoto
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stategetphoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(pid).innerHTML=xmlHttp.responseText; 
		
		}
	}
 //#####################################################################################################
 //########################### [ GET PRIMARY PHOTO ] ###################################################
var ppid;
function Get_PrimaryPhoto(id)
	{ 
	    ppid=id;
	    document.getElementById(ppid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="getprimaryphoto.php";
		xmlHttp.onreadystatechange=stategetprimaryphoto
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stategetprimaryphoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(ppid).innerHTML=xmlHttp.responseText; 
		
		}
	}
 //#####################################################################################################
 //########################### [ GET NEXT UPLOAD ] ###################################################
var nuid;
function show_next(id)
	{ 
	    nuid=id;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="ajaxupload/nextupload.php";
		xmlHttp.onreadystatechange=stategetnextphoto
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stategetnextphoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(nuid).innerHTML=xmlHttp.responseText; 
		}
	}
 //#####################################################################################################
//########################### [ SET PRIMARY PHOTO ] ###################################################
//var primaryid;
function Set_Primary(pid,id,val)
	{ 
	   //primaryid=id;
	   document.getElementById("priimg").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="set_primaryphoto.php?id="+pid+"&val="+val;
		xmlHttp.onreadystatechange=statesetprimaryphoto
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function statesetprimaryphoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById("priimg").innerHTML=xmlHttp.responseText; 
		}
	}
 //#####################################################################################################
 //########################### [ DELETE PHOTO ] ###################################################
var primaryid;
var photoid;
function Delete_Photo(pid,id,val)
	{ 
	  primaryid=id;
	   photoid=pid;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="set_primaryphoto.php?id="+pid+"&val="+val;;
		xmlHttp.onreadystatechange=statedelphoto
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function statedelphoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(primaryid).innerHTML=xmlHttp.responseText; 
		  document.getElementById("upload"+photoid).innerHTML="";
		  document.getElementById("addmore").style.display="";
		}
	}
 //#####################################################################################################
 //############################################[ REPORT MEMBER ]#####################################################
function Report_Member(mid)
	{   //document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="report_member.php?mid="+mid;
		xmlHttp.onreadystatechange=reportmember
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function reportmember() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     mm=xmlHttp.responseText;
			 document.getElementById("Layer1").innerHTML=mm;	
			 scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
	
	function showbrowse(viewtype,showtype,city,country,mid,nearme)
	{   document.getElementById("shbrowse").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url;
		url="templates/browse"+viewtype+".php?show="+showtype;	
		
		if(nearme!=''){
		url="templates/browse"+viewtype+".php?show="+showtype+"&nearme="+nearme;	
		}
		
		if(city!=''){
		url="templates/browse"+viewtype+".php?show="+showtype+"&city="+city;	
		}
		
		if(country!=''){
		url="templates/browse"+viewtype+".php?show="+showtype+"&country="+country;	
		}
		
		if(mid!=''){
		url="templates/browse"+viewtype+".php?show="+showtype+"&mid="+mid;	
		}
		
		xmlHttp.onreadystatechange=showbrowsechange
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function showbrowsechange() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     document.getElementById("shbrowse").innerHTML=xmlHttp.responseText;
		}
	}
	
	var pageid;
	function showpaging(pid,pagename)
	{   
	    pageid=pid;
	    document.getElementById(pageid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url=pagename;
		xmlHttp.onreadystatechange=showpagingchange
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}
	
	function showpagingchange() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     document.getElementById(pageid).innerHTML=xmlHttp.responseText;
		}
	}
	

//########################### [ GET SEARCH PAGES ] ###################################################
 var memid;
function GetSearch(id,srch,searchid)
	{ 
	
	
	    memid=id;
		document.getElementById(memid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url;
		if(searchid!=""){
		    url="advance_search.php?type="+srch+"&id="+searchid;	
		}else{
			url="advance_search.php?type="+srch;
		}
		xmlHttp.onreadystatechange=stateGetSearch
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stateGetSearch() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(memid).innerHTML=xmlHttp.responseText; 
		}
	}
 //#####################################################################################################
 //########################### [ GET CONNECTION OF MEMBER ] ###################################################
 var connid;
function showconn(id,sortby,show)
	{ 
	
	
	    connid=id;
		document.getElementById(connid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var val;
		if(show!="")
		{
		  val="?type="+sortby+"&show="+show;
		}
		else
		{
		  val="?type="+sortby;	
		}
		var url="member_conn.php"+val;
		xmlHttp.onreadystatechange=stateGetconn
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stateGetconn() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(connid).innerHTML=xmlHttp.responseText; 
		}
	}
 //#####################################################################################################
 //########################### [ GET CONNECTION OF MEMBER ] ###################################################
function Allow_Rating(id,chk)
	{ 
	   //document.getElementById(connid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="allow_rating.php?id="+id+"&val="+chk;
		xmlHttp.onreadystatechange=StateAllowRating
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function StateAllowRating() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  mm=xmlHttp.responseText;
			 document.getElementById("Layer1").innerHTML=mm;	
			 scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
		}
	}
 //#####################################################################################################
 
//########################### [ GET RATED PHOTO ] ###################################################
var rateid;
function Get_RatedPhoto(id,pid)
	{ 
	    rateid=id;
		document.getElementById(rateid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="rated_photo.php?id="+pid;
		xmlHttp.onreadystatechange=StateGetRatedpoto
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function StateGetRatedpoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		     document.getElementById(rateid).innerHTML=xmlHttp.responseText;	
		}
	}
 //#####################################################################################################
 //########################### [ GET PHOTO FOR RATE ] ###################################################
var getrateid;
var getpicid;
function Rate_Me(id,pic,sex,age,et)
	{ 
	    getrateid=id;
		getpicid=pic;
		document.getElementById(getrateid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="rate_me.php?sex="+sex+"&age="+age+"&et="+et;
		xmlHttp.onreadystatechange=photoforrate
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function photoforrate() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		     document.getElementById(getrateid).innerHTML=xmlHttp.responseText;	
			 Get_RatedPhoto('showrated',getpicid);
		}
	}
 //#####################################################################################################
 
 //########################### [ GET  MEMBER PHOTO FOR RATE ] ###################################################
var getrateid;
function Rate_Member(id,mid)
	{ 
	    getrateid=id;
		document.getElementById(getrateid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="rate_member.php?mid="+mid;
		xmlHttp.onreadystatechange=memberphotoforrate
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function memberphotoforrate() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		     document.getElementById(getrateid).innerHTML=xmlHttp.responseText;	
			// Get_RatedPhoto('showrated',getpicid);
		}
	}
 //#####################################################################################################
 
 //########################### [ SUBMIT MEMBER  RATE] ###################################################
var submitid;
var memid;
function submit_memberrate(id,rating,mid)
	{ 
	    submitid=id;
		memid=mid;
	 //	document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="rated_photo.php?id="+id+"&rating="+rating+"mid="+mid;
		xmlHttp.onreadystatechange=statesubmitmemberrate
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function statesubmitmemberrate() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		    // document.getElementById("showrated").innerHTML=xmlHttp.responseText;	
			 Rate_Member('rateme',memid);
		}
	}
 //#####################################################################################################
 
  //########################### [ GET PHOTO FOR RATE BY AGE ] ###################################################
var getrateid;
var getpicid;
function Rate_Me_Age(id,pic,sex,age,et)
	{ 
	    getrateid=id;
		getpicid=pic;
		document.getElementById(getrateid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="rate_me.php?sex="+sex+"&age="+age+"&et="+et;
		xmlHttp.onreadystatechange=photoforratebyage
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function photoforratebyage() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		     document.getElementById(getrateid).innerHTML=xmlHttp.responseText;	
			 Get_RatedPhoto('showrated',getpicid);
		}
	}
 //#####################################################################################################
 
//########################### [ SUBMIT RATE] ###################################################
var submitid;
var ssex;
var svage;
var seth;
function submit_rate(id,rating,sex,age,et)
	{ 
	    submitid=id;
		ssex=sex;
		sage=age;
		seth=et;
	 //	document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="rated_photo.php?id="+id+"&rating="+rating;
		xmlHttp.onreadystatechange=statesubmitrate
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function statesubmitrate() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		     document.getElementById("showrated").innerHTML=xmlHttp.responseText;	
			 Rate_Me('rateme',submitid,ssex,sage,seth);
		}
	}
 //#####################################################################################################
  //############################################[ ADD TOFAVORITE ]#####################################################
var favtype;
var favid;
var favlogid;
var addmid;
function Add_To_Favorite(logid,mid,type,id,cname)
	{ 
	    favtype=type;
		favid=id;
		favlogid=logid;
		addmid=mid;
		//document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="set_addtofavorite.php?mid="+mid+"&type="+type+"&id="+id+"&class="+cname;
		xmlHttp.onreadystatechange=stateaddtofavorite
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stateaddtofavorite() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     mm=xmlHttp.responseText;
			 if((favtype=="add" || favtype=="remove") && (favlogid!="") ){
			    document.getElementById(favid).innerHTML=mm;
				
				show_message(favtype,addmid);
			 }else{
			//if(favtype=="remove")
			//{
			//   document.getElementById(favid).innerHTML="Add to favorites"; 
			//}
			 document.getElementById("Layer1").innerHTML=mm;	
			 scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
			 
			 }
		}
	}
 //#################################################################################################
 function show_message(favtype,addmid)
	{ 
	   xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="set_addtofavorite.php?mid="+addmid+"&favtype="+favtype;
		xmlHttp.onreadystatechange=stateshowmessage
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stateshowmessage() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     mm=xmlHttp.responseText;
			 document.getElementById("Layer1").innerHTML=mm;	
			 scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			 scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			 document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
			 document.getElementById('Layer1').style.top=(scrolltop+150)+"px";
			 
		}
	}
 //########################### [ GET FAVORTIES] ###################################################
var favlid;
function getfavorites(val,id)
	{ 
	    favlid=id;
	    document.getElementById(favlid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="favorites.php?val="+val;
		xmlHttp.onreadystatechange=stategetfavorite
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stategetfavorite() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		     document.getElementById(favlid).innerHTML=xmlHttp.responseText;	
		
		}
	}
 //#####################################################################################################
  //#################################################################################################
	
 var matchid;
 function Show_searchPopup(page,id)
	{ 
	    matchid=id;
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="matchdetails.php?page="+page;
		xmlHttp.onreadystatechange=searchgetpopup
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function searchgetpopup() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(matchid).innerHTML=m;	
		    scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
		    document.getElementById(matchid).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(matchid).style.width)/2)+"px";
		    document.getElementById(matchid).style.top=(scrolltop+150)+"px";
		    
		}
	}
 //############################################[ SEND INVITE PROFILE ]#####################################################
 function Send_Share_invite(s_mail,s_msg,url,val)
	{ 
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="send_invite.php?to="+s_mail+"&msg="+s_msg+"&url="+url+"&val="+val;
		xmlHttp.onreadystatechange=sendshareinvite
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function sendshareinvite() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    mm=xmlHttp.responseText;
			
		    document.getElementById("mail_message").innerHTML=mm;	
		}
	}
 //#################################################################################################
 
 //###############################  [ SHOW VIEWED ME ] ###############################################
 function showviewedme(viewtype)
	{   document.getElementById("showviewedmerec").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="templates/viewedme"+viewtype+".php";
		xmlHttp.onreadystatechange=showviewedmechange
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function showviewedmechange() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		     document.getElementById("showviewedmerec").innerHTML=xmlHttp.responseText;
		}
	}
 //####################################################################################################
 //###############################  [ GET CITY + ZIPCODE FOR COUNTRY ID ] ###############################################
 function get_cityname(id)
	{   
	    document.getElementById("zipcity").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="get_city.php?id="+id;
		xmlHttp.onreadystatechange=getcitysatechange
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function getcitysatechange() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{  
		     document.getElementById("zipcity").innerHTML=xmlHttp.responseText;
		}
	}
 //####################################################################################################
//###############################  [ GET CITY FOR COUNTRY ID ] ###############################################
 function get_cityname_1(id,show)
	{   
	    document.getElementById("zipcity").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="get_city_1.php?id="+id+"&show="+show;
		xmlHttp.onreadystatechange=getcitysatechange_1
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function getcitysatechange_1() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{  
		     document.getElementById("zipcity").innerHTML=xmlHttp.responseText;
		}
	}
 //####################################################################################################
 //###############################  [ GET SEARCH CITY FOR COUNTRY ID ] ###############################################
 function get_search_cityname(id)
	{   
	    document.getElementById("scity").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="search_city.php?id="+id;
		xmlHttp.onreadystatechange=getsearchcitysatechange
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function getsearchcitysatechange() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{  
		     document.getElementById("scity").innerHTML=xmlHttp.responseText;
		}
	}
 //####################################################################################################

 //############################################[ SEND COMPOSE MESSAGE ]#####################################################
 function Send_Compose_Message(s_mail,s_sub,s_msg)
	{ 
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="send_compose_message.php?to="+s_mail+"&sub="+s_sub+"&msg="+s_msg;
		xmlHttp.onreadystatechange=sendcomposemessage
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function sendcomposemessage() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    mm=xmlHttp.responseText;
			
		    document.getElementById("mail_message").innerHTML=mm;	
		}
	}
 //#################################################################################################
//########################### [ SHOW UPLOAD PHOTO ] ###################################################
var pid;
function Show_UploadPhoto(id)
	{ 
	   pid=id;
	    document.getElementById(pid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="show_mempic.php";
		xmlHttp.onreadystatechange=stategetmemphoto
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stategetmemphoto() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(pid).innerHTML=xmlHttp.responseText; 
		
		}
	}
 //#####################################################################################################
 
 //########################### [ SUBMIT PAGE ] ###################################################

function Page_Submit()
	{ 
	  	xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="chat.php?uname=hemant";alert(url)
		xmlHttp.onreadystatechange=dfgdfg
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function dfgdfg() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		  document.getElementById(pid).innerHTML=xmlHttp.responseText; 
		
		}
	}
 //#####################################################################################################
 //###############################  [ GET CITY NAME/ZIPCODE FOR COUNTRY ID ] ###############################################
 function Set_Cityname(id)
	{   
	    document.getElementById("zipcity").innerHTML="<img src='themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="set_city.php?id="+id;
		xmlHttp.onreadystatechange=setcitysatechange
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function setcitysatechange() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{  
		     document.getElementById("zipcity").innerHTML=xmlHttp.responseText;
		}
	}
 //####################################################################################################
 
 //###############################  [ DELETE SAVED SEARCH ] ###############################################
 function Delete_Save(id)
	{   
	   xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		c=confirm("Are you sure, you want to delete?");
		if(c){
		document.getElementById(id).style.display='none';	
		var url="delete_savesearch.php?id="+id;
		xmlHttp.onreadystatechange=setdeletesavesearch
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		}
   }	
		
	function setdeletesavesearch() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{  
		     //
		}
	}
 //####################################################################################################
 var ematchid;
 function Show_EditMatch(page,id)
	{ 
	    ematchid=id;
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="edit_match.php?page="+page;
		xmlHttp.onreadystatechange=seteditmatch
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function seteditmatch() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(ematchid).innerHTML=m;	
		    scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
		    document.getElementById(matchid).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(matchid).style.width)/2)+"px";
		    document.getElementById(matchid).style.top=(parseInt(scrolltop)+150)+"px";
		    
		}
	}
//######################################## [ RAISE PROFILE (BUMP)] #############################################################
var riseid;
function RiseUP_Profile(page,id)
	{ 
	    riseid=id;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="get_popup.php?page="+page;
		xmlHttp.onreadystatechange=sateriseprofile
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function sateriseprofile() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(riseid).innerHTML=m;	
		    scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
		    document.getElementById(riseid).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(riseid).style.width)/2)+"px";
		    document.getElementById(riseid).style.top=(parseInt(scrolltop)+150)+"px";
		    
		}
	}
//#####################################################################################################
//######################################## [ GET MEMBER MATCH] #############################################################
var matchid;
var editmatch;
function Get_Match(page,id,edit)
	{ 
	    matchid=id;
		editmatch=edit;
		document.getElementById(matchid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url=page+".php";
		xmlHttp.onreadystatechange=stategetmatch
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stategetmatch() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(matchid).innerHTML=m;	
		    scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
		    document.getElementById(matchid).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(matchid).style.width)/2)+"px";
		    document.getElementById(matchid).style.top=(parseInt(scrolltop)+150)+"px";
		    if(editmatch!='' && editmatch=='edit'){
			 Show_searchPopup('bsearch','Layer2');    
			}
		}
	}
//#####################################################################################################

//######################################## [ HOOK THESE TWO UP ] #############################################################
function Hook_UP(name,email,mid)
	{ 
	  // document.getElementById(matchid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="hookup.php?name="+name+"&email="+email+"&mid="+mid;
		xmlHttp.onreadystatechange=statehookup
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function statehookup() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById('Layer1').innerHTML=m;	
		    scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
		    document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
		    document.getElementById('Layer1').style.top=(parseInt(scrolltop)+150)+"px";
		   
		}
	}
//#####################################################################################################

//######################################## [ HOOK THESE TWO UP ] #############################################################
var fpassid;
function Send_Forgotpass(member_email,id)
	{ 
	    fpassid=id;
	  
		if(member_email==""){
		alert("Please Enter your email address !");
		return false;
		}
		if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(member_email)) && member_email!="")
		{
		alert("Please enter correct email address!");
		return false;
		}
  
	  // document.getElementById(matchid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="send_forgotpass.php?email="+member_email;
		xmlHttp.onreadystatechange=stateforgotpass
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stateforgotpass() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(fpassid).innerHTML=m;	
		   	   
		}
	}
//#####################################################################################################
var fpassid;
function Send_Forgotpass(member_email,id)
	{ 
	    fpassid=id;
	  
		if(member_email==""){
		alert("Please Enter your email address !");
		return false;
		}
		if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(member_email)) && member_email!="")
		{
		alert("Please enter correct email address!");
		return false;
		}
  
	  // document.getElementById(matchid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='25' height='25' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="send_forgotpass.php?email="+member_email;
		xmlHttp.onreadystatechange=stateforgotpass
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stateforgotpass() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(fpassid).innerHTML=m;	
		   	   
		}
	}
//#####################################################################################################
//########################################## [ MATCH ACCEPT/CLOSE] ####################################
var matchtype;
var accmid;
function Match_Accept(mid,amid,type,mtype)
	{ 
	    matchtype=mtype;
		accmid=mid;
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="match_accept.php?mid="+mid+"&amid="+amid+"&type="+type+"&mtype="+mtype;
		xmlHttp.onreadystatechange=statematchaccept
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function statematchaccept() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById('Layer1').innerHTML=m;	
		    scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
		    document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
		    document.getElementById('Layer1').style.top=(parseInt(scrolltop)+150)+"px";
			
			if(matchtype=='B')
			{
			    Get_Match('basicmatch','membermatch','');
				Member_Match(accmid,'B');
			}else{
				Get_Match('advancematch','membermatch','');
				Member_Match(accmid,'A');
			}
		}
	}
//#####################################################################################################

//########################################## [ LOGIN ] ####################################
function chk_login(val)
	{ 
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="gologin.php?val="+val;
		xmlHttp.onreadystatechange=stategologin
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stategologin() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById('Layer1').innerHTML=m;	
		    scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
		    document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
		    document.getElementById('Layer1').style.top=(parseInt(scrolltop)+150)+"px";
		}
	}
//#####################################################################################################

//################################## [ CHECK IM MESSAGES ] ######################################
var imuser;
var impass;
var im_mid;
var interval;
var newn=0;
function Get_IM_Message(user,pass,mid)
	{
		newn=newn+1;
		imuser=user;
		impass=pass;
		im_mid=mid;
	    xmlHttp1=GetXmlHttpObject1()
		if (xmlHttp1==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="get_im_message.php?user="+user;//window.status=newn;
		xmlHttp1.onreadystatechange=statechangeimmessage
		xmlHttp1.open("GET",url,true)
		xmlHttp1.send(null)
	}	
		
	function statechangeimmessage() 
	{ 
		if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
		{	
		 var page;
		 var immsg;
		 m= xmlHttp1.responseText;
		 
		 if(m>0){
			//imcomplete=1;
//		    document.getElementById('Layer1').innerHTML=m;	
//		    scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
//		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
//		    document.getElementById('Layer1').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer1').style.width)/2)+"px";
//		    document.getElementById('Layer1').style.top=(parseInt(scrolltop)+150)+"px";
            //start_timer(imuser,impass,im_mid,'stop'); 
			
			page="rainbowfix_im/index.php?mid="+im_mid+"&chatid="+m;
			window.open(page,'','height=480px,width=700px,top=110px,left=20px,resizable=yes,scrollbars=yes');
			//window.clearTimeout(interval);
		 }
		 else{
			//Get_IM_Message(imuser,impass,im_mid)
			
			interval=setTimeout("Get_IM_Message('"+imuser+"','"+impass+"','"+im_mid+"')",5000);
		 }
		 }
	}

//###################################################################################################
var stime;
function Check_IM_Message(user,pass,mid,val)
  {
    
  // if(val=="start")
//   {  
      Get_IM_Message(user,pass,mid);
      //setInterval("Check_IM_Message('"+user+"','"+pass+"','"+mid+"','"+val+"')",2000);
  // } 
  }
function start_timer(user,pass,mid,val)
 {
   //if(val=="start")
//   {  
    Check_IM_Message(user,pass,mid,val);
  // }
 } 
 


//########################################## [ BLOCK USER FOR CHAT ] ####################################
function Chat_UserSetting(mid,blockmid,type)
	{ 
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="../chatuser_setting.php?mid="+mid+"&blockmid="+blockmid+"&type="+type;
		xmlHttp.onreadystatechange=statechatsetting
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function statechatsetting() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			if(m!=""){
			alert(m);
			}
		}
	}
//#####################################################################################################
//#################################################[ GET SUCCESS STORIES ]################################################  
	var storyid;
 	function Get_SuccessStories(id)
	{  
	    storyid=id;
		document.getElementById(storyid).innerHTML="<img src='../../themes/rainbowfix/images/load.gif' width='20' height='20' />";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="templates/successstories.php";
		xmlHttp.onreadystatechange=GetSuccessStories
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
	function GetSuccessStories() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
		  document.getElementById(storyid).innerHTML= xmlHttp.responseText;
		}
	}
 //#################################################################################################
 //############################################[ INVITE FRIEND SCRIPT ]#####################################################
 var Invid;
 var pgname;
 function Show_Invite(page,id,val3)
	{     
		Invid=id;
		pgname=page;
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="import/import.php"
		xmlHttp.onreadystatechange=stategetinvitepopup
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
		
	function stategetinvitepopup() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(Invid).innerHTML="<div class='popup' align='left'>"+m+"</div>";	
			scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			//document.getElementById(SPUID).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(SPUID).style.width)/2)+"px";
		    //document.getElementById(SPUID).style.top=(((parseInt(document.body.clientHeight)+parseInt(scrolltop))/2-parseInt(document.getElementById(SPUID).style.width)/2))+"px";
			document.getElementById(Invid).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(Invid).style.width)/2)+"px";
		    document.getElementById(Invid).style.top=(scrolltop+150)+"px";
			
		}
	}
 //#################################################################################################
 //############################################[ GET MEMBER MATCH ]#####################################################
function Member_Match(mid,type)
	{ 
	    //document.getElementById(showid).innerHTML="<img src='themes/rainbowfix/images/load.gif' width='30' height='30' />";
		xmlHttp1=GetXmlHttpObject1()
		if (xmlHttp1==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="get_membermatch.php?mid="+mid+"&type="+type;
		xmlHttp1.onreadystatechange=statemembermatch
		xmlHttp1.open("GET",url,true)
		xmlHttp1.send(null)
		
	}	
		
	function statemembermatch() 
	{ 
		if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
		{   
		     mm=xmlHttp1.responseText;
			 document.getElementById("matchid").innerHTML=mm;	
			 
		}
	}
 //#################################################################################################
 
    function GetXmlHttpObject()
	{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
	}
	
	//########## [ for xmlHttp1 ] #######################
	function GetXmlHttpObject1()
	{ 
	var objXMLHttp1=null
	if (window.XMLHttpRequest)
	{
	objXMLHttp1=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp1=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp1
	}
//#################################################################################################