$(document).ready(function(){ 
			
	GetPaging(1)
    $("#tab1").click(function(){ 
      
		var t=$("#cur_tab").val();
		$("#cur_tab").val('1');
		var t1="#tab"+t;
		$(t1).removeClass('current');
       // ajax_search(); 
	    $("#tab1").addClass('current');
		dhtmlserachbm();
	});
		 
	
}); 



function GetPaging(pg)
		{
			
			document.getElementById("inline_txt").innerHTML ='<div><table border="0" cellpadding="0" cellspacing="0" width="100%" style="height: 168.5px;"><tbody><tr><td align="center"><p><img alt="loading.gif" src="images/loading.gif" height="30" width="30"><br><strong><font color="#FFFFFF">Loading ...</font></strong></p></td></tr></tbody></table></div>';
			obj=document.frmbrowse;
			
			uname = obj.uname.value;
			email = obj.email.value;
			choosecity = obj.choosecity.value;
			browseby = obj.browseby.value;
			sagefrom = obj.sagefrom.value;
			sageto = obj.sageto.value;
			//status=obj.status.value;
			country = obj.country.value;
			city = obj.city.value;
			//citymiles = obj.citymiles.value;
			state = obj.state.value;
			//statemiles = obj.statemiles.value;
			//zipmiles = obj.zipmiles.value;
			//zipcode = obj.zipcode.value;
			//alert(choosecity)
			$.post("browsemember.php",{pg:pg,uname:uname,email:email,browseby:browseby,sagefrom:sagefrom,sageto:sageto,country:country,city:city,state:state,choosecity:choosecity,sessid:Math.random()},function(data)
			{
				document.getElementById("inline_txt").innerHTML ="";
				document.getElementById("inline_txt").innerHTML =data;
			});
			
	}
	

var xmlHttpdhtmlserachbm
function dhtmlserachbm()
{ 
	xmlHttpdhtmlserachbm=RemoteRequestObject()
	if (xmlHttpdhtmlserachbm==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 } 

		var url="searchbrowsemembers.php"
		 
		url=url+"?rand="+Math.random()
	
		xmlHttpdhtmlserachbm.onreadystatechange=stateChangedhtmlserachbm 
		xmlHttpdhtmlserachbm.open("GET",url,true)
		xmlHttpdhtmlserachbm.send(null)
	
}

function stateChangedhtmlserachbm() 
{ 
	if (xmlHttpdhtmlserachbm.readyState==4 || xmlHttpdhtmlserachbm.readyState=="complete")
	{
		document.getElementById("somediv").style.display="";
		document.getElementById("somediv").innerHTML="";
		
		document.getElementById("somediv").innerHTML=""+xmlHttpdhtmlserachbm.responseText+""			
		divwin=dhtmlmodal.open('agebox', 'span', 'somediv', 'Search Members', 'width=550px,height=420px,center=1,resize=0,scrolling=0'); 
			
			
	} 
}

function fnsearch()
{
	var obj1 = document.frmBrowseSearch;
	var obj2 = document.frmbrowse;
	
	for (var i=0; i < obj1.browseby.length; i++)
		 {
		 if (obj1.browseby[i].checked)
			  {
		   var rad_val = obj1.browseby[i].value;
		 }
		 }
	/*var str1="";
	for (var i=0; i < obj1.status.length; i++)
	 {
	 if (obj1.status[i].checked)
	 {
		 str1=str1+","+obj1.status[i].value;
	 }
	 }*/


	 obj2.uname.value = obj1.uname.value;
	 obj2.email.value = obj1.email.value;
	 obj2.choosecity.value = obj1.choosecity.value;
	 obj2.browseby.value = rad_val;
	 obj2.sagefrom.value = obj1.sagefrom.value;
	 obj2.sageto.value = obj1.sageto.value;
	 //obj2.status.value = str1;
	 //obj2.havephoto.value = obj1.havephoto.value;
	 obj2.country.value = obj1.country.value;
	 obj2.city.value = obj1.city.value;
	 //obj2.citymiles.value = obj1.citymiles.value;
	 obj2.state.value = obj1.state.value;
	 //obj2.statemiles.value = obj1.statemiles.value;
	 //obj2.zipcode.value = obj1.zipcode.value;
	 //obj2.zipmiles.value = obj1.zipmiles.value;

	 GetPaging(1)
	 fnClose();
	
}

			

		


