var queryString;
var StateString;
var CityString;
var oPopup = window. createPopup ();
//1 save
//2 remove
	function editpasswordproperty(){
		open_url('profile.php?editpassword=true','my_site_content');
	}
	
	function mailreply(id,pageid){
		open_url('detailmessage.php?replymailevent=true&id='+id+'&pageid='+pageid,'my_site_content');
	}
//	function advsearchproperty(){
//		open_url('advancesearch.php?advvalue=true','my_site_content');
//	}
//////////////////////////////////////////////////////////////////////
	function popupimage(filename,pathimg){
	window.open("imagepopup.php?filedir="+pathimg+"&imgname="+filename,+"imageWindow","width=10,height=10,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes");
	}
//////////////////////////////////////////////////////////////////////
function popupimageforviewdetail(fulldir,wi,hei)
	{	
	//document.write();
		var oPopBody = oPopup.document.body; 
		oPopBody.style.backgroundColor = "lightyellow";
		oPopBody.style.border = "solid black 1px";
			if(wi)
			{
				oPopBody.innerHTML = "<img src=" +fulldir + " "+ wi +" " +hei + ">"; 
			}
			else{
				oPopBody.innerHTML = "<img src=" +fulldir +">"; 
			}
		oPopup.show(100, 100, 300,300, document.body);
 
	}
	//function popupmember(name){
	//window.open("memberdetailpopup.php?mname="+name,+"imageWindow","width=400,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no");
	//}
//////////////////////////////////////////////////////////////////////
	function popupviewdetail(id){
	window.open("viewdetail.php?id="+id,+"imageWindow","width=600,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes");
	}
//////////////////////////////////////////////////////////////////////
	/*
	function resetform(){
	document.form1.mr_property_category_id.value="";
	document.form1.mr_property_mrtype_id.value="";
	document.form1.mr_property_township.value="";
	document.form1.mr_property_city.value="";
	document.form1.mr_property_state.value="";
	document.form1.coditionprice.value="";
	document.form1.mr_property_price.value="";
	document.form1.mr_property_currencyid.value="";
	}
	*/
//////////////////////////////////////////////////////////////////
	function dischkbtm(){
	document.mainform1.acceptfile.checked=null;
	}

///////////////////////////////////////////////////////////////////////
	function sendremove(fname,fpath){
		setRemoveQueryString(fname,fpath);
		//open_url(queryString,'my_site_content');
		location.href=queryString;
	}
	
	function setRemoveQueryString(fname,fpath){
    	queryString="";
    	queryString="post.php?";
    	var frm = document.forms[1];
    	var numberElements =  frm.elements.length;
    	for(var i = 0; i < numberElements; i++) {
		  if (frm.elements[i].value!=""){
			queryString += frm.elements[i].name+"="+
			encodeURIComponent(frm.elements[i].value) +"&";
		  }					
        }
    	queryString = queryString.substring(0,queryString.length-1);
    	queryString += "&act=2&file=" + fname + "&path=" +fpath;
	}
//////////////////////////////////////////////////////////////////////////////////////////
	function cityevent(){
		document.forms[1].mr_property_township.value=null;
		setCityEventQueryString();
	    open_url(CityString, 'my_site_content');
	    }	
		
	function setCityEventQueryString(){
		CityString="";
		
		if(document.forms[1].name=="advancesearchform")
		{
		CityString="search.php?";
		}
		else if(document.forms[1].name=="mainform1")
		{
		CityString="post.php?";
		}
		else if(document.forms[1].name=="registerform")
		{
		CityString="signup.php?";
		}
		else if(document.forms[1].name=="editprofileform")
		{
		CityString="editprofile.php?";
		}
		else if(document.forms[1].name=="searchmypropertyform")
		{
		CityString="managemyproperty.php?";
		}
		else if(document.forms[1].name=="searchmyshortlistform")
		{
		CityString="managemyshortlist.php?";
		}
		else{		
    	CityString="index.php?";
		}
		
    	var frm = document.forms[1];
    	var numberElements =  frm.elements.length;
    	for(var i = 0; i < numberElements; i++) {
		  if (frm.elements[i].value!=""){
			CityString += frm.elements[i].name+"="+
			encodeURIComponent(frm.elements[i].value) +"&";
		  }					
        }
    	CityString = CityString.substring(0,CityString.length-1);
    	CityString += "&act=cboevent";
		
    }			
////////////////////////////////////////////////////////////////////
	function stateevent(){
		document.forms[1].mr_property_city.value=null;
		document.forms[1].mr_property_township.value=null;
		setStateEventQueryString();
		open_url(StateString,'my_site_content');
	    }
		
	function setStateEventQueryString(){
		StateString="";
		//document.write(document.forms[1].name);
		if(document.forms[1].name=="advancesearchform")
		{
		StateString="search.php?";
		}
		else if(document.forms[1].name=="mainform1")
		{
		StateString="post.php?";
		}
		else if(document.forms[1].name=="registerform")
		{
		StateString="signup.php?";
		}
		else if(document.forms[1].name=="editprofileform")
		{
		StateString="editprofile.php?";
		}
		else if(document.forms[1].name=="searchmypropertyform")
		{
		StateString="managemyproperty.php?";
		}
		else if(document.forms[1].name=="searchmyshortlistform")
		{
		StateString="managemyshortlist.php?";
		}
		else{		
    	StateString="index.php?";
		}
    	var frm = document.forms[1];
    	var numberElements =  frm.elements.length;
    	for(var i = 0; i < numberElements; i++) {
		  if (frm.elements[i].value!=""){
			StateString += frm.elements[i].name+"="+
			encodeURIComponent(frm.elements[i].value) +"&";
		  }					
        }
    	StateString = StateString.substring(0,StateString.length-1);
    	StateString += "&act=cboevent";
		
    }		
////////////////////////////////////////////////////////////////////////////////////////////////