﻿var HashValue = ""; var ver; var FireIframeEvent = ""; var FromIndexOrViewProfile = false; var RetainReferer = ""; var Pointers = ""; var oldLocation = window.location.hash; var HashTriggered; HashTriggered = false; var iInterval; function CheckUnCheck() { $get("ctl00_chkDeals").checked = !$get("ctl00_chkDeals").checked } function RefreshFeatures() { var newpath = ""; var path = document.location.href; if (path.toLowerCase().indexOf("/client") != -1) { newpath = path.substring(0, path.toLowerCase().indexOf("client")) + "searchresults.aspx" } else { newpath = path.substring(0, path.lastIndexOf("/") + 1) + "searchresults.aspx" } if ($get("ctl00_ddlBusinessType").value != "0") { CallMethod("PopulateBusinessFeatures", ReloadFeatures, onFail, newpath, "strSelectedValue", $get("ctl00_ddlBusinessType").value, "strSelectedFeatures", "", "Path", document.location.href) } else { var Features = document.getElementById("ctl00_phBusinessFeatures"); Features.innerHTML = "" } } function ReloadFeatures(response) { var Features = document.getElementById("ctl00_phBusinessFeatures"); Features.innerHTML = response.d; var sel = document.getElementsByTagName("select"); for (var f = 0; f < sel.length; f++) { if (sel[f].id.toLowerCase().indexOf("featuresddl") != -1) { sel[f].options[0].selected = true } } AJAXUpdateControls("," + Pointers + ",", "Features", "ctl00_hidFeatures"); Pointers = "" } function Right(str, n) { if (n <= 0) { return "" } else { if (n > String(str).length) { return str } else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n) } } } function CallPageMethod(methodName, onSuccess, onFail) { var Ref = ""; var args = ""; var objReferer; var postPage = false; var strValue = ""; var objReferer = document.getElementById("ctl00_phContents_hidReferer"); var l = arguments.length; if (l > 3) { for (var i = 3; i < l - 1; i += 2) { if (args.length != 0) { args += "," } strValue = arguments[i + 1]; if (isNaN(strValue) == true) { if (strValue.indexOf('"') != -1) { args += '"' + arguments[i] + '":"' + arguments[i + 1].replace(/"/g, "&quot;") + '"' } else { args += '"' + arguments[i] + '":"' + arguments[i + 1] + '"' } } else { args += '"' + arguments[i] + '":"' + arguments[i + 1] + '"' } } } var loc = window.location.href; if (loc.indexOf("?") != -1) { loc = loc.substr(0, loc.indexOf("?")) } else { if (loc.indexOf("#") != -1) { loc = loc.substr(0, loc.indexOf("#")) } } Ref = document.referrer; postPage = true; if (postPage == true) { jQuery.ajax({ type: "POST", url: loc + "/" + methodName, data: "{" + args + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: onSuccess, fail: onFail }) } } function SearchDisplay(ButtonClicked) { var Features = ""; var MinPrice = 0; var MaxPrice = 0; var SearchText = ""; var Areas = ""; var Activities = ""; var Category = 0; var Provinces = ""; var PageClicked = 1; var newpath = ""; var Locale = 0; var ConsiderDeals = 0; try { var path = document.location.href; if (path.toLowerCase().indexOf("searchresults.aspx") == -1) { newpath = path.substring(0, path.lastIndexOf("/") + 1) + "searchresults.aspx" } SelectFeatures("ctl00_hidFeatures", "F"); if ($get("ctl00_hidFeatures").value != "") { Features = $get("ctl00_hidFeatures").value; if (Right(Features, 1) == ",") { Features = Features.substring(0, Features.length - 1) } } if (Features != "") { if ($get("ctl00_hidActivities") != "") { Features = Features + "," + $get("ctl00_hidActivities").value } } else { if ($get("ctl00_hidActivities") != "") { Features = $get("ctl00_hidActivities").value } } if (Right(Features, 1) == ",") { Features = Features.substring(0, Features.length - 1) } if ($get("ctl00_txtMinPrice") != null) { if ($get("ctl00_txtMinPrice").value != "") { if (isNaN($get("ctl00_txtMinPrice").value) == false) { MinPrice = $get("ctl00_txtMinPrice").value } } } if ($get("ctl00_txtMaxPrice") != null) { if ($get("ctl00_txtMaxPrice").value != "") { if (isNaN($get("ctl00_txtMaxPrice").value) == false) { MaxPrice = $get("ctl00_txtMaxPrice").value } } } SearchText = $get("ctl00_txtSearch").value; Areas = $get("ctl00_HidAreaValues").value; Category = $get("ctl00_ddlBusinessType").value; Provinces = $get("ctl00_hidStates").value; if ($get("ctl00_chkDeals").checked == true) { ConsiderDeals = 1 } else { ConsiderDeals = 0 } Locale = $get("ctl00_language").value; if (window.location.href.toLowerCase().indexOf("searchresults.aspx") != -1) { if ($get("ctl00_phContents_hidOperation").value == "") { $get("ctl00_phContents_hidSearchtext").value = $get("ctl00_txtSearch").value; $get("ctl00_phContents_hidAreas").value = Areas; $get("ctl00_phContents_hidAct").value = Features; $get("ctl00_phContents_hidCategory").value = $get("ctl00_ddlBusinessType").value; $get("ctl00_phContents_hidProvince").value = $get("ctl00_hidStates").value; $get("ctl00_phContents_hidMinValue").value = MinPrice; $get("ctl00_phContents_hidMaxValue").value = MaxPrice } else { SearchText = $get("ctl00_phContents_hidSearchtext").value; Areas = $get("ctl00_phContents_hidAreas").value; Activities = $get("ctl00_phContents_hidAct").value; Category = $get("ctl00_phContents_hidCategory").value; Provinces = $get("ctl00_phContents_hidProvince").value; MinPrice = $get("ctl00_phContents_hidMinValue").value; MaxPrice = $get("ctl00_phContents_hidMaxValue").value; PageClicked = $get("ctl00_phContents_hidSelectedPage").value } } if (ButtonClicked == true) { SaveHiddenVariables(Areas, Features, Provinces, MinPrice, MaxPrice, Category, SearchText, PageClicked); ShowHideAdvanceFeatures(false) } ShowProgress(); SetSearchDisplay(); CallMethod("SearchClick", onSuccess, onFail, newpath, "strSearchString", SearchText, "strArea", Areas, "strPointersIds", Features, "iBusinessType", Category, "strSelectedStates", Provinces, "iStartRow", PageClicked, "dblMinPrice", MinPrice, "dblMaxPrice", MaxPrice, "strURLPath", document.location.href, "Locale", Locale, "ConsiderDeals", ConsiderDeals) } catch (exp) { if (document.getElementById("Processing1")) { document.getElementById("Processing1").style.display = "none" } } } function ShowHideAdvanceFeatures(Show) { var Display = document.getElementById("p7ABt1_1"); if (Display) { var DisplayDiv = document.getElementById("p7ABc1_1"); if (DisplayDiv) { if (DisplayDiv.style.display != "none" && DisplayDiv.style.display != "") { if (Show == false) { P7_ABtrig(Display) } } else { if (Show == true) { if (DisplayDiv.style.display == "none" || DisplayDiv.style.display == "") { P7_ABtrig(Display) } } } } } } function SaveHiddenVariables(Areas, Features, Provinces, MinPrice, MaxPrice, Category, SearchText, PageClicked) { var loc = ""; loc = window.location.href.toLowerCase(); if (loc.indexOf("searchresults.aspx") != -1) { $get("ctl00_phContents_hidOperation").value = ""; $get("ctl00_phContents_hidPageSelected").value = (parseInt(PageClicked) - 1 + 10) / 10; if ($get("ctl00_hidClickNumber").value == "") { $get("ctl00_hidClickNumber").value = "0" } $get("ctl00_hidClickNumber").value = parseInt($get("ctl00_hidClickNumber").value) + 1; $get("ctl00_hidClick").value = $get("ctl00_hidClick").value + $get("ctl00_hidClickNumber").value + "|" + Areas + "|" + Features + "|" + Provinces + "|" + MinPrice + "|" + MaxPrice + "|" + Category + "|" + SearchText + "|" + (parseInt(PageClicked) - 1 + 10) / 10 + "$" } SaveURLState() } function SaveURLState() { var ConsiderDeals = 0; if ($get("ctl00_chkDeals") != null) { if ($get("ctl00_chkDeals").checked == true) { ConsiderDeals = 1 } else { ConsiderDeals = 0 } } if (window.location.href.toLowerCase().indexOf("searchresults.aspx") != -1) { var objPageSelected = document.getElementById("ctl00_phContents_hidPageSelected"); var objState = document.getElementById("ctl00_hidClickNumber"); if (objPageSelected != null) { if (objPageSelected.value != "") { HashValue = "#q=" + encodeURIComponent($get("ctl00_txtSearch").value) + "&p=" + objPageSelected.value + "&s=" + objState.value + "&d=" + ConsiderDeals; oldLocation = HashValue; window.location.hash = "q=" + encodeURIComponent($get("ctl00_txtSearch").value) + "&p=" + objPageSelected.value + "&s=" + objState.value + "&d=" + ConsiderDeals } else { HashValue = "#q=" + encodeURIComponent($get("ctl00_txtSearch").value) + "&p=1&s=" + objState.value + "&d=" + ConsiderDeals; oldLocation = HashValue; window.location.hash = "q=" + encodeURIComponent($get("ctl00_txtSearch").value) + "&p=1&s=" + objState.value + "&d=" + ConsiderDeals } } else { HashValue = "#q=" + encodeURIComponent($get("ctl00_txtSearch").value) + "&p=1&s=" + objState.value + "&d=" + ConsiderDeals; oldLocation = HashValue; window.location.hash = "q=" + encodeURIComponent($get("ctl00_txtSearch").value) + "&p=1&s=" + objState.value + "&d=" + ConsiderDeals } } } function CallMethod(methodName, onSuccess, onFail, newpath) { var args = ""; var strValue = ""; var l = arguments.length; if (l > 3) { for (var i = 4; i < l - 1; i += 2) { if (args.length != 0) { args += "," } strValue = arguments[i + 1]; if (isNaN(strValue) == true) { if (strValue.indexOf('"') != -1) { args += '"' + arguments[i] + '":"' + arguments[i + 1].replace(/"/g, "&quot;") + '"' } else { args += '"' + arguments[i] + '":"' + arguments[i + 1] + '"' } } else { args += '"' + arguments[i] + '":"' + arguments[i + 1] + '"' } } } if (newpath == "") { var loc = window.location.href; if (loc.indexOf("?") != -1) { loc = loc.substr(0, loc.indexOf("?")) } else { if (loc.indexOf("#") != -1) { loc = loc.substr(0, loc.indexOf("#")) } } } else { loc = newpath } jQuery.ajax({ type: "POST", url: loc + "/" + methodName, data: "{" + args + "}", contentType: "application/json; charset=utf-8", dataType: "json", cache: true, success: onSuccess, fail: onFail }) } function onSuccess(response) { try { var PanelText = document.getElementById("SearchDisplay"); var loc = window.location.href; var results = null; results = response.d.split("|$|"); PanelText.innerHTML = "<table border=0 cellpading=0 cellspacing=0>" + response.d.substring(0, response.d.indexOf("|$|") - 1) + "</table>"; document.getElementById("Processing1").style.display = "none"; SearchString = window.location.href; SearchString = SearchString.replace("#", "&"); var SearchBox = document.getElementById("ctl00_txtSearch"); var CategoryBox = document.getElementById("ctl00_phContents_hidCategory"); var HiddenSearchBox = document.getElementById("ctl00_phContents_hidSearchtext"); var Advertisements = document.getElementById("ctl00_phContents_ltlAdvertisments"); if (results[4]) { if (parseInt(results[4]) == 1) { $get("ctl00_chkDeals").checked = true } else { $get("ctl00_chkDeals").checked = false } } if (results[3]) { Advertisements.innerHTML = results[3] } else { Advertisements.innerHTML = "" } if (SearchBox != null) { if (loc.indexOf("?") != -1) { StringPresent = true } if (loc.indexOf("#") != -1) { HashPresent = true } SearchBox.value = ""; HiddenSearchBox.value = ""; if (results[2]) { SearchBox.value = results[2]; HiddenSearchBox.value = SearchBox.value } CategoryBox.value = results[1]; AJAXUpdateControls(CategoryBox.value, "ddlBusinessType", "") } } catch (exp) { if (document.getElementById("Processing1")) { document.getElementById("Processing1").style.display = "none" } } } function LoadSearchPage() { var Ref = ""; try { ver = document.getElementById("ctl00_HidVersion"); Ref = document.referrer; if (Ref != "") { if (Ref.indexOf("?", 0) != -1) { Ref = document.referrer.substring(0, Ref.indexOf("?", 0) - 1) } } var Address = window.location.href; if (Address.toLowerCase().indexOf("searchresults.aspx") != -1) { var loc = window.location.href } if (HashTriggered == false) { if ((Ref == "" || (Ref.toLowerCase().indexOf("costaricabeauty.com") == -1 && Ref.toLowerCase().indexOf("localhost") == -1)) && window.location.href.toLowerCase().indexOf("searchresults.aspx") != -1) { var obj1 = document.getElementById("ctl00_hidGO"); obj1.value = "false"; if (loc.indexOf("#") != -1 && loc.indexOf("?") != -1) { ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", decodeURIComponent(loc.substr(loc.indexOf("?") + 1)), "URLPath", window.location.href) } else { if (loc.indexOf("#") != -1) { ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", decodeURIComponent(window.location.hash), "URLPath", window.location.href) } else { if (loc.indexOf("?") != -1) { loc = loc.substr(loc.indexOf("?") + 1); ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", decodeURIComponent("#" + loc), "URLPath", window.location.href) } else { ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", "", "URLPath", window.location.href) } } } } else { if (window.location.href.toLowerCase().indexOf("searchresults.aspx") != -1) { if (!(ver.value == 7 && navigator.appName == "Microsoft Internet Explorer")) { ShowProgress(); if (loc.indexOf("#") == -1 && loc.indexOf("?") != -1) { ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", decodeURIComponent(loc.substr(loc.indexOf("?") + 1)), "URLPath", window.location.href); P7_initAB(); ShowHideAdvanceFeatures(true) } else { SearchDisplay(true); ShowHideAdvanceFeatures(false) } } } } } } catch (exp) { if (document.getElementById("Processing1")) { document.getElementById("Processing1").style.display = "none" } } } function sessionExists() { var doc = getIFrameDocument(); try { if (doc.body.innerHTML == "") { return false } else { return true } } catch (exp) { return true } } function GetQueryString(ji, strString) { var Qpart = ""; var hu = ""; if (strString != "") { hu = strString } else { hu = window.location.search.substring(1) } Qpart = hu.replace("#", "&"); gy = Qpart.split("&"); for (i = 0; i < gy.length; i++) { ft = gy[i].split("="); if (ft[0] == ji) { return ft[1] } } } window.onhashchange = HashChangeHandler; function GetHashValue() { HashValue = window.location.hash } function SetPreSelectedAJAXData(strHistoryArea, strHistoryPointerIds, strHistoryStates, dblMinPrice, dblMaxPrice, strHistoryCategory) { AJAXUpdateControls(strHistoryCategory, "ddlBusinessType", ""); RefreshFeatures(); AJAXUpdateControls("," + strHistoryStates + ",", "ddlStates", "ctl00_hidStates"); AJAXUpdateControls("," + strHistoryArea + ",", "chkArea", "ctl00_HidAreaValues"); Pointers = strHistoryPointerIds; AJAXUpdateControls("," + strHistoryPointerIds + ",", "Activities", "ctl00_hidActivities"); var MaxPrice = document.getElementById("ctl00_txtMaxPrice"); var MinPrice = document.getElementById("ctl00_txtMinPrice"); if (MinPrice != null) { MinPrice.value = dblMinPrice; MaxPrice.value = dblMaxPrice } var Deals = "0"; Deals = GetQueryString("d", window.location.href); if (Deals == 1) { $get("ctl00_chkDeals").checked = true } else { $get("ctl00_chkDeals").checked = false } } function AJAXUpdateControls(strSelectedData, strControl, strHidControl) { var strselected = ""; var objHidFeatures; var CategoryLink; var strName = ""; var strFound = false; var ShowPrice = document.getElementById("ctl00_PriceDivision"); if (strHidControl != "") { var objControl = document.getElementById(strHidControl) } for (var i = 0; i < document.forms[0].elements.length; i++) { strName = document.forms[0].elements[i].name; if (document.forms[0].elements[i].type == "radio" || document.forms[0].elements[i].type == "checkbox") { if (strName.indexOf(strControl) != -1) { document.forms[0].elements[i].checked = false; if (strSelectedData.indexOf("," + document.forms[0].elements[i].value + ",") != -1) { document.forms[0].elements[i].checked = true; if (document.forms[0].elements[i].value != "0") { if (strselected != "") { strselected = strselected + "," + document.forms[0].elements[i].value } else { strselected = document.forms[0].elements[i].value } } } } } if (document.forms[0].elements[i].type == "select-one") { if (strName.indexOf(strControl) != -1) { var list = document.forms[0].elements[i]; for (var intI = 0; intI < list.options.length; intI++) { if (strControl == "ddlBusinessType") { list.options[intI].selected = false; CategoryLink = document.getElementById("link" + list.options[intI].value); CategoryLink.style.fontWeight = "normal"; if (list.options[intI].value == strSelectedData) { list.options[intI].selected = true; EnableDisableActivities("ctl00_ddlBusinessType", "ctl00_hidGO"); if (strControl == "ddlBusinessType") { CategoryLink.style.fontWeight = "bold"; if (list.options[intI].text == "0") { ShowPrice.style.display = "block" } else { if (list.options[intI].text == "1") { ShowPrice.style.display = "block" } else { ShowPrice.style.display = "none" } } } if (strselected != "") { strselected = strselected + "," + document.forms[0].elements[i].value } else { strselected = document.forms[0].elements[i].value } } } else { if (strSelectedData.indexOf("," + list.options[intI].value + ",") != -1) { list.options[intI].selected = true; if (strselected != "") { strselected = strselected + "," + document.forms[0].elements[i].value } else { strselected = document.forms[0].elements[i].value } } } } } } } if (objControl != null) { objControl.value = strselected } } function HashChangeHandler() { ver = document.getElementById("ctl00_HidVersion").value; var obj1 = document.getElementById("ctl00_hidClick"); var HashPresent = false; var StringPresent = false; var SearchString = ""; var BrowserStates; var iParameter; var parameters; var strHistoryArea; var strHistoryPointerIds; var strHistoryStates; var dblMinPrice = 0; var dblMaxPrice = 0; var strHistoryCategory; var strParameters; var newHash; newHash = ""; ConsiderDeals = "0"; try { if ($get("ctl00_chkDeals").checked == true) { ConsiderDeals = 1 } else { ConsiderDeals = 0 } ver = document.getElementById("ctl00_HidVersion"); var objState = document.getElementById("ctl00_hidClickNumber"); var statenumber = objState.value; if (statenumber == "") { statenumber = "1" } else { statenumber = parseInt(statenumber) + 1 } if (!(ver.value == 7 && navigator.appName == "Microsoft Internet Explorer")) { if (window.location.href.toLowerCase().indexOf("searchresults.aspx") != -1) { newHash = decodeURIComponent(window.location.hash); if (newHash == "" || newHash == "#") { newHash = "#q=" + $get("ctl00_txtSearch").value + "&p=1&s=" + statenumber + "&d=" + ConsiderDeals } if (HashValue == "#" || HashValue == "") { HashValue = "#q=" + $get("ctl00_txtSearch").value + "&p=1&s=" + +statenumber + "&d=" + ConsiderDeals } if (decodeURIComponent(HashValue) != newHash) { HashValue = window.location.hash; oldLocation = window.location.hash; var loc = window.location.href; if (loc.indexOf("?") != -1) { StringPresent = true } if (loc.indexOf("#") != -1) { HashPresent = true } SearchString = obj1.value; if (obj1.value.indexOf("$") != -1) { BrowserStates = SearchString.split("$"); SearchString = BrowserStates[0]; if (SearchString != "") { if (window.location.href.indexOf("&s=") != -1) { statenumber = GetQueryString("s", window.location.href) } else { statenumber = "1" } } else { statenumber = "1" } for (iParameter = 0; iParameter < BrowserStates.length; iParameter++) { strParameters = BrowserStates[iParameter]; parameters = strParameters.split("|"); if (parameters[0] == statenumber) { strHistoryArea = parameters[1]; strHistoryPointerIds = parameters[2]; strHistoryStates = parameters[3]; dblMinPrice = parseFloat(parameters[4]); dblMaxPrice = parseFloat(parameters[5]); strHistoryCategory = parameters[6]; SetPreSelectedAJAXData(strHistoryArea, strHistoryPointerIds, strHistoryStates, dblMinPrice, dblMaxPrice, strHistoryCategory); break } } } if (StringPresent == true && HashPresent == true) { HashTriggered = true; ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", "#" + decodeURIComponent(window.location.href.substr(window.location.href.indexOf("?") + 1)) + "$" + obj1.value, "URLPath", window.location.href) } if (StringPresent == true && HashPresent == false) { HashTriggered = true; ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", "#" + decodeURIComponent(window.location.href.substr(window.location.href.indexOf("?") + 1)) + "$" + obj1.value, "URLPath", window.location.href) } else { if (StringPresent == false && HashPresent == true) { HashTriggered = true; ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", decodeURIComponent(window.location.hash) + "$" + obj1.value, "URLPath", window.location.href) } else { if (StringPresent == false && HashPresent == false) { HashTriggered = true; ShowProgress(); CallPageMethod("HandleExternalRequests", onSuccess, onFail, "HashValue", "#$" + obj1.value, "URLPath", window.location.href) } } } } } } } catch (exp) { if (document.getElementById("Processing1")) { document.getElementById("Processing1").style.display = "none" } } } function HideFeatures() { var Display = document.getElementById("p7ABt1_1"); if (Display) { var DisplayDiv = document.getElementById("p7ABc1_1"); if (DisplayDiv) { DisplayDiv.style.display = "none" } } } function ShowProgress() { var Browser; Browser = "IE"; if (document.getElementById && !document.all) { Browser = "FFox" } if (Browser == "IE") { var objDiv = document.getElementById("Processing1"); objDiv.style.display = "block"; objDiv.style.zIndex = "999999"; var objLeft = (document.body.clientWidth - objDiv.offsetWidth) / 2; var objTop = (document.body.clientHeight - objDiv.offsetHeight) / 2; objLeft = objLeft + document.body.scrollLeft; objTop = objTop + document.body.scrollTop; objDiv.style.position = "fixed"; objDiv.style.top = 250 + "px"; objDiv.style.left = objLeft + "px" } else { var objDiv = document.getElementById("Processing1"); objDiv.style.display = "block"; objDiv.style.zIndex = "999999"; var objLeft = (window.innerWidth - objDiv.offsetWidth) / 2; var objTop = (window.innerHeight - objDiv.offsetHeight) / 2; objLeft = objLeft + window.pageXOffset; objTop = objTop + window.pageYOffset; objDiv.style.position = "fixed"; objDiv.style.top = 250 + "px"; objDiv.style.left = objLeft + "px" } objDiv.style.zIndex = "999999" } function doClick(buttonName, e, Page) { var key; if (window.event) { key = window.event.keyCode } else { key = e.which } if (key == 13) { var btn = document.getElementById(buttonName); if (window.event) { window.event.keyCode = 0 } else { e.which = 0 } if (btn != null) { if (Page == "1") { btn.click() } else { SearchDisplay(true) } return false } } } function onFail(response) { } function saveState(message) { var templateDiv = document.getElementById("historyFrame"); var doc = getIFrameDocument(); doc.open(); doc.write("<html><body><p>" + message + "</p></body></html>"); doc.close() } function getIFrameDocument() { var historyFrame = document.getElementById("historyFrame"); var doc = historyFrame.contentDocument; if (doc == undefined) { doc = historyFrame.contentWindow.document } return doc } function wopen(url, name, w, h) { w += 32; h += 96; wleft = (screen.width - w) / 2; wtop = (screen.height - h) / 2; if (wleft < 0) { w = screen.width; wleft = 0 } if (wtop < 0) { h = screen.height; wtop = 0 } var win = window.open(url, name, "width=" + w + ", height=" + h + ", left=" + wleft + ", top=" + wtop + ", location=no, menubar=no, status=no, toolbar=no, titlebar=no, scrollbars=yes, resizable=no"); win.resizeTo(w, h); win.moveTo(wleft, wtop); win.focus() } function SetScrollEvent() { window.onscroll = ScrollPage } function ScrollPage() { ShowDiv(true) } function LoadTab() { var obj = document.getElementById("p7ABt1_1"); var obj1 = document.getElementById("hidShow"); if (obj1) { if (obj1.value == "none") { obj1.value = "visible"; P7_ABtrig(obj) } } } function revealModal(divID) { window.onscroll = function() { document.getElementById(divID).style.top = document.body.scrollTop }; document.getElementById(divID).style.display = "block"; document.getElementById(divID).style.top = document.body.scrollTop } function hideModal(divID) { document.getElementById(divID).style.display = "none" } function EnableDisableActivities(strBusinessType, hidGO) { var objActivities = document.getElementById("tr1"); var objActivities1 = document.getElementById("tr2"); var objBusinessCategory = document.getElementById(strBusinessType); objBusinessCategory.style.visibility = "hidden"; var i, strValue, strFlag; var aPosition; try { for (i = 0; i < MyArray.length; i++) { strValue = MyArray[i]; if (parseInt(strValue.substring(0, strValue.indexOf("-"))) == parseInt(objBusinessCategory.value)) { strFlag = strValue.substring(strValue.indexOf(objBusinessCategory.value) + 2); break } } if (parseInt(objBusinessCategory.value) == 0) { strFlag = 0 } if (parseInt(strFlag) == 0) { objActivities.style.display = "none"; objActivities1.style.display = "none" } else { objActivities.style.display = "block"; objActivities1.style.display = "block" } } catch (err) { } } function SetCategoryValue(strId, strCategoryDropDownName, strHidGO, strLinkNumber, strTotalLinks, strHidActivities, strHidFeatures) { var objCategoryDropDown = document.getElementById(strCategoryDropDownName); var objHidFeatures = document.getElementById(strHidFeatures); var objHidActivities = document.getElementById(strHidActivities); var iCount; var ShowPrice = document.getElementById("ctl00_PriceDivision"); var PriceLabel = document.getElementById("ctl00_lblPrice"); var HidPriceLabel = document.getElementById("ctl00_HidPriceLabel"); var HidSalaryLabel = document.getElementById("ctl00_HidSalaryLabel"); try { if (document.getElementById("link" + strLinkNumber).style.fontWeight != "bold") { for (iCount = 0; iCount < objCategoryDropDown.options.length; iCount++) { document.getElementById("link" + objCategoryDropDown.options[iCount].value).style.fontWeight = "normal"; if (objCategoryDropDown.options[iCount].value == strId) { objCategoryDropDown.options[iCount].selected = true; EnableDisableActivities(strCategoryDropDownName, strHidGO); objHidFeatures.value = ""; objHidActivities.value = ""; RefreshFeatures(); $get("ctl00_txtMaxPrice").value = ""; $get("ctl00_txtMinPrice").value = ""; if (objCategoryDropDown.options[iCount].text == "0") { ShowPrice.style.display = "block"; PriceLabel.value = HidPriceLabel.value } else { if (objCategoryDropDown.options[iCount].text == "1") { ShowPrice.style.display = "block"; PriceLabel.value = HidSalaryLabel.value } else { ShowPrice.style.display = "none"; PriceLabel.value = "" } } objCategoryDropDown.style.visibility = "hidden" } } } document.getElementById("link" + strLinkNumber).style.fontWeight = "bold" } catch (exp) { if (document.getElementById("Processing1")) { document.getElementById("Processing1").style.display = "none" } } } function SelectFeatures(strFieldName, Type) { var strselected = ""; var objHidFeatures; objHidFeatures = document.getElementById(strFieldName); var strName = ""; for (var i = 0; i < document.forms[0].elements.length; i++) { strName = document.forms[0].elements[i].name; if (document.forms[0].elements[i].type == "radio" || document.forms[0].elements[i].type == "checkbox") { if (strName.indexOf("Features") != -1) { if (Type == "F") { if (document.forms[0].elements[i].checked == true) { if (document.forms[0].elements[i].value != "0") { if (strselected != "") { strselected = strselected + "," + document.forms[0].elements[i].value } else { strselected = document.forms[0].elements[i].value } } } } } else { if (strName.indexOf("chkArea") != -1) { if (Type == "A") { if (document.forms[0].elements[i].checked == true) { if (document.forms[0].elements[i].value != "0") { if (strselected != "") { strselected = strselected + "," + document.forms[0].elements[i].value } else { strselected = document.forms[0].elements[i].value } } } } } } } if (document.forms[0].elements[i].type == "select-one") { if (strName.indexOf("Features") != -1) { if (Type == "F") { if (document.forms[0].elements[i].value != "0") { if (strselected != "") { strselected = strselected + "," + document.forms[0].elements[i].value } else { strselected = document.forms[0].elements[i].value } } } } } } objHidFeatures.value = strselected } function ShowDiv(strScroll) { var iBrowserHeight = 0; var iHeight = 0; var iBrowserHeight = 0; var iSearchbarheight = 0; var iTopBarHeight = 0; var iNewsBarHeight = 0; var objDiv = document.getElementById("TopBar"); var objNewsDiv = document.getElementById("newsbar"); var objSearchDiv = document.getElementById("SearchBar"); var objPlaceholderDiv = document.getElementById("placeholderDiv"); var scrollX, scrollY; if (objDiv != null) { if (document.all) { if (!document.documentElement.scrollLeft) { scrollX = document.body.scrollLeft } else { scrollX = document.documentElement.scrollLeft } if (!document.documentElement.scrollTop) { scrollY = document.body.scrollTop } else { scrollY = document.documentElement.scrollTop } } else { scrollX = window.pageXOffset; scrollY = window.pageYOffset } iTopBarHeight = document.getElementById("TopBar").offsetHeight; if (document.getElementById("newsbar") != null) { iSearchbarheight = document.getElementById("SearchBar").offsetHeight; iNewsBarHeight = document.getElementById("newsbar").offsetHeight } iTopBarHeight = document.getElementById("TopBar").offsetHeight; if (strScroll == false) { if ((getDocHeight() - (iTopBarHeight + iSearchbarheight + iNewsBarHeight)) <= document.documentElement.clientHeight) { if (scrollY <= "98") { objDiv.style.display = "block"; objPlaceholderDiv.style.display = "none"; if (objNewsDiv) { objNewsDiv.style.display = "block"; objSearchDiv.style.display = "block" } } } } else { if (scrollY <= "98") { objDiv.style.display = "block"; objPlaceholderDiv.style.display = "none"; if (objNewsDiv) { objNewsDiv.style.display = "block"; objSearchDiv.style.display = "block" } } } if (document.getElementById("TopBar").style.display == "block") { clearInterval(iInterval) } } } function MM_jumpMenu(targ, selObj, restore) { eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'"); if (restore) { selObj.selectedIndex = 0 } } function GP_popupConfirmMsg(msg) { document.MM_returnValue = confirm(msg) } function ValidateSearch(strFieldName, strddlBusinessType, strTxtMinName, strTxtMaxName, strMinPrice, strMaxPrice, strMinMaxValue, strCorrectValue, strBlankMaxValue, strBlankMinValue, strPage, hidGO, strpageURL, strSearchTextBox, strPostPath) { var strErrorMessage = ""; var Browser; var Deals = "0"; var objState = document.getElementById("ctl00_hidClickNumber"); var statenumber = objState.value; if (statenumber == "") { statenumber = "1" } else { statenumber = parseInt(statenumber) + 1 } if ($get("ctl00_chkDeals").checked == true) { Deals = "1" } else { Deals = "0" } Browser = "IE"; if (document.getElementById && !document.all) { Browser = "FFox" } ShowProgress(); var strselected = ""; var strName = ""; for (var i = 0; i < document.forms[0].elements.length; i++) { strName = document.forms[0].elements[i].name; if (document.forms[0].elements[i].type == "radio" || document.forms[0].elements[i].type == "checkbox") { if (strName.indexOf("Features") != -1) { if (document.forms[0].elements[i].checked == true) { if (document.forms[0].elements[i].value != "0") { if (strselected != "") { strselected = strselected + "," + document.forms[0].elements[i].value } else { strselected = document.forms[0].elements[i].value } } } } } if (document.forms[0].elements[i].type == "select-one") { if (strName.indexOf("Features") != -1) { if (document.forms[0].elements[i].value != "0") { if (strselected != "") { strselected = strselected + "," + document.forms[0].elements[i].value } else { strselected = document.forms[0].elements[i].value } } } } } var strErrorMessage = ""; var objHidFeatures; objHidFeatures = document.getElementById(strFieldName); objHidFeatures.value = strselected; var obj1 = document.getElementById(hidGO); var objTextBox = document.getElementById(strSearchTextBox); obj1.value = "true"; ver = document.getElementById("ctl00_HidVersion"); if (ver.value == 7 && navigator.appName == "Microsoft Internet Explorer") { if (objTextBox.value != "") { document.forms[0].action = strPostPath + "?q=" + encodeURIComponent(objTextBox.value) } else { document.forms[0].action = strPostPath } } else { if (objTextBox.value != "") { document.forms[0].action = strPostPath + "#q=" + encodeURIComponent(objTextBox.value) + "&p=1&s=" + statenumber + "&d=" + Deals; HashValue = "#q=" + $get("ctl00_txtSearch").value + "&p=1&s=" + statenumber + "&d=" + Deals } else { document.forms[0].action = strPostPath + "#q=&p=1&s=" + statenumber + "&d=" + Deals; HashValue = "#q=" + $get("ctl00_txtSearch").value + "&p=1&s=" + statenumber + "&d=" + Deals } } HashValue = document.forms[0].action; document.forms[0].submit() } function SetSearchDisplay() { var objNewsDiv; objNewsDiv = document.getElementById("SearchBar"); var selectedPosX = 0; var selectedPosY = 0; while (objNewsDiv != null) { selectedPosX += objNewsDiv.offsetLeft; selectedPosY += objNewsDiv.offsetTop; objNewsDiv = objNewsDiv.offsetParent } window.scrollTo(selectedPosX, selectedPosY) } function getDocHeight() { var D = document; return Math.max(Math.max(D.body.scrollHeight, D.documentElement.scrollHeight), Math.max(D.body.offsetHeight, D.documentElement.offsetHeight), Math.max(D.body.clientHeight, D.documentElement.clientHeight)) } function SetNewsDisplay() { var objNewsDiv; if (document.getElementById("divNewsContent") != null) { objNewsDiv = document.getElementById("divNewsContent") } else { objNewsDiv = document.getElementById("newsbar") } var selectedPosX = 0; var selectedPosY = 0; while (objNewsDiv != null) { selectedPosX += objNewsDiv.offsetLeft; selectedPosY += objNewsDiv.offsetTop; objNewsDiv = objNewsDiv.offsetParent } window.scrollTo(selectedPosX, selectedPosY) } function showDiv() { var e = document.getElementById("ctl00_phContents_IMGDIV"); adjustDivs() } function getDocHeight() { var D = document; return Math.max(Math.max(D.body.scrollHeight, D.documentElement.scrollHeight), Math.max(D.body.offsetHeight, D.documentElement.offsetHeight), Math.max(D.body.clientHeight, D.documentElement.clientHeight)) } function adjustDivs() { var objDiv = document.getElementById("ctl00_phContents_IMGDIV"); var objLeft; var objTop; if (objDiv != null) { objLeft = (document.body.clientWidth - objDiv.offsetWidth) / 2; objTop = (document.body.clientHeight - objDiv.offsetHeight) / 2; objLeft = objLeft + document.body.scrollLeft; objTop = objTop + document.body.scrollTop; if (isNaN(objLeft) == true) { objLeft = (window.innerWidth - objDiv.style.width) / 2; objTop = (window.innerHeight - objDiv.Height) / 2; objLeft = objLeft + window.pageXOffset; objTop = objTop + window.pageYOffset } iTopBarHeight = document.getElementById("TopBar").offsetHeight; objDiv.style.position = "fixed"; objDiv.style.display = "block"; objDiv.style.zIndex = "999999"; objDiv.style.top = "200px"; objDiv.style.left = objLeft + "px" } } function RetrievePicture(imgCtrl, picid) { imgCtrl.onload = null; var d = new Date(); imgCtrl.src = "ShowImage.ashx?picname=" + picid + "&Time=" + d.getTime() };
