

function searchresult(){
    var s1 = document.getElementById("price_min_search").value;
    var s2 = document.getElementById("bedrooms").value;
    var s3 = document.getElementById("bathrooms").value;
    var s4 = document.getElementById("company_id").value;
    var s5 = document.getElementById("sales_id").value;
    var s6 = document.getElementById("office_id").value;
    var s7 = document.getElementById("office_mailid").value;
    var s8 = document.getElementById("agent_name").value;
    var s9 = document.getElementById("price_max_search").value;
    window.open("results.php?pricemin="+s1+"&p="+s2+"&p="+s3+"&p="+s4+"&p="+s5+"&p="+s6+"&p="+s7+"&p="+s8+"&p="+s9,"preview","height=620,width=555,top=40,left=40,scrollbars=auto,resizable=yes,menubar=no,toolbar=no,location=no");
}

function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
 	return value.replace(re, "$1");
}

// Removes ending whitespaces
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}

function trim(Val) {
	while(''+Val.charAt(0)==' ')
	Val=Val.substring(1,Val.length);
	return Val
}

function search() {
	var str = trim(window.location.href);
	var redr = str.split('pricemin=')
	var read = redr[1].split('&p=')
	document.getElementById('details_frame').src = "http://c21wwcrest.idx.net/search_page.php?price_min="+read[0]+"&baths="+read[1]+"&beds="+read[2]+"&cid="+read[3]+"&agent_id="+read[4]+"&office_id="+read[5]+"&wwsrch=1"+"&price_max="+read[8]+"&mode="+read[9]+"&qry="+read[10];
	// document.getElementById('details_frame').src = "http://c21wwcrest.idx.net/search_page.php?price_min="+read[0]+"&baths="+read[1]+"&beds="+read[2]+"&cid="+read[3]+"&wwsrch=1"+"&price_max="+read[8];
}
