
function popupwindow(mypage, myname, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes,status=yes'
	mywindow = window.open(mypage, myname, winprops)
	isOpened = true;
	if (parseInt(navigator.appVersion) >= 4) { mywindow.window.focus(); }
}

//PST is short for PropertySearchTabs
function PrepPropertySearchJSFunctions(){
	InitPropertySearchJSElements();
	UpdateHiddenPropertyStatusTextBox();
	BindClickToSyncEventToCheckBoxList(CheckBoxListPrivatePropertyDistrict, CheckBoxPrivatePropertyDistrictAll);
	BindClickToSyncEventToCheckBoxList(CheckBoxListHDBPropertyDistrict, CheckBoxHDBPropertyDistrictAll);
	BindClickToSyncEventToCheckBoxList(CheckBoxListCommercialPropertyDistrict, CheckBoxCommercialPropertyDistrictAll);
}

function PrepPropertySearchResultJSFunctions(){
	InitPropertySearchJSElements();
	UpdatePropertySearchPanels();
	BindClickToSyncEventToCheckBoxList(CheckBoxListPrivatePropertyDistrict, CheckBoxPrivatePropertyDistrictAll);
	BindClickToSyncEventToCheckBoxList(CheckBoxListHDBPropertyDistrict, CheckBoxHDBPropertyDistrictAll);
	BindClickToSyncEventToCheckBoxList(CheckBoxListCommercialPropertyDistrict, CheckBoxCommercialPropertyDistrictAll);
	
	SyncOverallCheckBox(CheckBoxListPrivatePropertyDistrict, CheckBoxPrivatePropertyDistrictAll);
	SyncOverallCheckBox(CheckBoxListHDBPropertyDistrict, CheckBoxHDBPropertyDistrictAll);
	SyncOverallCheckBox(CheckBoxListCommercialPropertyDistrict, CheckBoxCommercialPropertyDistrictAll);
}

function UpdatePropertySearchPanels(){
	if(PanelPrivatePropertySearch && PanelHDBPropertySearch && PanelCommercialPropertySearch){
		var Type = TextBoxPropertyType.getAttribute("value");
		SyncPropertyTypeDropDownListsAndHiddenTextBox(Type);
	}
}
function DropDownListPropertyType_Change(objDropDownListPropertyType){
		var Type = objDropDownListPropertyType.options[objDropDownListPropertyType.selectedIndex].value;
		SyncCommonFormControlElements();
		SyncPropertyTypeDropDownListsAndHiddenTextBox(Type);
}
function SyncCommonFormControlElements(){
	var blnIsForSale, TextBoxPropertyMinPrice, TextBoxPropertyMaxPrice, TextBoxPropertyKeyword;	
	var Type = GetProertyTypeFromShownPanel();
	
	eval("RadioButtonPropertyStatusForSale = RadioButton" + Type + "PropertyStatusForSale;");
	eval("TextBoxPropertyMinPrice = TextBox" + Type + "PropertyMinPrice;");
	eval("TextBoxPropertyMaxPrice = TextBox" + Type + "PropertyMaxPrice;");
	eval("TextBoxPropertyKeyword = TextBox" + Type + "PropertyKeyword;");
	
	blnIsForSale = RadioButtonPropertyStatusForSale.checked;
	
	var Types = new Array("Private", "HDB", "Commercial");
	for(var x = 0; x < Types.length; x++){
		if(blnIsForSale){
			eval("RadioButton" + Types[x] + "PropertyStatusForSale.checked = true;");
		}
		else{
			eval("RadioButton" + Types[x] + "PropertyStatusForRent.checked = true;");
		}
		eval("TextBox" + Types[x] + "PropertyMinPrice.value = TextBoxPropertyMinPrice.value;");
		eval("TextBox" + Types[x] + "PropertyMaxPrice.value = TextBoxPropertyMaxPrice.value;");
		eval("TextBox" + Types[x] + "PropertyKeyword.value = TextBoxPropertyKeyword.value;");
	}
}
function GetProertyTypeFromShownPanel(){
	if(PanelPrivatePropertySearch.style.display != "none") return "Private";
	if(PanelHDBPropertySearch.style.display != "none") return "HDB";
	if(PanelCommercialPropertySearch.style.display != "none") return "Commercial";
}
function SyncPropertyTypeDropDownListsAndHiddenTextBox(Type){
	SelectDropDownListOptionWithValue(DropDownListPrivatePropertyType, Type);
	SelectDropDownListOptionWithValue(DropDownListHDBPropertyType, Type);
	SelectDropDownListOptionWithValue(DropDownListCommercialPropertyType, Type);
	TextBoxPropertyType.value = Type;
	PST_SwitchToPanel(Type);
}
function SelectDropDownListOptionWithValue(objDropDownList, value){
	for(var x = 0; x < objDropDownList.options.length; x++){
		var option = objDropDownList.options[x];
		if(option.value == value){
			objDropDownList.selectedIndex = x;
			return;
		}
	}
}
function PST_SwitchToPanel(Type){
	if(Type == "HDB"){
		PanelPrivatePropertySearch.style.display = "none";
		PanelHDBPropertySearch.style.display = "block";
		PanelCommercialPropertySearch.style.display = "none";
	}else if(Type == "Commercial"){
		PanelPrivatePropertySearch.style.display = "none";
		PanelHDBPropertySearch.style.display = "none";
		PanelCommercialPropertySearch.style.display = "block";
	}else{
		PanelPrivatePropertySearch.style.display = "block";
		PanelHDBPropertySearch.style.display = "none";
		PanelCommercialPropertySearch.style.display = "none";
	}
}

function PST_SwitchToTab(strObjID){
	Anchor_Click(document.getElementById(strObjID));
	UpdateHiddenPropertyStatusTextBox();
}

function UpdateHiddenPropertyStatusTextBox(){
	TextBoxPropertyType.value = PST_GetCurrentTabName();
}

function PST_GetCurrentTabName(){
	var LIs = $j("#productCycle8 li.productCycleTab");
	for(var x = 0; x < LIs.length; x++){
		if(ElementHasClassName(LIs[x], "current")){
			return LIs[x].id.split("_")[1];
		}
	}
	return "";
}

function ElementHasClassName(objElem, strClassName){
	var classNameArray = objElem.className.split(" ");
	for(var x = 0; x < classNameArray.length; x++ ){
		if(classNameArray[x] == strClassName) return true;
	}
	return false;
}

function SetCheckBoxListAllItemsChecked(objOverallCheckBox, objCheckBoxList){
	$j("#" + objCheckBoxList.id + " input").attr("checked",objOverallCheckBox.checked);
}

function BindClickToSyncEventToCheckBoxList(objCheckBoxList, objOverallCheckBox){
	$j("#" + objCheckBoxList.id + " input").bind("click", function(e){
		SyncOverallCheckBox(objCheckBoxList, objOverallCheckBox);
	});
}

function SyncOverallCheckBox(objCheckBoxList, objOverallCheckBox){
	var CheckBoxes = $j("#" + objCheckBoxList.id + " input");
	var blnAllChecked = true;
	for(var i = 0; i < CheckBoxes.length; i++){
		if(!CheckBoxes[i].checked) blnAllChecked = false;
	}
	objOverallCheckBox.checked = blnAllChecked;
}

function Anchor_Click(objAnchor){
		if(document.createEvent){
				var evt = document.createEvent('MouseEvents');
				evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
				objAnchor.dispatchEvent(evt);
		}else{
				objAnchor.click();
		}
}

function SearchProperty(){
	var RadioButtonPropertyStatusForSale;
	var RadioButtonPropertyStatusForRent;
	var DropDownListPropertyTypeDetail;
	var TextBoxPropertyMinPrice;
	var TextBoxPropertyMaxPrice;
	//var CheckBoxPropertyDistrictAll;//Not needed
	var CheckBoxListPropertyDistrict;
	var DropDownListPropertyNoOfBedrooms;
	var TextBoxPropertyKeyword;
	
	var Type = TextBoxPropertyType.value;
	
	switch(Type)
	{
		default:
			Type = "";
		case "":
		case "Private":
			RadioButtonPropertyStatusForSale = RadioButtonPrivatePropertyStatusForSale;
			RadioButtonPropertyStatusForRent = RadioButtonPrivatePropertyStatusForRent;
			DropDownListPropertyTypeDetail = DropDownListPrivatePropertyTypeDetail;
			TextBoxPropertyMinPrice = TextBoxPrivatePropertyMinPrice;
			TextBoxPropertyMaxPrice = TextBoxPrivatePropertyMaxPrice;
			//CheckBoxPropertyDistrictAll = CheckBoxPrivatePropertyDistrictAll;//Not needed
			CheckBoxListPropertyDistrict = CheckBoxListPrivatePropertyDistrict;
			DropDownListPropertyNoOfBedrooms = DropDownListPrivatePropertyNoOfBedrooms;
			TextBoxPropertyKeyword = TextBoxPrivatePropertyKeyword;
			break;
		case "HDB":
			RadioButtonPropertyStatusForSale = RadioButtonHDBPropertyStatusForSale;
			RadioButtonPropertyStatusForRent = RadioButtonHDBPropertyStatusForRent;
			DropDownListPropertyTypeDetail = DropDownListHDBPropertyTypeDetail;
			TextBoxPropertyMinPrice = TextBoxHDBPropertyMinPrice;
			TextBoxPropertyMaxPrice = TextBoxHDBPropertyMaxPrice;
			//CheckBoxPropertyDistrictAll = CheckBoxHDBPropertyDistrictAll;//Not needed
			CheckBoxListPropertyDistrict = CheckBoxListHDBPropertyDistrict;
			//DropDownListPropertyNoOfBedrooms = DropDownListHDBPropertyNoOfBedrooms;//No Bedroom for HDB
			TextBoxPropertyKeyword = TextBoxHDBPropertyKeyword;
			break;
		case "Commercial":
			RadioButtonPropertyStatusForSale = RadioButtonCommercialPropertyStatusForSale;
			RadioButtonPropertyStatusForRent = RadioButtonCommercialPropertyStatusForRent;
			DropDownListPropertyTypeDetail = DropDownListCommercialPropertyTypeDetail;
			TextBoxPropertyMinPrice = TextBoxCommercialPropertyMinPrice;
			TextBoxPropertyMaxPrice = TextBoxCommercialPropertyMaxPrice;
			//CheckBoxPropertyDistrictAll = CheckBoxCommercialPropertyDistrictAll;//Not needed
			CheckBoxListPropertyDistrict = CheckBoxListCommercialPropertyDistrict;
			//DropDownListPropertyNoOfBedrooms = DropDownListCommercialPropertyNoOfBedrooms;//No Bedroom for Commercial
			TextBoxPropertyKeyword = TextBoxCommercialPropertyKeyword;
			break;
	}
	
	var Status = RadioButtonPropertyStatusForSale.checked ? GetLabelTextFor(RadioButtonPropertyStatusForSale) : GetLabelTextFor(RadioButtonPropertyStatusForRent);
	var TypeDetail = GetDropDownListSelectedValue(DropDownListPropertyTypeDetail);
	var MinPrice = TextBoxPropertyMinPrice.value;
	var MaxPrice = TextBoxPropertyMaxPrice.value;
	
	var StripMinPrice = StripStringToInt(MinPrice);
	var StripMaxPrice = StripStringToInt(MaxPrice);
//	alert("StripMinPrice -> " + StripMinPrice);
//	alert(TryParseInt(StripMinPrice, false));
//	alert("StripMaxPrice -> " + StripMaxPrice);
//	alert(TryParseInt(StripMaxPrice, false));
	var ParsedMinPrice = TryParseInt(StripMinPrice, -1);
	var ParsedMaxPrice = TryParseInt(StripMaxPrice, -1);
	
	if(ParsedMinPrice == -1){
		TextBoxPropertyMinPrice.focus();
		TextBoxPropertyMinPrice.select();
		return;
	}else if(ParsedMinPrice < MIN_PRICE_ALLOWED || ParsedMinPrice > MAX_PRICE_ALLOWED){
		TextBoxPropertyMinPrice.value = addCommas(MIN_PRICE_ALLOWED);
		TextBoxPropertyMinPrice.focus();
		TextBoxPropertyMinPrice.select();
		return;
	}
	if(ParsedMaxPrice == -1){
		TextBoxPropertyMaxPrice.focus();
		TextBoxPropertyMaxPrice.select();
		return;
	}else if(ParsedMaxPrice < MIN_PRICE_ALLOWED || ParsedMaxPrice > MAX_PRICE_ALLOWED){
		TextBoxPropertyMaxPrice.value = addCommas(MAX_PRICE_ALLOWED);
		TextBoxPropertyMaxPrice.focus();
		TextBoxPropertyMaxPrice.select();
		return;
	}
	var District = GetCheckBoxListSelectedValues(CheckBoxListPropertyDistrict);
	var NoOfBedrooms = GetDropDownListSelectedValue(DropDownListPropertyNoOfBedrooms);
	var Keyword = TextBoxPropertyKeyword.value;
	
	//alert("Type:" + Type + 
	//			"\r\nTypeDetail:" + TypeDetail + 
	//			"\r\nStatus:" + Status + 
	//			"\r\nMinPrice:" + MinPrice + 
	//			"\r\nMaxPrice:" + MaxPrice + 
	//			"\r\nDistrict:" + District + 
	//			"\r\nNoOfBedrooms:" + NoOfBedrooms + 
	//			"\r\nKeyword:" + Keyword);
	
	document.location.href = PropertyURL + PropertySearchPath + "?" + 
		"Type=" + urlencode(Type) + 
		"&TypeDetail=" + urlencode(TypeDetail) + 
		"&Status=" + urlencode(Status) + 
		"&MinPrice=" + urlencode(MinPrice) + 
		"&MaxPrice=" + urlencode(MaxPrice) + 
		"&District=" + urlencode(District) + 
		"&NoOfBedrooms=" + urlencode(NoOfBedrooms) + 
		"&Keyword=" + urlencode(Keyword);
}
function StripStringToInt(strNumber){
	if(strNumber.indexOf(".") > -1) strNumber = strNumber.split(".")[0];
	return strNumber.replace(/,/g, "");
}
function TryParseInt(str,defaultValue){
    var retValue = defaultValue;
    if(str!=null){
        if(str.length>0){
            if (!isNaN(str)){
                retValue = parseInt(str);
            }
        }
    }
    return retValue;
}

function GetLabelTextFor(objElement){
	return $j("label[for='" + objElement.id + "']").text();
}
function GetDropDownListSelectedValue(objDropDownListElement){
	if(objDropDownListElement){
		for(var x = 0; x < objDropDownListElement.options.length; x++){
			var objOption = objDropDownListElement.options[x];
			if(objOption.selected) return objOption.value;
		}
	}
	return "";
}
function GetCheckBoxListSelectedValues(objCheckBoxList){
	var strSeparator = "|";
	
	var SelectedValues = new Array();
	
	var CheckBoxes = $j("#" + objCheckBoxList.id + " :checkbox");
	for(var x = 0; x < CheckBoxes.length; x++){
		var CheckBox = CheckBoxes[x];
		if(CheckBox.checked) SelectedValues.push(CheckBox.parentNode.getAttribute("title"));
	}
	
	return SelectedValues.join(strSeparator);
}

function urlencode (str) {
    // URL-encodes string  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/urlencode
    // +   original by: Philip Peterson
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: AJ
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: travc
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Lars Fischer
    // +      input by: Ratheous
    // +      reimplemented by: Brett Zamir (http://brett-zamir.me)
    // %          note 1: This reflects PHP 5.3/6.0+ behavior
    // *     example 1: urlencode('Kevin van Zonneveld!');
    // *     returns 1: 'Kevin+van+Zonneveld%21'
    // *     example 2: urlencode('http://kevin.vanzonneveld.net/');
    // *     returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F'
    // *     example 3: urlencode('http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a');
    // *     returns 3: 'http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a'
    var hexStr = function (dec) {
        return '%' + dec.toString(16).toUpperCase();
    };

    var ret = '',
            unreserved = /[\w.-]/; // A-Za-z0-9_.- // Tilde is not here for historical reasons; to preserve it, use rawurlencode instead
    str = (str+'').toString();

    for (var i = 0, dl = str.length; i < dl; i++) {
        var ch = str.charAt(i);
        if (unreserved.test(ch)) {
            ret += ch;
        }
        else {
            var code = str.charCodeAt(i);
            // Reserved assumed to be in UTF-8, as in PHP
            if (code === 32) {
                ret += '+'; // %20 in rawurlencode
            }
            else if (code < 128) { // 1 byte
                ret += hexStr(code);
            }
            else if (code >= 128 && code < 2048) { // 2 bytes
                ret += hexStr((code >> 6) | 0xC0);
                ret += hexStr((code & 0x3F) | 0x80);
            }
            else if (code >= 2048 && code < 65536) { // 3 bytes
                ret += hexStr((code >> 12) | 0xE0);
                ret += hexStr(((code >> 6) & 0x3F) | 0x80);
                ret += hexStr((code & 0x3F) | 0x80);
            }
            else if (code >= 65536) { // 4 bytes
                ret += hexStr((code >> 18) | 0xF0);
                ret += hexStr(((code >> 12) & 0x3F) | 0x80);
                ret += hexStr(((code >> 6) & 0x3F) | 0x80);
                ret += hexStr((code & 0x3F) | 0x80);
            }
        }
    }
    return ret;
}
function urldecode (str) {
    // Decodes URL-encoded string  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/urldecode
    // +   original by: Philip Peterson
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: AJ
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // +      input by: travc
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Lars Fischer
    // +      input by: Ratheous
    // +   improved by: Orlando
    // %        note 1: info on what encoding functions to use from: http://xkr.us/articles/javascript/encode-compare/
    // *     example 1: urldecode('Kevin+van+Zonneveld%21');
    // *     returns 1: 'Kevin van Zonneveld!'
    // *     example 2: urldecode('http%3A%2F%2Fkevin.vanzonneveld.net%2F');
    // *     returns 2: 'http://kevin.vanzonneveld.net/'
    // *     example 3: urldecode('http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a');
    // *     returns 3: 'http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a'
    
    var hash_map = {}, ret = str.toString(), unicodeStr='', hexEscStr='';
    
    var replacer = function (search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };
    
    // The hash_map is identical to the one in urlencode.
    hash_map["'"]   = '%27';
    hash_map['(']   = '%28';
    hash_map[')']   = '%29';
    hash_map['*']   = '%2A';
    hash_map['~']   = '%7E';
    hash_map['!']   = '%21';
    hash_map['%20'] = '+';
    hash_map['\u00DC'] = '%DC';
    hash_map['\u00FC'] = '%FC';
    hash_map['\u00C4'] = '%D4';
    hash_map['\u00E4'] = '%E4';
    hash_map['\u00D6'] = '%D6';
    hash_map['\u00F6'] = '%F6';
    hash_map['\u00DF'] = '%DF';
    hash_map['\u20AC'] = '%80';
    hash_map['\u0081'] = '%81';
    hash_map['\u201A'] = '%82';
    hash_map['\u0192'] = '%83';
    hash_map['\u201E'] = '%84';
    hash_map['\u2026'] = '%85';
    hash_map['\u2020'] = '%86';
    hash_map['\u2021'] = '%87';
    hash_map['\u02C6'] = '%88';
    hash_map['\u2030'] = '%89';
    hash_map['\u0160'] = '%8A';
    hash_map['\u2039'] = '%8B';
    hash_map['\u0152'] = '%8C';
    hash_map['\u008D'] = '%8D';
    hash_map['\u017D'] = '%8E';
    hash_map['\u008F'] = '%8F';
    hash_map['\u0090'] = '%90';
    hash_map['\u2018'] = '%91';
    hash_map['\u2019'] = '%92';
    hash_map['\u201C'] = '%93';
    hash_map['\u201D'] = '%94';
    hash_map['\u2022'] = '%95';
    hash_map['\u2013'] = '%96';
    hash_map['\u2014'] = '%97';
    hash_map['\u02DC'] = '%98';
    hash_map['\u2122'] = '%99';
    hash_map['\u0161'] = '%9A';
    hash_map['\u203A'] = '%9B';
    hash_map['\u0153'] = '%9C';
    hash_map['\u009D'] = '%9D';
    hash_map['\u017E'] = '%9E';
    hash_map['\u0178'] = '%9F';
    hash_map['\u00C6'] = '%C3%86';
    hash_map['\u00D8'] = '%C3%98';
    hash_map['\u00C5'] = '%C3%85';

    for (unicodeStr in hash_map) {
        hexEscStr = hash_map[unicodeStr]; // Switch order when decoding
        ret = replacer(hexEscStr, unicodeStr, ret); // Custom replace. No regexing
    }
    
    // End with decodeURIComponent, which most resembles PHP's encoding functions
    ret = decodeURIComponent(ret);

    return ret;
}

//Auto-comma'd numeric input box JS functions

//function isNumberKeyPressed(evt, objThis){
//	//alert("Key Pressed!");
//	var charCode = (evt.which) ? evt.which : event.keyCode
//	if (charCode < 48 || charCode > 57){//(charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
//		return false;
//	}
//	var strFromCharCode = String.fromCharCode(charCode);
//	var strChangedTo = objThis.value + strFromCharCode;
//	objThis.value = strChangedTo;
//	//objThis.value = formatNumber(strChangedTo);
//	return false;
//}
//function isNumberKeyDown(evt, objThis){
//	//alert("Key Downed!");
//	var charCode = (evt.which) ? evt.which : event.keyCode
//	if (charCode == 8){
//		var strVal = objThis.value;
//		var strChangedTo = strVal.substring(0, strVal.length - 1);
//		objThis.value = strChangedTo;
//		//objThis.value = formatNumber(strChangedTo);
//		return false;
//	}
//}
function formatNumber(nro){
	var v = nro;
	while (v.indexOf(',') >= 0) { // remove all commas
		v = v.replace(',','');
	}
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(v)) {
		v = v.replace(rgx, '$1' + ',' + '$2');		
	}
	return v;
}

//End Auto

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

function OnMouseOverFocusMinPrice(objThis){
	objThis.focus();
	objThis.select();
}
function OnClickMinPrice(objThis){
	objThis.value = "";
}
function OnMouseOverFocusMaxPrice(objThis){
	objThis.focus();
	objThis.select();
}
function OnClickMaxPrice(objThis){
	objThis.value = "";
}
function OnBlurMinPrice(objThis){
	var fltValue = (objThis.value == null || objThis.value == "") ? parseFloat(MIN_PRICE_ALLOWED) : (TryParseInt(StripStringToInt(objThis.value), -1) == -1) ? parseFloat(MIN_PRICE_ALLOWED) : TryParseInt(StripStringToInt(objThis.value), -1);
	var strValue = addCommas("" + fltValue);
	objThis.value = strValue;
}
function OnBlurMaxPrice(objThis){
	var fltValue = (objThis.value == null || objThis.value == "") ? parseFloat(MAX_PRICE_ALLOWED) : (TryParseInt(StripStringToInt(objThis.value), -1) == -1) ? parseFloat(MAX_PRICE_ALLOWED) : TryParseInt(StripStringToInt(objThis.value), -1);
	var strValue = addCommas("" + fltValue);
	objThis.value = strValue;
}
