// JavaScript Document
var xmlHttp
var spanId;
var day;
var month;
var year;
var val;
var sgen;
var from;
var to;
var sp;
var stat;

function delete_msg(msgid)
{	
    xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	  alert("Browser does not support HTTP Request")
	  return
	}
	
	var url="delete_message.php?msgid="+msgid;
	xmlHttp.onreadystatechange=delstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	
		
function delstatechanged() 
{ 
    if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{			
	   val = xmlHttp.responseText;
	   strat = val.indexOf(',');
	   
	   val1 = val.substring(strat,-1);
	   val2 = val.substring(strat+1);
	   
	  document.getElementById('msg_rem').innerHTML = val1;
	  document.getElementById('msg_rem1').innerHTML = val1;
	  //document.getElementById('msg_rem2').innerHTML = val1;
	  //document.getElementById('msg_rem3').innerHTML = val1;
	  document.getElementById('inbx').innerHTML=val2;
	} 
}

///New
function tik_send(mid)
{	
    xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	  alert("Browser does not support HTTP Request")
	  return
	}
	
	var url="tik.php?mid="+mid;				
	xmlHttp.onreadystatechange=tikstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	
		
function tikstatechanged() 
{ 
    if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{			
	  document.getElementById('tik_but').style.display='none';
	  document.getElementById('tik_sent').style.display='';
	} 
}

function tik_send_search(mid)
{		
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	  alert("Browser does not support HTTP Request")
	  return
	}
	
	var url="tik.php?mid="+mid;				
	xmlHttp.onreadystatechange=function(){searchtikstatechanged(mid);}
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	
		
function searchtikstatechanged(tikid) 
{ 
    if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{			
	  document.getElementById('tik_but'+tikid).style.display='none';
	  document.getElementById('tik_sent'+tikid).style.display='';
	} 
}

function tik_send_inbox(mid,tikid)
{	
    xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	  alert("Browser does not support HTTP Request")
	  return
	}
	var url="tik.php?mid="+mid;				
	xmlHttp.onreadystatechange=function(){tikinboxstatechanged(mid,tikid);}
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	
		
function tikinboxstatechanged(tikinid,tikid1) 
{   
    if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{			
	  document.getElementById('tik_but_inbox'+tikinid+tikid1).style.display='none';
	  document.getElementById('tik_sent_inbox'+tikinid+tikid1).style.display='';
	} 
}
///End new

function showcity(val)
{		
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}		
	
	document.getElementById('step1212').innerHTML="<img src='images/load.gif'/><br><font color='red'><strong>Heel even geduld.<br> Alle plaatsen worden nu opgehaald.</strong></font>";
	
	var url="city.php?st="+val;				
	//alert (url);
	xmlHttp.onreadystatechange=citystatechanged
	
	xmlHttp.open("GET",url,true)
	
	xmlHttp.send(null)
}	
		
function citystatechanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{			
		results = xmlHttp.responseText.split("<br>");    							
		document.frmregister.city.options.length =0 ;
		document.frmregister.city.options[document.frmregister.city.options.length]= new Option("kies nu uw plaats","");
		for(i=0;i < results.length-1;i++)
		{
			optionsval = results[i].split(",");
			document.frmregister.city.options[document.frmregister.city.options.length]= new Option(optionsval[1],optionsval[0]);
		}    
	   
	   document.getElementById('step1212').innerHTML = "";
	} 
}

function showsearchcity(val)
{		
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}		
	document.getElementById('step1212').innerHTML="<img src='images/load.gif'/><br><font color='red'><strong>Heel even geduld.<br> Alle plaatsen worden nu opgehaald.</strong></font>";
	
	
	var url="city.php?st="+val;				
	//alert (url);
	xmlHttp.onreadystatechange=searchcitystatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	
		
		
function searchcitystatechanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{			
		//alert (xmlHttp.responseText);
		results = xmlHttp.responseText.split("<br>");    							
		document.frmsearch.city.options.length =0 ;
		document.frmsearch.city.options[document.frmsearch.city.options.length]= new Option("kies nu uw plaats","");
		for(i=0;i < results.length-1;i++)
		{
			optionsval = results[i].split(",");
			document.frmsearch.city.options[document.frmsearch.city.options.length]= new Option(optionsval[1],optionsval[0]);
		}  
	 document.getElementById('step1212').innerHTML = ""; 	
	}
	
}

function update_mgen(sid)
{
	spanId=sid;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}		
	val=document.getElementById("mem_gender").value;
	var url="save_updateprofile.php?val="+val;				
	xmlHttp.onreadystatechange=statechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	
	
function statechanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{			
			document.getElementById('mygender').innerHTML=val;
			document.getElementById(spanId).style.display='none';
	} 
}
	
 function update_dob(sid)
	{
		spanId=sid;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		day=document.getElementById("day").value;
		month=document.getElementById("month").value;
		year=document.getElementById("year").value;
		
		var url="save_updateprofile.php?val1="+day+"&val2="+month+"&val3="+year;				
		xmlHttp.onreadystatechange=dobstatechanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
	
	function dobstatechanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{	   
				document.getElementById('age').innerHTML=xmlHttp.responseText;
				document.getElementById(spanId).style.display='none';
		} 
	}

function update_sgen(sid)
	{
		spanId=sid;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		sgen=document.getElementById("s_gender").value;
		var url="save_updateprofile.php?sg="+sgen;				
		xmlHttp.onreadystatechange=sgenstatechanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
	
	function sgenstatechanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
				if(sgen!="")
					document.getElementById('searchgender').innerHTML=sgen;
				else
					document.getElementById('searchgender').innerHTML="doesn't matter";
				document.getElementById(spanId).style.display='none';
		} 
	}	
	
	function update_agegroup(sid)
	{
		spanId = sid;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		from=document.getElementById("age_from").value;
		to=document.getElementById("age_to").value;
		
		var url="save_updateprofile.php?ag1="+from+"&ag2="+to;				
		xmlHttp.onreadystatechange=agstatechanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
	
	function agstatechanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
				document.getElementById('age_group').innerHTML=xmlHttp.responseText;
				document.getElementById(spanId).style.display='none';
		
		} 
	}
	
	function update_sport(sid)
	{
		spanId=sid;
		xmlHttp=GetXmlHttpObject()
		str="";
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		
		sp=document.getElementById("spcnt").value;
			
		for(i=0;i<sp;i++)
		{
			if(document.getElementById("sport"+i).checked==true)
			str=str+document.getElementById("sport"+i).value+",";
		}
		
		var url="save_updateprofile.php?sprt="+str;				
		xmlHttp.onreadystatechange=spstatechanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
	
	function spstatechanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
		  for(i=0;i<sp;i++)
		  {
			str=str+document.getElementById("sport"+i).value+",";
		  }
		    document.getElementById('games').innerHTML=xmlHttp.responseText;
			document.getElementById(spanId).style.display='none';
		} 
	}
   

  function update_city(sid)
	{
		spanId = sid;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		cit=document.getElementById("mem_city").value;
		dist=document.getElementById("distance").value;
		var url="save_updateprofile.php?city="+cit+"&distance="+dist;				
		xmlHttp.onreadystatechange=ststatechanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
	
	function ststatechanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
				document.getElementById('mycity').innerHTML=cit;
				document.getElementById('dis').innerHTML=dist;
				document.getElementById(spanId).style.display='none';
		} 
	}


///Added New after 19-06-2009///////////////
function filter_data()
{   
	    
	document.getElementById('load_matches').innerHTML="<img align='absmiddle' src='images/load.gif'/>";
	if(document.getElementById('load_matches1'))
	   document.getElementById('load_matches1').innerHTML="<img align='absmiddle' src='images/load.gif'/>";
	
	var url;
	var str = "";
	var data1 = "";
	var data2 = "";
	var data3 = "";
	var data4 = "";
	var data5 = "";
	var data6 = "";
	var data7 = "";
	var data8 = "";
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert("Browser does not support HTTP Request")
		return
	}		
	data1=document.getElementById("distance").value;
	data2=document.getElementById("age_from").value;
	data3=document.getElementById("age_to").value;
	
	if(document.getElementById("active").checked==true)
	   data4=document.getElementById("active").value;
	if(document.getElementById("all").checked==true)
	   data5=document.getElementById("all").value;
	
	data6=document.getElementById("s_gender").value;
	
	if(document.getElementById("is_pic").checked==true)
	{
	   data7=document.getElementById("is_pic").value;
	}
	else
	{
	  data7="";
	}
	if(document.getElementById("is_message").checked==true)   
	{
	   data8=document.getElementById("is_message").value;
	}
	else 
	{
	   data8=""; 
	}
	
	if(data1!="")
	   str = str+'distance='+data1;
	
	if(data2!="")
	   str = str+'&age_from='+data2;
	
	if(data3!="")
	   str = str+'&age_to='+data3;
	   
	if(data4!="")
	   str = str+'&active='+data4;
	
	if(data5!="")
	  str = str+'&all='+data5;
	
	if(data6!="")
	   str = str+'&s_gender='+data6;
	
	if(data7!="")
	   str = str+'&is_pic='+data7;  
	   
	if(data8!="")
	   str = str+'&is_message='+data8;   
	   
	strspt = "";
	for(i=0;i<12;i++)
	{
		if(document.getElementById("sport"+i).checked==true)
		   strspt=strspt+document.getElementById("sport"+i).value+",";
	}
	
	if(strspt!="")
	{
	   strspt = strspt.substr(0,(strspt.length-1));
	   url="ajax_free_search.php?"+str+"&sport="+strspt;				
	}
	else
	   url="ajax_free_search.php?"+str;				
	//alert(url)
	xmlHttp.onreadystatechange=filterstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	

function filterstatechanged() 
{  
	
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{	
	  document.getElementById('load_matches').innerHTML=xmlHttp.responseText; 
	  if(document.getElementById('load_matches1'))
	  {
		document.getElementById('load_matches1').innerHTML=xmlHttp.responseText; 
	  }
	} 
}
	
function show_data(pageindex)
{   
	var url;
	var mid;
	var str = "";
	var data1 = "";
	var data2 = "";
	var data3 = "";
	var data4 = "";
	var data5 = "";
	var data6 = "";
	var data7 = "";
	var data8 = "";
	
	//document.getElementById('show_load_img').style.display = '';
	//alert(document.body.scrollTop)
	//document.getElementById('show_load_img').style.top = document.scrollTop;
	//document.getElementById('show_load_img').innerHTML = "<img align='absmiddle' src='images/loadingAnimation.gif'/>";
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}		
	mid = document.getElementById("mid").value;
	data1=document.getElementById("distance").value;
	data2=document.getElementById("age_from").value;
	data3=document.getElementById("age_to").value;
	if(document.getElementById("active").checked==true)
	   data4=document.getElementById("active").value;
	if(document.getElementById("all").checked==true)
	   data5=document.getElementById("all").value;
	
	data6=document.getElementById("s_gender").value;
	
	
	if(document.getElementById("is_pic").checked==true)
	{
	  data7=document.getElementById("is_pic").value;
	}
	else
	{
	  data7="";
	}
	if(document.getElementById("is_message").checked==true)   
	{
	   data8=document.getElementById("is_message").value;
	}
	else 
	{
	   data8=""; 
	}
		
		
	if(data1!="")
	   str = str+'&distance='+data1;
	
	if(data2!="")
	   str = str+'&age_from='+data2;
	
	if(data3!="")
	   str = str+'&age_to='+data3;
	   
	if(data4!="")
	   str = str+'&active='+data4;
	
	if(data5!="")
	  str = str+'&all='+data5;
	
	if(data6!="")
	   str = str+'&s_gender='+data6;
	
	if(data7!="")
	   str = str+'&is_pic='+data7;  
	   
	if(data8!="")
	   str = str+'&is_message='+data8;   
	   
	strspt = "";
	for(i=0;i<12;i++)
	{
		if(document.getElementById("sport"+i).checked==true)
		   strspt=strspt+document.getElementById("sport"+i).value+",";
	}
	
	pageval = document.getElementById('pageval').value;
	
	if(strspt!="")
	{
	   strspt = strspt.substr(0,(strspt.length-1));
	   url="ajax_search_page.php?mid="+mid+str+"&sport="+strspt+"&pageindex="+pageindex+"&pageval="+pageval;				
	}
	else
	   url="ajax_search_page.php?mid="+mid+str+"&pageindex="+pageindex+"&pageval="+pageval;				

    xmlHttp.onreadystatechange=showstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	
	
function showstatechanged() 
{  
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	  document.getElementById('already_result').innerHTML=xmlHttp.responseText;
	} 
}

function sendUncheckAjaxRequest(mid,mode)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert("Browser does not support HTTP Request")
		return
	}
	
	var url="chkunchk.php?mid="+mid+"&mode="+mode;				
	
	xmlHttp.onreadystatechange=showsendstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function showsendstatechanged() 
{  
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	  res=xmlHttp.responseText;
	  //alert(res)
	  arr= res.split(',');
	  total_sport=parseInt(arr[0]);
	  total_unselected=parseInt(arr[1]);
	  
	  total_selected=parseInt(total_sport-total_unselected);
	  
	  document.getElementById('numsel1').innerHTML=total_selected;
	  document.getElementById('numsel2').innerHTML=total_selected;
	  document.getElementById('numsel').innerHTML=total_selected;
	} 
}


///Added on 14-05-2010
function send_msg_next()
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert("Browser does not support HTTP Request")
		return
	}
	
	if(document.getElementById('message').value=="" )
	{
		document.getElementById('message').style.borderColor = "Red";
		document.getElementById('message').value = "Je hebt nog niks geschreven. Schrijf eerst een bericht en klik dan op de groene knop";
		document.getElementById('message').className = "Red Light12A";
		return false;
	}
	
	if(document.getElementById('message').value=="klik hier om je bericht te typen" )
	{
		document.getElementById('message').style.borderColor = "Red";
		document.getElementById('message').value = "Je hebt nog niks geschreven. Schrijf eerst een bericht en klik dan op de groene knop";
		document.getElementById('message').className = "Red Light12A";
		return false;
	}
	
	if(document.getElementById('message').value=="Je hebt nog niks geschreven. Schrijf eerst een bericht en klik dan op de groene knop" )
	{
		document.getElementById('message').style.borderColor = "Red";
		document.getElementById('message').value = "Je hebt nog niks geschreven. Schrijf eerst een bericht en klik dan op de groene knop";
		document.getElementById('message').className = "Red Light12A";
		return false;
	}
	
	msgtype = document.getElementById('msgtype').value; 
	senderid = document.getElementById('senderid').value; 	
	receiverid = document.getElementById('receiverid').value; 	
	msg = document.getElementById('message').value; 
	
	document.getElementById('msgbox').innerHTML='<div class="float_left Bdr_Blue1" style="width:336px; height:280px; margin:0 0 0 11px;"><div class="BlueBg" ><div class="Match Light18A "><div class="float_left"> <strong>Beste Matches</strong> </div><div class="float_right Light13A PadT2"><u><strong>( Hoe werkt dit? )</strong></u></div></div><div class="MatchRoulette" align="center" style="padding-top:16px"><br /><br /><br /><img src="images/ajax-loader_mr.gif" /><br /><br /><br /><br /><span class="clear Light16A tc_blue1"><strong>...MatchRoulette zoekt nu <br />jouw volgende Match...</strong></span><br /><br /><br /><br /><br /></div></div></div>';
	
	var url="save_pers_msg.php?msgtype="+msgtype+"&senderid="+senderid+"&receiverid="+receiverid+"&message="+msg;				
	
	xmlHttp.onreadystatechange=showsendmsgstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showsendmsgstatechanged() 
{  
  if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
    document.getElementById('msgbox').innerHTML = xmlHttp.responseText; 
  }
}

function show_next_match(match_id)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert("Browser does not support HTTP Request")
		return
	}
	
	document.getElementById('msgbox').innerHTML='<div class="float_left Bdr_Blue1 " style="width:336px; height:280px; margin:0 0 0 11px;"><div class="BlueBg" ><div class="Match Light18A "><div class="float_left"> <strong>Beste Matches</strong> </div><div class="float_right Light13A PadT2"><u><strong>( Hoe werkt dit? )</strong></u></div></div><div class="MatchRoulette" align="center" style="padding-top:16px"><br /><br /><br /><img src="images/ajax-loader_mr.gif" /><br /><br /><br /><span class="clear Light16A tc_blue1"><strong>...MatchRoulette zoekt nu <br />jouw volgende Match...</strong></span><br /><br /><br /><br /><br /><br /></div></div></div>';
	
	var url="go_next_match.php?receiverid="+match_id;				
	xmlHttp.onreadystatechange=shownextstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function shownextstatechanged() 
{  
  if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
    document.getElementById('msgbox').innerHTML = xmlHttp.responseText; 
  }
}


function send_msg_next_mr()
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert("Browser does not support HTTP Request")
		return
	}
	
	if(document.getElementById('message').value=="")
	{
		document.getElementById('message').style.borderColor = "Red";
		document.getElementById('message').value = "Je hebt nog niks geschreven. Schrijf eerst een bericht en klik dan op de groene knop";
		document.getElementById('message').className = "Red Light12A";
		return false;
	}
	
	if(document.getElementById('message').value=="klik hier om je bericht te typen" )
	{
		document.getElementById('message').style.borderColor = "Red";
		document.getElementById('message').value = "Je hebt nog niks geschreven. Schrijf eerst een bericht en klik dan op de groene knop";
		document.getElementById('message').className = "Red Light12A";
		return false;
	}
	
	if(document.getElementById('message').value=="Je hebt nog niks geschreven. Schrijf eerst een bericht en klik dan op de groene knop" )
	{
		document.getElementById('message').style.borderColor = "Red";
		document.getElementById('message').value = "Je hebt nog niks geschreven. Schrijf eerst een bericht en klik dan op de groene knop";
		document.getElementById('message').className = "Red Light12A";
		return false;
	}
	
	
	msgtype = document.getElementById('msgtype').value; 
	senderid = document.getElementById('senderid').value; 	
	receiverid = document.getElementById('receiverid').value; 	
	msg = document.getElementById('message').value; 
	
	document.getElementById('msgbox1').innerHTML='<div class="MatchLeft PadT38"><div class="BlueBg" ><div class="Match Light18A "><div class="float_left"> <strong>Beste Matches</strong> </div><div class="float_right Light13A PadT2"><u><strong>( Hoe werkt dit? )</strong></u></div></div><div class="MatchRoulette" align="center"><br /><br /><br /><img src="images/ajax-loader_mr.gif" /><br /><br /><br /><span class="clear Light16A tc_blue1"><strong>...MatchRoulette zoekt nu <br />jouw volgende Match...</strong></span><br /><br /><br /><br /><br /><br /></div></div></div>';
	
	var url="save_pers_msg_match_roul_page.php?msgtype="+msgtype+"&senderid="+senderid+"&receiverid="+receiverid+"&message="+msg;				
	xmlHttp.onreadystatechange=showsendmsgstatechangedmr
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showsendmsgstatechangedmr() 
{  
  if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
    document.getElementById('msgbox1').innerHTML = xmlHttp.responseText; 
  }
}


function show_next_match_mr(match_id)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert("Browser does not support HTTP Request")
		return
	}
	
	document.getElementById('msgbox1').innerHTML='<div class="MatchLeft PadT38"><div class="BlueBg" ><div class="Match Light18A "><div class="float_left"> <strong>Beste Matches</strong> </div><div class="float_right Light13A PadT2"><u><strong>( Hoe werkt dit? )</strong></u></div></div><div class="MatchRoulette" align="center"><br /><br /><br /><img src="images/ajax-loader_mr.gif" /><br /><br /><br /><span class="clear Light16A tc_blue1"><strong>...MatchRoulette zoekt nu <br />jouw volgende Match...</strong></span><br /><br /><br /><br /><br /><br /></div></div></div>';
	
	var url="go_next_match_mr.php?receiverid="+match_id;				
	xmlHttp.onreadystatechange=shownextstatechangedmr
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function shownextstatechangedmr() 
{  
  if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
    document.getElementById('msgbox1').innerHTML = xmlHttp.responseText; 
  }
}
/////

///For new full profile page
function show_next_profile(match_id)
{  
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert("Browser does not support HTTP Request")
		return
	}
	
	document.getElementById('matched_profile').innerHTML = "<div class='clear' align='center'><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><span class='Blue2 tf22'>Please wait <br /><img align='absmiddle' src='images/ajax_prof-loader.gif'/></span><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>";
	var url="view_profile_next.php?receiverid="+match_id;				
	xmlHttp.onreadystatechange=shownextprofstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function shownextprofstatechanged() 
{  
  if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
    document.getElementById('matched_profile').innerHTML = xmlHttp.responseText; 
  }
}
///For new full profile page

///For lp profile page
function show_next_lp_profile(match_id,sid)
{  
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert("Browser does not support HTTP Request")
		return
	}
	
	document.getElementById('lp_matched_profile').innerHTML = "<div class='clear' align='center'><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><span class='Blue2 tf22'>Please wait <br /><img align='absmiddle' src='images/ajax_prof-loader.gif'/></span><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>";
	var url="lp_view_profile_next.php?receiverid="+match_id+"&sid="+sid;				
	xmlHttp.onreadystatechange=showlpnextprofstatechanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showlpnextprofstatechanged() 
{  
  if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
    document.getElementById('lp_matched_profile').innerHTML = xmlHttp.responseText; 
  }
}
///For lp profile page


function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
	  objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
	  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}

function check_checkbox(id,mid)
{
  document.getElementById('imgsel'+id).innerHTML="<img src='images/img_listing_green.jpg' onclick=uncheck_checkbox('"+id+"','"+mid+"') alt='' />";		
  document.getElementById('img_go'+id).innerHTML="<img src='images/listing_go_green.jpg' />";
  sendUncheckAjaxRequest(mid,"select");
}
function uncheck_checkbox(id,mid)
{
  document.getElementById('imgsel'+id).innerHTML="<img src='images/img_listing_pink.jpg' onclick=check_checkbox('"+id+"','"+mid+"') alt='' />";	
  document.getElementById('img_go'+id).innerHTML="<img src='images/listing_go_pink.jpg' />";
  sendUncheckAjaxRequest(mid,"unselect");
}

function SelectAll_ajax(pagesize)
{ 
  k = document.getElementById('sendnum').value ;
  myflag1=0;
  for(i=1;i<=k;i++)
  {
    try
    { 
  	  str=document.getElementById('imgsel'+i).innerHTML;
	  fi=str.replace('img_listing_pink.jpg', 'img_listing_green.jpg');
	  fi=fi.replace('check_checkbox', 'uncheck_checkbox');
	  document.getElementById('imgsel'+i).innerHTML=fi; //"<img src='images/img_listing_green.jpg' onclick=uncheck_checkbox('"+i+"') alt='' />";					
      document.getElementById('img_go'+i).innerHTML="<img src='images/listing_go_green.jpg'  alt='' />";					
      myflag1=1;
    }	
    catch(e)
    {
	  
    }
  }
 
  if(myflag1)
    sendUncheckAjaxRequest(0,"selectall");
}//end function

function UnselectAll_ajax(pagesize)
{   
   k = document.getElementById('sendnum').value;
   myflag=0;
   for(i=1;i<=k;i++)
   {	
	 try
	 {
		str=document.getElementById('imgsel'+i).innerHTML;
		fi=str.replace('img_listing_green.jpg', 'img_listing_pink.jpg');
		fi=fi.replace('uncheck_checkbox', 'check_checkbox');
		document.getElementById('imgsel'+i).innerHTML=fi; //"<img src='images/img_listing_pink.jpg' onclick=check_checkbox('"+i+"') alt='' />";				
		document.getElementById('img_go'+i).innerHTML="<img src='images/listing_go_pink.jpg' alt='' />";					
		myflag=1;
	 }
	 catch(e)
	 {
		 
 	 } 
   }	
   if(myflag)
	 sendUncheckAjaxRequest(0,"unselectall");
}//end function