//Added for live chat-By Yogi
try{
	var lpMTagConfig = {'lpServer' : "server.iad.liveperson.net",'lpNumber' : "58857452",'lpProtocol' : (document.location.toString().indexOf('https:')==0) ? 'https' : 'http'}; 
	function lpAddMonitorTag(src)
	{
		if(typeof(src)=='undefined'||typeof(src)=='object')
		{
			src=lpMTagConfig.lpMTagSrc?lpMTagConfig.lpMTagSrc:'/hcp/html/mTag.js';
		}
		if(src.indexOf('http')!=0)
		{
			src=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+src+'?site='+lpMTagConfig.lpNumber;
		}else{
			if(src.indexOf('site=')<0){
				if(src.indexOf('?')<0)
					src=src+'?';
				else 
					src=src+'&';
				src=src+'site='+lpMTagConfig.lpNumber;
			}
		};
		var s=document.createElement('script');
		s.setAttribute('type','text/javascript');
		s.setAttribute('charset','iso-8859-1');
		s.setAttribute('src',src);
		document.getElementsByTagName('head').item(0).appendChild(s);
	}
	if (window.attachEvent) 
		window.attachEvent('onload',lpAddMonitorTag); 
	else 
		window.addEventListener("load",lpAddMonitorTag,false);
}catch(e){}

var baseSubDomain="www";var baseURL="https://www.auction.gohoming.com/GoHomingWeb/";
 /* environment changes */
  var sTestURL = document.location.href.toUpperCase().replace("HTTP://", "").replace("HTTPS://", "");
  if (sTestURL.substring(0, 3) != "WWW") 
  {
	if (sTestURL.substring(0, 7) == "PREVIEW") { baseURL = "http://preview.auction.gohoming.com/GoHomingWeb/"; baseSubDomain = "preview"; }
	if (sTestURL.substring(0, 3) == "UAT") { baseURL = "http://uat.auction.gohoming.com:8080/GoHomingWeb/"; baseSubDomain = "uat"; }
        if (sTestURL.substring(0, 2) == "QA") { baseURL = "http://192.168.92.232:8081/GoHomingWeb/"; baseSubDomain = "qa"; }
 	if (sTestURL.substring(0, 4) == "QAPE") { baseURL = "http://192.168.92.232:8080/GoHomingWeb/"; baseSubDomain = "qape"; }
	if (sTestURL.substring(0, 3) == "DEV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "dev"; }
	if (sTestURL.substring(0, 4) == "DEVM") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devm"; }
	if (sTestURL.substring(0, 4) == "DEVV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devv"; }
	if (sTestURL.substring(0, 5) == "DEVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devpe"; }
	if (sTestURL.substring(0, 6) == "DEVMPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devmpe"; }
	if (sTestURL.substring(0, 6) == "DEVVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devvpe"; }
    
  }
 /* environment changes */
var freeTextEntered="";var loadComplete=false;var compareCount=0;var autoRefresh=false;var saveSearchQuery="";var pageAutoPopup = false;var searchType = "Map";
try {var settings = { spaces: false };} catch(e) { }
var email={tldn:new RegExp("^[^\@]+\@[^\@]+\.(A[C-GL-OQ-UWXZ]|B[ABD-JM-OR-TVWYZ]|C[ACDF-IK-ORUVX-Z]|D[EJKMOZ]|E[CEGR-U]|F[I-KMOR]|G[ABD-IL-NP-UWY]|H[KMNRTU]|I[DEL-OQ-T]|J[EMOP]|K[EG-IMNPRWYZ]|L[A-CIKR-VY]|M[AC-EGHK-Z]|N[ACE-GILOPRUZ]|OM|P[AE-HKL-NR-TWY]|QA|R[EOSUW]|S[A-EG-ORT-VYZ]|T[CDF-HJ-PRTVWZ]|U[AGKMSYZ]|V[ACEGINU]|W[FS]|XN|Y[ETU]|Z[AMW]|AERO|ARPA|ASIA|BIZ|CAT|COM|COOP|EDU|GOV|INFO|INT|JOBS|MIL|MOBI|MUSEUM|NAME|NET|ORG|PRO|TEL|TRAVEL)$","i")};
/*try {window.addEventListener("message", messageCallBack, false);} catch(e) { }*/
/* START: Site Specific */
var agent = {width: 177,height: 308,src: "agent.png",adjustTop: 15,adjustLeft: 20,speechTop: 45,speechLeft: 65};
var baseDomain = "altisourcehomes.com";var autoCompleteDefaultText = "Search by 'Address' or 'City, State' or 'Zip'";var hompageSlideShowNO=1;var hompageSlidetimer;
var userDisplayStyle="text=font-family:arial;font-size:12px;font-weight:bold;color:%23333333;&login=font-family:arial;color:%23326799;font-weight:bold;font-size:12px;text-decoration:none;&logout=font-family:arial;color:%23326799;font-weight:bold;font-size:12px;text-decoration:none;&register=font-family:arial;color:%23669932;font-weight:bold;font-size:12px;text-decoration:none;&hover=color:%23020D48;";
function pageReadyLoad() {
	try { pageTracker._setDomainName(".altisourcehomes.com");pageTracker._addIgnoredOrganic(".altisourcehomes.com");pageTracker._setAllowHash(false);pageTracker._setAllowLinker(true); } catch (e) { }
  try { templatePageLoad(); } catch (e) { }
  setUserDisplay();
  try { if ($("#zipCityStateInput").val() == "") {$("#zipCityStateInput").val(autoCompleteDefaultText); initFreeTextSearch(); } } catch (e) { }
  try { if ($("#resultTotal").length > 0) { setSearchResultsFields(); } } catch (e) { }
   try { if ($("#resultTotal").length <= 0) { setSearchResultsFields(); } } catch (e) { }
  try { if ($("#compareListings").length > 0) { loadCompareFromCookie(); } } catch (e) { }
  try { if ($("#mortageCalInPage").length > 0) { mortageCalInPage(); } } catch (e) { }
  try { if ($(".refinementBox").length > 0) { refinementsAddMoreLink(); } } catch (e) { }
  
  try { if ($("#thumbsBid").length > 0) {showFirstPhotoBid(); } } catch (e) { }
  try { if ($("#thumbsOffer").length > 0) {showFirstPhotoOffer(); } } catch (e) { }
  
  try { if ($("#searchResultsPageMap").length > 0) {searchResultsMap(); } } catch (e) { }
	try { if ($("#statePageMap").length > 0) {stateBrowsePathMap(); } } catch (e) { }
  try { if ($("#embedPage").length > 0) { embedPage(); } } catch (e) { }
  try { if ($("#resultTotal").length > 0) { $("#resultTotal").html(formatNumber(resultsTotal)+" Results Found, "+perPage+" per page"); } } catch (e) { }
  
  try { if ($("#detailsPageMap").length > 0) { propertyDetailsMapV2(); } } catch (e) { }
  function propertyDetailsMapV2() 
  {
  	if (propertyDetailsLAT != null && propertyDetailsLONG != null) 
  	{
        	  if (GBrowserIsCompatible()) 
	  	  {
			map = new GMap2(document.getElementById("detailsPageMap"));
			map.setCenter(new GLatLng(propertyDetailsLAT, propertyDetailsLONG), 13);
			map.setUIToDefault();
			map.checkResize();
           	  }
          } 
  	else if (propertyADDRESS != null) 
  	{
  	     if (GBrowserIsCompatible()) 
  	     {
  	      map = new GMap2(document.getElementById("detailsPageMap"));
		      map.setCenter(new GLatLng(-34.397, 150.644), 13);
  	      map.setUIToDefault();
  	      geocoder = new GClientGeocoder();
  	      codeAddressV2(propertyADDRESS);
              map.checkResize();
  	     }
      } else {
          document.getElementById("detailsPageMap").innerHTML = "<b>Address or Lat/Long required to map property</b>";
      }
  }
  function codeAddressV2(address) {
  	if (geocoder) {
  		// Create our "tiny" marker icon
  		map.checkResize();
  		var houseIcon = new GIcon(G_DEFAULT_ICON);
  		houseIcon.image = "/images/map-marker.gif";
  		houseIcon.iconSize = new GSize(15,16);
  		houseIcon.iconAnchor = new GPoint(-1,-1);
  		houseIcon.shadow = '';
  		houseIcon.shadowSize = new GSize(0,0);
  		
  		// Set up our GMarkerOptions object
  		markerOptions = { icon:houseIcon };
  
  	  geocoder.getLatLng(
  	    address,
  	    function(point) {
  	      if (!point) {
  	        //alert(address + " not found");
  	      } else {
  	        map.setCenter(point, 11);
  	        var marker = new GMarker(point, markerOptions);
  	        map.addOverlay(marker);
  					
  				  var panoramaOptions = { latlng:point };
  				  myPano = new GStreetviewPanorama(document.getElementById("detailsPageStreetView"), panoramaOptions);
  				  GEvent.addListener(myPano, "error", handleNoFlash);
  	      }
  	    }
  	  );
  	}
}

  
  try { if ($("#iframeMySeller").length > 0) { mySeller();iframeEmbedResize('MySeller');$(window).resize(function () {iframeEmbedResize('MySeller');}); } } catch (e) { }
  
  try { if ($("#iframeEmbedPage").length > 0) {var linkArray=document.location.href.split("url=");document.getElementById("iframeEmbedPage").src=linkArray[1];iframeEmbedResize('MySeller');$(window).resize(function () {iframeEmbedResize('MySeller');});} } catch (e) { }
  
  try { if ($("#iframeMyShopper").length > 0) { myAccount();iframeEmbedResize('MyShopper');$(window).resize(function () {iframeEmbedResize('MyShopper');}); } } catch (e) { }
  try { if ($("#iframeLogin").length > 0) { loginPage();iframeEmbedResize('Login');$(window).resize(function () {iframeEmbedResize('Login');}); } } catch (e) { }
  try { if ($("#iframeRegister").length > 0) { registerPage();iframeEmbedResize('Register');$(window).resize(function () {iframeEmbedResize('Register');}); } } catch (e) { }
  try { if ($("#iframeRegisterILA").length > 0) { registerPageILA();iframeEmbedResize('RegisterILA');$(window).resize(function () {iframeEmbedResize('RegisterILA');}); } } catch (e) { }
  try { if ($("#pageLinks").length > 0) {document.getElementById("pageLinks2").innerHTML=document.getElementById("pageLinks").innerHTML } } catch (e) { }
  try { autoPopup(); } catch (e) { }
  try { if ($("#homePageSlideShow").length > 0) {
		var zIndexNumber = 10000;$("div").each(function() {$(this).css("zIndex", zIndexNumber);zIndexNumber -= 10;});
		$("#mainContent").css("background-color","transparent");
		//$(".agentsSubmitListings").css("zIndex", zIndexNumber-10);
		hompageSlidetimer = setTimeout(function() { hompageSlideShow(); }, 7000); 
		flowplayer("player", "/flash/flowplayer-3.1.5.swf");	
	}} catch (e) { }
	//loadAgent();
	try { if ($("#leadPhone").length > 0) {$("#leadPhone").mask("(999) 999-9999"); } } catch (e) { }
	try { if ($("#leadEmail").length > 0) {$("#leadEmail").format({type:"email",autofix:true}); } } catch (e) { }
	try { if ($("#standardMessage").length > 0) {loadStandardMessagePopup(); } } catch (e) { }
	loadComplete=true;
}
function openILARegistration(){
	this.location.href="embed.htm?url="+baseURL+"registerILA.action";
	
}
function idSearchWidget() {
	listingId = $("#listingId").val();
	listing = AJAX("get","/"+listingId+"/verifyListing.htm");
	
	if (listing != "") {document.location.href = listing; } else { alert("Listing ID "+listingId+" Not Found"); }
}
function loadAgent() {
myAgent = new JCritter(agent);
myAgent.draw();
myAgent.show();
myAgent.onClick = function() {myCritter.say("Hello, Im Gomer Homingway.<br/>As you navigate the site, I will be here with help.");}
}
function liquidusVideoLink(sLink) {showPopupFrame(580,720,30,10);$("#iframePopup").attr("src","http://www.liquidusvideolink.com/?"+sLink);}
function agentInfoCall() { $("#sellerInfoCall").css("display", "block");trackEvent("Call"); }
function agentInfoEmail() { $("#sellerInfoEmail").css("display", "block");trackEvent("Email"); }
function requestNewsletter(sType) {trackEvent("Email Sign Up");showPageFrame();$("#iframePage").attr("src",pageTracker._getLinkerUrl(baseURL+"registerUser.action?domain="+baseDomain+"&type="+sType));}



function findLocation() {$.get("/getgeolocation.htm",{x:""},geoLocation,"text");}
function geoLocation(data) {if (data.indexOf(",") > 0) { $("#zipCityStateInput").val(data.toUpperCase().substring(0,data.indexOf(",")+4));}}
function hompageSlideShow() {
  try {
    if ($.browser.msie && ($.browser.version == 7 || $.browser.version == 6)) {
        var topScroll = 296 * (hompageSlideShowNO - 1);
        $(".slideON").attr("class", "slideOFF");
        $(".slideOFF").attr("class", "slideOFF");
        $("#slideBar" + hompageSlideShowNO).attr("class", "slideON");
        if (hompageSlideShowNO == 1) { $("#homePageSlideShow").scrollTop(0); } else { $("#homePageSlideShow").animate({ scrollTop: topScroll }, 1000); }
    } else {
        var leftScroll = 614 * (hompageSlideShowNO - 1);
        $(".slideON").attr("class", "slideOFF");
        $(".slideOFF").attr("class", "slideOFF");
        $("#slideBar" + hompageSlideShowNO).attr("class", "slideON");
        if (hompageSlideShowNO == 1) { $("#homePageSlideShow").scrollLeft(0); } else { $("#homePageSlideShow").animate({ scrollLeft: leftScroll }, 1000); }
    }
    hompageSlidetimer = setTimeout(function() { hompageSlideShow(); }, 7000);
    hompageSlideShowNO++;
    if (hompageSlideShowNO > 5) { hompageSlideShowNO = 1; }
  } catch(e) {}
}
function homeSlide(slideNumber) {trackEvent("Slide Show", "Slide " + slideNumber);clearTimeout(hompageSlidetimer);hompageSlideShowNO = slideNumber;hompageSlideShow();}
function featuredHomeScroll(direction) {
  if ($.browser.msie && ($.browser.version == 7 || $.browser.version == 6)) {
	  var topScroll = $("#scrollListingsHome").scrollLeft();
	  if (direction == "LEFT") { $("#scrollListingsHome").animate({ scrollTop: topScroll - 110 }, 1000); }
	  if (direction == "RIGHT") { $("#scrollListingsHome").animate({ scrollTop: topScroll + 110 }, 1000); }
  } else {
	  var leftScroll = $("#scrollListingsHome").scrollLeft();
	  if (direction == "LEFT") { $("#scrollListingsHome").animate({ scrollLeft: leftScroll - 330 }, 1000); }
	  if (direction == "RIGHT") { $("#scrollListingsHome").animate({ scrollLeft: leftScroll + 330 }, 1000); }
  }
}
/* END: Site Specific */
/*
function messageCallBack(event) {
  alert("origin:"+event.origin+"\ndata:"+event.data+"\nsource:"+event.source);
  if (event.origin.indexof(baseSubDomain+".auction.gohoming.com") > 0)
  {
    var data = event.data;
    if (data.substring(0,5) == "LOGIN:") {
      setCookie("loginData", data.substring(6,data.length - 1)+"||||", 1);
    }
    if (data.substring(0,6) == "LOGOUT:") {
      setCookie("loginData", "", 1);
    }
  }
  setUserDisplay();
}
*/
function loadPropertyDetails(url) {trackEvent('More Info');document.location.href=url;}
function loadPropertyBid(url) {
	if(url.indexOf("?")!=-1){
		trackEvent('Bid');
		var Full_campainURL=document.location.href;
		var Full_campainURLPartOne=Full_campainURL.split('?');
		 if(Full_campainURLPartOne[1]!=null){
		 url=url+"&"+Full_campainURLPartOne[1];
		}
		document.location.href=url+"&propDetailsBySearch=Y";
	}else{
		document.location.href=url+"?propDetailsBySearch=Y";
	}
}
function loadBidPropertyDetails(url) {trackEvent('Current Bid');document.location.href=url;}
function contactSupport() {this.location.href='/contact-us.htm';}
function mySeller() {$("#iframeMySeller").attr("src",pageTracker._getLinkerUrl(baseURL + "getSellerHome.action?domain="+baseDomain+"&refUrl="+escape(document.location.href)));}
function myAccount() {$("#iframeMyShopper").attr("src",pageTracker._getLinkerUrl(baseURL+"getShopperHome.action?domain="+baseDomain+"&refUrl="+escape(document.location.href)));trackEvent("My GoHoming");}
function loginPage() {$("#iframeLogin").attr("src",pageTracker._getLinkerUrl(baseURL+"getLoginForm.action?domain="+baseDomain+"&refUrl="+escape(document.location.href)));}
function registerPage() {$("#iframeRegister").attr("src",pageTracker._getLinkerUrl(baseURL+"registerUser.action?domain="+baseDomain+"&refUrl="+escape(document.location.href)));}
function registerPageILA() {$("#iframeRegisterILA").attr("src",pageTracker._getLinkerUrl(baseURL+"registerILA.action?domain="+baseDomain+"&refUrl="+escape(document.location.href)));}
function embedPage() {var sURL = document.location.href;sURL = sURL.substring(sURL.indexOf("?")+5);showPageFrame();$("#iframePage").attr("src", pageTracker._getLinkerUrl(sURL));}

function setUserDisplay() {

$("#loginFrame").attr("src",pageTracker._getLinkerUrl(baseURL + "userFrame.action?domain="+baseDomain+"&registerTarget=http://"+baseSubDomain+"."+baseDomain+"/auctionRegister.htm&loginTarget=http://"+baseSubDomain+"."+baseDomain+"/auctionLogin.htm&"+userDisplayStyle));}

function idSearch() {
    var propertyID = $("#propertyID").val();
    var MLS = $("#MLS").val();
    var verify = "";
    if (propertyID != "") {
      verify = AJAX("get", "/" + propertyID + "/verifyProperty.htm", "", "text/html");
      if (verify != "" && verify != "error") {
      	document.location.href =verify.replace("gohoming.com","altisourcehomes.com");
      } else {
      	alert("Propery ID " + propertyID + " not found.");
      }
    } else if (MLS != "") {
      verify = AJAX("get", "/" + MLS + "/verifyMLS.htm", "", "text/html");
      if (verify != "" && verify != "error") {
      	document.location.href =verify.replace("gohoming.com","altisourcehomes.com");
      } else {
      	alert("MLS # " + MLS + " not found.");
      }
    } else {
        alert("Property ID or MLS # required");
    }
}


function basicSearch() {
  var tmpCityName="";
  var tmpCityName1="";
  var manualData="";
  var sURL = ""; var propertyCount = "0"; var userInput = $("#zipCityStateInput").val().toUpperCase();
  if (userInput == autoCompleteDefaultText.toUpperCase()) {
    /* do nothing */
  } else if ($(".ac_results>li").length > 0) {
    var selectListItem = $(".ac_results>li").html().toUpperCase();
    selectListItem = selectListItem.replace("<SPAN CLASS=\"AC_MATCH\">","").replace("<SPAN CLASS=AC_MATCH>","").replace("</SPAN>","");
    if (selectListItem==userInput) {freeTextEntered = selectListItem.toUpperCase();}else{freeTextEntered =userInput.toUpperCase();manualData="Y";}
  } else {
   freeTextEntered = userInput.toUpperCase();
   manualData="Y";
  }
  if (freeTextEntered.indexOf(",") > 0 && manualData!="Y") {
     if (freeTextEntered.indexOf(" (") > 0) {var tmpC = freeTextEntered.split(" (");freeTextEntered = tmpC[0];propertyCount=tmpC[1].replace(")","");}
      var baseURL = "";
      var tmp = freeTextEntered.split(",");
      if (tmp[0].toUpperCase().indexOf(" IN ") > 0) {
          var tmpCity = tmp[0].toUpperCase().split(" IN ");          
          tmpCityName=tmpCity[1].trim().toProperCase();          
          tmpCityName1=tmpCityName.replace(/ /g,"-");          
          baseURL = "/" + tmp[1].trim() + "/" + tmpCityName1 + "/" + tmp[0].substring(0,5);
      } else {
      	tmpCityName=tmp[0].trim().toProperCase();          
        tmpCityName1=tmpCityName.replace(/ /g,"-");            	
        baseURL = "/" + tmp[1].trim() + "/" + tmpCityName1;
      }
      var minPrice = ($("#minPrice").length > 0)? $("#minPrice").val() : '';
      var maxPrice = ($("#maxPrice").length > 0)? $("#maxPrice").val() : '';
      if(minPrice>maxPrice){
		 alert("Please enter valid price range.");
		 return;
      }
      if (minPrice != "" && maxPrice != "") {
	sURL += baseURL + "/search-results.htm?minPrice=" + minPrice +"&maxPrice=" + maxPrice+"&city="+tmpCityName+"&type=reo-properties"; 		
      } else if (minPrice != "") {		
	sURL += baseURL + "/search-results.htm?minPrice=" + minPrice+"&city="+tmpCityName+"&type=reo-properties"; 				
      } else if (maxPrice != "") {
	sURL += baseURL + "/search-results.htm?maxPrice=" + maxPrice+"&city="+tmpCityName+"&type=reo-properties"; 		
      } else {
	sURL += baseURL + "/search-results.htm?pagenumber=1&city="+tmpCityName+"&type=reo-properties"; 	      
      }
  }else if(freeTextEntered!=""&&manualData=='Y'){  
	  if(userInput.indexOf(" IN ")!=-1 && userInput.indexOf(",")!=-1 ){
		userInput=userInput.replace(", ",'');  	
		var userInputArray=userInput.split(" IN ");
		userInput=userInputArray[1]+userInputArray[0];//userInput.replace(" IN ",'');  	
	  }
  	  userInput=userInput.replace(/[,`'~@$%^&* ?]/g,'');  	  
  	  var minPrice = ($("#minPrice").length > 0)? $("#minPrice").val() : '';
	  var maxPrice = ($("#maxPrice").length > 0)? $("#maxPrice").val() : '';
	  if(minPrice>maxPrice){
	  	alert("Please enter valid price range.");
	 	return;
	   }
	   if (minPrice != "" && maxPrice != "") {
	 	sURL +=  "/search-results.htm?minPrice=" + minPrice +"&maxPrice=" + maxPrice+"&fullPropAddress="+userInput+"&type=reo-properties"; 		
	   } else if (minPrice != "") {		
	 	sURL +=  "/search-results.htm?minPrice=" + minPrice+"&fullPropAddress="+userInput+"&type=reo-properties"; 				
	   } else if (maxPrice != "") {
	 	sURL +=  "/search-results.htm?maxPrice=" + maxPrice+"&fullPropAddress="+userInput+"&type=reo-properties"; 		
	   } else {
	 	sURL += "/search-results.htm?fullPropAddress="+userInput+"&type=reo-properties"; 	      	 	
      	   }
  } else {
      alert("Please enter a valid 'city, state' or 'zip'.\nYou can also make a selection from the suggestion dropdown.");
  }
	searchType = (sURL.indexOf("minPrice") > 0 || sURL.indexOf("maxPrice") > 0) ? "Price Search" : "Basic Search";
  if (sURL != "") {if (propertyCount == "0") {verifySearch(sURL);} else {document.location.href=sURL;}}
}

function setSearch(freeTextValue) {freeTextEntered=freeTextValue;}
function verifySearch(sURL) {trackEvent(searchType);if (sURL!="") {try {var SR=AJAX("get",sURL.replace("search-results.htm","verifysearch.htm"),"","text/html");if (SR=="0") {alert("There are no properties matching your search");} else {document.location.href=sURL;}} catch(e) {alert("Invalid Search, Try Again.");}} else {alert("Invalid Search");}}
function freeTextVal() {
var txtVal="";var sURL=document.location.href.replace("http://","");
if (sURL.indexOf("?")>0) {
	sURL=sURL.split("?");sURL=sURL[0].split("/");
} else {
	sURL=sURL.split("/");
}
if (sURL.length > 1) {
	txtVal = sURL[1];if (sURL[2].indexOf(".htm") == -1) {txtVal=sURL[2]+", "+sURL[1];}txtVal=txtVal.toUpperCase();
}
return txtVal;
}
function mortageCalInPage() {$("#mortageCalInPage").attr("src",pageTracker._getLinkerUrl(baseURL+"mortgageCalculator.action?domain="+baseDomain));}

function lendarsOnepropertyDetails() 
{
	window.open(baseURL+'getLenderOnePopUpPage.action', 'AgentZip','left=20,top=20,width=1000,height=580,toolbar=0,resizable=1,titlebar=0,menubar=0,status=0,location=0,scrollbars=1' );
}
function contactUsForm() {$("#contactusframe").attr("src",pageTracker._getLinkerUrl(baseURL+"contactCustomerCare.action?domain="+baseDomain));}
function customerCare() {showPageFrame();$("#iframePage").attr("src",pageTracker._getLinkerUrl(baseURL+"ccHomePage.action?domain="+baseDomain+"&refUrl=http://"+baseSubDomain+"."+baseDomain));}
function trackEvent(action, optional_label, optional_value) {
	if (pageAutoPopup == false) {
		var category = "Homepage";
		try {
			switch(window.location.href.replace("-", "_").match(/\w+\.htm|html/).toString()) {
				case "property.htm": category = "Property"; break;
				case "photo_results.htm": category = "Search Results"; break;
				case "search_results.htm": category = "Search Results"; break;
				case "map-results-coming.htm": category="Search Results";break;
				case "search-results-coming.htm": category="Search Results";break;
				case "photo-results-coming.htm": category="Search Results";break;
				case "property-bid.htm": category="Property";break;
				case "property-offer.htm": category="Property";break;
				case "simil-property.htm": category="Property";break;
				case "map_results.htm": category = "Search Results"; break;
				case "home.htm": category = "Homepage"; break;
			}
		} catch(e) { }
		var label = (optional_label == null)? "null" : "'" + optional_label + "'";
		var value = (optional_value == null)? "null" : "'" + optional_value + "'";
		try {console.log("Calling pageTracker._trackEvent('" + category + "', '" + action + "', " + label + ", " + value +")");} catch(e) {}
		if (baseSubDomain == "www") {pageTracker._trackEvent(category, action, optional_label, optional_value);}
	}
}
function iframeEmbedResize(sFrame) {
  var maxHeight; var maxWidth;
  if (window.innerHeight == null) {
    maxHeight = document.documentElement.clientHeight; maxWidth = document.documentElement.clientWidth;
  } else {
    maxHeight = window.innerHeight; maxWidth = window.innerWidth;
  }
  maxWidth = maxWidth - 60;
  maxHeight = maxHeight + 300;
  $("#iframe"+sFrame).css("min-width", "950px").css("width", maxWidth + "px").css("height", "1050px").attr("scrolling","auto");
  $(".details").css("width", maxWidth + "px").css("position", "relative").css("min-width","900px").css("border", "1px solid #333").css("background", "").css("background-color", "white").css("padding-top", "6px").css("margin-left", "0px").css("padding-bottom","0px");
  maxWidth = maxWidth + 25;
  $(".page").css("width",maxWidth+"px");

}
function iframePageResize() {
  var maxHeight;var maxWidth;
  if (window.innerHeight == null) {
    maxHeight = document.documentElement.clientHeight; maxWidth = document.documentElement.clientWidth;
  } else {
    maxHeight = window.innerHeight; maxWidth = window.innerWidth;
  }
  pxLeft = 0; pxTop = -11;
  maxWidth = maxWidth - 50; maxHeight = maxHeight - 245;
  $("#iframePage").css("top", pxTop + "px").css("left", pxLeft + "px").css("width", maxWidth + "px").css("height", maxHeight + "px").css("display", "block");
  $(".details").css("width", maxWidth + "px").css("position", "relative").css("top", "-11px").css("border", "1px solid #333").css("background", "").css("background-color", "white").css("padding-top", "6px").css("margin-left", "0px");
}
function showPageFrame() { $("#mainContent").css("display", "none");iframePageResize();$(window).resize(function () {iframePageResize();}); }
function advancedSearch() {alert("Feature Not Available");}
/* $("#photoPreviewImg").attr("src", $("#thumbs>a>img:first").attr("src")); } */

function showFirstPhotoBid() 
{
	var hrefCall = $("#thumbsBid1>a:first").attr("href");
	hrefCall=hrefCall.substring(25);
	hrefCall=hrefCall.substring(0,hrefCall.length-3);
	$("#photoPreviewImgBid").attr("src",hrefCall);
}
function showFirstPhotoOffer() 
{
	var hrefCall = $("#thumbsOffer1>a:first").attr("href");
	hrefCall=hrefCall.substring(27);
	hrefCall=hrefCall.substring(0,hrefCall.length-3);
	$("#photoPreviewImgOffer").attr("src",hrefCall);
}

function showPhotoBid(photoURL) {$("#photoPreviewImgBid").attr("src",photoURL);}

function showPhotoOffer(photoURL) {$("#photoPreviewImgOffer").attr("src",photoURL);}


var slideshowchild=1;
var slidecountBid=1;
var slidecountOffer=1;
function slidePhoto(pageName,direction) 
{
	if(pageName=="BID")
	{
		var elementId=document.getElementById("thumbsBid");
		var elementTagname=elementId.getElementsByTagName("img");
		var elementLength=elementTagname.length;
		var leftScroll=$("#thumbsBid").scrollLeft();
		if (direction=="LEFT") 
		{
			if(slidecountBid>2)
			{
				$("#thumbsBid").animate({scrollLeft:leftScroll-81},1000);
				slidecountBid--;
				document.getElementById("slidePhotoRightBid").className="slidePhotoRight";

			}
			else if(slidecountBid==2)
			{
				$("#thumbsBid").animate({scrollLeft:leftScroll-81},1000);
				slidecountBid--;
				document.getElementById("slidePhotoLeftBid").className="slidePhotoLeftHide";	
				document.getElementById("slidePhotoRightBid").className="slidePhotoRight";
			}
			else if(slidecountBid<=1)
			{
				document.getElementById("slidePhotoLeftBid").className="slidePhotoLeftHide";	
			}
			trackEvent("Photos", "Slide Left");

		}
		if (direction=="RIGHT") 
		{
			
			if(elementLength>(3+slidecountBid))
			{
				$("#thumbsBid").animate({scrollLeft:leftScroll+81},1000);
				slidecountBid++;
				document.getElementById("slidePhotoLeftBid").className="slidePhotoLeft";
			}
			else if(elementLength==(3+slidecountBid))
			{
				$("#thumbsBid").animate({scrollLeft:leftScroll+81},1000);
				slidecountBid++;
				document.getElementById("slidePhotoRightBid").className="slidePhotoRightHide";
				document.getElementById("slidePhotoLeftBid").className="slidePhotoLeft";
			}
			else if(elementLength<(3+slidecountBid))
			{
				document.getElementById("slidePhotoRightBid").className="slidePhotoRightHide";
			}
			trackEvent("Photos", "Slide Right");
		}
	}
	else if(pageName=="OFFER")
	{
		
		var elementId=document.getElementById("thumbsOffer");
		var elementTagname=elementId.getElementsByTagName("img");
		var elementLength=elementTagname.length;
		var leftScroll=$("#thumbsOffer").scrollLeft();
		if (direction=="LEFT") 
		{
			if(slidecountOffer>2)
			{
				$("#thumbsOffer").animate({scrollLeft:leftScroll-81},1000);
				slidecountOffer--;
				document.getElementById("slidePhotoRightOffer").className="slidePhotoRight";

			}
			else if(slidecountOffer==2)
			{
				$("#thumbsOffer").animate({scrollLeft:leftScroll-81},1000);
				slidecountOffer--;
				document.getElementById("slidePhotoLeftOffer").className="slidePhotoLeftHide";	
				document.getElementById("slidePhotoRightOffer").className="slidePhotoRight";
			}
			else if(slidecountOffer<=1)
			{
				document.getElementById("slidePhotoLeftOffer").className="slidePhotoLeftHide";	
			}
			trackEvent("Photos", "Slide Left");

		}
		if (direction=="RIGHT") 
		{
			if(elementLength>(3+slidecountOffer))
			{
				$("#thumbsOffer").animate({scrollLeft:leftScroll+81},1000);
				slidecountOffer++;
				document.getElementById("slidePhotoLeftOffer").className="slidePhotoLeft";
			}
			else if(elementLength==(3+slidecountOffer))
			{
				$("#thumbsOffer").animate({scrollLeft:leftScroll+81},1000);
				slidecountOffer++;
				document.getElementById("slidePhotoRightOffer").className="slidePhotoRightHide";
				document.getElementById("slidePhotoLeftOffer").className="slidePhotoLeft";				
			}
			else if(elementLength<(3+slidecountOffer))
			{
				document.getElementById("slidePhotoRightOffer").className="slidePhotoRightHide";
			}
			trackEvent("Photos", "Slide Right");
		}
		
	}
}
function setCookie(c_name,value,expiredays) {var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toGMTString());}
function getCookie(c_name) {if (document.cookie.length>0) {c_start=document.cookie.indexOf(c_name+"=");if (c_start != -1) {c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if (c_end==-1) {c_end=document.cookie.length;}return unescape(document.cookie.substring(c_start,c_end));}}return "null";}
function formatNumber(sNum) {
	var sNum = sNum.toString();var returnNum = "";var iLen = sNum.length;
	for (x = 0; x <= iLen; x++) {
		returnNum = sNum.substring(iLen-x,iLen-x+1)+returnNum;
		if (((x/3)%3).toString().indexOf(".") == -1 && x > 0) {returnNum = ","+returnNum;}
	}
	if (returnNum.substring(0,1) == ",") {returnNum = returnNum.substring(1);}
	return returnNum;
}
function siteLoad() {

	$.maxZIndex = $.fn.maxZIndex = function(opt) {
	    /// <summary>
	    /// Returns the max zOrder in the document (no parameter)
	    /// Sets max zOrder by passing a non-zero number
	    /// which gets added to the highest zOrder.
	    /// </summary>    
	    /// <param name="opt" type="object">
	    /// inc: increment value, 
	    /// group: selector for zIndex elements to find max for
	    /// </param>
	    /// <returns type="jQuery" />
	    var def = { inc: 10, group: "*" };
	    $.extend(def, opt);    
	    var zmax = 0;
	    $(def.group).each(function() {
	        var cur = parseInt($(this).css('z-index'));
	        zmax = cur > zmax ? cur : zmax;
	    });
	    if (!this.jquery)
	        return zmax;
	
	    return this.each(function() {
	        zmax += def.inc;
	        $(this).css("z-index", zmax);
	    });
	}

  /*
  START: jQuery.query

  jQuery.query - Query String Modification and Creation for jQuery Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
  Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
  Date: 2009/8/13
  @author Blair Mitchelmore
  @version 2.1.6
  */
  try {
    var $separator = settings.separator || '&';
    var $spaces = settings.spaces === false ? false : true;
    var $suffix = settings.suffix === false ? '' : '[]';
    var $prefix = settings.prefix === false ? false : true;
    var $hash = $prefix ? settings.hash === true ? "#" : "?" : "";
    var $numbers = settings.numbers === false ? false : true;
    jQuery.query = new function() {
      var is = function(o, t) {return o != undefined && o !== null && (!!t ? o.constructor == t : true);};
      var parse = function(path) {var m, rx = /\[([^[]*)\]/g, match = /^([^[]+?)(\[.*\])?$/.exec(path), base = match[1], tokens = [];while (m = rx.exec(match[2])) tokens.push(m[1]);return [base, tokens];};
      var set = function(target, tokens, value) {
        var o, token = tokens.shift();
        if (typeof target != 'object') target = null;
        if (token === "") {
          if (!target) target = [];
          if (is(target, Array)) {
            target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
          } else if (is(target, Object)) {
            var i = 0;
            while (target[i++] != null);
            target[--i] = tokens.length == 0 ? value : set(target[i], tokens.slice(0), value);
          } else {
            target = [];
            target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
          }
        } else if (token && token.match(/^\s*[0-9]+\s*$/)) {
          var index = parseInt(token, 10);
          if (!target) target = [];
          target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
        } else if (token) {
          var index = token.replace(/^\s*|\s*$/g, "");
          if (!target) target = {};
          if (is(target, Array)) {
            var temp = {};
            for (var i = 0; i < target.length; ++i) {
              temp[i] = target[i];
            }
            target = temp;
          }
          target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
        } else {
          return value;
        }
        return target;
      };
      
      var queryObject = function(a) {
        var self = this;
        self.keys = {};
        
        if (a.queryObject) {
          jQuery.each(a.get(), function(key, val) {
            self.SET(key, val);
          });
        } else {
          jQuery.each(arguments, function() {
            var q = "" + this;
            q = q.replace(/^[?#]/,''); /* remove any leading ? || # */
            q = q.replace(/[;&]$/,''); /* remove any trailing & || ; */
            if ($spaces) q = q.replace(/[+]/g,' '); /* replace +'s with spaces */
            
            jQuery.each(q.split(/[&;]/), function(){
              var key = decodeURIComponent(this.split('=')[0] || "");
              var val = decodeURIComponent(this.split('=')[1] || "");
              
              if (!key) return;
              
              if ($numbers) {
                if (/^[+-]?[0-9]+\.[0-9]*$/.test(val)) /* simple float regex */
                  val = parseFloat(val);
                else if (/^[+-]?[0-9]+$/.test(val)) /* simple int regex */
                  val = parseInt(val, 10);
              }
              
              val = (!val && val !== 0) ? true : val;
              
              if (val !== false && val !== true && typeof val != 'number')
                val = val;
              
              self.SET(key, val);
            });
          });
        }
        return self;
      };
      queryObject.prototype = {
        queryObject: true,
        has: function(key, type) {var value = this.get(key);return is(value, type);},
        GET: function(key) {if (!is(key)) return this.keys;var parsed = parse(key), base = parsed[0], tokens = parsed[1];var target = this.keys[base];while (target != null && tokens.length != 0) {target = target[tokens.shift()];}return typeof target == 'number' ? target : target || "";},
        get: function(key) {var target = this.GET(key);if (is(target, Object))return jQuery.extend(true, {}, target);else if (is(target, Array))return target.slice(0);return target;},
        SET: function(key, val) {var value = !is(val) ? null : val;var parsed = parse(key), base = parsed[0], tokens = parsed[1];var target = this.keys[base];this.keys[base] = set(target, tokens.slice(0), value);return this;},
        set: function(key, val) {return this.copy().SET(key, val);},
        REMOVE: function(key) {return this.SET(key, null).COMPACT();},
        remove: function(key) {return this.copy().REMOVE(key);},
        EMPTY: function() {var self = this;jQuery.each(self.keys, function(key, value) {delete self.keys[key];});return self;},
        load: function(url) {var hash = url.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1");var search = url.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1");return new queryObject(url.length == search.length ? '' : search, url.length == hash.length ? '' : hash);},
        empty: function() {return this.copy().EMPTY();},
        copy: function() {return new queryObject(this);},
        COMPACT: function() {
          function build(orig) {
            var obj = typeof orig == "object" ? is(orig, Array) ? [] : {} : orig;
            if (typeof orig == 'object') {
              function add(o, key, value) {
                if (is(o, Array))
                  o.push(value);
                else
                  o[key] = value;
              }
              jQuery.each(orig, function(key, value) {
                if (!is(value)) return true;
                add(obj, key, build(value));
              });
            }
            return obj;
          }
          this.keys = build(this.keys);
          return this;
        },
        compact: function() {return this.copy().COMPACT();},
        toString: function() {
          var i = 0, queryString = [], chunks = [], self = this;
          var encode = function(str) {
            str = str + "";
            if ($spaces) str = str.replace(/ /g, "+");
            return encodeURIComponent(str);
          };
          var addFields = function(arr, key, value) {if (!is(value) || value === false) return;var o = [encode(key)];if (value !== true) {o.push("=");o.push(encode(value));}arr.push(o.join(""));};
          var build = function(obj, base) {var newKey = function(key) {return !base || base == "" ? [key].join("") : [base, "[", key, "]"].join("");};jQuery.each(obj, function(key, value) {if (typeof value == 'object') {build(value, newKey(key));}else{addFields(chunks, newKey(key), value);}});};
          build(this.keys);
          if (chunks.length > 0) queryString.push($hash);
          queryString.push(chunks.join($separator));
          return queryString.join("");
        }
      };
      
      return new queryObject(location.search, location.hash);
    };
  } catch(e) {}
  /* END: jQuery.query */
  
  /* START: bgIframe script
	http://brandonaaron.net
	Version 2.1.1
	*/
  try {
    (function($){
    $.fn.bgIframe = $.fn.bgiframe = function(s) {
      if ( $.browser.msie && /6.0/.test(navigator.userAgent) ) {
        s = $.extend({top : 'auto', left : 'auto', width : 'auto', height : 'auto', opacity : true, src : 'javascript:false;'}, s || {});
        var prop = function(n){return n&&n.constructor==Number?n+'px':n;},
            html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
                     'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
                     'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
                     'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
                     'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
              '"/>';
        return this.each(function() {if ( $('> iframe.bgiframe', this).length == 0 ) {this.insertBefore( document.createElement(html), this.firstChild );} });
      }
      return this;
    };
    })(jQuery);
  } catch(e) {}
  /* END: bgIframe script */

	/* START: format
	http://cloudgen.w0ng.hk/jquery/format.php
	Copyright (c) 2010 C. F., Wong (<a href="http://cloudgen.w0ng.hk">Cloudgen Examplet Store</a>)
	Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
	version 1.02 
	*/
  try {
		(function($){
			$.extend($.expr[":"],{
				regex:function(d,a,c){
					var e=new RegExp(c[3],"g");
					var b=("text"===d.type)?d.value:d.innerHTML;
					return(b=="")?true:(e.exec(b))
				}
			});
			$.fn.output=function(d){
				return(this.is(":text"))?this.val(d):this.html(d)
			};
			formatter={
				getRegex:function(settings){
					var settings=$.extend({type:"decimal",precision:5,decimal:'.',allow_negative:true},settings);
					var result="";
					if(settings.type=="decimal"){
						var e=(settings.allow_negative)?"-?":"";
						if(settings.precision>0)
							result="^"+e+"\\d+$|^"+e+"\\d*"+settings.decimal+"\\d{1,"+settings.precision+"}$";
						else result="^"+e+"\\d+$"
					}else if(settings.type=="phone-number"){
						result="^\\d[\\d\\-]*\\d$"
					}else if(settings.type=="alphabet"){
						result="^[A-Za-z]+$"
					}
					return result
				},
				isEmail:function(d){
					var a=$(d).output();
					var c=false;
					var e=true;
					var e=new RegExp("[\s\~\!\#\$\%\^\&\*\+\=\(\)\[\]\{\}\<\>\\\/\;\:\,\?\|]+");
					if(a.match(e)!=null){
						return c
					}
					if(a.match(/((\.\.)|(\.\-)|(\.\@)|(\-\.)|(\-\-)|(\-\@)|(\@\.)|(\@\-)|(\@\@))+/)!=null){
						return c
					}
					if(a.indexOf("\'")!=-1){
						return c
					}
					if(a.indexOf("\"")!=-1){
						return c
					}
					if(email.tldn&&a.match(email.tldn)==null){
						return c
					}
					return e
				},
				formatString:function(target,settings){
					var settings=$.extend({type:"decimal",precision:5,decimal:'.',allow_negative:true},settings);
					var oldText=$(target).output();
					var newText=oldText;
					if(settings.type=="decimal"){
						if(newText!=""){
							var g;
							var h=(settings.allow_negative)?"\\-":"";
							var i="\\"+settings.decimal;
							g=new RegExp("[^\\d"+h+i+"]+","g");
							newText=newText.replace(g,"");
							var h=(settings.allow_negative)?"\\-?":"";
							if(settings.precision>0)
								g=new RegExp("^("+h+"\\d*"+i+"\\d{1,"+settings.precision+"}).*");
							else g=new RegExp("^("+h+"\\d+).*");
							newText=newText.replace(g,"$1")
						}
					}else if(settings.type=="phone-number"){
						newText=newText.replace(/[^\-\d]+/g,"").replace(/^\-+/,"").replace(/\-+/,"-")
					}else if(settings.type=="alphabet"){
						newText=newText.replace(/[^A-Za-z]+/g,"")
					}
					if(newText!=oldText)
						$(target).output(newText)
				}
			};
			$.fn.format=function(settings,wrongFormatHandler){
				var settings=$.extend({type:"decimal",precision:5,decimal:".",allow_negative:true,autofix:false},settings);
				var decimal=settings.decimal;
				wrongFormatHandler=typeof wrongFormatHandler=="function"?wrongFormatHandler:function(){};
				this.keypress(function(d){
					$(this).data("old-value",$(this).val());
					var a=d.charCode?d.charCode:d.keyCode?d.keyCode:0;
					if(a==13&&this.nodeName.toLowerCase()!="input"){return false}
					if((d.ctrlKey&&(a==97||a==65||a==120||a==88||a==99||a==67||a==122||a==90||a==118||a==86||a==45))||(a==46&&d.which!=null&&d.which==0))
						return true;
					if(a<48||a>57){
						if(settings.type=="decimal"){
							if(settings.allow_negative&&a==45&&this.value.length==0)return true;
							if(a==decimal.charCodeAt(0)){
								if(settings.precision>0&&this.value.indexOf(decimal)==-1)return true;
								else return false
							}
							if(a!=8&&a!=9&&a!=13&&a!=35&&a!=36&&a!=37&&a!=39){return false}
							return true
						}else if(settings.type=="email"){
							if(a==8||a==9||a==13||(a>34&&a<38)||a==39||a==45||a==46||(a>64&&a<91)||(a>96&&a<123)){return true}
							if(a==64&&this.value.indexOf("@")==-1)return true;
							return false
						}else if(settings.type=="phone-number"){
							if(a==45&&this.value.length==0)return false;
							if(a==8||a==9||a==13||(a>34&&a<38)||a==39||a==45){return true}
							return false
						}else if(settings.type=="alphabet"){
							if(a==8||a==9||a==13||(a>34&&a<38)||a==39||(a>64&&a<91)||(a>96&&a<123))
							return true
						}else return false
					}else{
						if(settings.type=="alphabet"){
							return false
						}else return true
					}
				})
				.blur(function(){
					if(settings.type=="email"){
						if(!formatter.isEmail(this)){
							wrongFormatHandler.apply(this)
						}
					}else{
						if(!$(this).is(":regex("+formatter.getRegex(settings)+")")){
							wrongFormatHandler.apply(this)
						}
					}
				})
				.focus(function(){
					$(this).select()
				});
				if(settings.autofix){
					this.keyup(function(d){
						if($(this).data("old-value")!=$(this).val())
							formatter.formatString(this,settings)
						}
					)
				}
				return this
			}
		})(jQuery);
  } catch(e) {}
	/* END:  format */

	/* START: Masked Input plugin for jQuery
		Copyright (c) 2007-2009 Josh Bush (digitalbush.com)
		Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) 
		Version: 1.2.2 (03/09/2009 22:39:06)
	*/
  try {
		(function(a){var c=(a.browser.msie?"paste":"input")+".mask";var b=(window.orientation!=undefined);a.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};a.fn.extend({caret:function(e,f){if(this.length==0){return}if(typeof e=="number"){f=(typeof f=="number")?f:e;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(e,f)}else{if(this.createTextRange){var g=this.createTextRange();g.collapse(true);g.moveEnd("character",f);g.moveStart("character",e);g.select()}}})}else{if(this[0].setSelectionRange){e=this[0].selectionStart;f=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var d=document.selection.createRange();e=0-d.duplicate().moveStart("character",-100000);f=e+d.text.length}}return{begin:e,end:f}}},unmask:function(){return this.trigger("unmask")},mask:function(j,d){if(!j&&this.length>0){var f=a(this[0]);var g=f.data("tests");return a.map(f.data("buffer"),function(l,m){return g[m]?l:null}).join("")}d=a.extend({placeholder:"_",completed:null},d);var k=a.mask.definitions;var g=[];var e=j.length;var i=null;var h=j.length;a.each(j.split(""),function(m,l){if(l=="?"){h--;e=m}else{if(k[l]){g.push(new RegExp(k[l]));if(i==null){i=g.length-1}}else{g.push(null)}}});return this.each(function(){var r=a(this);var m=a.map(j.split(""),function(x,y){if(x!="?"){return k[x]?d.placeholder:x}});var n=false;var q=r.val();r.data("buffer",m).data("tests",g);function v(x){while(++x<=h&&!g[x]){}return x}function t(x){while(!g[x]&&--x>=0){}for(var y=x;y<h;y++){if(g[y]){m[y]=d.placeholder;var z=v(y);if(z<h&&g[y].test(m[z])){m[y]=m[z]}else{break}}}s();r.caret(Math.max(i,x))}function u(y){for(var A=y,z=d.placeholder;A<h;A++){if(g[A]){var B=v(A);var x=m[A];m[A]=z;if(B<h&&g[B].test(x)){z=x}else{break}}}}function l(y){var x=a(this).caret();var z=y.keyCode;n=(z<16||(z>16&&z<32)||(z>32&&z<41));if((x.begin-x.end)!=0&&(!n||z==8||z==46)){w(x.begin,x.end)}if(z==8||z==46||(b&&z==127)){t(x.begin+(z==46?0:-1));return false}else{if(z==27){r.val(q);r.caret(0,p());return false}}}function o(B){if(n){n=false;return(B.keyCode==8)?false:null}B=B||window.event;var C=B.charCode||B.keyCode||B.which;var z=a(this).caret();if(B.ctrlKey||B.altKey||B.metaKey){return true}else{if((C>=32&&C<=125)||C>186){var x=v(z.begin-1);if(x<h){var A=String.fromCharCode(C);if(g[x].test(A)){u(x);m[x]=A;s();var y=v(x);a(this).caret(y);if(d.completed&&y==h){d.completed.call(r)}}}}}return false}function w(x,y){for(var z=x;z<y&&z<h;z++){if(g[z]){m[z]=d.placeholder}}}function s(){return r.val(m.join("")).val()}function p(y){var z=r.val();var C=-1;for(var B=0,x=0;B<h;B++){if(g[B]){m[B]=d.placeholder;while(x++<z.length){var A=z.charAt(x-1);if(g[B].test(A)){m[B]=A;C=B;break}}if(x>z.length){break}}else{if(m[B]==z[x]&&B!=e){x++;C=B}}}if(!y&&C+1<e){r.val("");w(0,h)}else{if(y||C+1>=e){s();if(!y){r.val(r.val().substring(0,C+1))}}}return(e?B:i)}if(!r.attr("readonly")){r.one("unmask",function(){r.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){q=r.val();var x=p();s();setTimeout(function(){if(x==j.length){r.caret(0,x)}else{r.caret(x)}},0)}).bind("blur.mask",function(){p();if(r.val()!=q){r.change()}}).bind("keydown.mask",l).bind("keypress.mask",o).bind(c,function(){setTimeout(function(){r.caret(p(true))},0)})}p()})}})})(jQuery);
  } catch(e) {}
	/* END:  Masked Input */

  /* environment changes */
  var sTestURL = document.location.href.toUpperCase().replace("HTTP://", "").replace("HTTPS://", "");
  if (sTestURL.substring(0, 3) != "WWW") 
  {
	if (sTestURL.substring(0, 7) == "PREVIEW") { baseURL = "http://preview.auction.gohoming.com/GoHomingWeb/"; baseSubDomain = "preview"; }
	if (sTestURL.substring(0, 3) == "UAT") { baseURL = "http://uat.auction.gohoming.com:8080/GoHomingWeb/"; baseSubDomain = "uat"; }
        if (sTestURL.substring(0, 2) == "QA") { baseURL = "http://192.168.92.232:8081/GoHomingWeb/"; baseSubDomain = "qa"; }
 	if (sTestURL.substring(0, 4) == "QAPE") { baseURL = "http://192.168.92.232:8080/GoHomingWeb/"; baseSubDomain = "qape"; }
	if (sTestURL.substring(0, 3) == "DEV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "dev"; }
	if (sTestURL.substring(0, 4) == "DEVM") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devm"; }
	if (sTestURL.substring(0, 4) == "DEVV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devv"; }
	if (sTestURL.substring(0, 5) == "DEVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devpe"; }
	if (sTestURL.substring(0, 6) == "DEVMPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devmpe"; }
	if (sTestURL.substring(0, 6) == "DEVVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devvpe"; }
  }
 
  // Changes for TA2936
  try{
	pageUrl=baseURL+"checkUserSession.action?domain="+baseDomain;
	document.getElementById("sessionCheckerFrame").src=pageTracker._getLinkerUrl(pageUrl);
  }catch(e){}
  // 2936 Ends
  
  
  pageReadyLoad();
}

function myLocation() 
{
//var t = $("body>table").get(0);
//alert(t.length);
//$("table").html(AJAX("get","http://www.ipaddresslocation.org/my-ip-address.php","","text/html"));
}

var trackPropertyView_flag=1;
function trackPropertyView(iframe_partid,iframe_partid1)
{
	var sTestURL = document.location.href.toUpperCase().replace("HTTP://", "").replace("HTTPS://", "");
	if (sTestURL.substring(0, 3) != "WWW") 
	{
		if (sTestURL.substring(0, 7) == "PREVIEW") { baseURL = "http://preview.auction.gohoming.com/GoHomingWeb/"; baseSubDomain = "preview"; }
		if (sTestURL.substring(0, 3) == "UAT") { baseURL = "http://uat.auction.gohoming.com:8080/GoHomingWeb/"; baseSubDomain = "uat"; }
        	if (sTestURL.substring(0, 2) == "QA") { baseURL = "http://192.168.92.232:8081/GoHomingWeb/"; baseSubDomain = "qa"; }
 		if (sTestURL.substring(0, 4) == "QAPE") { baseURL = "http://192.168.92.232:8080/GoHomingWeb/"; baseSubDomain = "qape"; }
		if (sTestURL.substring(0, 3) == "DEV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "dev"; }
		if (sTestURL.substring(0, 4) == "DEVM") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devm"; }
		if (sTestURL.substring(0, 4) == "DEVV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devv"; }
		if (sTestURL.substring(0, 5) == "DEVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devpe"; }
		if (sTestURL.substring(0, 6) == "DEVMPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devmpe"; }
		if (sTestURL.substring(0, 6) == "DEVVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devvpe"; }
	}
	if(iframe_partid=="error")
	{
		var full_url=baseURL+"trackPropertyViewed.action?propertyTracker.propertyId="+iframe_partid1;
		if(trackPropertyView_flag=="1")
		{
			document.getElementById("frDocViewer").src = full_url;
			trackPropertyView_flag=0;
		}
	}
	else
	{
		var full_url=baseURL+"trackPropertyViewed.action?propertyTracker.listingId="+iframe_partid+"&propertyTracker.propertyId="+iframe_partid1;
		if(trackPropertyView_flag=="1")
		{
			document.getElementById("frDocViewer").src = full_url;
			trackPropertyView_flag=0;
		}
	}
}

function findclick(property_id,category,data,flag_track)
{
	var sTestURL = document.location.href.toUpperCase().replace("HTTP://", "").replace("HTTPS://", "");
	if (sTestURL.substring(0, 3) != "WWW") 
	{
		if (sTestURL.substring(0, 7) == "PREVIEW") { baseURL = "http://preview.auction.gohoming.com/GoHomingWeb/"; baseSubDomain = "preview"; }
		if (sTestURL.substring(0, 3) == "UAT") { baseURL = "http://uat.auction.gohoming.com:8080/GoHomingWeb/"; baseSubDomain = "uat"; }
		if (sTestURL.substring(0, 2) == "QA") { baseURL = "http://192.168.92.232:8081/GoHomingWeb/"; baseSubDomain = "qa"; }
 		if (sTestURL.substring(0, 4) == "QAPE") { baseURL = "http://192.168.92.232:8080/GoHomingWeb/"; baseSubDomain = "qape"; }
		if (sTestURL.substring(0, 3) == "DEV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "dev"; }
		if (sTestURL.substring(0, 4) == "DEVM") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devm"; }
		if (sTestURL.substring(0, 4) == "DEVV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devv"; }
		if (sTestURL.substring(0, 5) == "DEVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devpe"; }
		if (sTestURL.substring(0, 6) == "DEVMPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devmpe"; }
		if (sTestURL.substring(0, 6) == "DEVVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devvpe"; }
	}
	if(flag_track.id=="tab1")
	{
		var src=baseURL+"trackUserClick.action?propertyId="+property_id+"&clickCategory="+category+"&data="+data;
		document.getElementById("frDocViewer").src=src;
		
		flag_track.onClick="banner_selection('feat_ad1',0)";
	}
	else if(flag_track.id=="tab2")
	{
		var src=baseURL+"trackUserClick.action?propertyId="+property_id+"&clickCategory="+category+"&data="+data;
		document.getElementById("frDocViewer").src=src;
		
		flag_track.onClick="banner_selection('feat_ad2','http://www.walkscore.com/score/{address1}-{city1}-{state1}')";
	}
	else if(flag_track.id=="tab3")
	{
		var src=baseURL+"trackUserClick.action?propertyId="+property_id+"&clickCategory="+category+"&data="+data;
		document.getElementById("frDocViewer").src=src;
		
		flag_track.onClick="banner_selection('feat_ad3',0)";
	}
	else if(flag_track.id=="tab4")
	{
		var src=baseURL+"trackUserClick.action?propertyId="+property_id+"&clickCategory="+category+"&data="+data;
		document.getElementById("frDocViewer").src=src;
		
		flag_track.onClick="banner_selection('feat_ad4',0)";
	}
	else
	{
		var src=baseURL+"trackUserClick.action?propertyId="+property_id+"&clickCategory="+category+"&data="+data;
		document.getElementById("frDocViewer").src=src;
		flag_track.onclick="";
		
	}
	
}
var count_value=0;
function serach_result()
{
	var offerSpanIdentifierArray=new Array('offerSpanIdentifier1','offerSpanIdentifier2','offerSpanIdentifier3','offerSpanIdentifier4','offerSpanIdentifier5','offerSpanIdentifier6','offerSpanIdentifier7','offerSpanIdentifier8','offerSpanIdentifier9','offerSpanIdentifier10');
	
	for(var i=0;i<offerSpanIdentifierArray.length;i++)
	{	
		if(document.getElementById(offerSpanIdentifierArray[i])!=null)
		{
			if(document.getElementById(offerSpanIdentifierArray[i]).title=="Bid"){
				count_value=1;				    
			}
		}
	}
	if(count_value==1)
	{
		try{document.getElementById("srListingTypeInfo").style.display="block";
		document.getElementById("currentBidSort").style.display="block";
		document.getElementById("srListingTypeInfo_online_offer").style.display="none";
		document.getElementById("currentBidSort_online_offer").style.display="none";
		}catch(e){}
	}
	else{
		try{document.getElementById("srListingTypeInfo").style.display="none";
		document.getElementById("currentBidSort").style.display="none";
		document.getElementById("srListingTypeInfo_online_offer").style.display="block";
		document.getElementById("currentBidSort_online_offer").style.display="block";
		}catch(e){}
	}
}

function showTooltip(show_tooltip,inp_id,mess_txt)
{
	
	var xpos=getX(show_tooltip);
	var ypos=getY(show_tooltip);
	xpos1=xpos+40;
	ypos1=ypos+70;
	document.getElementById(inp_id).style.left=xpos1+"px";
	document.getElementById(inp_id).style.top=ypos1+"px";
	document.getElementById(inp_id).style.display="block";
	document.getElementById("name_cus").innerHTML=mess_txt;
}
function getX(obj)
{
		return obj.offsetLeft + (obj.offsetParent ? getX(obj.offsetParent) : obj.x ? obj.x : 0);
}              
	
function getY(obj)
{
		return (obj.offsetParent ? obj.offsetTop + getY(obj.offsetParent) : obj.y ? obj.y : 0);
}
function hideTooltip()
{
document.getElementById("name_cus").style.display="none";
}
/* Start Search Result and Map Result Page */
function loadPropertyOfferHoursHid()
{
	document.getElementById("offerTooltipbg").style.display="none";
}

function loadPropertyOfferHours(elementId,divId,mess_txt,fullURL)
{
	//alert(document.getElementById("offerToolTipOkBtn"))
	var xpos=getX(elementId);
	var ypos=getY(elementId);
	xpos1=xpos-310;
	ypos1=ypos+0;
	
	document.getElementById(divId).style.left=xpos1+"px";
	document.getElementById(divId).style.top=ypos1+"px";
	document.getElementById(divId).style.display="block";
	
	document.getElementById("offerToolTipOkBtn").href=fullURL;
	document.getElementById("loadPropertyOfferHoursTooltip").innerHTML="Multiple buyers have already placed offers on this home. The seller has asked all buyers to place their highest and best offers within the next "+mess_txt+" hours. Please place your highest and best offer now to maximize the chance the seller will select your offer.";
}
/* End Search Result and Map Result Page */

/* Start Property Offer Page */
function loadPropertyOfferHoursOfferPage(elementId,divId,mess_txt)
{
	var xpos=getX(elementId);
	var ypos=getY(elementId);
	xpos1=xpos-400;
	ypos1=ypos+0;
	
	document.getElementById(divId).style.left=xpos1+"px";
	document.getElementById(divId).style.top=ypos1+"px";
	document.getElementById(divId).style.display="block";
	
	var sURL = document.location.href;
	sURL = sURL.toLowerCase();
	if (sURL.indexOf("?") > 0) {document.getElementById("offerToolTipOkBtnOfferPage").href=document.location+"autopopup=bid";}
	else{document.getElementById("offerToolTipOkBtnOfferPage").href=document.location+"?autopopup=bid";}
	
	document.getElementById("loadPropertyOfferHoursTooltipOfferPage").innerHTML="Multiple buyers have already placed offers on this home. The seller has asked all buyers to place their highest and best offers within the next "+mess_txt+" hours. Please place your highest and best offer now to maximize the chance the seller will select your offer.";

}
function loadPropertyOfferHoursHidOfferPage()
{
document.getElementById("offerTooltipbgOfferPage").style.display="none";
}
/* End Property Offer Page */


function hideTooltip_search()
{
document.getElementById("name_cus_search").style.display="none";
}
function ajaximage()
{
 	var iframeId=document.getElementById("contact_list1_id");
	var iframeTagName=iframeId.getElementsByTagName("img");
	if(iframeTagName.length > 4){parent.document.getElementById("similiarIframe").style.display="block";}
 	parent.document.getElementById("help_image").style.display="none";
} 
function property_Bid_Browser()
{
	property_Bid(getCookie("sessionAvailable"));
	autoRefresh=true;
}

function property_Bid(listing)
{
	if(listing=="Y" || listing=="y")
	{
		$('.noRegistered_user').hide();
		$('.Registered_user').show();		
	}
	else
	{
		$('.noRegistered_user').show();
		$('.Registered_user').hide();		
	}	
}
function property_offer_Browser()
{
	property_offer(getCookie("sessionAvailable"));
	autoRefresh=true;
}
function property_offer(listing)
{

	if(listing=="Y" || listing=="y")
	{
		$('.noRegistered_user_offer').hide();
		$('.Register_user_offer').show();
	}
	else
	{
		$('.Register_user_offer').hide();
		$('.noRegistered_user_offer').show();
	}	
}

function property_search_Browser()
{
	property_Search(getCookie("sessionAvailable"));
	autoRefresh=true;
}
function property_Search(listing)
{

	if(listing=="Y" || listing=="y")
	{
		$('.bidAction1').hide();
		$('.bidAction').show();
	}
	else
	{
		$('.bidAction1').show();
		$('.bidAction').hide();
	}	
}
function gotoSearch(){
	var cookieValue=getCookie("search");
	
	if(cookieValue!=''){
		location.href=getCookie("search");
	}else{
		location.href="/search-results.htm?pagenumber=1";
	}
}

function Similar_Property(propertyId,zip,stateId) 
{	
	userId=getCookie("userId");
	sessionId=getCookie("sessionId");
	var url="";
	//URl Creation
	url="/simil-property.htm?propertyid="+propertyId+"&zip="+zip+"&stateId="+stateId+"&userId="+userId+"&sessionId="+sessionId;
	$("#similiarIframe").attr("src",url)
}
//Vijay
function generateUrl(stateCode,city,agentId){	
	cityName=city.replace(/ /g,"-");
	document.location.href="/"+stateCode+"/"+cityName+"/search-results.htm?agent="+agentId+"&city="+city+"&type=reo-properties";
}

function generateUrlHome(stateCode,city){	
	cityName=city.replace(/ /g,"-");
	document.location.href="/"+stateCode+"/"+cityName+"/search-results.htm?city="+city+"&type=reo-properties";
}

function generateUrlAgent(stateCode,city){
	cityName=city.replace(/ /g,"-");
	document.location.href="/"+stateCode+"/"+cityName+"/find-agent-name.htm?city="+city+"&type=reo-properties";
}
	
function saveSearchBut()
{
	cookieName=getCookie("showSaveSearchBtn");
	if(cookieName=="Y")
	{
		$('.saveSearchDiv').show();
		$('.saveSearchDiv1').show();
		
	}
	else{
		$('.saveSearchDiv').hide();
		$('.saveSearchDiv1').hide();
	
	}
}	
// Changes for TA2936
function checkSession()
{
	var isSessionAvailable="N";
	var docUrl=location.href;
	var paramsArray=docUrl.split("?");
	var paramsArray=paramsArray[1];
	//alert(paramsArray);
	var paramArray1=paramsArray.split("&");
	//alert(paramArray1[0]);
	var paramArray2=paramArray1[0].split("=");
	//alert(paramArray2[1]);
	isSessionAvailable=paramArray2[1];	
	if(isSessionAvailable=='Y'){
		setCookie("sessionAvailable", "Y", 1);
	}else{
		setCookie("sessionAvailable", "N", 1);
	}	
	var isUserId=paramArray1[1].split("=");
	isUserId=isUserId[1];	
	//alert("isUserId"+isUserId);
	setCookie("userId", isUserId, 1);

	var isSessionId=paramArray1[2].split("=");
	isSessionId=isSessionId[1];
	//alert("isSessionId"+isSessionId);
	setCookie("sessionId", isSessionId, 1);
	
	var showSaveSearchBtn=paramArray1[3].split("=");
	showSaveSearchBtn=showSaveSearchBtn[1];
	setCookie("showSaveSearchBtn", showSaveSearchBtn, 1);
	
	autoRefresh=true;
}
// 2936 ends
function openBuyerGuide() {
	window.open ("/pdf/BuyerTransactionGuide.pdf","buyerGuide","location=1,resizable=1,status=1,scrollbars=1,width=600,height=800"); 
}
function redirect_URL_event_calendar()
{
	location.href="/CA/search-results-coming.htm?phase=Coming&type=reo-properties";
}
function openHouse(event_id)
{
	 location.href="http://www.facebook.com/event.php?eid="+event_id;
}
function openHouse_facebookevents()
{
	var table_event_id=document.getElementById("openHouse_details_id");
	var table_event_obj=table_event_id.getElementsByTagName("a");
	for(var i=0; i<table_event_obj.length; i++)
	{
		if(table_event_obj[i].name=="-")
		{
			table_event_obj[i].style.display="none";
		}
	}
}
function checkTime(i)
{
	if (i<10)
	{i="0" + i}
	return i
}
function checkdate(timediff,currentTimeDifference_min,days_value,hours_value,mins_valus,secs_valus)
{
	if(currentTimeDifference_min >= 0)
	{ 
		document.getElementById("time_clock_days").innerHTML=days_value;
		document.getElementById("time_clock_hours").innerHTML=hours_value;
		document.getElementById("time_clock_min").innerHTML=mins_valus;
		document.getElementById("time_clock_sec").innerHTML=secs_valus;
	//	setTimeout('displayTime(timedifferenceInMillisecs)',500);
	}
	else
	{
		document.getElementById("time_clock_days").innerHTML="00";
		document.getElementById("time_clock_hours").innerHTML="00";
		document.getElementById("time_clock_min").innerHTML="00";
		document.getElementById("time_clock_sec").innerHTML="00";
	}
}
// walkscore movie to PRO  Start
var walkscore_temp_value=1;
function walkscore_address_pass(global_walkscore_address)
{
	if(walkscore_temp_value=="1")
	{
		var global_walkscore_address1=global_walkscore_address;
		document.getElementById("walkscore_iframeId").name=global_walkscore_address1;
		document.getElementById("walkscore_iframeId").src="/walkscore.htm";
		walkscore_temp_value=0;
	}


}
// walkscore  movie to PRO  end
function openRealTransLink() {
	window.open ("https://ava.altisource.com/webtop/default.asp","realTrans"); 
}
function property_document(pageName)
{	

	if(pageName=="Bid")
	{
		var elementId=document.getElementById("thumbsBid");
		var elementTagname=elementId.getElementsByTagName("img");
		var elementLength=elementTagname.length;
		if(elementLength<4)
		{
			document.getElementById("slidePhotoRightBid").className="slidePhotoRightHide";
		}
		else
		{
			document.getElementById("slidePhotoRightBid").className="slidePhotoRight";
		}
	}
	else if(pageName=="Offer")
	{	
		var elementId=document.getElementById("thumbsOffer");
		var elementTagname=elementId.getElementsByTagName("img");
		var elementLength=elementTagname.length;
		if(elementLength<4)
		{
			document.getElementById("slidePhotoRightOffer").className="slidePhotoRightHide";
		}
		else
		{
			document.getElementById("slidePhotoRightOffer").className="slidePhotoRight";
		}
		
	}

}
var campTemp=0;
function campaignsFullURL(pageName)
{
	
	var sTestURL = document.location.href.toUpperCase().replace("HTTP://", "").replace("HTTPS://", "");
	if (sTestURL.substring(0, 3) != "WWW") 
	{
		if (sTestURL.substring(0, 7) == "PREVIEW") { baseURL = "http://preview.auction.gohoming.com/GoHomingWeb/"; baseSubDomain = "preview"; }
		if (sTestURL.substring(0, 3) == "UAT") { baseURL = "http://uat.auction.gohoming.com:8080/GoHomingWeb/"; baseSubDomain = "uat"; }
        	if (sTestURL.substring(0, 2) == "QA") { baseURL = "http://192.168.92.232:8081/GoHomingWeb/"; baseSubDomain = "qa"; }
 		if (sTestURL.substring(0, 4) == "QAPE") { baseURL = "http://192.168.92.232:8080/GoHomingWeb/"; baseSubDomain = "qape"; }
		if (sTestURL.substring(0, 3) == "DEV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "dev"; }
		if (sTestURL.substring(0, 4) == "DEVM") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devm"; }
		if (sTestURL.substring(0, 4) == "DEVV") { baseURL = "http://dev.auction.gohoming.com:8081/GoHomingWeb/"; baseSubDomain = "devv"; }
		if (sTestURL.substring(0, 5) == "DEVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devpe"; }
		if (sTestURL.substring(0, 6) == "DEVMPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devmpe"; }
		if (sTestURL.substring(0, 6) == "DEVVPE") { baseURL = "http://devpe.auction.gohoming.com:7081/GoHomingWeb/"; baseSubDomain = "devvpe"; }
  	}

	var campURL= document.location.href;
	var campaignsFullURL=campURL;
	var campaignsFullURLPart=campaignsFullURL.split('?');	
	var campaignsFullURLPartByAnd=campaignsFullURLPart[1].split('&');
	
	for(var i=0;i<campaignsFullURLPartByAnd.length;i++)
	{

		var campaignsFullURLPartByAnd1=campaignsFullURLPartByAnd[i].split('=');
		if(campaignsFullURLPartByAnd1[0]=="utm_source" || campaignsFullURLPartByAnd1[0]=="utm_medium" || campaignsFullURLPartByAnd1[0]=="utm_campaign")
		{
			var campTemp=1;
		}
	}
	if(campTemp=="1")
	{
	
		if(pageName=="Search")
		{
			document.getElementById("campaignURLSearch").src=baseURL+"logCampaignData.action?domain="+baseDomain+"&refUrl="+escape(document.location.href);
		}
		else if(pageName=="Bid")
		{
			document.getElementById("campaignURLBid").src=baseURL+"logCampaignData.action?domain="+baseDomain+"&refUrl="+escape(document.location.href);
		}
		else if(pageName=="Offer")
		{
			document.getElementById("campaignURLOffer").src=baseURL+"logCampaignData.action?domain="+baseDomain+"&refUrl="+escape(document.location.href);
		}
	}
}
/* START Property Details Page: Reserve Met Tooltip*/
function reserveMetTooltip()
{
  	if(parent.document.getElementById("reservemetTooltipBid").style.display=="none")
  	{
  		parent.document.getElementById("reservemetTooltipBid").style.display="block";
	}
	else
	{
		parent.document.getElementById("reservemetTooltipBid").style.display="none";
	}

	
}
/* End Property Details Page: Reserve Met Tooltip*/
/* START Property Details Page: Financing Tooltip*/
function financingTooltip()
{
	if(document.getElementById("financingTooltip").style.display=="none")
	{
		$('.financingTooltip').show();
	}
	else
	{
		$('.financingTooltip').hide();
	}

}
/* End Property Details Page: Financing Tooltip*/
function getRefinementSearchItems(){
  var url=document.location.href;
  if(url.indexOf("search-results.htm")!=-1){
  	url=url.replace("search-results.htm","refinement-search.htm");
  }else if(url.indexOf("search-results-coming.htm")!=-1){
  	url=url.replace("search-results-coming.htm","refinement-search.htm");
  }else if(url.indexOf("map-results.htm")!=-1){
  	url=url.replace("map-results.htm","refinement-search.htm");
  }else if(url.indexOf("map-results-coming.htm")!=-1){
  	url=url.replace("map-results-coming.htm","refinement-search.htm");
  }else if(url.indexOf("campaign.htm")!=-1){
  	url=url.replace("campaign.htm","refinement-search.htm");
  }else if(url.indexOf("reo-homes.htm")!=-1){
  	url=url.replace("reo-homes.htm","refinement-search.htm");
  }  
  /*verify = AJAX("get", url, "", "text/html");
  if(verify.indexOf('availableRefinement')!=-1){
	 alert(verify);
  }*/ 
  //$('#availableRefinementBox').load('refinement-search.htm #availableRefinementBox');
 
  $('#availableRefinementBox').load(url);
}
