function findPos(el){var obj=document.getElementById(el);var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){curleft+=obj.offsetLeft;curtop+=obj.offsetTop}}return[curleft,curtop]}function findSize(el){var obj=document.getElementById(el);return[obj.offsetWidth,obj.offsetHeight]}function doPicture(el){var picEl=document.getElementById(el.id.replace(/Name/i,"Picture"));picEl.className="selected";var detailsEl=document.getElementById(el.id.replace(/Name/i,"Details"));detailsEl.style.display=""}function undoPicture(el){var picEl=document.getElementById(el.id.replace(/Name/i,"Picture"));picEl.className="";var detailsEl=document.getElementById(el.id.replace(/Name/i,"Details"));detailsEl.style.display="none"}function doName(el){var rename=el.id.replace(/Picture/i,"Name");var picEl=document.getElementById(rename);picEl.className="selected";var detailsEl=document.getElementById(el.id.replace(/Picture/i,"Details"));detailsEl.style.display=""}function undoName(el){var picEl=document.getElementById(el.id.replace(/Picture/i,"Name"));picEl.className="";var detailsEl=document.getElementById(el.id.replace(/Picture/i,"Details"));detailsEl.style.display="none"}var id;var leftIDs;var rightIDs;function toggleAdvancedSearch(el){var psEl=document.getElementById("propertySearch");if(psEl.className.indexOf("advanced")==-1){psEl.className="rightHandMenuItem advancedSearch";el.innerHTML="Quick search"}else{psEl.className="rightHandMenuItem quickSearch";el.innerHTML="Advanced search";$("#"+id+"_HomesToBuyLocationRegionDropDownList").val("");$("#"+id+"_HomesToBuyBedroomsDropDownList").val("");$("#"+id+"_HomesToBuyResultsOrderDropDownList").val("");$("#"+id+"_HomesToBuyShowSoldUnitsCheckBox").val("checked");$("#"+id+"_HomesToRentLocationRegionDropDownList").val("");$("#"+id+"_HomesToRentOrderByDropDownList").val("");$("#"+id+"_HomesToRentBedroomsDropDownList").val("");for(var i=0;i<leftIDs.length;i++){$("#"+rightIDs[i]+"_RegionDropDownList").val("");$("#"+rightIDs[i]+"_BedroomsDropDownList").val("");$("#"+leftIDs[i]+"_ResultsOrderDropDownList").val("");$("#"+leftIDs[i]+"_ShowSoldUnitsCheckBox").val("checked")}$("#"+id+"_WorkSpacesToLetSizeTextBox").val("");$("#"+id+"_WorkSpacesToLetLocationRegionDropDownList").val("");$("#"+id+"_WorkSpacesToLetUseDropDownList").val("");$("#"+id+"_WorkSpacesToLetOrderByDropDownList").val("");$("#"+id+"_WorkSpacesToLetShowSoldUnitsCheckBox").val("");$("#"+id+"_WorkSpacesToBuySizeTextBox").val("");$("#"+id+"_WorkSpacesToBuyLocationRegionDropDownList").val("");$("#"+id+"_WorkSpacesToBuyOrderByDropDownList").val("");$("#"+id+"_WorkSpacesToBuyShowSoldUnitsCheckBox").val("");$("#"+id+"_WorkSpacesToBuyUseDropDownList").val("")}}function setupSearch(baseId,initLeftIDs,initRightIDs){id=baseId;leftIDs=initLeftIDs;rightIDs=initRightIDs}function switchSearch(val){$(".homesToBuySearch").css("display","none");$(".homesToRentSearch").css("display","none");$(".workSpacesToBuySearch").css("display","none");$(".workSpacesToLetSearch").css("display","none");$("#"+id+"_SearchTypeDropDownList").val(val);var searchType=val;var housingSchemeIndex=0;var splitBits=val.split("-");if(splitBits.length==2){searchType=splitBits[0];housingSchemeIndex=splitBits[1]}switch(parseInt(searchType)){case 1:$("#"+id+"_HomesToBuyPlaceHolderRight").css("display","");$("#"+id+"_HomesToBuyPlaceHolderLeft").css("display","");break;case 2:$("#"+id+"_HomesToRentPlaceHolderRight").css("display","");$("#"+id+"_HomesToRentPlaceHolderLeft").css("display","");break;case 3:$("#"+id+"_WorkSpacesToLetPlaceHolderRight").css("display","");$("#"+id+"_WorkSpacesToLetPlaceHolderLeft").css("display","");break;case 4:$("#"+id+"_WorkSpacesToBuyPlaceHolderRight").css("display","");$("#"+id+"_WorkSpacesToBuyPlaceHolderLeft").css("display","");break;default:$("#homesAffordableRight"+housingSchemeIndex).css("display","");$("#homesAffordableLeft"+housingSchemeIndex).css("display","");break}}function checkChildCheckBoxes(aspCheckBoxID,checkVal){var re=new RegExp(aspCheckBoxID);for(i=0;i<document.forms[0].elements.length;i++){elm=document.forms[0].elements[i];if((re.test(elm.id))&&(elm.type=="checkbox")){elm.checked=checkVal}}}function toggleVisibility(cID,v){var c=document.getElementById(cID);if(c){if(v){c.style.display=""}else{c.style.display="none"}}}function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true}else{if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r}else{return false}}}function openPrintWindow(url,customGaPath){window.open(url,"PrintThisPage","width=640,height=480,menubar=1,toolbar=1,scrollbars=1");if((customGaPath)&&(customGaPath!="")){pageTracker._trackPageview(customGaPath)}return false}(function($){if(!document.defaultView||!document.defaultView.getComputedStyle){var oldCurCSS=jQuery.curCSS;jQuery.curCSS=function(elem,name,force){if(name!=="backgroundPosition"||!elem.currentStyle||elem.currentStyle[name]){return oldCurCSS.apply(this,arguments)}var style=elem.style;if(!force&&style&&style[name]){return style[name]}return oldCurCSS(elem,"backgroundPositionX",force)+" "+oldCurCSS(elem,"backgroundPositionY",force)}}})(jQuery);(function($){function toArray(strg){strg=strg.replace(/left|top/g,"0px");strg=strg.replace(/right|bottom/g,"100%");strg=strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var res=strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]]}$.fx.step.backgroundPosition=function(fx){if(!fx.bgPosReady){var start=$.curCSS(fx.elem,"backgroundPosition");if(!start){start="0px 0px"}start=toArray(start);fx.start=[start[0],start[2]];var end=toArray(fx.options.curAnim.backgroundPosition);fx.end=[end[0],end[2]];fx.unit=[end[1],end[3]];fx.bgPosReady=true}var nowPosX=[];nowPosX[0]=((fx.end[0]-fx.start[0])*fx.pos)+fx.start[0]+fx.unit[0];nowPosX[1]=((fx.end[1]-fx.start[1])*fx.pos)+fx.start[1]+fx.unit[1];fx.elem.style.backgroundPosition=nowPosX[0]+" "+nowPosX[1]}})(jQuery);$(function(){$("#mainNav li a").css({backgroundPosition:"0 -114px"});$("#mainNav li a").hover(function(){if(!$(this).parent().hasClass("selected")){$(this).css({backgroundPosition:"0 -14px"});$(this).stop().animate({backgroundPosition:"(0 0)"},250)}},function(){if(!$(this).parent().hasClass("selected")){$(this).css({backgroundPosition:"0 -100px"});$(this).stop().animate({backgroundPosition:"(0 -114px)"},250)}});$("#mainNav li.selected a").css({backgroundPosition:"0 0"})});function twitterThis(){var bigurl=String(window.location).replace(/%20/g," ");$.getJSON("http://json-tinyurl.appspot.com/?&callback=?",{url:bigurl},function(data){window.location="http://twitter.com/home?status=Currently reading "+data.tinyurl})};