var max_popupwidth = 720; var max_popupheight = 540; // floor plan window var reapitPopup = null; function showFloorplan(url,w,h){ if(reapitPopup && !reapitPopup.closed){reapitPopup.close();reapitPopup = null;} var oldw = w; var oldh = h; if(w>max_popupwidth){ w = max_popupwidth; h = Math.round(h*w/oldw); } if(h>max_popupheight){ h = max_popupheight; w = Math.round(oldw*h/oldh); } reapitPopup = window.open(url,'plan','width='+w+',height='+h+',scrollbars=yes,resizable=yes'); } // virtual tour function showVTour(tour,w,h){ w = (w) ? w : 400; h = (h) ? h : 300; if(reapitPopup && !reapitPopup.closed){reapitPopup.close();reapitPopup = null;} reapitPopup = window.open(tour,'vtour','width='+w+',height='+h+',scrollbars=no,resizable=yes'); } function showSlideshow(url){ if(reapitPopup && !reapitPopup.closed){reapitPopup.close();reapitPopup = null;} reapitPopup = window.open(url,'slideshow','width=750,height=620,scrollbars=no,resizable=yes'); } function newInstructionSet(){ this.instructionUrls = new Array(); this.counter = 0; this.activeWrapper = 0; this.attributes = new Object(); this.divsAligned = false; this.div0Opacity = 100; this.div1Opacity = 0; this.transitionStep = 5; this.divWidth = 0; this.divHeight = 0; this.originalDivHeight = 0; this.originalModuleHeight = 0; this.setAttribute = function(a,v){ this.attributes[a] = v; } this.setAttributes = function(){ for(var i=0;i= this.instructionUrls.length){ this.counter = 0; } this.doTransition(); } this.doTransition = function(){ var div0, div1; if((div0 = document.getElementById("newInstructionWrapper"+this.getAttribute("id")+"_0")) && (div1 = document.getElementById("newInstructionWrapper"+this.getAttribute("id")+"_1"))){ if(this.activeWrapper == 0){ this.div0Opacity += this.transitionStep*this.getAttribute("transitionSpeed"); if(this.div0Opacity >= 100){ setOpacity(div0,100); setOpacity(div1,0); return; } }else{ this.div0Opacity -= this.transitionStep; if(this.div0Opacity <= 0){ setOpacity(div0,0); setOpacity(div1,100); return; } } this.div1Opacity = 100 - this.div0Opacity; setOpacity(div0,this.div0Opacity); setOpacity(div1,this.div1Opacity); var thisObj = this; window.setTimeout(function(){ thisObj.doTransition() },50); } } this.loadCarousel = function(){ if(this.getAttribute("useCarousel")){ var carouselObj = new SWFObject(this.getAttribute("carouselSWF"), "carousel"+this.getAttribute("id")+"_"+this.counter, this.getAttribute("thumbnailWidth"), this.getAttribute("thumbnailHeight"), "6.0.65", "#FFFFFF"); carouselObj.addParam("quality", "high"); carouselObj.addParam("scale", "noscale"); carouselObj.addParam("salign", "LT"); carouselObj.addParam("flashvars", "xmlfile="+escape(this.getAttribute("cacheFolder")+"carousel-"+this.getAttribute("id")+"_"+this.counter+".xml")); carouselObj.addParam("wmode", "transparent"); carouselObj.write("carousel"+this.getAttribute("id")+"_"+this.counter); } } } function LightBox(){ this.attributes = new Object(); this.imageArr = new Object(); this.opacityTable = new Object(); this.mainImage; this.setAttribute = function(a,v){ this.attributes[a] = v; } this.setAttributes = function(){ for(var i=0;i"; container.appendChild(newDiv); this.imageArr[id] = newDiv; } } this.currentImage = id; this.doTransition(); } this.unloadImage = function(){ this.currentImage = this.mainImageID; this.doTransition(); } this.doTransition = function(){ var transitionInProgress = false; for(i in this.opacityTable){ if(i == this.currentImage){ if(this.opacityTable[i] < 100){ this.opacityTable[i] += 10; transitionInProgress = true; } }else{ if(this.opacityTable[i] > 0){ this.opacityTable[i] -= 10; transitionInProgress = true; } } } if(transitionInProgress){ for(i in this.opacityTable){ setOpacity(i,this.opacityTable[i]); } var thisObj = this; window.setTimeout(function(){ thisObj.doTransition() },50); } } } function saveWebStat(dbtype,rps,pcode,type){ params = "rps="+rps+"&dbtype="+dbtype+"&pcode="+pcode+"&type="; params += (type == null) ? "d" : type; jsonServerProcess("savewebstat",params); } function shorthandNumber(num,k,unit){ k = (k==null) ? 1000 : k; unit = (unit == null) ? "" : unit; suffix_arr = (k == 1024) ? new Array(" "," K"," M"," G"," T") : new Array("","K","M","B"); var i=0; while(num >= k && i=suffix_arr.length) ? suffix_arr.length-1 : i; num = Math.round(num*1000)/1000; return num+suffix_arr[i]+unit; } function populatePriceDropDowns(id,type){// module id, sales|lettings var prices, text, selected; if((prices = eval(type+"PriceBands"+id)) != null){ prices = prices.split(","); var minSelected = (eval("typeof(minSelected"+type+id+") != 'undefined'")) ? eval("minSelected"+type+id) : ""; var maxSelected = (eval("typeof(maxSelected"+type+id+") != 'undefined'")) ? eval("maxSelected"+type+id) : "~"; if((minSelect = window.document.getElementById("minPriceDropDown"+id)) != null && (maxSelect = window.document.getElementById("maxPriceDropDown"+id)) != null){ clearDropDown(minSelect); clearDropDown(maxSelect); addToDropDown(minSelect,0,0); for(var i=0;i