var _resources={"photoAccessUrl":"http://photos.harcourts.com.au","webSiteRootUrl":"http://harringtonpark.harcourts.com.au","close":"Close","loadingDotDotDot":"Loading...","favouriteSearchesAddAnAlert":"Add an alert","favouriteSearchAllProperties":"All properties","favouriteSearchEmail":"Email","favouriteSearchSms":"SMS","favouriteSearchOpenHomes":"Open homes","favouriteSearchRemove":"Remove","savingDotDotDot":"Saving...","searchingDotDotDot":"Searching...","shortListAddTo":"add to my shortlist","shortListRemoveFromWide":"remove from my shortlist","shortListRemoveFrom":"remove ...","lat":-24.60706913770968,"lng":133.505859375,"zoom":4};var hasFlash=function(){var a=6;if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.indexOf("Windows")>-1){document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+a+'))) \n</script\> \n');if(window.hasFlash!=null)return window.hasFlash}if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){var b=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;return parseInt(b.substr(b.indexOf(".")-2,2),10)>=a}return false}();String.prototype.normalize=function(){return this.replace(/\s+/g," ")};if(Array.prototype.push==null){Array.prototype.push=function(){var i=0,a=this.length,b=arguments.length;while(i<b){this[a++]=arguments[i++]}return this.length}}if(!Function.prototype.apply){Function.prototype.apply=function(a,b){var c=[];var d,e;if(!a)a=window;if(!b)b=[];for(var i=0;i<b.length;i++){c[i]="b["+i+"]"}e="a.__applyTemp__("+c.join(",")+");";a.__applyTemp__=this;d=eval(e);a.__applyTemp__=null;return d}}function named(a){return new named.Arguments(a)}named.Arguments=function(a){this.oArgs=a};named.Arguments.prototype.constructor=named.Arguments;named.extract=function(a,b){var c,d;var i=a.length;while(i--){d=a[i];if(d!=null&&d.constructor!=null&&d.constructor==named.Arguments){c=a[i].oArgs;break}}if(c==null)return;for(e in c)if(b[e]!=null)b[e](c[e]);return};var parseSelector=function(){var a=/^([^#.>`]*)(#|\.|\>|\`)(.+)$/;function r(s,t){var u=s.split(/\s*\,\s*/);var v=[];for(var i=0;i<u.length;i++)v=v.concat(b(u[i],t));return v}function b(c,d,e){c=c.normalize().replace(" ","`");var f=c.match(a);var g,h,i,j,k,n;var l=[];if(f==null)f=[c,c];if(f[1]=="")f[1]="*";if(e==null)e="`";if(d==null)d=document;switch(f[2]){case"#":k=f[3].match(a);if(k==null)k=[null,f[3]];g=document.getElementById(k[1]);if(g==null||(f[1]!="*"&&!o(g,f[1])))return l;if(k.length==2){l.push(g);return l}return b(k[3],g,k[2]);case".":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;k=f[3].match(a);if(k!=null){if(g.className==null||typeof(g.className)!="String"||g.className.match("(\\s|^)"+k[1]+"(\\s|$)")==null)continue;j=b(k[3],g,k[2]);l=l.concat(j)}else if(g.className!=null&&g.className.match("(\\s|^)"+f[3]+"(\\s|$)")!=null)l.push(g)}return l;case">":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;j=b(f[3],g,">");l=l.concat(j)}return l;case"`":h=m(d,f[1]);for(i=0,n=h.length;i<n;i++){g=h[i];j=b(f[3],g,"`");l=l.concat(j)}return l;default:if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;l.push(g)}return l}}function m(d,o){if(o=="*"&&d.all!=null)return d.all;return d.getElementsByTagName(o)}function o(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:","")==q.toLowerCase()}return r}();var sIFR=function(){var a="http://www.w3.org/1999/xhtml";var b=false;var c=false;var d;var ah=[];var al=document;var ak=al.documentElement;var am=window;var au=al.addEventListener;var av=am.addEventListener;var f=function(){var g=navigator.userAgent.toLowerCase();var f={a:g.indexOf("applewebkit")>-1,b:g.indexOf("safari")>-1,c:navigator.product!=null&&navigator.product.toLowerCase().indexOf("konqueror")>-1,d:g.indexOf("opera")>-1,e:al.contentType!=null&&al.contentType.indexOf("xml")>-1,f:true,g:true,h:null,i:null,j:null,k:null};f.l=f.a||f.c;f.m=!f.a&&navigator.product!=null&&navigator.product.toLowerCase()=="gecko";if(f.m&&g.match(/.*gecko\/(\d{8}).*/))f.j=new Number(g.match(/.*gecko\/(\d{8}).*/)[1]);f.n=g.indexOf("msie")>-1&&!f.d&&!f.l&&!f.m;f.o=f.n&&g.match(/.*mac.*/)!=null;if(f.d&&g.match(/.*opera(\s|\/)(\d+\.\d+)/))f.i=new Number(g.match(/.*opera(\s|\/)(\d+\.\d+)/)[2]);if(f.n||(f.d&&f.i<7.6))f.g=false;if(f.a&&g.match(/.*applewebkit\/(\d+).*/))f.k=new Number(g.match(/.*applewebkit\/(\d+).*/)[1]);if(am.hasFlash&&(!f.n||f.o)){var aj=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;f.h=parseInt(aj.substr(aj.indexOf(".")-2,2),10)}if(g.match(/.*(windows|mac).*/)==null||f.o||f.c||(f.d&&(g.match(/.*mac.*/)!=null||f.i<7.6))||(f.b&&f.h<7)||(!f.b&&f.a&&f.k<312)||(f.m&&f.j<20020523))f.f=false;if(!f.o&&!f.m&&al.createElementNS)try{al.createElementNS(a,"i").innerHTML=""}catch(e){f.e=true}f.p=f.c||(f.a&&f.k<312);return f}();function at(){return{bIsWebKit:f.a,bIsSafari:f.b,bIsKonq:f.c,bIsOpera:f.d,bIsXML:f.e,bHasTransparencySupport:f.f,bUseDOM:f.g,nFlashVersion:f.h,nOperaVersion:f.i,nGeckoBuildDate:f.j,nWebKitVersion:f.k,bIsKHTML:f.l,bIsGecko:f.m,bIsIE:f.n,bIsIEMac:f.o,bUseInnerHTMLHack:f.p}}if(am.hasFlash==false||!al.getElementsByTagName||!al.getElementById||(f.e&&(f.p||f.n)))return{UA:at()};function af(e){if((!k.bAutoInit&&(am.event||e)!=null)||!l(e))return;b=true;for(var i=0,h=ah.length;i<h;i++)j.apply(null,ah[i]);ah=[]}var k=af;function l(e){if(c==false||k.bIsDisabled==true||((f.e&&f.m||f.l)&&e==null&&b==false)||al.getElementsByTagName("body").length==0)return false;return true}function m(n){if(f.n)return n.replace(new RegExp("%\d{0}","g"),"%25");return n.replace(new RegExp("%(?!\d)","g"),"%25")}function as(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:","")==q.toLowerCase()}function o(p,q,r,s,t){var u="";var v=p.firstChild;var w,x,y,z;if(s==null)s=0;if(t==null)t="";while(v){if(v.nodeType==3){z=v.nodeValue.replace("<","&lt;");switch(r){case"lower":u+=z.toLowerCase();break;case"upper":u+=z.toUpperCase();break;default:u+=z}}else if(v.nodeType==1){if(as(v,"a")&&!v.getAttribute("href")==false){if(v.getAttribute("target"))t+="&sifr_url_"+s+"_target="+v.getAttribute("target");t+="&sifr_url_"+s+"="+m(v.getAttribute("href")).replace(/&/g,"%26");u+='<a href="asfunction:_root.launchURL,'+s+'">';s++}else if(as(v,"br"))u+="<br/>";if(v.hasChildNodes()){y=o(v,null,r,s,t);u+=y.u;s=y.s;t=y.t}if(as(v,"a"))u+="</a>"}w=v;v=v.nextSibling;if(q!=null){x=w.parentNode.removeChild(w);q.appendChild(x)}}return{"u":u,"s":s,"t":t}}function A(B){if(al.createElementNS&&f.g)return al.createElementNS(a,B);return al.createElement(B)}function C(D,E,z){var p=A("param");p.setAttribute("name",E);p.setAttribute("value",z);D.appendChild(p)}function F(p,G){var H=p.className;if(H==null)H=G;else H=H.normalize()+(H==""?"":" ")+G;p.className=H}function aq(ar){var a=ak;if(k.bHideBrowserText==false)a=al.getElementsByTagName("body")[0];if((k.bHideBrowserText==false||ar)&&a)if(a.className==null||a.className.match(/\bsIFR\-hasFlash\b/)==null)F(a,"sIFR-hasFlash")}function j(I,J,K,L,M,N,O,P,Q,R,S,r,T){if(!l())return ah.push(arguments);aq();named.extract(arguments,{sSelector:function(ap){I=ap},sFlashSrc:function(ap){J=ap},sColor:function(ap){K=ap},sLinkColor:function(ap){L=ap},sHoverColor:function(ap){M=ap},sBgColor:function(ap){N=ap},nPaddingTop:function(ap){O=ap},nPaddingRight:function(ap){P=ap},nPaddingBottom:function(ap){Q=ap},nPaddingLeft:function(ap){R=ap},sFlashVars:function(ap){S=ap},sCase:function(ap){r=ap},sWmode:function(ap){T=ap}});var U=parseSelector(I);if(U.length==0)return false;if(S!=null)S="&"+S.normalize();else S="";if(K!=null)S+="&textcolor="+K;if(M!=null)S+="&hovercolor="+M;if(M!=null||L!=null)S+="&linkcolor="+(L||K);if(O==null)O=0;if(P==null)P=0;if(Q==null)Q=0;if(R==null)R=0;if(N==null)N="#FFFFFF";if(T=="transparent")if(!f.f)T="opaque";else N="transparent";if(T==null)T="";var p,V,W,X,Y,Z,aa,ab,ac;var ad=null;for(var i=0,h=U.length;i<h;i++){p=U[i];if(p.className!=null&&p.className.match(/\bsIFR\-replaced\b/)!=null)continue;V=p.offsetWidth-R-P;W=p.offsetHeight-O-Q;aa=A("span");aa.className="sIFR-alternate";ac=o(p,aa,r);Z="txt="+m(ac.u).replace(/\+/g,"%2B").replace(/&/g,"%26").replace(/\"/g,"%22").normalize()+S+"&w="+V+"&h="+W+ac.t;F(p,"sIFR-replaced");if(ad==null||!f.g){if(!f.g){if(!f.n)p.innerHTML=['<embed class="sIFR-flash" type="application/x-shockwave-flash" src="',J,'" quality="best" wmode="',T,'" bgcolor="',N,'" flashvars="',Z,'" width="',V,'" height="',W,'" sifr="true"></embed>'].join("");else p.innerHTML=['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" sifr="true" width="',V,'" height="',W,'" class="sIFR-flash"><param name="movie" value="',J,'"></param><param name="flashvars" value="',Z,'"></param><param name="quality" value="best"></param><param name="wmode" value="',T,'"></param><param name="bgcolor" value="',N,'"></param> </object>'].join('')}else{if(f.d){ab=A("object");ab.setAttribute("data",J);C(ab,"quality","best");C(ab,"wmode",T);C(ab,"bgcolor",N)}else{ab=A("embed");ab.setAttribute("src",J);ab.setAttribute("quality","best");ab.setAttribute("flashvars",Z);ab.setAttribute("wmode",T);ab.setAttribute("bgcolor",N)}ab.setAttribute("sifr","true");ab.setAttribute("type","application/x-shockwave-flash");ab.className="sIFR-flash";if(!f.l||!f.e)ad=ab.cloneNode(true)}}else ab=ad.cloneNode(true);if(f.g){if(f.d)C(ab,"flashvars",Z);else ab.setAttribute("flashvars",Z);ab.setAttribute("width",V);ab.setAttribute("height",W);ab.style.width=V+"px";ab.style.height=W+"px";p.appendChild(ab)}p.appendChild(aa);if(f.p)p.innerHTML+=""}if(f.n&&k.bFixFragIdBug)setTimeout(function(){al.title=d},0)}function ai(){d=al.title}function ae(){if(k.bIsDisabled==true)return;c=true;if(k.bHideBrowserText)aq(true);if(am.attachEvent)am.attachEvent("onload",af);else if(!f.c&&(al.addEventListener||am.addEventListener)){if(f.a&&f.k>=132&&am.addEventListener)am.addEventListener("load",function(){setTimeout("sIFR({})",1)},false);else{if(al.addEventListener)al.addEventListener("load",af,false);if(am.addEventListener)am.addEventListener("load",af,false)}}else if(typeof am.onload=="function"){var ag=am.onload;am.onload=function(){ag();af()}}else am.onload=af;if(!f.n||am.location.hash=="")k.bFixFragIdBug=false;else ai()}k.UA=at();k.bAutoInit=true;k.bFixFragIdBug=true;k.replaceElement=j;k.updateDocumentTitle=ai;k.appendToClassName=F;k.setup=ae;k.debug=function(){aq(true)};k.debug.replaceNow=function(){ae();k()};k.bIsDisabled=false;k.bHideBrowserText=true;return k}();if(typeof sIFR=="function"&&!sIFR.UA.bIsIEMac&&(!sIFR.UA.bIsWebKit||sIFR.UA.nWebKitVersion>=100)){sIFR.setup();};;if(typeof sIFR=="function"){sIFR.replaceElement(".introBanner .introTitle h1",named({sFlashSrc:"/Flash/flash.type.swf",sColor:"#FFFFFF",sWmode:"transparent",sCase:"upper"}));sIFR.replaceElement(".mediaFeatures ul li h2",named({sFlashSrc:"/Flash/flash.type.swf",sColor:"#0c0c0c",sWmode:"transparent",sCase:"upper",sHoverColor:"3270ad"}));sIFR.replaceElement(".officeTitle h2",named({sFlashSrc:"/Flash/flash.type.swf",sColor:"#3d3d3d",sWmode:"transparent",sCase:"upper",sHoverColor:"3270ad"}));};;if(typeof sIFR=="function")(function(){var j=document;var h=j.documentElement;sIFR.removeDecoyClasses=function(){function a(b){if(b&&b.className!=null)b.className=b.className.replace(/\bsIFR-hasFlash\b/,"")}return function(){a(h);a(j.getElementsByTagName("body")[0])}}();sIFR.preferenceManager={storage:{sCookieId:"sifr",set:function(a){var b=new Date();b.setFullYear(b.getFullYear()+3);j.cookie=[this.sCookieId,"=",a,";expires=",b.toGMTString(),";path=/"].join("")},get:function(){var a=j.cookie.match(new RegExp(";?"+this.sCookieId+"=([^;]+);?"));if(a!=null&&a[1]=="false")return false;else return true},reset:function(){var a=new Date();a.setFullYear(a.getFullYear()-1);j.cookie=[this.sCookieId,"=true;expires=",a.toGMTString(),";path=/"].join("")}},disable:function(){this.storage.set(false)},enable:function(){this.storage.set(true)},test:function(){return this.storage.get()}};if(sIFR.preferenceManager.test()==false){sIFR.bIsDisabled=true;sIFR.removeDecoyClasses()}sIFR.rollback=function(){function a(b){var c,d,e,f,g,h;var l=parseSelector(b);var i=l.length-1;var m=false;while(i>=0){c=l[i];l.length--;d=c.parentNode;if(c.getAttribute("sifr")=="true"){h=0;while(h<d.childNodes.length){c=d.childNodes[h];if(c.className=="sIFR-alternate"){e=c;h++;continue}d.removeChild(c)}if(e!=null){f=e.firstChild;while(f!=null){g=f.nextSibling;d.appendChild(e.removeChild(f));f=g}d.removeChild(e)}if(!sIFR.UA.bIsXML&&sIFR.UA.bUseInnerHTMLHack)d.innerHTML+="";d.className=d.className.replace(/\bsIFR\-replaced\b/,"")};m=true;i--}return m}return function(k){named.extract(arguments,{sSelector:function(a){k=a}});if(k==null)k="";else k+=">";sIFR.removeDecoyClasses();sIFR.bHideBrowserText=false;if(a(k+"embed")==false)a(k+"object")}}()})();;(function(b){function H(){v.hide();r.onerror=r.onload=null;F&&F.abort();l.empty()}function Q(){b.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})}function B(){H();var a=q[s];e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));var d,f,o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(o==""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(I))f="image";else if(d.match(T))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,s,e)===false){h=false;return}l.css("padding",t+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case"html":l.html(e.content);G();break;case"inline":b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(l.children())});b(a).appendTo(l);G();break;case"image":h=false;b.fancybox.showActivity();r=new Image;r.onerror=function(){Q()};r.onload=function(){r.onerror=null;r.onload=null;U()};r.src=d;break;case"swf":var u="",w="";u+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+d+'"></param>';b.each(e.swf,function(p,R){u+='<param name="'+p+'" value="'+R+'"></param>';w+=" "+p+'="'+R+'"'});u+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+w+"></embed></object>";l.html(u);G();break;case"ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];typeof f=="string"?(f+="&selector="+a[1]):(f.selector=a[1])}h=false;b.fancybox.showActivity();F=b.ajax(b.extend(e.ajax,{url:d,data:f,error:Q,success:function(p){if(F.status==200){l.html(p);G()}}}));break;case"iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+
(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(l);J();break}}function U(){h=true;e.width=r.width;e.height=r.height;b("<img />").attr({id:"fancybox-img",src:r.src,alt:e.title}).appendTo(l);J()}function G(){l.width(e.width);l.height(e.height);if(e.width=="auto")e.width=l.width();if(e.height=="auto")e.height=l.height();J()}function J(){v.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");h=false;return}j=q;n=s;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){K&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});y.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}m=V();W();if(g.is(":visible")){b(z.add(C).add(D)).hide();var a=g.position();k={top:a.top,left:a.left,width:g.width(),height:g.height()};var d=k.width==m.width&&k.height==m.height;i.fadeOut(c.changeFade,function(){function f(){i.html(l.contents()).fadeIn(c.changeFade,L)}b.event.trigger("fancybox-change");i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).empty().css("overflow","hidden");A.prop=0;b(A).animate({prop:1},{duration:d?0:c.changeSpeed,easing:c.easingChange,step:M,complete:f})})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=S();i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(l.contents());g.css(k).show();if(c.opacity)m.opacity=0;A.prop=0;b(A).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(m.width-c.padding*2,1),height:Math.max(m.height-c.padding*2-x,1)}).html(l.contents());g.css(m).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}}function M(a){var d=Math.round(k.width+(m.width-k.width)*a),f=Math.round(k.height+(m.height-k.height)*a),o=Math.round(k.top+(m.top-k.top)*a),u=Math.round(k.left+(m.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:u+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+x*a),0);i.css({width:d+"px",height:f+"px"});if(typeof m.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)}function L(){i.css("overflow",overflow=c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&y.one("click",b.fancybox.close);c.showCloseButton&&z.show();X();b(window).bind("resize.fb",b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;Y()}function V(){var a=N(),d={},f=c.margin,o=c.autoScale,u=(t+f)*2,w=(t+f)*2,p=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-t*2;o=false}else d.width=c.width+p;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-t*2;o=false}else d.height=c.height+p;if(o&&(d.width>a[0]-u||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){u+=p;w+=p;o=Math.min(Math.min(a[0]-u,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-p))+p;d.height=Math.round(o*(d.height-p))+p}else{d.width=Math.min(d.width,a[0]-u);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+t*2))*0.5;d.left=a[2]+(a[0]-(d.width+t*2))*0.5;if(c.autoScale==false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d}function S(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Z(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-t,left:a.left-c.padding-t}}else{a=N();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d}
function X(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d==0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!=0)C.show();if(c.cyclic&&j.length>1||n!=j.length-1)D.show()}}function Y(){if(j.length-1>n){var a=j[n+1].href;if(typeof a!=="undefined"&&a.match(I)){var d=new Image;d.src=a}}if(n>0){a=j[n-1].href;if(typeof a!=="undefined"&&a.match(I)){d=new Image;d.src=a}}}function $(){if(v.is(":visible")){b("div",v).css("top",O*-40+"px");O=(O+1)%12}else clearInterval(P)}function N(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]}function Z(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d}function W(){b("#fancybox-title").remove();x=0;if(c.titleShow!=false){var a=c.title;a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):aa(a);if(!(!a||a=="")){var d=m.width-c.padding*2;b('<div id="fancybox-title" class="'+("fancybox-title-"+c.titlePosition)+'" />').css({width:d,paddingLeft:c.padding,paddingRight:c.padding}).html(a).appendTo("body");switch(c.titlePosition){case"inside":x=b("#fancybox-title").outerHeight(true)-c.padding;m.height+=x;break;case"over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(E).hide();K&&b("#fancybox-title span").fixPNG()}}}function aa(a){if(a&&a.length)switch(c.titlePosition){case"inside":return a;case"over":return'<span id="fancybox-title-over">'+a+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+
a+'</span><span id="fancybox-title-right"></span></span>'}return false}function ba(){if(!b("#fancybox-wrap").length){b("body").append(l=b('<div id="fancybox-tmp"></div>'),v=b('<div id="fancybox-loading"><div></div></div>'),y=b('<div id="fancybox-overlay"></div>'),g=b('<div id="fancybox-wrap"></div>'));E=b('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(g);E.append(i=b('<div id="fancybox-inner"></div>'),z=b('<a id="fancybox-close"></a>'),C=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),D=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));z.click(b.fancybox.close);v.click(b.fancybox.cancel);C.click(function(a){a.preventDefault();b.fancybox.prev()});D.click(function(a){a.preventDefault();b.fancybox.next()});b.support.opacity||E.find(".fancy-bg").fixPNG();if(K){b(z.add(".fancy-ico").add("div",v)).fixPNG();y.get(0).style.setExpression("height","document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");v.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");E.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}}
var l,v,y,g,E,i,z,C,D,s=0,e={},q=[],n=0,c={},j=[],F=null,r=new Image,I=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,T=/[^\.]\.(swf)\s*$/i,P,O=1,k,m,h=false,t=20,A=b.extend(b("<div/>")[0],{prop:0}),x=0,K=!b.support.opacity&&!window.XMLHttpRequest;b.fn.fixPNG=function(){return this.each(function(){var a=b(this).css("backgroundImage");if(a.match(/^url\(["']?(.*\.png)["']?\)$/i)){a=RegExp.$1;b(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod="+
(b(this).css("backgroundRepeat")=="no-repeat"?"crop":"scale")+", src='"+a+"')"}).each(function(){var d=b(this).css("position");d!="absolute"&&d!="relative"&&b(this).css("position","relative")}).css("zoom",1)}})};b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a));b(this).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];s=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");s=q.index(this)}B();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;q=[];s=0;if(b.isArray(a)){for(var f=0,o=a.length;f<o;f++)if(typeof a[f]=="object")b(a[f]).data("fancybox",b.extend({},d,a[f]));else a[f]=b({}).data("fancybox",b.extend({content:a[f]},d));q=jQuery.merge(q,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},d,a));else a=b({}).data("fancybox",b.extend({content:a},d));q.push(a)}B()}};b.fancybox.showActivity=function(){clearInterval(P);v.show();P=setInterval($,66)};b.fancybox.hideActivity=function(){v.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);if(a>-1&&j.length>a){s=a;B()}if(c.cyclic&&j.length>1&&a<0){s=j.length-1;B()}if(c.cyclic&&j.length>1&&a>=j.length){s=0;B()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");H();e&&b.isFunction(e.onCancel)&&e.onCancel(q,s,e);h=false}};b.fancybox.close=function(){function a(){y.fadeOut("fast");g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=s=0;c=e={};h=false}if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}H();b(z.add(C).add(D)).hide();b("#fancybox-title").remove();g.add(i).add(y).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=S();var d=g.position();m={top:d.top,left:d.left,width:g.width(),height:g.height()};if(c.opacity)m.opacity=1;A.prop=1;b(A).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){if(!(h||g.is(":hidden"))){h=true;var a=i.wrapInner("<div style='overflow:auto'></div>").children(),d=a.height();g.css({height:d+c.padding*2+x});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=N(),d=c.margin,f={};f.top=a[3]+(a[1]-(g.height()-x+t*2))*0.5;f.left=a[2]+(a[0]-(g.width()+t*2))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){ba()})})(jQuery);;;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')
$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)
return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)
helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}
function settings(element){return $.data(element,"tooltip");}
function handle(event){if(settings(this).delay)
tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}
function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))
return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}
helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)
helper.body.append("<br/>");helper.body.append(part);}
helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}
if(settings(this).showURL&&$(this).url())
helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)
helper.parent.fixPNG();handle.apply(this,arguments);}
function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))
helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}
update();}
function update(event){if($.tooltip.blocked)
return;if(event&&event.target.tagName=="OPTION"){return;}
if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}
if(current==null){$(document.body).unbind('mousemove',update);return;}
helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}
helper.parent.css({left:left,right:right,top:top});}
var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}
if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}
function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}
function hide(event){if($.tooltip.blocked)
return;if(tID)
clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}
if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))
helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)
helper.parent.unfixPNG();}})(jQuery);;(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null,stopOnHover:false},o||{});return this.each(function(){var running=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var div=$(this),ul=$("ul",div),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v;}
var li=$("li",ul),itemLength=li.size(),curr=o.start;div.css("visibility","visible");li.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});div.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var liSize=o.vertical?height(li):width(li);var ulSize=liSize*itemLength;var divSize=liSize*v;li.css({width:li.width(),height:li.height()});ul.css(sizeCss,ulSize+"px").css(animCss,-(curr*liSize));div.css(sizeCss,divSize+"px");if(o.btnPrev)
$(o.btnPrev).click(function(){return go(curr-o.scroll,"left");});if(o.btnNext)
$(o.btnNext).click(function(){return go(curr+o.scroll,"right");});if(o.btnGo)
$.each(o.btnGo,function(i,val){$(val).click(function(){return go(o.circular?o.visible+i:i,"go");});});if(o.mouseWheel&&div.mousewheel)
div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll);});if(o.auto){autoScroll=setInterval(function(){go(curr+o.scroll);},o.auto+o.speed);if(o.stopOnHover){div.hover(function(){clearInterval(autoScroll);},function(){autoScroll=setInterval(function(){go(curr+o.scroll);},o.auto+o.speed);});}}
function vis(){return li.slice(curr).slice(0,v);};function go(to,dir){if(!running){if(o.beforeStart)
o.beforeStart.call(this,vis());if(o.circular){if(to<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*liSize)+"px");curr=to==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll;}else if(to>=itemLength-v+1){ul.css(animCss,-((v)*liSize)+"px");curr=to==itemLength-v+1?v+1:v+o.scroll;}else curr=to;}else{if(to<0||to>itemLength-v)return;else curr=to;}
running=true;ul.animate(animCss=="left"?{left:-(curr*liSize)}:{top:-(curr*liSize)},o.speed,o.easing,function(){if(o.afterEnd)
o.afterEnd.call(this,vis(),dir);running=false;});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled");}}
return false;};});};function css(el,prop){return parseInt($.css(el[0],prop))||0;};function width(el){return el[0].offsetWidth+css(el,'marginLeft')+css(el,'marginRight');};function height(el){return el[0].offsetHeight+css(el,'marginTop')+css(el,'marginBottom');};})(jQuery);;;(function($){$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}
if(typeof options=='function')
options={success:options};var url=$.trim(this.attr('action'));if(url){url=(url.match(/^([^#]+)/)||[])[1];}
url=url||window.location.href||''
options=$.extend({url:url,type:this.attr('method')||'GET'},options||{});var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}
if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}
var a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(var n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n])
a.push({name:n,value:options.data[n][k]});}
else
a.push({name:n,value:options.data[n]});}}
if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}
this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}
var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}
else
options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm();});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){$(options.target).html(data).each(oldSuccess,arguments);});}
else if(options.success)
callbacks.push(options.success);options.success=function(data,status){for(var i=0,max=callbacks.length;i<max;i++)
callbacks[i].apply(options,[data,status,$form]);};var files=$('input:file',this).fieldValue();var found=false;for(var j=0;j<files.length;j++)
if(files[j])
found=true;var multipart=false;if(options.iframe||found||multipart){if(options.closeKeepAlive)
$.get(options.closeKeepAlive,fileUpload);else
fileUpload();}
else
$.ajax(options);this.trigger('form-submit-notify',[this,options]);return this;function fileUpload(){var form=$form[0];if($(':input[name=submit]',form).length){alert('Error: Form elements must not be named "submit".');return;}
var opts=$.extend({},$.ajaxSettings,options);var s=$.extend(true,{},$.extend(true,{},$.ajaxSettings),opts);var id='jqFormIO'+(new Date().getTime());var $io=$('<iframe id="'+id+'" name="'+id+'" src="about:blank" />');var io=$io[0];$io.css({position:'absolute',top:'-1000px',left:'-1000px'});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;$io.attr('src','about:blank');}};var g=opts.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,opts]);if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&$.active--;return;}
if(xhr.aborted)
return;var cbInvoked=0;var timedOut=0;var sub=form.clk;if(sub){var n=sub.name;if(n&&!sub.disabled){options.extraData=options.extraData||{};options.extraData[n]=sub.value;if(sub.type=="image"){options.extraData[name+'.x']=form.clk_x;options.extraData[name+'.y']=form.clk_y;}}}
setTimeout(function(){var t=$form.attr('target'),a=$form.attr('action');form.setAttribute('target',id);if(form.getAttribute('method')!='POST')
form.setAttribute('method','POST');if(form.getAttribute('action')!=opts.url)
form.setAttribute('action',opts.url);if(!options.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}
if(opts.timeout)
setTimeout(function(){timedOut=true;cb();},opts.timeout);var extraInputs=[];try{if(options.extraData)
for(var n in options.extraData)
extraInputs.push($('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />').appendTo(form)[0]);$io.appendTo('body');io.attachEvent?io.attachEvent('onload',cb):io.addEventListener('load',cb,false);form.submit();}
finally{form.setAttribute('action',a);t?form.setAttribute('target',t):$form.removeAttr('target');$(extraInputs).remove();}},10);var nullCheckFlag=0;function cb(){if(cbInvoked++)return;io.detachEvent?io.detachEvent('onload',cb):io.removeEventListener('load',cb,false);var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;if((doc.body==null||doc.body.innerHTML=='')&&!nullCheckFlag){nullCheckFlag=1;cbInvoked--;setTimeout(cb,100);return;}
xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;xhr.getResponseHeader=function(header){var headers={'content-type':opts.dataType};return headers[header];};if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];xhr.responseText=ta?ta.value:xhr.responseText;}
else if(opts.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText);}
data=$.httpData(xhr,opts.dataType);}
catch(e){ok=false;$.handleError(opts,xhr,'error',e);}
if(ok){opts.success(data,'success');if(g)$.event.trigger("ajaxSuccess",[xhr,opts]);}
if(g)$.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(opts.complete)opts.complete(xhr,ok?'success':'error');setTimeout(function(){$io.remove();xhr.responseXML=null;},100);};function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}
else
doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.tagName!='parsererror')?doc:null;};};};$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().bind('submit.form-plugin',function(){$(this).ajaxSubmit(options);return false;}).each(function(){$(":submit,input:image",this).bind('click.form-plugin',function(e){var form=this.form;form.clk=this;if(this.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$(this).offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-this.offsetLeft;form.clk_y=e.pageY-this.offsetTop;}}
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},10);});});};$.fn.ajaxFormUnbind=function(){this.unbind('submit.form-plugin');return this.each(function(){$(":submit,input:image",this).unbind('click.form-plugin');});};$.fn.formToArray=function(semantic){var a=[];if(this.length==0)return a;var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els)return a;for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n)continue;if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}
continue;}
var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)
a.push({name:n,value:v[j]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:n,value:v});}
if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0],n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}
return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++)
a.push({name:n,value:v[i]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:this.name,value:v});});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))
continue;v.constructor==Array?$.merge(val,v):val.push(v);}
return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful=='undefined')successful=true;if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1))
return null;if(tag=='select'){var index=el.selectedIndex;if(index<0)return null;var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v)
v=(op.attributes&&op.attributes['value']&&!(op.attributes['value'].specified))?op.text:op.value;if(one)return v;a.push(v);}}
return a;}
return el.value;};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea')
this.value='';else if(t=='checkbox'||t=='radio')
this.checked=false;else if(tag=='select')
this.selectedIndex=-1;});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))
this.reset();});};$.fn.enable=function(b){if(b==undefined)b=true;return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select==undefined)select=true;return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio')
this.checked=select;else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}
this.selected=select;}});};function log(){if($.fn.ajaxSubmit.debug&&window.console&&window.console.log)
window.console.log('[jquery.form] '+Array.prototype.join.call(arguments,''));};})(jQuery);;var utils={appendParam:function(url,name,value){return url+(url.indexOf("?")<0?"?":"&")+
name+"="+value;},getByID:function(arr,id){for(var i=0;i<arr.length;i++){var obj=arr[i];if(obj&&obj.id==id){return obj;}}
return null;},getGLatLng:function($el){var lat=new Number($el.attr("lat"));var lng=new Number($el.attr("lng"));return new google.maps.LatLng(lat,lng);},getQueryString:function(options){defaults={defaultvalue:null};options=$.extend(defaults,options);var qs=options.url;if(qs==null){qs=location.search.substring(1,location.search.length);}
if(qs.length==0)
return options.defaultvalue;qs=qs.replace(/\+/g,' ');var args=qs.split('&');for(var i=0;i<args.length;i++){var value;var pair=args[i].split('=');var name=unescape(pair[0]);if(pair.length==2)
value=unescape(pair[1]);else
value=name;if(name==options.id||i==options.id-1)
return value;}
return options.defaultvalue;},getUrlWithoutHost:function(encode){var href=window.location.href;var count=0;for(var i=0;i<href.length;i++){if(href[i]=='/'){count++;if(count==3){var url=href.substring(i);return encode?utils.urlEncode(url):url;}}}
return"/";},inArray:function(val,arr){for(var i=0;i<arr.length;i++){if(arr[i]==val)
return true;}
return false;},is:function(o){return(typeof(o)!="undefined"&&o!=null);},urlDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/;while((m=r.exec(o))!=null&&m.length>1&&m[1]!=''){b=parseInt(m[1].substr(1),16);t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;},urlEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;while(x<c.length){var m=r.exec(c.substr(x));if(m!=null&&m.length>1&&m[1]!=''){o+=m[1];x+=m[1].length;}else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16);o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;},popupWin:function(opts){var features="width="+opts.width+",height="+opts.height+",status="+(opts.status?"1":"0")+",resizable="+(opts.resizable?"1":"0")+",scrollbars="+(opts.scrollbars?"1":"0");window.open(opts.href,opts.name,features);}};(function($){$.extend($.expr[":"],{regex:function(a,i,m,r){r=new RegExp(m[3],'i');return r.test($(a).val());}});$.fn.appendSiteGuid=function(){return this.each(function(){var $this=$(this);if($this.find("input[name=siteguid]").length==0){$this.append('<input name="siteguid" type="hidden" value="'+
$("body").attr("siteguid")+'" />')}});};$.fn.googleMap=function(options){return this.each(function(){googleMapsV3.init(this,options);});};$.fn.harcourtsForm=function(options){function displayValidationSummary(result,options){if(!options.validationSelector){options.validationSelector=".validationSummary";}
var $validationSummary=$(options.validationSelector);if($validationSummary.length==0){alert(result.ValidationSummary);}else{$validationSummary.show().html(result.ValidationSummary.replace(/\r\n/g,"<br />"));}};this.appendSiteGuid();return this.each(function(){var $this=$(this);var siteGuid=$("body").attr("siteguid");if(siteGuid){var $siteGuid=$this.find("input[name=siteguid]");if($siteGuid.length==0){$this.append('<input name="siteguid" type="hidden" value="'+
siteGuid+'" />');}}
var $fields=$this.find(":input");if(!options.allowAutoComplete){$fields.not("[type=hidden]").attr("autocomplete","off")}
if(options.clearFields){$fields.not("[type=hidden]").clearFields();}
var $captchaKey=$this.find("input[name=captchaKey],input[name="+
options.namePrefix+"CaptchaKey]");var $captchaForm=$(".frmCaptcha, .regCaptcha");if($captchaForm.length==1)
$captchaForm.hide();var $input=$("#formEnquiry input, #formEnquiry textarea, #formRegister input");if($input.length>0){$input.click(function(){checkCaptcha(options);});}
$this.find(".btn").click(function(event){event.preventDefault();validateAndPost();return false;});$this.find("input").keypress(function(event){if(event.keyCode==13){event.preventDefault();validateAndPost();return false;}});function checkCaptcha(options){if(($captchaKey.length==1&&$captchaKey.val()=="")||$captchaForm.is(':hidden')){$.post("/Default/GetCaptcha",{},function(captchaKeyString){$captchaKey.val(captchaKeyString);$(".captchaImage").attr("src","/Images/Captcha.ashx?key="+captchaKeyString);if($captchaForm.length==1)
$captchaForm.show();});}};function validateAndPost(){var result=$this.harcourtsValidate(options.namePrefix);if(!result.IsValid){displayValidationSummary(result,options);return false;}
$.post(options.url,$fields.serialize(false),function(result){if($captchaKey.length==1&&result.CaptchaKey){$captchaKey.val(result.CaptchaKey);$this.find(".captchaImage").attr("src","/Images/Captcha.ashx?key="+result.CaptchaKey);var $captcha=$("input[name=captcha],input[name="+
options.namePrefix+"Captcha]");$captcha.val("");$captcha.focus();}
if(!result.IsValid){for(var i=0;i<result.Errors.length;i++){var $el=$($this.find("[name="+result.Errors[i].Key+"],[name="+options.namePrefix+result.Errors[i].Key+"]"));$el.addClass("error");}
$this.trigger("formError");displayValidationSummary(result,options);return false;}
$this.trigger("formSuccess");$fields.not("[type=hidden]").clearFields();if(result.SuccessMessage){if($captchaForm.length==1)
$captchaForm.hide();if($captchaKey.length==1)
$captchaKey.val("");alert(result.SuccessMessage);}
if(result.SuccessUrl){window.location=result.SuccessUrl;}},"json");return false;};});};$.fn.setPosition=function(position){return this.each(function(){$(this).css({position:"absolute",marginLeft:0,marginTop:0,top:position.top,left:position.left});});};$.fn.scrollPaging=function(options,callback){return this.each(function(){var percentage=40;var $outerThis=$(this);var isFirstScroll=true;var previousItemCount=0;var previousHeight=0;var triggerEventScrollTop=0;var triggerEventScrollTopIncrement=0;var pageHeight;$outerThis.scroll(function(data){if(!utils.is(options)){alert("options is a required argument.");return;}
if(!utils.is(options.pageIndex)){alert("options.pageIndex is a required property.");return;}
if(!utils.is(options.pageSize)){alert("options.pageSize is a required property.");return;}
if(!utils.is(options.totalCount)){alert("options.totalCount is a required property.");return;}
if(options.pageIndex*options.pageSize+options.pageSize>=options.totalCount){return;}
var $this=$(this);var height=$this.children("ul").height();var itemCount=$this.find(">ul li").length;if(height<previousHeight){isFirstScroll=true;previousHeight=height;}
if(isFirstScroll){pageHeight=height;triggerEventScrollTopIncrement=pageHeight*percentage/100;triggerEventScrollTop=triggerEventScrollTopIncrement;previousItemCount=0;isFirstScroll=false;}
if($this.scrollTop()>=triggerEventScrollTop){if(itemCount<=previousItemCount){return;}
triggerEventScrollTop+=pageHeight;previousItemCount=itemCount;previousHeight=height;options.pageIndex++;callback.apply(this,[options]);}})})};$.fn.streetView=function(options){return this.each(function(){if(options.url){var ll=utils.getQueryString({id:"cbll",url:options.url}).split(',');options.latlng=new google.maps.LatLng(new Number(ll[0]),new Number(ll[1]));var cbp=utils.getQueryString({id:"cbp",url:options.url}).split(',');options.pov={pitch:cbp[4],yaw:cbp[1]};}
var $this=$(this);new GStreetviewClient().getNearestPanoramaLatLng(options.latlng,function(glatlng){if(glatlng){$this.trigger("hasnearbypanoramas");}else{$this.trigger("nonearbypanoramas",glatlng);}});this.pan=new GStreetviewPanorama(this,options);google.maps.event.addListener(this.pan,"error",function(errorCode){$this.trigger("error");if(errorCode==600){}else if(errorCode==603){alert("Error: Flash doesn't appear to be supported by your browser");}else{alert("Street view panorama error: "+errorCode);}});return false;});};$.fn.htabs=function($divs,activeTabClassName){if(!activeTabClassName){activeTabClassName="active";}
var $this=$(this);if(this.length==0){alert("No tabs have been selected");}
if(this.length!=$divs.length){alert("The number of divs for tabs does not match the number of tabs.");return this;}
if($this.filter("."+activeTabClassName).length==0){$($this[0]).addClass(activeTabClassName);}
$divs.show().addClass("offscreen");return this.each(function(n){var $div=$($divs[n]);if($(this).hasClass(activeTabClassName)){$div.show().removeClass("offscreen");}
var $outerThis=$(this);$(this).click(function(){if($(this).hasClass(activeTabClassName)){return false;}
$this.removeClass(activeTabClassName);$(this).addClass(activeTabClassName);$divs.addClass("offscreen");$div.removeClass("offscreen");$(this).trigger("tabChange",this);return false;});});};$.fn.toggleVisibility=function(){return this.each(function(){if($(this).is(":visible")){$(this).hide();}else{$(this).show();}});};$.fn.harcourtsValidate=function(namePrefix){var $this=$(this);var result={ValidationSummary:null,Errors:[],IsValid:false};$this.find(":input").removeClass("error");var $compareToFields=$this.find("input[compareto],textarea[compareto]");var $requiredFields=$this.find("input[isrequired=true],textarea[isrequired=true]");var $regexFields=$this.find("input[regex],textarea[regex]");$compareToFields.each(function(){var $el=$(this);var $elCompareTo=$this.find("[name="+$el.attr("compareto")+"]");var elValue=$.trim($el.val());var elCompareToValue=$.trim($elCompareTo.val());if(elValue!=elCompareToValue){result.Errors[result.Errors.length]={Key:$el.attr("name"),ErrorMessage:$el.attr("errormessage")};}});$requiredFields.each(function(){var $el=$(this);$el.val($.trim($el.val()));if(($el.is(":checkbox")&&!$el.is(":checked"))||$el.val()==""){result.Errors[result.Errors.length]={Key:$el.attr("name"),ErrorMessage:$el.attr("errormessage")};}});$regexFields.each(function(){var $el=$(this);$el.val($.trim($el.val()));if($el.val()!=""&&$el.filter(":regex("+$el.attr("regex")+")").length!=1){result.Errors[result.Errors.length]={Key:$el.attr("name"),ErrorMessage:$el.attr("regexerrormessage")};}});result.IsValid=true;if(result.Errors.length>0){result.IsValid=false;result.ValidationSummary="";for(var i=0;i<result.Errors.length;i++){result.ValidationSummary+="- "+result.Errors[i].ErrorMessage;if(result.ValidationSummary.substr(-1)!="."){result.ValidationSummary+=".";}
result.ValidationSummary+="\r\n";$("[name="+result.Errors[i].Key+"],[name="+namePrefix+
result.Errors[i].Key+"],").addClass("error");}
if($this.attr("errormessageprefix")){result.ValidationSummary=$this.attr("errormessageprefix")+"\r\n\r\n"+result.ValidationSummary;}
if($this.attr("errormessagesuffix")){result.ValidationSummary+="\r\n"+$this.attr("errormessagesuffix");}}
return result;};})(jQuery);;jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};jQuery.cookieKey=function(cookie,subkey){if(typeof(cookie)=='undefined'||cookie==null||cookie.length==0)return;var kvpArr=cookie.split("&");for(i=0;i<kvpArr.length;i++){var kvp=kvpArr[i].split("=");if(kvp[0]==subkey){return kvp[1];}}
return;};;(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);;(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);;(function(b,a,c){b.fn.jScrollPane=function(f){function d(D,N){var ay,P=this,X,aj,w,al,S,Y,z,r,az,aE,au,j,I,i,k,Z,T,ap,W,u,B,aq,ae,am,G,m,at,ax,y,av,aH,g,K,ai=true,O=true,aG=false,l=false,ao=D.clone(false,false).empty(),ab=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aH=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");g=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function ar(aQ){var aO,aP,aK,aM,aL,aJ,aI,aN;ay=aQ;if(X===c){aI=D.scrollTop();aN=D.scrollLeft();D.css({overflow:"hidden",padding:0});aj=D.innerWidth()+g;w=D.innerHeight();D.width(aj);X=b('<div class="jspPane" />').css("padding",aH).append(D.children());al=b('<div class="jspContainer" />').css({width:aj+"px",height:w+"px"}).append(X).appendTo(D)}else{D.css("width","");aJ=D.innerWidth()+g!=aj||D.outerHeight()!=w;if(aJ){aj=D.innerWidth()+g;w=D.innerHeight();al.css({width:aj+"px",height:w+"px"})}if(!aJ&&K==S&&X.outerHeight()==Y){D.width(aj);return}K=S;X.css("width","");D.width(aj);al.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}aO=X.clone(false,false).css("position","absolute");aP=b('<div style="width:1px; position: relative;" />').append(aO);b("body").append(aP);S=Math.max(X.outerWidth(),aO.outerWidth());aP.remove();Y=X.outerHeight();z=S/aj;r=Y/w;az=r>1;aE=z>1;if(!(aE||az)){D.removeClass("jspScrollable");X.css({top:0,width:al.width()-g});o();E();Q();x();ah()}else{D.addClass("jspScrollable");aK=ay.maintainPosition&&(I||Z);if(aK){aM=aC();aL=aA()}aF();A();F();if(aK){M(aM,false);L(aL,false)}J();af();an();if(ay.enableKeyboardNavigation){R()}if(ay.clickOnTrack){q()}C();if(ay.hijackInternalLinks){n()}}if(ay.autoReinitialise&&!av){av=setInterval(function(){ar(ay)},ay.autoReinitialiseDelay)}else{if(!ay.autoReinitialise&&av){clearInterval(av)}}aI&&D.scrollTop(0)&&L(aI,false);aN&&D.scrollLeft(0)&&M(aN,false);D.trigger("jsp-initialised",[aE||az])}function aF(){if(az){al.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));T=al.find(">.jspVerticalBar");ap=T.find(">.jspTrack");au=ap.find(">.jspDrag");if(ay.showArrows){aq=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aD(0,-1)).bind("click.jsp",aB);ae=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aD(0,1)).bind("click.jsp",aB);if(ay.arrowScrollOnHover){aq.bind("mouseover.jsp",aD(0,-1,aq));ae.bind("mouseover.jsp",aD(0,1,ae))}ak(ap,ay.verticalArrowPositions,aq,ae)}u=w;al.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){u-=b(this).outerHeight()});au.hover(function(){au.addClass("jspHover")},function(){au.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);au.addClass("jspActive");var s=aI.pageY-au.position().top;b("html").bind("mousemove.jsp",function(aJ){U(aJ.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});p()}}function p(){ap.height(u+"px");I=0;W=ay.verticalGutter+ap.outerWidth();X.width(aj-W-g);if(T.position().left===0){X.css("margin-left",W+"px")}}function A(){if(aE){al.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));am=al.find(">.jspHorizontalBar");G=am.find(">.jspTrack");i=G.find(">.jspDrag");if(ay.showArrows){ax=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aD(-1,0)).bind("click.jsp",aB);y=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aD(1,0)).bind("click.jsp",aB);if(ay.arrowScrollOnHover){ax.bind("mouseover.jsp",aD(-1,0,ax));y.bind("mouseover.jsp",aD(1,0,y))}ak(G,ay.horizontalArrowPositions,ax,y)}i.hover(function(){i.addClass("jspHover")},function(){i.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);i.addClass("jspActive");var s=aI.pageX-i.position().left;b("html").bind("mousemove.jsp",function(aJ){V(aJ.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});m=al.innerWidth();ag()}}function ag(){al.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){m-=b(this).outerWidth()});G.width(m+"px");Z=0}function F(){if(aE&&az){var aI=G.outerHeight(),s=ap.outerWidth();u-=aI;b(am).find(">.jspCap:visible,>.jspArrow").each(function(){m+=b(this).outerWidth()});m-=s;w-=s;aj-=aI;G.parent().append(b('<div class="jspCorner" />').css("width",aI+"px"));p();ag()}if(aE){X.width((al.outerWidth()-g)+"px")}Y=X.outerHeight();r=Y/w;if(aE){at=Math.ceil(1/z*m);if(at>ay.horizontalDragMaxWidth){at=ay.horizontalDragMaxWidth}else{if(at<ay.horizontalDragMinWidth){at=ay.horizontalDragMinWidth}}i.width(at+"px");k=m-at;ad(Z)}if(az){B=Math.ceil(1/r*u);if(B>ay.verticalDragMaxHeight){B=ay.verticalDragMaxHeight}else{if(B<ay.verticalDragMinHeight){B=ay.verticalDragMinHeight}}au.height(B+"px");j=u-B;ac(I)}}function ak(aJ,aL,aI,s){var aN="before",aK="after",aM;if(aL=="os"){aL=/Mac/.test(navigator.platform)?"after":"split"}if(aL==aN){aK=aL}else{if(aL==aK){aN=aL;aM=aI;aI=s;s=aM}}aJ[aN](aI)[aK](s)}function aD(aI,s,aJ){return function(){H(aI,s,this,aJ);this.blur();return false}}function H(aL,aK,aO,aN){aO=b(aO).addClass("jspActive");var aM,aJ,aI=true,s=function(){if(aL!==0){P.scrollByX(aL*ay.arrowButtonSpeed)}if(aK!==0){P.scrollByY(aK*ay.arrowButtonSpeed)}aJ=setTimeout(s,aI?ay.initialDelay:ay.arrowRepeatFreq);aI=false};s();aM=aN?"mouseout.jsp":"mouseup.jsp";aN=aN||b("html");aN.bind(aM,function(){aO.removeClass("jspActive");aJ&&clearTimeout(aJ);aJ=null;aN.unbind(aM)})}function q(){x();if(az){ap.bind("mousedown.jsp",function(aN){if(aN.originalTarget===c||aN.originalTarget==aN.currentTarget){var aL=b(this),aO=aL.offset(),aM=aN.pageY-aO.top-I,aJ,aI=true,s=function(){var aR=aL.offset(),aS=aN.pageY-aR.top-B/2,aP=w*ay.scrollPagePercent,aQ=j*aP/(Y-w);if(aM<0){if(I-aQ>aS){P.scrollByY(-aP)}else{U(aS)}}else{if(aM>0){if(I+aQ<aS){P.scrollByY(aP)}else{U(aS)}}else{aK();return}}aJ=setTimeout(s,aI?ay.initialDelay:ay.trackClickRepeatFreq);aI=false},aK=function(){aJ&&clearTimeout(aJ);aJ=null;b(document).unbind("mouseup.jsp",aK)};s();b(document).bind("mouseup.jsp",aK);return false}})}if(aE){G.bind("mousedown.jsp",function(aN){if(aN.originalTarget===c||aN.originalTarget==aN.currentTarget){var aL=b(this),aO=aL.offset(),aM=aN.pageX-aO.left-Z,aJ,aI=true,s=function(){var aR=aL.offset(),aS=aN.pageX-aR.left-at/2,aP=aj*ay.scrollPagePercent,aQ=k*aP/(S-aj);if(aM<0){if(Z-aQ>aS){P.scrollByX(-aP)}else{V(aS)}}else{if(aM>0){if(Z+aQ<aS){P.scrollByX(aP)}else{V(aS)}}else{aK();return}}aJ=setTimeout(s,aI?ay.initialDelay:ay.trackClickRepeatFreq);aI=false},aK=function(){aJ&&clearTimeout(aJ);aJ=null;b(document).unbind("mouseup.jsp",aK)};s();b(document).bind("mouseup.jsp",aK);return false}})}}function x(){if(G){G.unbind("mousedown.jsp")}if(ap){ap.unbind("mousedown.jsp")}}function aw(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(au){au.removeClass("jspActive")}if(i){i.removeClass("jspActive")}}function U(s,aI){if(!az){return}if(s<0){s=0}else{if(s>j){s=j}}if(aI===c){aI=ay.animateScroll}if(aI){P.animate(au,"top",s,ac)}else{au.css("top",s);ac(s)}}function ac(aI){if(aI===c){aI=au.position().top}al.scrollTop(0);I=aI;var aL=I===0,aJ=I==j,aK=aI/j,s=-aK*(Y-w);if(ai!=aL||aG!=aJ){ai=aL;aG=aJ;D.trigger("jsp-arrow-change",[ai,aG,O,l])}v(aL,aJ);X.css("top",s);D.trigger("jsp-scroll-y",[-s,aL,aJ]).trigger("scroll")}function V(aI,s){if(!aE){return}if(aI<0){aI=0}else{if(aI>k){aI=k}}if(s===c){s=ay.animateScroll}if(s){P.animate(i,"left",aI,ad)}else{i.css("left",aI);ad(aI)}}function ad(aI){if(aI===c){aI=i.position().left}al.scrollTop(0);Z=aI;var aL=Z===0,aK=Z==k,aJ=aI/k,s=-aJ*(S-aj);if(O!=aL||l!=aK){O=aL;l=aK;D.trigger("jsp-arrow-change",[ai,aG,O,l])}t(aL,aK);X.css("left",s);D.trigger("jsp-scroll-x",[-s,aL,aK]).trigger("scroll")}function v(aI,s){if(ay.showArrows){aq[aI?"addClass":"removeClass"]("jspDisabled");ae[s?"addClass":"removeClass"]("jspDisabled")}}function t(aI,s){if(ay.showArrows){ax[aI?"addClass":"removeClass"]("jspDisabled");y[s?"addClass":"removeClass"]("jspDisabled")}}function L(s,aI){var aJ=s/(Y-w);U(aJ*j,aI)}function M(aI,s){var aJ=aI/(S-aj);V(aJ*k,s)}function aa(aU,aP,aJ){var aN,aK,aL,s=0,aT=0,aI,aO,aR,aQ,aS;try{aN=b(aU)}catch(aM){return}aK=aN.outerHeight();aL=aN.outerWidth();al.scrollTop(0);al.scrollLeft(0);while(!aN.is(".jspPane")){s+=aN.position().top;aT+=aN.position().left;aN=aN.offsetParent();if(/^body|html$/i.test(aN[0].nodeName)){return}}aI=aA();aO=aI+w;if(s<aI||aP){aQ=s-ay.verticalGutter}else{if(s+aK>aO){aQ=s-w+aK+ay.verticalGutter}}if(aQ){L(aQ,aJ)}viewportLeft=aC();aR=viewportLeft+aj;if(aT<viewportLeft||aP){aS=aT-ay.horizontalGutter}else{if(aT+aL>aR){aS=aT-aj+aL+ay.horizontalGutter}}if(aS){M(aS,aJ)}}function aC(){return-X.position().left}function aA(){return-X.position().top}function af(){al.unbind(ab).bind(ab,function(aL,aM,aK,aI){var aJ=Z,s=I;P.scrollBy(aK*ay.mouseWheelSpeed,-aI*ay.mouseWheelSpeed,false);return aJ==Z&&s==I})}function o(){al.unbind(ab)}function aB(){return false}function J(){X.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){aa(s.target,false)})}function E(){X.find(":input,a").unbind("focus.jsp")}function R(){var s,aI;X.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aM){if(aM.target!==this){return}var aL=Z,aK=I;switch(aM.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aM.keyCode;aJ();break;case 35:L(Y-w);s=null;break;case 36:L(0);s=null;break}aI=aM.keyCode==s&&aL!=Z||aK!=I;return!aI}).bind("keypress.jsp",function(aK){if(aK.keyCode==s){aJ()}return!aI});if(ay.hideFocus){D.css("outline","none");if("hideFocus"in al[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus"in al[0]){D.attr("hideFocus",false)}}function aJ(){var aL=Z,aK=I;switch(s){case 40:P.scrollByY(ay.keyboardSpeed,false);break;case 38:P.scrollByY(-ay.keyboardSpeed,false);break;case 34:case 32:P.scrollByY(w*ay.scrollPagePercent,false);break;case 33:P.scrollByY(-w*ay.scrollPagePercent,false);break;case 39:P.scrollByX(ay.keyboardSpeed,false);break;case 37:P.scrollByX(-ay.keyboardSpeed,false);break}aI=aL!=Z||aK!=I;return aI}}function Q(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aJ,aI;try{aJ=b(location.hash)}catch(s){return}if(aJ.length&&X.find(location.hash)){if(al.scrollTop()===0){aI=setInterval(function(){if(al.scrollTop()>0){aa(location.hash,true);b(document).scrollTop(al.position().top);clearInterval(aI)}},50)}else{aa(location.hash,true);b(document).scrollTop(al.position().top)}}}}function ah(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function n(){ah();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aI;if(s.length>1){aI=s[1];if(aI.length>0&&X.find("#"+aI).length>0){aa("#"+aI,true);return false}}})}function an(){var aJ,aI,aL,aK,aM,s=false;al.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aN){var aO=aN.originalEvent.touches[0];aJ=aC();aI=aA();aL=aO.pageX;aK=aO.pageY;aM=false;s=true}).bind("touchmove.jsp",function(aQ){if(!s){return}var aP=aQ.originalEvent.touches[0],aO=Z,aN=I;P.scrollTo(aJ+aL-aP.pageX,aI+aK-aP.pageY);aM=aM||Math.abs(aL-aP.pageX)>5||Math.abs(aK-aP.pageY)>5;return aO==Z&&aN==I}).bind("touchend.jsp",function(aN){s=false}).bind("click.jsp-touchclick",function(aN){if(aM){aM=false;return false}})}function h(){var s=aA(),aI=aC();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ao.append(X.children()));ao.scrollTop(s);ao.scrollLeft(aI)}b.extend(P,{reinitialise:function(aI){aI=b.extend({},ay,aI);ar(aI)},scrollToElement:function(aJ,aI,s){aa(aJ,aI,s)},scrollTo:function(aJ,s,aI){M(aJ,aI);L(s,aI)},scrollToX:function(aI,s){M(aI,s)},scrollToY:function(s,aI){L(s,aI)},scrollToPercentX:function(aI,s){M(aI*(S-aj),s)},scrollToPercentY:function(aI,s){L(aI*(Y-w),s)},scrollBy:function(aI,s,aJ){P.scrollByX(aI,aJ);P.scrollByY(s,aJ)},scrollByX:function(s,aJ){var aI=aC()+s,aK=aI/(S-aj);V(aK*k,aJ)},scrollByY:function(s,aJ){var aI=aA()+s,aK=aI/(Y-w);U(aK*j,aJ)},positionDragX:function(s,aI){V(s,aI)},positionDragY:function(aI,s){V(aI,s)},animate:function(aI,aL,s,aK){var aJ={};aJ[aL]=s;aI.animate(aJ,{duration:ay.animateDuration,ease:ay.animateEase,queue:false,step:aK})},getContentPositionX:function(){return aC()},getContentPositionY:function(){return aA()},getContentWidth:function(){return S()},getContentHeight:function(){return Y()},getPercentScrolledX:function(){return aC()/(S-aj)},getPercentScrolledY:function(){return aA()/(Y-w)},getIsScrollableH:function(){return aE},getIsScrollableV:function(){return az},getContentPane:function(){return X},scrollToBottom:function(s){U(j,s)},hijackInternalLinks:function(){n()},destroy:function(){h()}});ar(N)}f=b.extend({},b.fn.jScrollPane.defaults,f);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){f[this]=f[this]||f.speed});var e;this.each(function(){var g=b(this),h=g.data("jsp");if(h){h.reinitialise(f)}else{h=new d(g,f);g.data("jsp",h)}e=e?e.add(g):g});return e};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);;$(function(){$.ajaxSetup({cache:true,type:'GET',dataType:'html',error:function(xhr){$("body").children(":last").after('<div class="ajaxError" style="display:none;">AJAX ERROR:<b>'+xhr.status+": "+xhr.statusText+"</b><br/><br/>"+xhr.responseText.replace("<!--","").replace("-->","")+"<br/><br/>&nbsp;</div>");}});$("input.helpInput").each(function(){var $helpInput=$(this);var defaultVal=$helpInput.attr("title");if($helpInput.val()=="")
$helpInput.val(defaultVal);$helpInput.focus(function(){if(this.value==defaultVal)
this.value="";else
$(this).select();}).blur(function(){if(jQuery.trim(this.value)=="")
this.value=defaultVal;});$(this).parents("form").find("input[type=submit]").click(function(){if($helpInput.val()==defaultVal)
$helpInput.val("");});});$(".shortlist").live("click",function(){var listingID=new Number($(this).parents("li[listingID]:first").attr("listingID"));shortList().toggleShortListItem(this,listingID);return false;});shortList().updateAll();$("a.popuphelp").fancybox();});function now(){return+new Date;};function shortList(){var self={toggleShortListItem:function(elem,listingId){var action=$(elem).hasClass("inshortlist")?"remove":"add";$.post("/MyAccount/UpdateShortList/",{listingId:listingId,action:action},self._toggleShortListItem);},_toggleShortListItem:function(data){self._updateCount(data);self.update();},update:function(){var shortListArr=self._getShortListArray();$(".shortlist").each(function(){var curr$=$(this);var listingID=new Number(curr$.parents("li[listingID]:first").attr("listingID"));var inShortList=utils.inArray(listingID,shortListArr);if(inShortList){curr$.text(curr$.hasClass("wide")?_resources.shortListRemoveFromWide:_resources.shortListRemoveFrom);}else{curr$.text(_resources.shortListAddTo);}
curr$.toggleClass("inshortlist",inShortList);});},_getShortListArray:function(){var cookie=$.cookie("MyAccount");if(typeof(cookie)=='undefined'||cookie==null)return[];var cookieVal=$.cookieKey(cookie,"ShortList");if(typeof(cookieVal)=='undefined'||cookieVal==null||cookieVal.length==0)return[];return cookieVal.split(",");},updateCount:function(){var count=self._getShortListArray().length;self._updateCount(count);var cookie=$.cookie("MyAccount"),openhomeAlertCount,listingAlertCount;if(!(typeof(cookie)=='undefined'||cookie==null)){openhomeAlertCount=$.cookieKey(cookie,"OAlrtC");listingAlertCount=$.cookieKey(cookie,"LAlrtC");}
self._updateOtherCount($("#accSummary span.openhomeAlertTotal"),openhomeAlertCount);self._updateOtherCount($("#accSummary span.listingAlertTotal"),listingAlertCount);},_updateCount:function(count){if(count>0)
$("#shortlistTotal span").show().find("strong").text(count);else
$("#shortlistTotal span").hide();self._updateOtherCount($("#accSummary span.shortlistTotal"),count);},_updateOtherCount:function(elem$,count){var dis=(count>0)?count:"-";elem$.text(dis);},updateAll:function(){if(typeof($("body").attr("siteguid"))=='undefined'){$(".shortlist").show();self.updateCount();self.update();}},removeFromShortListTable:function($elem,listingId){$elem.find(".saving").show();$elem.fadeOut(500,function(){$elem.remove();});$.post("/MyAccount/UpdateShortList/",{listingId:listingId,action:"remove"},function(){self._removeFromShortListTable($elem)});},_removeFromShortListTable:function($elem){self.updateCount();}};return self;};function createExternalPage(){var self={siteGuid:null,init:function(){self.siteGuid=$("body").attr("siteguid");if(self.siteGuid){$("a[href]").each(function(){var $this=$(this);var href=$this.attr("href");if(href.indexOf("siteguid=")<0&&href!="#"&&href!=""){$this.attr("href",utils.appendParam(href,"siteguid",self.siteGuid));}});}}};self.init();};function createGoogleMapAndStreetView(){var self={createGoogleMapAndStreetViewInit:function(){$("#mapView").click(function(){$("#streetView").addClass("off");$(this).removeClass("off");$("#gmapStreetView").hide();var $gmap=$("#gmap");var map=$gmap.get(0).map;map.setCenter(map.getCenter());$gmap.show();return false;});$("#streetView").click(function(){$("#mapView").addClass("off");$(this).removeClass("off");$("#gmap").hide();$("#gmapStreetView").show();return false;});},configureStreetView:function($li){var $mapView=$("#mapView");var $streetView=$("#streetView");$gmapStreetView=$("#gmapStreetView");var oid=$li.attr("oid");$streetView.attr("oid",oid);var streetViewUrl=$li.attr("streetviewurl");var options={};if(streetViewUrl){options.url=streetViewUrl;}else{options.latlng=utils.getGLatLng($li);}
$mapView.removeClass("off");$streetView.addClass("off")
$gmapStreetView.streetView(options).bind("hasnearbypanoramas",function(){$streetView.show();}).bind("nonearbypanoramas",function(){$streetView.hide();}).bind("error",function(){$streetView.hide();});$gmapStreetView.hide();$("#gmap").show();},getPointByOid:function(oid){var points=googleMapsV3.map.options.points;for(var i=0;i<points.length;i++){if(points[i].oid==oid){return points[i];}}},getOrganisationalUnitGoogleMapInfoWindow:function($li){var oid=$li.attr("oid");$.get("/OrganisationalUnit/GetGoogleMapInfoWindow/"+oid,function(data){var point=self.getPointByOid(oid);point.infoHtml=data;point.marker.infoHtml=data;point.marker.openInfoWindowHtml(data);self.configureStreetView($li);});},openMarkerInfoWindow:function(oid){var point=self.getPointByOid(oid);var infoHtml=$("#officeInfoHtml"+oid).html();if(!infoHtml){return;}
point.infoHtml=infoHtml;point.marker.infoHtml=infoHtml;point.marker.openInfoWindowHtml(infoHtml);},zoomToOffice:function($li){var gLatLng=utils.getGLatLng($li);var zoom=15;var map=googleMapsV3.map;if(map.getZoom()!=zoom){map.setCenter(gLatLng,zoom);}else{map.panTo(gLatLng);}}};self.createGoogleMapAndStreetViewInit();return self;};function createBaseFindOfficeAgent(){var self={createBaseFindOfficeAgentInit:function(){$("#findOffice input[type=text]").keydown(function(e){if(e.keyCode==13){e.stopPropagation();}});},displayPagerValues:function(pagerOptions){if(pagerOptions.totalCount<=1){$("#findPager div").hide();return;}
var top=pagerOptions.pageIndex*pagerOptions.pageSize+pagerOptions.pageSize;if(top>pagerOptions.totalCount){top=pagerOptions.totalCount;}
var $span=$("#findPager span");$span.slice(0,1).html(1);$span.slice(1,2).html(top);$span.slice(2,3).html(pagerOptions.totalCount);$("#findPager div").show();}};self=$.extend(true,self,createGoogleMapAndStreetView());self.createBaseFindOfficeAgentInit();return self;};function createFindAnAgent(){var self={pagerOptions:{pageIndex:0,pageSize:50},createFindAnAgentInit:function(){var HELPER_FADE_IN_SPEED=2000;var pagerOptions=this.pagerOptions;var $resultList=$("#resultList");var divLoadingHtml="<div class='loading'>"+_resources.loadingDotDotDot+"</div>";var divSearchingHtml="<div class='loading'>"+_resources.searchingDotDotDot+"</div>";var helperHtml=$resultList.html();$("#resultList .helper").hide().fadeIn(HELPER_FADE_IN_SPEED);$('#findOffice').ajaxForm({target:"#resultList",success:function(){$(".resultBarLeft>h3").html($("#resultsTotal").html());pagerOptions.totalCount=$("#resultsTotal").attr("totalcount");self.displayPagerValues(pagerOptions);self.loadMap();if(pagerOptions.totalCount==1){setTimeout(function(){self.selectSingle($("#resultList > ul li"),true)},500);}},error:function(data){window.location.href="/Error/";}});$("#btnSearch").click(function(){pagerOptions.pageIndex=0;pagerOptions.searchParameters={agentName:$("input[name=agentName]").val(),locationName:$("input[name=locationName]").val()};$(".resultBarLeft h3").html("");$("#findPager div").hide();if(pagerOptions.searchParameters.agentName==""&&pagerOptions.searchParameters.locationName==""){$resultList.html(helperHtml);$("#resultList .helper").addClass("highlight").show();setTimeout('$("#resultList .helper").removeClass("highlight")',1000);$("input[name=agentName]").focus();return false;}else{$resultList.html(divSearchingHtml).scrollTop(0);}});$resultList.scrollPaging(pagerOptions,function(data){$resultList.append(divLoadingHtml);$.get("/Staff/Search/?pageIndex="+data.pageIndex+"&agentName="+data.searchParameters.agentName+"&locationName="+data.searchParameters.locationName,function(result){$("#resultListHidden").html(result);$resultList.find(".loading").remove();$("#resultList ul").append($("#resultListHidden ul").html());self.displayPagerValues(pagerOptions);});});$("#resultList .agent_info h2").live("click",function(a,b,c){var $li=$(this).parents("li");self.selectSingle($li);$("input[name=agentName]").focus();return false;});$("input[name=agentName]").focus();self.loadMap();},loadMap:function(){var $li=$("#ouList li[lat]");if($li.length<=0){$("#gmap").show().googleMap({});return;}
var points=new Array();$li.each(function(i){var pos=utils.getGLatLng($(this));points[i]={position:pos,oid:$(this).attr("oid")};});$("#streetView").hide();$("#gmapStreetView").hide();setTimeout(function(){$("#gmap").show().googleMap({points:points});self.addMapClickListeners(points);},250);},addMapClickListeners:function(points){for(var i=0;i<points.length;i++){google.maps.event.addListener(points[i].marker,"click",function(){var $this=$("li[oid="+this.oid+"]");if(!this.infoHtml){self.getOrganisationalUnitGoogleMapInfoWindow($this);}
this.openInfoWindowHtml(this.infoHtml);});}},getOrganisationalUnitGoogleMapInfoWindow:function($li){var oid=$li.attr("oid");$.get("/OrganisationalUnit/GetGoogleMapInfoWindow/"+oid,function(data){var point=self.getPointByOid(oid);point.infoHtml=data;point.marker.infoHtml=data;point.marker.openInfoWindowHtml(data);self.configureStreetView($li);});},openMarkerInfoWindow:function(oid){var point=self.getPointByOid(oid);var infoHtml=$("#officeInfoHtml"+oid).html();if(!infoHtml){return;}
point.infoHtml=infoHtml;point.marker.infoHtml=infoHtml;point.marker.openInfoWindowHtml(infoHtml);},selectSingle:function($li){var ouid=$li.attr("ouid");var $ouli=$("#ouList li[oid="+ouid+"]");self.zoomToOffice($ouli);var ouli=$ouli.get(0);if(!ouli.infoHtml){var $officeInfoHtml=$("#officeInfoHtml"+ouid);if($officeInfoHtml.length==1){ouli.infoHtml=$officeInfoHtml.html();}}
if(!ouli.infoHtml){self.getOrganisationalUnitGoogleMapInfoWindow($ouli);}else{self.openMarkerInfoWindow($ouli.attr("oid"));}
self.configureStreetView($ouli);}};self=$.extend(true,self,createBaseFindOfficeAgent());self.createFindAnAgentInit();return self;};function createFindAnOffice(){var self={createFindAnOfficeInit:function(){var divSearchingHtml="<div class='loading'>"+_resources.searchingDotDotDot+"</div>";$('#findOffice').ajaxForm({target:"#resultList",success:function(){self.loadList();self.loadMap();},error:function(data){window.location.href="/Error/";}});$("#btnSearch").click(function(){$(".resultBarLeft h3").html("");$("#resultList").html(divSearchingHtml);});self.loadList();self.loadMap();},loadList:function(){var $li=$("#resultList li[lat]");$("#resultList li[lat] > h2 a").each(function(){$(this).removeAttr("href");}).click(function(){self.selectSingle($(this).parents("li"));$("input[name=officeName]").focus();});$(".resultBarLeft>h3").html($("#resultsTotal").html());if($li.length==1){setTimeout(function(){self.selectSingle($li,true)},500);}
$("input[name=officeName]").focus();},loadMap:function(){var $li=$("#resultList li[lat]");points=new Array();$li.each(function(i){points[i]=utils.getGLatLng($(this));points[i].oid=$(this).attr("oid");});$("#streetView").hide();$("#gmapStreetView").hide();setTimeout(function(){$("#gmap").show().googleMap({points:points});self.addMapClickListeners(points);},250);},addMapClickListeners:function(points){for(var i=0;i<points.length;i++){google.maps.event.addListener(points[i].marker,"click",function(){var $this=$("li[oid="+this.oid+"]");if(!this.infoHtml){self.getOrganisationalUnitGoogleMapInfoWindow($this);}
this.openInfoWindowHtml(this.infoHtml);});}},selectSingle:function($li,forceExpand){var $div=$li.children("div:first");if($div.length==0){$li.append("<div></div>");$div=$li.children("div:first");}
self.zoomToOffice($li);self.openMarkerInfoWindow($li.attr("oid"));if($div.children().length<=0){$div.load("/OrganisationalUnit/GetOfficeAndStaffDetails/"+$li.attr("oid"),function(){var $liNew=$(this).parent("li");self.openMarkerInfoWindow($liNew.attr("oid"));$liNew.addClass("expanded");$liNew.children("div:first").show();self.configureStreetView($liNew);});}else if(!forceExpand){if($li.hasClass("expanded")){$div.hide();$li.removeClass("expanded");}else{$div.show();$li.addClass("expanded");}}
self.configureStreetView($li);}};self=$.extend(true,self,createBaseFindOfficeAgent());self.createFindAnOfficeInit();return self;};function createBaseViewOfficeAgent(){var self={createBaseViewOfficeAgentInit:function(){var $li=$("#office_agent_tabs li");$li.htabs($(".office_agent_content > div"),"tabActive");if($("#office_agent_tabs li.tabActive .tabLocation").length==1){self.initMapAndEnquiries();}else{$li.find(".tabLocation").parent().one("tabChange",self.initMapAndEnquiries);}},initMapAndEnquiries:function(){var $gmap=$(".gmap");var point=utils.getGLatLng($gmap);point.oid=$gmap.attr("oid");$gmap.googleMap({points:[point],mapzoom:15});google.maps.event.addListener(point.marker,"click",function(){if(!this.infoHtml){$.get("/OrganisationalUnit/GetGoogleMapInfoWindow/"+point.oid,function(data){point.infoHtml=data;point.marker.infoHtml=data;point.marker.openInfoWindowHtml(data);});}});self.configureStreetView($gmap);$("#formEnquiry").harcourtsForm({url:"/OrganisationalUnit/Enquiry",namePrefix:"enq"});officeMapDone=true;}};self=$.extend(true,self,createGoogleMapAndStreetView());self.createBaseViewOfficeAgentInit();return self;};function createFavouriteSearchesList(obj){var self={$editIntervalDiv:null,maximumAlerts:3,savingCount:0,defaultIntervalID:6,favouriteSearchBaseUrl:null,favouriteSearches:[],intervals:[],isSmsSupported:true,addAlert:function($div,alert){if(!alert){var defaultInterval=utils.getByID(self.intervals,self.defaultIntervalID);alert={id:null,isOpenHomeAlert:false,dayOfWeek:defaultInterval.dayOfWeek,daysInterval:defaultInterval.daysInterval,typeID:1};}
var $ul=$div.find(".alerts ul");var html='<li><select class="type"><option value="1">'+
_resources.favouriteSearchEmail+'</option>';if(self.isSmsSupported){html+='<option value="2">'+
_resources.favouriteSearchSms+'</option>';}
html+='</select><select class="style"><option value="all">'+
_resources.favouriteSearchAllProperties+'</option>';if(!$(".naiHarcourts").length&&$("a[id$=openhome]").length)
html+='<option value="openhomes">'+
_resources.favouriteSearchOpenHomes+'</option>';html+='</select><select class="interval">';var interval;for(var i=0;i<self.intervals.length;i++){html+='<option value="'+self.intervals[i].id+'">'+
self.intervals[i].name+'</option>';if(alert.dayOfWeek==self.intervals[i].dayOfWeek&&alert.daysInterval==self.intervals[i].daysInterval){interval=self.intervals[i];}}
html+='</select><a class="removeAlert" href="#"></a></li>';$li=$(html);$ul.append($li);if(alert.id!=null){$li.attr("oid",alert.id);}
$li.find("select.type").val(alert.typeID);$li.find("select.style").val(alert.isOpenHomeAlert?"openhomes":"all");$li.find("select.interval").val(interval.id);$li.find("a").html(_resources.favouriteSearchRemove);if($ul.find("li").length>=self.maximumAlerts){$div.find(".alerts a.add").hide();}
if(alert.id==null){self.saveAlert($li);}
$li.find(".removeAlert").click(function(){var $li=$(this).parents("li");self.removeAlert($li);return false;});$li.find("select").change(function(){var $li=$(this).parents("li");self.saveAlert($li);return false;});return;},buildList:function(){for(var i=0;i<self.favouriteSearches.length;i++){var s=self.favouriteSearches[i];var $div=$('<div class="search">'+'<div class="saving"></div>'+'<h3><a href="#"></a></h3><div class="desc"></div><div class="alerts"><ul></ul></div>'+'<div class="remove"><a href="#"></a></div></div>');$(".favouriteSearches").append($div);$div.attr("oid",s.id);$div.find(".saving").html(_resources.savingDotDotDot).hide();$div.find("h3 a").attr("href",self.favouriteSearchBaseUrl+"/"+s.id).html(s.name);$div.find(".desc").html(s.description);$div.find(".remove a").html(_resources.favouriteSearchRemove);for(var j=0;j<s.alerts.length;j++){self.addAlert($div,s.alerts[j]);}
$div.find(".alerts").append('<a class="add" href="#">'+
_resources.favouriteSearchesAddAnAlert+'</a>');if(s.alerts.length>=self.maximumAlerts){$div.find(".alerts a.add").hide();}}
self.setAlternateClass();},init:function(){self.buildList();$(".favouriteSearches .search .add").click(function(){var $div=$(this).parents("div[oid]");self.addAlert($div);return false;});$(".favouriteSearches .search .remove a").click(function(){var $this=$(this);var $div=$this.parents("div[oid]");self.showSaving($div);var $totalSummary=$(".totalSummary");var totalCount=$totalSummary.attr("totalcount");$.post("/MyAccount/DeleteFavouriteSearch",{id:$div.attr("oid"),listingSearchType:$(".favouriteSearches").attr("listingsearchtype"),currentTotalCount:totalCount},function(data){$totalSummary.attr("totalcount",totalCount-1).html(data);shortList().updateCount();},"html");$div.fadeOut(1000,function(){$div.remove();self.setAlternateClass();});return false;});},removeAlert:function($li){var $div=$li.parents("div[oid]");var oid=$li.attr("oid");if(!oid){return;}
$li.attr("oid","");self.showSaving($div);var command={alertId:oid,isOpenHomeAlert:$li.find("select.style").val()=="openhomes"};$.post("/MyAccount/DeleteFavouriteSearchAlert/",command,shortList().updateCount);$li.fadeOut(500,function(){$div.find(".add").show();$li.remove();});},saveAlert:function($li){var $div=$li.parents("div[oid]");self.showSaving($div);var interval=utils.getByID(self.intervals,$li.find("select.interval").val());var alert={id:$li.attr("oid"),searchID:$div.attr("oid"),typeID:$li.find("select.type").val(),isOpenHomeAlert:$li.find("select.style").val()=="openhomes",daysInterval:interval.daysInterval,dayOfWeek:interval.dayOfWeek};$.post("/MyAccount/UpdateFavouriteSearchAlert",alert,function(id){$li.attr("oid",id);shortList().updateCount();},"html");},setAlternateClass:function(){$(".favouriteSearches>div:nth-child(even)").addClass("alt");$(".favouriteSearches>div:nth-child(odd)").removeClass("alt");},showSaving:function($div){self.savingCount++;var count=self.savingCount;$div.find(".saving").stop(true,true).attr("savingCount",count).show();setTimeout('$(".favouriteSearches .search .saving[savingCount='+
count+']").fadeOut(500)',1000);}};$.extend(true,self,obj);self.init();return self;};function createViewAgent(){var self={createViewAgentInit:function(){}};self=$.extend(true,self,createBaseViewOfficeAgent());self.createViewAgentInit();return self;};function createViewOffice(){var self={createViewOfficeInit:function(){if($("#ourListings").children().length>0){$("#office_agent_tabs li:has(a.tabListings)").click();}else{$(".tabListings").one("click mouseover",self.loadListings);}
$("#officeTabs li").htabs($(".staffResults > ul"),"active");},loadListings:function(){var url=$(this).attr("href");$(this).removeAttr("href");if($(".ourListings").children().length>0){return false;}
$("#ourListings").load(url);},loadStaff:function(){var idx=0;var $tab;if($(this).attr("stafftype")){idx=$("#officeTabs > li > a").index(this);$tab=$(this);}else{$tab=$("#officeTabs > li > a:first");}
var $ulToLoad=$($(".staffResults > ul").get(idx));if($ulToLoad.children().length==0&&$ulToLoad.attr("loading")!="true"){$ulToLoad.attr("loading","true");$ulToLoad.load($tab.attr("href"),function(){$ulToLoad.removeAttr("loading");});}}};self=$.extend(true,self,createBaseViewOfficeAgent());self.createViewOfficeInit();return self;};var homePage={loadFeatures:function(){homePage._currentlySelected=0;$("#featured .featProperties li").each(function(i){$(this).bind('click',i,homePage.selectFeatureListing);});$("#featured .featProperties li a").removeAttr('href');$("#featured .featImg").css('background-color','black');homePage.initAutoPlay();$("#featured").hover(homePage.pauseAutoPlay,homePage.initAutoPlay);homePage.initSubfeatCarousel();},initAutoPlay:function(){if(typeof homePage._autoPlayInterval!='undefined'&&homePage._autoPlayInterval!=0)
clearInterval(homePage._autoPlayInterval);homePage._autoPlayMax=$("#featured .featProperties li").length;if(homePage._autoPlayMax<=1)
return;homePage._autoPlayInterval=setInterval("homePage.autoPlay()",7000);},initSubfeatCarousel:function(){var $container=$("#home_subFeatures");var length=$container.find(".subBoxes li").length;if(length>4){$container.jCarouselLite({btnNext:"#home_subFeatures #scrollRight",btnPrev:"#home_subFeatures #scrollLeft",vertical:false,visible:4,mouseWheel:false,auto:10000,speed:500,mouseWheel:true,stopOnHover:true});}},pauseAutoPlay:function(){clearInterval(homePage._autoPlayInterval);homePage._autoPlayInterval=0;},autoPlay:function(){var next=homePage._currentlySelected+1;if(next>=homePage._autoPlayMax)
next=0;homePage.selectFeatureListing({data:next});},animateLeft:function(current,next){var width=417;var duration=400;var $current;var $next;$("#featured .featImg a").each(function(i){if(i==current){$current=$(this);}else if(i==next){$next=$(this);}});$next.css("left",width+"px");$next.animate({"left":"0px"},duration,"swing");$current.animate({"left":-width+"px"},duration,"swing");},selectFeatureListing:function(eventObject){var id=eventObject.data;if(homePage._currentlySelected===id)
return;$("#featured .featProperties li").each(function(i){$(this).toggleClass('selectedFeature',i==id);});homePage.animateLeft(homePage._currentlySelected,id);homePage._currentlySelected=id;}};var listing_ListingSearchResultsGallery={init:function(){$("#galleryView .imgViewer").each(function(){var listingID=new Number($(this).parents("li[listingID]:first").attr("listingID"));var images=null;var imagesLoading=false;var index=0;var maxIndex=new Number($(this).find(".viewCount span").text())-1;var $img=$(this).prev();var $viewIndex=$(this).find(".viewCount strong");var showNextImage=false;var showImage=function(){$img.fadeOut("fast",function(){$(this).css("background-image","url("+images[index].src+")");$(this).fadeIn("fast");$viewIndex.text(index+1);showNextImage=false;});};if(maxIndex<=0){$(this).find("a.btn").hide();return;}
$(this).mouseover(function(){if(!images&&!imagesLoading){imagesLoading=true;$.getJSON("/Listing/Thumbnails/"+listingID,function(results){images=new Array();$.each(results,function(i,result){images[i]=new Image();if(result==""){images[i].src="/Images/missing-thumbnail.gif";}else{images[i].src=_resources.photoAccessUrl+result;}});if(showNextImage){$img.find(".loading").remove();showImage();}});}});var clicked=false;$(this).find("a.btn").click(function(){if(!clicked){clicked=true;$.post("/ListingHit/IncrementListingHit/"+listingID);}
if(images||index==0){index=index+($(this).parent().hasClass("viewR")?1:-1);if(index<0){index=maxIndex;}else if(index>maxIndex){index=0;}}
if(images){showImage();}else{$(this).parent().parent().prev().append("<div class='loading' style='background:white;font-size:10px;line-height:16px;margin-top:168px;position:absolute;padding:0 5px 0 5px;'>loading...</div>");showNextImage=true;}});});}};var listing_View={_carouselIndex:0,init:function(){this.initImageCarousel("photoBrowse","photoIndex");$(".fancybox").fancybox({'frameWidth':640,'frameHeight':480,'showNavArrows':false,'titlePosition':'over','cyclic':true,'titleFormat':listing_View.formatTitle,'onComplete':listing_View._fancyOnLoadComplete,'onClosed':listing_View._fancyOnClosed,'onStart':listing_View._fancyOnStart});$(".basicFancybox").fancybox({'frameWidth':640,'frameHeight':480,'titleShow':false});$(".popupWin").click(function(){utils.popupWin({href:$(this).attr("href"),name:"virtualTour",width:800,height:480,scrollbars:true,resizable:true,status:false});return false;});$("#mediaOptions a.btn").each(function(){if($(this).hasClass("disabled")){return;}
var $li=$(this).parent();if($li.hasClass("view_map")||$li.hasClass("view_photo")){$(this).click(function(){$("#mediaContainer > div").hide();$("#mediaOptions a.btn").removeClass("active");$(".mediaInfo div").hide();$(this).addClass("active");if($li.hasClass("view_map")){var zoom=$(this).attr("zoom");var points=new Array();points[0]={position:utils.getGLatLng($(this))};$("#mapView").removeClass("hidden").show();$("div.mediaInfo .mapIcon").show();$("#map").googleMap({points:points,mapzoom:parseInt(zoom),allowSearch:false});}else if($li.hasClass("view_photo")){$("div.mediaInfo .photoIcon").show();$("#mediaContainer #photoBrowse").show();}});}});$("#formEnquiry").harcourtsForm({url:"/OrganisationalUnit/Enquiry",namePrefix:"enq"});$("a.print").click(function(){if(top!=self){for(var i=0;i<top.frames.length;i++){var frame=top.frames[i];if(frame==self){frame.focus();frame.print();}}}else{window.print();}
return false;});$(".contactAgentBtn a.btn").click(function(){setTimeout('$("#formEnquiry input[name=name]").select().focus()',100);});$("#fancy-auto-play").live("click",function(){listing_View.autoPlayStart(1000);$("#fancy-auto-play").hide();$("#fancy-auto-pause").show();return false;});$("#fancy-auto-pause").live("click",function(){listing_View.autoPlayPause();$("#fancy-auto-play").show();$("#fancy-auto-pause").hide();return false;});},initImageCarousel:function(containerElID,indexElID){var $container=$("#"+containerElID);var $index=$("#"+indexElID);$("#photoBrowse").hover(function(){$("#photozoom").fadeTo("fast",1.0);},function(){$("#photozoom").fadeTo("fast",0.7);});$("#photozoom").click(function(){listing_View.selectCurrentCarousel(containerElID);});var currentIndex=0;var $photos=$(".photoLrge a");$container.find(".imgScrollList div").each(function(i){var $img=$($photos.get(i));if(i>0){$img.css("background-image","url("+$(this).attr("largeUrl")+")").hide();}else{$img.css("list-style-image","url("+$(this).attr("largeUrl")+")");}
$(this).attr("index",i);});if($container.find(".imgScrollList ul li").length>3){$container.find(".imgScrollList").jCarouselLite({btnNext:"#"+containerElID+" .imgScroll_down .btn",btnPrev:"#"+containerElID+" .imgScroll_up .btn",vertical:true,visible:3,mouseWheel:false,beforeStart:listing_View._imageScrollList_beforeStart,afterEnd:listing_View._imageScrollList_AfterEnd});}
if($container.find(".imgScrollList div").length>1){var $lastSelectedScroller=$container.find(".imgScrollList div[index=0]").eq(0);$lastSelectedScroller.addClass("selected");$container.find(".imgScrollList div").click(function(){$this=$(this);var index=Number($this.attr("index"));if(index==currentIndex)
return;$index.html(""+(index+1));var newphoto=$photos.get(index);var oldphoto=$photos.get(currentIndex);$(oldphoto).stop(false,true).fadeOut("fast",function(){$(newphoto).removeClass("hidden").fadeIn("fast").css("display","block")});$this.addClass('selected');if($lastSelectedScroller)
$lastSelectedScroller.removeClass('selected');currentIndex=index;$lastSelectedScroller=$this;}).mouseover(function(){var index=new Number($(this).attr("index"));$index.html(""+(index+1));}).mouseout(function(){$index.html(""+(currentIndex+1));});}},selectCurrentCarousel:function(containerElID){$("#"+containerElID).find("a.fancybox:visible:first").trigger("click");},inArray:function(elem,array){var _html=elem.html().replace(/ jQuery\d+="(?:\d+|null)"/g,"");for(var i=0,length=array.length;i<length;i++){var _arrHtml=array[i].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,"");if(_arrHtml===_html){return i;}}
return-1;},_imageScrollList_beforeStart:function($items){listing_View._carouselIndex=listing_View.inArray($items.find('div.selected').parent('li'),$items);},_imageScrollList_AfterEnd:function($newItems,dir){$newItems.eq(listing_View._carouselIndex).children("div").trigger("click");},formatTitle:function(title,currentArray,currentIndex,currentOpts){var buttons='';if(currentArray.length>1){var isPlaying=listing_View._getIsAutoPlay();buttons='<li class="navLeft"><a onclick="$.fancybox.prev();" class="btn">Left</a></li>'
+'<li class="navRight"><a onclick="$.fancybox.next();" class="btn">Right</a></li>'
+'<li class="navPlay"><a id="fancy-auto-play" class="btn" href="#"'+(isPlaying?' style="display:none;"':'')+'>Play</a></li>'
+'<li class="navPause"><a id="fancy-auto-pause" class="btn" href="#"'+(isPlaying?'':' style="display:none;"')+'>Pause</a></li>'}
var div='<div id="fancybox-title-over">'
+'<div class="imageXY">'
+'Photo: '+(currentIndex+1)+' of '+currentArray.length
+'</div>'
+'<div id="fancy-player"><ul>'
+buttons
+'</ul></div>'
+'<div class="imageCaption">'
+(title&&title.length?$('<div/>').text(title).html():'&nbsp;')
+'</div>'
+'</div>';return div;},autoPlayStart:function(interval){var autoPlay={'timeoutId':0,'isRunning':true,'isFiring':false,'interval':interval};autoPlay.timeoutId=setTimeout(listing_View._autoPlayMoveNext,autoPlay.interval);listing_View.__autoPlayTimer=autoPlay;},autoPlayPause:function(){var autoPlay=listing_View.__autoPlayTimer;if(utils.is(autoPlay)&&autoPlay.isRunning){clearTimeout(autoPlay.timeoutId);autoPlay.timeoutId=0;autoPlay.isRunning=false;}},_autoPlayMoveNext:function(){listing_View.__autoPlayTimer.isFiring=true;$.fancybox.next();},_getIsAutoPlay:function(){var result=utils.is(listing_View.__autoPlayTimer)&&listing_View.__autoPlayTimer.isRunning;return result;},_fancyOnLoadComplete:function(){if(listing_View._getIsAutoPlay())
listing_View.autoPlayStart(3500);},_fancyOnClosed:function(){listing_View.autoPlayPause();},_fancyOnStart:function(){if(listing_View._getIsAutoPlay()){var autoPlay=listing_View.__autoPlayTimer;if(!autoPlay.isFiring){clearTimeout(autoPlay.timeoutId);autoPlay.timeoutId=0;}}}};var listing_SearchForm={initCommon:function(){$("#locations select").change(function(){var selectChanged=this;var selectFirstChild;var selectedIndex=this.selectedIndex;$(this).parent().nextAll().find("select").each(function(i){this.selectedIndex=0;this.disabled=true;$(this).addClass("disabled");if(i==0&&selectedIndex>0){selectFirstChild=this;$.getJSON("/Location/DropDownLocations/"+$(selectChanged).val(),function(results){$(selectFirstChild).find("option:not(:first)").remove();$.each(results,function(i,result){var opt=new Option();opt.text=result.name;opt.value=result.id;selectFirstChild.options[i+1]=opt;});selectFirstChild.disabled=false;$(selectFirstChild).removeClass("disabled");});}});});$("#locations").parents("form").submit(function(){var $selects=$("#locations select");var $location=$("input[name=location]");for(var i=$selects.length-1;i>=0;i--){var select=$selects.get(i);if(select.selectedIndex>0){$location.val($(select).val());return;}}
$location.val("");});$("li[minMaxDropDowns] select").change(function(){var firstIndex;$(this).parents("li[minMaxDropDowns]").children("select").each(function(i){if(i==0){firstIndex=this.selectedIndex;}else if(firstIndex>this.selectedIndex){this.selectedIndex=0;}});});$("#listtype").change(function(){$("#homeFeature form").attr("action",this.value);var selectChanged=this;var selectFirstChild;var selectedIndex=this.selectedIndex;var _listingTypeID=$("#listtype option:selected").attr('data-listingtypeid');var _propertyTypes=$("[name=proptype]");_propertyTypes.addClass("disabled");var _pricing=$("li[minMaxDropDowns] select");_pricing.addClass("disabled");_propertyTypes.each(function(i){this.selectedIndex=0;this.disabled=true;selectFirstChild=this;$.getJSON("/PropertyType/GetPropertyTypesJson/"+_listingTypeID,function(results){$(selectFirstChild).find("option:not(:first)").remove();$.each(results,function(i,result){var opt=new Option();opt.text=result.name;opt.value=result.id;selectFirstChild.options[i+1]=opt;});selectFirstChild.disabled=false;$(selectFirstChild).removeClass("disabled");});});_pricing.each(function(i){this.selectedIndex=0;var selectChanged=this;$.getJSON("/Price/GetPricesJson/"+_listingTypeID,function(results){$(selectChanged).find("option:not(:first)").remove();$.each(results,function(i,result){var opt=new Option();opt.text=result.text;opt.value=result.value;selectChanged.options[i+1]=opt;$(selectChanged).removeClass("disabled");});});});}).trigger("change");},initRentOrSale:function(){$("#rentOrSaleRadios input[type=radio]").change(function(){var rangeString=$(this).val()=="false"?$("#rentPriceRange").val():$("#salePriceRange").val();var items=rangeString.split("~");$("#priceDropDowns select").each(function(){$(this).find("option:not(:first)").remove();for(var i=0;i<items.length;i++){var nameVal=items[i].split('|');this.options[i+1]=new Option(nameVal[1],nameVal[0]);}
var opt0=this.options[0];this.options[this.options.length]=new Option(opt0.value,opt0.text);});});}};var listing_ListingSearchResults={init:function(){var $searchKeyword=$("#searchKeyword");var searchKeyword=jQuery.trim($searchKeyword.val());if(searchKeyword&&searchKeyword!=$searchKeyword.attr("title")){$("body").append('<img src="'+_resources.webSiteRootUrl+'/ListingHit/Metrics/'+
utils.urlEncode(searchKeyword)+'_'+now()+'_statistics" alt="" style="display:none;" />');}
$("#saveSearch a.save").click(function(e){e.preventDefault();var $this=$(this);$this.hide();var $loginMessage=$("#saveSearch .loginMessage");if($loginMessage.html()){$loginMessage.show();var url=utils.getUrlWithoutHost(true);$("#saveSearch .ssLogin,#saveSearch .ssRegister").each(function(){$(this).attr("href",utils.appendParam($(this).attr("href"),"ReturnUrl",url));});return;}
$(".favouriteSearches").html('<div class="savingSearch">'+_resources.savingDotDotDot+"</div>").show();$("#saveSearch").append('<div class="shadowBase">'+'<img alt="" src="/Images/detailMedia-base.png"/></div>');var $search=$("input[name=search]");var isHelperText=false;if($search.val()==$search.attr("title")){$search.val("");isHelperText=true;}
var form=$("form:has(input[name=pageid])").serialize();if(isHelperText){$search.val($search.attr("title"));}
$.post("/MyAccount/SaveFavouriteSearch",form,function(obj){$(".favouriteSearches .savingSearch").remove();createFavouriteSearchesList(obj);$(".favouriteSearches").slideDown("fast");$(".favouriteSearches .search .remove a").click(function(){$(".favouriteSearches").slideUp("fast",function(){$("#saveSearch .shadowBase").remove();$this.show();});});},"json");});$("#pageCount").change(function(e){var find="#pageCount + a:contains("+$(this).val()+")";window.location=$(find).attr('href');e.preventDefault();});var points=new Array();$("#searchResults li[lat]").each(function(i){var lat=new Number($(this).attr("lat"));var lng=new Number($(this).attr("lng"));if(lat!=0||lng!=0){points[points.length]=new google.maps.LatLng(lat,lng);}});$("#listTabs a").click(function(){$("#listTabs li").each(function(){$(this).removeClass("listActive");});$(this).parent().addClass("listActive");if($(this).parent().attr("id")=="map-v"){}});$(".openhomeshort").click(function(){var $openHomeDates=$(this).next();$(this).toggleClass("openhomeshort");$(this).toggleClass("openhomeshortup");$openHomeDates.slideToggle();var loaded=false;if(!loaded){var listingID=$(this).parents("li[listingID]").attr("listingID");$openHomeDates.load("/Listing/GetOpenHomesForListing/"+listingID);loaded=true;}});$(".openhome").click(function(){document.location=$(this).parent().find("a:first").attr('href');});if($("#map-v").hasClass('listActive')){$("#searchResultsMapView").show();$("#searchResultsMapMain").each(function(){var options={points:points,mapzoom:4,allowSearch:true,doSearch:true};googleMapsV3.init(this,options);});}
$("div.listingContent h2").tooltip();dropnav.init();}};var myAccount_EditProfile={init:function(){$("#formEditProfile").harcourtsForm({url:"/MyAccount/EditProfile",namePrefix:"reg",clearFields:false});}};var myAccount_LogOn={init:function(){$("#formLogOn").harcourtsForm({url:"/MyAccount/LogOn",namePrefix:"reg",allowAutoComplete:"true"});}};var myAccount_Register={init:function(){$("#formRegister").harcourtsForm({url:"/MyAccount/Register",namePrefix:"reg",allowAutoComplete:"true"});}};var myAccount_ShortList={init:function(){$("td.shortlistEntry .remove a").live("click",function(){var $parent=$(this).parents("tr[listingID]:first");var listingID=new Number($parent.attr("listingID"));shortList().removeFromShortListTable($parent,listingID);});}};var myAccount_FavouriteSearches={init:function(){$("#alertsteps a").click(function(){$(this).hide();$(".listingAlert-howto").show();});}};var community_Index={init:function(){var $tabs=$('#tabs').tabs();$(".ui-tabs-panel").each(function(i){var totalSize=$(".ui-tabs-panel").size()-1;if(i!=totalSize){next=i+2;$(this).append("<a href='#' class='next-tab mover' rel='"+next+"'>Next Page &#187;</a>");}
if(i!=0){prev=i;$(this).append("<a href='#' class='prev-tab mover' rel='"+prev+"'>&#171; Prev Page</a>");}});$('.next-tab, .prev-tab').click(function(){$tabs.tabs('select',$(this).attr("rel"));return false;});}};var dropnav={init:function(){jQuery.each(["#navPropType > li h3","#navLocation > li h3"],function(idx,query){var $ul=$(query).next();$(query).click(function(){$ul.toggleClass("hover");}).hover(null,function(){if($ul.hasClass("hover"))
$ul.removeClass("hover");});$ul.hover(null,function(){$(this).toggleClass("hover");});});}};var rental_Appraisal_Enquiry={init:function(){$("#formEnquiry").harcourtsForm({url:"/PropertyManagement/FreeRentalAppraisalEnquiry",namePrefix:"reg"});}};var property_management_newsletter_signup={init:function(){$("#formSignup").harcourtsForm({url:"/PropertyManagement/NewsLetterSignup",namePrefix:"reg"});}};$(function(){if($('body.naiHarcourts').length==1){$("ul.dropdown li").hover(function(){$(this).addClass("hover");$('ul:first',this).css('visibility','visible');},function(){$(this).removeClass("hover");$('ul:first',this).css('visibility','hidden');});$("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");$('#tabs').tabs({fx:{opacity:'toggle'}}).tabs('rotate',10000);$('#dialog_link, ul#icons li').hover(function(){$(this).addClass('ui-state-hover');},function(){$(this).removeClass('ui-state-hover');});function rotateNewsItems(){var nextItems=$('ol.rotate li.active + li, ol.rotate:not(:has(li.active + li)) li:first-child');var previousItems=$('ol.rotate li.active');previousItems.removeClass('active');nextItems.addClass('active');var fadeTimeInMillis=800;var inactiveItems=$('ol.rotate li:not(.active)');var itemCount=inactiveItems.length;var currentCount=0;inactiveItems.fadeOut(fadeTimeInMillis,function(){currentCount+=1;if(currentCount==inactiveItems.length){$('ol.rotate li.active').fadeIn(fadeTimeInMillis);}});};setInterval(rotateNewsItems,5000);$('#newsFeed li, #twitterBar li').css('display','block').hide();$('#newsFeed ol, #twitterBar ol').addClass('rotate').hover(function(){$(this).removeClass('rotate');$('li',this).stop(false,true);$('li.active',this).fadeTo(1,1);},function(){$(this).addClass('rotate');});rotateNewsItems();}});$(function(){$.fn.addInputPrefix=function(prefix){this.find("input[type=hidden]").each(function(){var $this=$(this);if($this.attr("id")){$this.attr("id",prefix+"_"+$this.attr("id"));}
if($this.attr("name")){$this.attr("name",prefix+"."+$this.attr("name"));}});return this;};$.fn.ajaxUpdate=function(data){if($.ajaxRedirectResult(data)){return false;}
$(this).html(data).functionName(true);return true;};$.fn.functionName=function(isPostBack){var msg="";var $el=$(this);var $elements=$el.find("[data-functionname]");if($el.attr("data-functionname")){$elements=$elements.add($el);}
$elements.each(function(){var $this=$(this);var fns=$this.attr("data-functionname").split(' ');for(var j=0;j<fns.length;j++){var v=fns[j].split('.');var obj=window;var theObject;var success=true;for(var i=0;i<v.length;i++){if(!obj){success=false;break;}
theObject=obj;obj=obj[v[i]];}
if(typeof obj!=="function"){success=false;}
if(success){obj.apply(theObject,[$this,(isPostBack===true)]);}else{msg+=fns[j]+"\r\n";}}});if(msg!=""){alert("Could not resolve function(s):\r\n\r\n"+msg);}
return this;};$.fn.harcourtsSerialize=function(){var $this=$(this);return $this.find(":visible").add($this.find(":visible > input[type=hidden],.include :input,:input.include")).remove(".exclude").serialize();};$.fn.harcourtsSubmit=function(options){if(typeof options=="String"){options={url:options};}
if(!options){options={};}
return this.each(function(){var $form=$(this);if(!options.url){options.url=$form.attr("action");if(!options.url){options.url=window.location.href}}
var validator;$form.submit(function(){validator.cancelSubmit=true;return true;});validator=$form.validate({submitHandler:function(form){this.settings.cancelSubmit=true;if(!validator.form()){validator.focusInvalid();return false;}
validator.formSubmitted=true;if(options.submitHandler){if(options.presubmit||options.postsubmit){alert("options.presubmit and options.postsubmit are not valid when options.submitHandler is used.");return false;}
options.submitHandler.apply(this,[form]);}else{if(options.presubmit){options.presubmit.apply(this,[form]);}
$.post(options.url,$form.find(":visible").add($form.find(":visible > input[type=hidden]")).remove(".exclude").serialize(),function(data){if($form.ajaxUpdate(data)){if(options.postsubmit){options.postsubmit.apply(this,[form]);}}},"html");}
return false;}});});};$.fn.outerHTML=function(val){if(val){$(val).insertBefore(this);$(this).remove();}
else{return $("<div>").append($(this).clone()).html();}}
$.fn.sid=function(sid){if(!sid){return this.attr("data-sid");}
return this.attr("data-sid",sid);};$.ajaxRedirectResult=function(data){var redirectStartsWith="AjaxRedirectResult:";if(typeof(data)=="string"&&data.startsWith(redirectStartsWith)){window.location=data.substring(redirectStartsWith.length,data.length);return true;}
return false;};$.resource=function(key){return $("[data-resource="+key+"]").attr("data-resourcetext");}
var $body=$("body");$body.functionName();});String.prototype.startsWith=function(t,i){if(!i){return(t==this.substring(0,t.length));}else{return(t.toLowerCase()==this.substring(0,t.length).toLowerCase());}}
String.prototype.endsWith=function(t,i){if(!i){return(t==this.substring(this.length-t.length));}else{return(t.toLowerCase()==this.substring(this.length-t.length).toLowerCase());}}
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
String.prototype.format=function(){var txt=this,i=arguments.length;while(i--){txt=txt.replace(new RegExp('\\{'+i+'\\}','gm'),arguments[i]);}return txt;}
String.prototype.htmlEncode=function(){return $('<div/>').text(this.toString()).html();}
String.prototype.htmlDecode=function(){return $('<div/>').html(this.toString()).text();}
String.prototype.contains=function(t){return this.indexOf(t)>=0;}
String.prototype.replaceAll=function(x,y){return this.split(x).join(y);};String.prototype.toBool=function(){return(/^true$/i).test(this.toLowerCase());};function StringBuilder(value){this.strings=new Array("");this.append(value);}
StringBuilder.prototype.append=function(value){if(value){this.strings.push(value);}}
StringBuilder.prototype.clear=function(){this.strings.length=1;}
StringBuilder.prototype.toString=function(){return this.strings.join("");}
Array.prototype.findPageByID=function(id){for(var i=0;i<this.length;i++){var item=this[i];if(item.id===id){return item;}
if(item.children.length>0){var result=item.children.findPageByID(id);if(result){return result;}}}
return null;};Array.prototype.removePage=function(obj){for(var i=0;i<this.length;i++){var item=this[i];if(item===obj){this.splice(i,1);return true;}
if(item.children.length>0){if(item.children.removePage(obj)===true){return true;}}}
return false;}
Array.prototype.addPage=function(id,obj){for(var i=0;i<this.length;i++){var item=this[i];if(item.id===id){item.children.push(obj);return true;}
if(item.children.length>0){if(item.children.addPage(id,obj)===true){return true;}}}
return false;}
$(function(){if($('body.landmarkHarcourts').length==1){$("#howto").tabs();$(document).ready(function(){$("#linkList").accordion({collapsible:true,autoHeight:false,active:7});$("#postCode").accordion({collapsible:true,autoHeight:false});function megaHoverOver(){$(this).find(".sub").stop().fadeTo('fast',1).show();(function($){jQuery.fn.calcSubWidth=function(){rowWidth=0;$(this).find("ul").each(function(){rowWidth+=$(this).width();});};})(jQuery);if($(this).find(".row").length>0){var biggestRow=0;$(this).find(".row").each(function(){$(this).calcSubWidth();if(rowWidth>biggestRow){biggestRow=rowWidth;}});$(this).find(".sub").css({'width':biggestRow});$(this).find(".row:last").css({'margin':'0'});}else{$(this).calcSubWidth();$(this).find(".sub").css({'width':rowWidth});}}
function megaHoverOut(){$(this).find(".sub").stop().fadeTo('fast',0,function(){$(this).hide();});}
var config={sensitivity:2,interval:100,over:megaHoverOver,timeout:1,out:megaHoverOut};$("#siteSwitcher ul li .sub").css({'opacity':'0'});$("#siteSwitcher ul li").hoverIntent(config);$(".navMainContainer ul li .sub").css({'opacity':'0'});$(".navMainContainer ul li").hoverIntent(config);});$("#quickSearchInput").attr("value","suburb, street, listing #");var text="suburb, street, listing #";$("#quickSearchInput").focus(function(){$(this).addClass("active");if($(this).attr("value")==text)$(this).attr("value","");});$("#quickSearchInput").blur(function(){$(this).removeClass("active");if($(this).attr("value")=="")$(this).attr("value",text);});$(function(){$('.navMainContainer .last, .navMainContainer .first').hover(function(){$(this).children('a').addClass('active');$('.dropdown1').show;},function(){$('.dropdown1').hide;$(this).children('a').removeClass('active');});});$(function(){$('.siteDropLink').hover(function(){$('.siteDropLinkBtn').addClass('active');$('.dropdown1').show;},function(){$('.dropdown1').hide;$('.siteDropLinkBtn').removeClass('active');});});$(function(){$('.scroll-pane').jScrollPane({verticalDragMinHeight:20,verticalDragMaxHeight:52});});$("a.print").click(function(){if(top!=self){for(var i=0;i<top.frames.length;i++){var frame=top.frames[i];if(frame==self){frame.focus();frame.print();}}}else{window.print();}
return false;});}});;var harcourtsPublic={divHelp:null,divHelpTitle:null,divHelpContent:null,lastHelpImage:null,lastHelpAlignment:null,init:function(){var self=this;var $sid3899=$('[data-sid=3899]');$sid3899.mouseover(function(){var $this=$(this);self.lastHelpImage=$this;self.lastHelpAlignment=$this.attr('data-alignment');if(self.divHelp===null){self.createHelpPopup();}
self.populateHelpPopupLoading();self.positionHelpPopup();self.populateHelpPopup($this.attr('data-key'));}).mouseout(function(){self.hideHelpPopup();});},createHelpPopup:function(){var self=this;$('body').append('<div data-sid="3900" class="helpPopup"><div class="helpPopupTitle"></div><div class="helpPopupContent"></div></div>');self.divHelp=$('[data-sid=3900]');self.divHelpTitle=self.divHelp.find('.helpPopupTitle');self.divHelpContent=self.divHelp.find('.helpPopupContent');},populateHelpPopupLoading:function(){var self=this;self.divHelp.width(300);self.divHelp.height();self.divHelpTitle.html($.resource('LoadingDotDotDot'));self.divHelpContent.html('');self.divHelp.css({'display':'block'});},positionHelpPopup:function(){var self=this;self.divHelp.css({'top':'-1024px','left':'-1024px','position':'absolute'});var ib=self.lastHelpImage;var db=self.divHelp;var cb=self.getClientBounds();var x=ib.offset().left+21;var y=ib.offset().top+21;if(self.lastHelpAlignment=='BottomRight'||self.lastHelpAlignment=='TopRight'){if(x+db.width()>cb.width-30){x=cb.width-db.width()-30;}}else{x=ib.offset().left-db.width()-20;if(x<30){x=30;}}
if(self.lastHelpAlignment=='BottomRight'||self.lastHelpAlignment=='BottomLeft'){if(y+db.height()>cb.height){y=ib.offset().top-db.height();}}else{y=ib.offset().top-db.height()-20;if(y<30){y=30;}}
self.divHelp.css({'top':y+'px','left':x+'px'});},populateHelpPopup:function(helpKey){var self=this;$.ajax({type:"get",cache:true,async:true,url:"/WebsiteContent/Help/GetByKey",data:{key:helpKey},dataType:"html",success:function(json){var help=$.parseJSON(json);var title=help.Title;var content=help.Content;var width=300;var height;if(!title){title=$.resource('HelpIconDefaultTitle');}else{if(help.Width){width=help.Width+'px';}
if(help.Height){height=help.Height+'px';}}
if(!content){content=$.resource('HelpIconDefaultContent')+' <small>('+help.Name+')</small>';}
self.divHelp.width(width);self.divHelp.height(height);self.divHelpTitle.html(title);self.divHelpContent.html(content);self.positionHelpPopup();}});},hideHelpPopup:function(){var self=this;self.divHelp.css({'display':'none'});},getClientBounds:function(){var clientWidth;var clientHeight;if($.browser.msie){clientWidth=document.documentElement.clientWidth;clientHeight=document.documentElement.clientHeight;}
else if($.browser.webkit){clientWidth=window.innerWidth;clientHeight=window.innerHeight;}
else if($.browser.opera){clientWidth=Math.min(window.innerWidth,document.body.clientWidth);clientHeight=Math.min(window.innerHeight,document.body.clientHeight);}
else{clientWidth=Math.min(window.innerWidth,document.documentElement.clientWidth);clientHeight=Math.min(window.innerHeight,document.documentElement.clientHeight);}
return{left:0,top:0,width:clientWidth,height:clientHeight}}};;(function($){var scripts=[];function loadScript(url,callback,context){var script=scripts[url]||(scripts[url]={loaded:false,callbacks:[]});if(script.loaded){return callback.apply(context);}
script.callbacks.push({fn:callback,context:context});if(script.callbacks.length==1){$.ajax({type:'GET',url:url,dataType:'script',cache:true,success:function(){script.loaded=true;$.each(script.callbacks,function(){this.fn.apply(this.context);});script.callbacks.length=0;}});}}
$.requireScript=function(url,callback,context,options){if(typeof options==='undefined'&&context&&context.hasOwnProperty('parallel')){options=context;context=window;}
options=$.extend({parallel:true},options);if(!$.isArray(url)){return loadScript(url,callback,context);}
var counter=0;if(options.parallel){return $.each(url,function(){loadScript(this,function(){if(++counter==url.length){callback.apply(context);}});});}
(function(){if(counter==url.length){return callback.apply(context);}
loadScript(url[counter++],arguments.callee);})();};$.requireScript.registerLoaded=function(url){$.each($.makeArray(url),function(){(scripts[url]||(scripts[url]={})).loaded=true;});};})(jQuery);;(function($){$.extend($.support,{placeholder:!!('placeholder'in document.createElement('input'))});$.fn.addPlaceholder=function(options){var settings={'class':'placeholder','allowspaces':false,'dopass':true,'dotextarea':true,'checkafill':false};return this.each(function(){if($.support.placeholder)return false;$.extend(settings,options);if(!(this.tagName.toLowerCase()=='input'||(settings['dotextarea']&&this.tagName.toLowerCase()=='textarea')))return true;var $this=$(this),ph=this.getAttribute('placeholder'),ispass=$this.is('input[type=password]');if(!ph)return true;if(settings['dopass']&&ispass){passPlacehold($this,ph);}
else if(!ispass){inputPlacehold($this,ph)}});function inputPlacehold(el,ph){if(valueEmpty(el.val())||el.val()==ph){el.val(ph);el.addClass(settings['class']);}
el.focusin(function(){if(el.hasClass(settings['class'])){el.removeClass(settings['class']);el.val('');}});el.focusout(function(){if(valueEmpty(el.val())){el.val(ph);el.addClass(settings['class']);}});}
function passPlacehold(el,ph){el.addClass(settings['class']);var span=$('<span/>',{'class':el.attr('class')+' '+settings['class'],text:ph,css:{border:'none',cursor:'text',background:'transparent',position:'absolute',top:el.position().top,left:el.position().left,lineHeight:el.height()+3+'px',paddingLeft:parseFloat(el.css('paddingLeft'))+2+'px'}}).insertAfter(el);el.focusin(function(){if(el.hasClass(settings['class'])){span.hide();el.removeClass(settings['class']);}});el.focusout(function(){if(valueEmpty(el.val())){span.show();el.addClass(settings['class']);}});if(settings['checkafill']){(function checkPass(){if(!valueEmpty(el.val())&&el.hasClass(settings['class'])){el.focusin();}
setTimeout(checkPass,250);})();}}
function valueEmpty(value){return settings['allowspaces']?value==='':$.trim(value)==='';}};})(jQuery);;(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}
var validator=$.data(this[0],'validator');if(validator){return validator;}
validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}
this.submit(function(event){if(validator.settings.debug)
event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}
validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}
return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(!element){return;}
if(command){var validator=$.data(element.form,'validator');if(!validator){return;}
var settings=validator.settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)
settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}
var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}
return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)
return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!=Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)
this.element(element);else if(element.parentNode.name in this.submitted)
this.element(element.parentNode);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);}
$(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler)
$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())
$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}
if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}
this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)
$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)
count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))
return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}
var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method",e);throw e;}}
if(dependencyMismatch)
return;if(this.objectLength(rules))
this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)
return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)
return arguments[i];}
return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}
this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)
toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(!this.labelContainer.append(label).length)
this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}
if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}
this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))
return this.findByName(element.name).filter(':checked').length;}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)
this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
if(rules.messages){delete rules.messages;}
return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))
return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))
return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))
return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])
this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}
previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}
return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))
return"dependency-mismatch";if(/[^0-9-]+/.test(value))
return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)
nDigit-=9;}
nCheck+=nDigit;bEven=!bEven;}
return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};if($.ajaxPrefilter){$.ajaxPrefilter(function(settings,original,jqXHR){var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
pendingRequests[port]=jqXHR;}});}else{$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
return(pendingRequests[port]=ajax.apply(this,arguments));}
return ajax.apply(this,arguments);};}})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery);;var googleMapsV3={infoWindowVisible:false,infoWindow:null,map:null,mapMarkerArray:null,requestID:0,zoomToExtent:false,fitBoundsAfterSearch:false,supressSearch:false,clearKeyWordOnNextSearch:false,init:function(element,options){this.mapMarkerArray=new Array();this.map=null;options=this.mergeDefaultOptions(options);this.infoWindow=new google.maps.InfoWindow({maxWidth:420});this.infoWindowVisible=false;var mapCenter=(options.points&&options.points.length>0)?this.getCentroid(options.points):new google.maps.LatLng(_resources.lat,_resources.lng);var myOptions={minZoom:4,maxZoom:20,zoom:options.mapzoom,center:mapCenter,mapTypeId:google.maps.MapTypeId.ROADMAP};this.map=new google.maps.Map(element,myOptions);this.map.options=options;if(options.points&&options.points.length>0){for(var i=0;i<options.points.length;i++){var marker=this.displayMarker(options.points[i]);this.mapMarkerArray['point_'+i]={Marker:marker};}
if(options.points.length>1){this.map.fitBounds(this.getBounds(options.points));}}
google.maps.event.addListener(this.infoWindow,'closeclick',function(){googleMapsV3.infoWindowVisible=false;});google.maps.event.addListener(this.map,'click',function(){if(googleMapsV3.infoWindowVisible){googleMapsV3.infoWindowVisible=false;googleMapsV3.infoWindow.close();}});if(options.allowSearch){this.zoomToExtent=options.zoomToExtent;$(document.forms[0]).submit(function(){return false;});if($.browser.msie){$(document.getElementById('searchKeyword')).keydown(function(e){if(e.which==13)
googleMapsV3.dosearchFromMap();});}
this.initMapSearch(options);}},mergeDefaultOptions:function(options){options.fitBoundsAfterSearch=(options.fitBoundsAfterSearch)?true:false;options.mapzoom=(options.mapzoom!=null)?options.mapzoom:_resources.zoom;options.allowSearch=(options.allowSearch!=null)?options.allowSearch:false;options.doSearch=(options.doSearch!=null)?options.doSearch:false;return options;},attachMarkerListener:function(marker){google.maps.event.addDomListener(marker,'click',function(){if(!marker.allListingsHaveSameLocation){this.map.fitBounds(new google.maps.LatLngBounds(marker.sw,marker.ne));}
else{googleMapsV3.showInfoWindow(marker,0);}});},showInfoWindow:function(marker,position){if(marker.listingIDs.length==0)
return;var url="/Map/ListingsInfoWindow/?listingIDs="+
encodeURI(marker.listingIDs)+'&position='+position+'&rnd='+Math.random();$.get(url,function(data){var div=document.createElement("DIV");div.innerHTML=data;$("a",div).click(function(){var navinc=parseInt($(this).attr('data-navigate'));var newpos=isNaN(navinc)?0:position+navinc;googleMapsV3.showInfoWindow(marker,newpos);});googleMapsV3.infoWindow.setContent(div);googleMapsV3.infoWindow.setPosition(marker.position);if(!googleMapsV3.infoWindowVisible){googleMapsV3.infoWindow.open(marker.getMap());}
googleMapsV3.infoWindowVisible=true;});},boundschanged:false,zoomchanged:false,searchControl:null,initMapSearch:function(options){google.maps.event.addListener(this.map,'zoom_changed',function(){googleMapsV3.zoomchanged=true;});google.maps.event.addListener(this.map,'bounds_changed',function(){googleMapsV3.boundschanged=true;});this.fitBoundsAfterSearch=options.fitBoundsAfterSearch;this.searchControl=document.createElement('DIV');this.searchControl.className="mapSearchControl";this.searchControl.innerText="Searching...";this.searchControl.style.visibility='hidden';this.searchControl.index=1;this.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(this.searchControl);var firstIdle=true;google.maps.event.addListener(this.map,'idle',function(){firstIdle=false;if((googleMapsV3.boundschanged||googleMapsV3.zoomchanged)){googleMapsV3.dosearchFromMap();if(googleMapsV3.clearKeyWordOnNextSearch){googleMapsV3.clearKeyWordOnNextSearch=false;document.getElementById('searchKeyword').value="";}}});this.attachListingFormChangeHandlers();},currentListingSearchParameters:"",previousListingSearchParameters:"",dosearchFromMap:function(){if(googleMapsV3.infoWindowVisible){}
if(googleMapsV3.supressSearch){googleMapsV3.supressSearch=false;return;}
if(googleMapsV3.requestID>1){var el=document.getElementById("originalTermText");if(el){el.value="";}
el=document.getElementById("originalLocation");if(el){el.value="";}}
googleMapsV3.currentListingSearchParameters=this.getListingSearchParameters();var formAction=document.forms['srchform'].action;var url='/Map/MapSearch/?formAction='+encodeURI(formAction)+'&'+this.getMapSearchParameters(this.map)+googleMapsV3.currentListingSearchParameters;var added=0;if(googleMapsV3.currentListingSearchParameters!=googleMapsV3.previousListingSearchParameters){this.clearMarkers(googleMapsV3.mapMarkerArray);googleMapsV3.mapMarkerArray=new Array();}
googleMapsV3.previousListingSearchParameters=googleMapsV3.currentListingSearchParameters;googleMapsV3.searchControl.style.visibility='visible';window.setTimeout('googleMapsV3.searchControl.style.visibility = "hidden"',600);googleMapsV3.requestID++;$.getJSON(url+'&requestID='+googleMapsV3.requestID+'&r='+Math.random(),function(jsonResult){if(jsonResult.ResetViewport&&googleMapsV3.requestID>1){googleMapsV3.fitBoundsAfterSearch=true;googleMapsV3.clearKeyWordOnNextSearch=true;}
if(jsonResult.MapSearchResults.length==0||jsonResult.RequestID!=googleMapsV3.requestID)
return;var zoomchangeForRequest=googleMapsV3.zoomchanged;if(zoomchangeForRequest){for(var key in googleMapsV3.mapMarkerArray){googleMapsV3.mapMarkerArray[key].ToHide=true;}}
var allPositions=new Array();$.each(jsonResult.MapSearchResults,function(i,result){var existingResult=googleMapsV3.mapMarkerArray[result.TileKey];if(existingResult){allPositions[allPositions.length]=existingResult.Marker;googleMapsV3.showMarker(existingResult);existingResult.ToHide=false;}
else{var marker=googleMapsV3.createMarker(result);googleMapsV3.attachMarkerListener(marker);allPositions[allPositions.length]=marker;added++;}});if(zoomchangeForRequest){for(var key in googleMapsV3.mapMarkerArray){if(googleMapsV3.mapMarkerArray[key].ToHide){googleMapsV3.hideMarker(googleMapsV3.mapMarkerArray[key]);googleMapsV3.mapMarkerArray[key].ToHide=false;}}}
googleMapsV3.zoomchanged=false;googleMapsV3.boundschanged=false;if(googleMapsV3.fitBoundsAfterSearch){googleMapsV3.fitBoundsAfterSearch=false;googleMapsV3.map.fitBounds(googleMapsV3.getBounds(allPositions));}});},showMarker:function(item){if(item&&item.Marker&&!item.Marker.getVisible())
item.Marker.setVisible(true);},hideMarker:function(item){if(item&&item.Marker&&item.Marker.getVisible())
item.Marker.setVisible(false);},clearMarkers:function(markers){for(var key in markers){this.removeMarker(markers[key]);}},removeMarker:function(item){if(item&&item.Marker){item.Marker.setMap(null);}},getMapSearchParameters:function(map){var bounds=map.getBounds();var minlat=bounds.getSouthWest().lat();var maxlat=bounds.getNorthEast().lat();var minlon=bounds.getSouthWest().lng();var maxlon=bounds.getNorthEast().lng();minlon=minlon<0?180:minlon;maxlon=maxlon<0?180:maxlon;minlat=minlat>0?0:minlat;return'minlat='+minlat+'&maxlat='+maxlat+'&minlon='+minlon+'&maxlon='+maxlon+'&zoom='+map.getZoom();},getIconForResult:function(result){var sizeX=60;var sizeY=60;scaleFactor=(Math.log(result.ListingCount+15)/4.5);if(scaleFactor>1.2)
scaleFactor=1.2;var scaledSizeX=sizeX*scaleFactor;var scaledSizeY=sizeY*scaleFactor;var image=new google.maps.MarkerImage('/Images/harcourts-marker.png',new google.maps.Size(sizeX,sizeY),new google.maps.Point(0,0),new google.maps.Point(13,41),new google.maps.Size(scaledSizeX,scaledSizeY));return image;},attachListingFormChangeHandlers:function(){var elementlist=new Array('searchKeyword','selectPriceMin','max','selectBedMin','selectBedMax','selectPriceMax','filterMax','location','proptype','selectLandSizeMin','selectLandSizeMax','selectfloorAreaMin','selectfloorAreaM','sale');for(var i=0;i<elementlist.length;i++){var el=window.document.getElementById(elementlist[i]);if(el){$(el).change(function(){googleMapsV3.dosearchFromMap();});}}},getListingSearchParameters:function(){var paramlist="";var elementlist=new Array('pageid','searchKeyword','selectPriceMin','max','selectBedMin','selectBedMax','selectPriceMax','filterMax','location','proptype','selectLandSizeMin','selectLandSizeMax','selectfloorAreaMin','selectfloorAreaM','sale');for(var i=0;i<elementlist.length;i++){var el=document.getElementById(elementlist[i]);if(el&&el.value!=el.title){if(!(el.value.indexOf('suburb,')==0)){if(el.type=='radio'){paramlist+='&'+el.name+'='+((el)?el.checked:"false");}
else{paramlist+='&'+el.name+'='+((el)?encodeURI(el.value.replace('#','')):"");}}}}
var ott=window.document.getElementById('originalTermText');if(ott){paramlist=paramlist+'&SearchKeyword='+ott.value;ott.value='';}
var orl=window.document.getElementById('originalLocation');if(orl){paramlist=paramlist+'&OriginalLocation='+orl.value;orl.value='';}
return paramlist;},displayMarker:function(point){var pos=point.position?point.position:point;var marker=new google.maps.Marker({position:pos,icon:'/Images/harcourts-marker.png',map:this.map,ne:pos,sw:pos,listingCount:1,listingZoomLevel:17,listingIDs:point.listingID,tileKey:'searchResult_'+point.listingID,title:point.listingID,oid:point.oid});point.marker=marker;point.marker.openInfoWindowHtml=function(data){googleMapsV3.supressSearch=true;var gmap=googleMapsV3.map;var infowindow=googleMapsV3.infoWindow;infowindow.setContent(data);if(gmap.getZoom()!=15)
gmap.setZoom(15);infowindow.setPosition(marker.position);infowindow.open(gmap);google.maps.event.addListenerOnce(gmap,'click',function(){infowindow.setMap(null);});};googleMapsV3.mapMarkerArray[marker.tileKey]={Marker:marker};return marker;},getTitle:function(listingCount,listingsHaveSameLocation){if(listingCount==1){return'One listing.  Click to display details';}
else if(listingsHaveSameLocation){return listingCount+' listings. Click to display details';}
else{return listingCount+' listings. Click to zoom in';}},getWidth:function(count){var sizeX=60;scaleFactor=(Math.log(count+15)/4.5);if(scaleFactor>1.2)
scaleFactor=1.2;return sizeX*scaleFactor;},createMarker:function(result){var marker=new google.maps.OverlayView({map:this.map});marker.position=new google.maps.LatLng(result.MarkerLatitude,result.MarkerLongitude);marker.text=result.ListingCount;marker.allListingsHaveSameLocation=result.AllListingsHaveSameLocation;marker.allListingsHaveSimilarLocation=result.AllListingsHaveSimilarLocation;marker.listingIDs=result.IDList;marker.listingCount=parseInt(result.ListingCount);marker.ne=new google.maps.LatLng(result.MaxLatitude,result.MaxLongitude);marker.sw=new google.maps.LatLng(result.MinLatitude,result.MinLongitude);marker.tileKey=result.TileKey;marker.listingZoomLevel=parseInt(result.ListingZoomLevel);marker.width=40;marker.setVisible=function(visible){marker.div_.style.display=(visible)?'block':'none';marker.visible_=visible;};marker.getVisible=function(){return marker.visible_;};marker.onRemove=function(){marker.div_.parentNode.removeChild(marker.div_);marker.div_=null;marker.visible_=false;};marker.onAdd=function(){var div=document.createElement('DIV');div.style.border="none";div.style.borderWidth="0px";div.style.position="absolute";if(marker.listingCount>1){div.className='mapClusterBackground';var text=document.createElement('DIV');text.className="clusterOverlay";text.innerHTML=marker.text;div.appendChild(text);}else{div.className='mapSingleBackground';}
div.style.backgroundPosition="0px 1px";div.style.cursor='pointer';google.maps.event.addDomListener(div,'click',function(){if(!marker.allListingsHaveSameLocation){if(marker.allListingsHaveSimilarLocation){if(marker.listingCount>2&&!marker.resolvedSimilarLocations){var formAction=document.forms['srchform'].action;var url='/Map/PointSearch/?formAction='+encodeURI(formAction)+'&radius=100&lat='+marker.position.lat()+'&lng='+marker.position.lng()+googleMapsV3.currentListingSearchParameters;url=url+'&r='+Math.random();$.getJSON(url,function(result){marker.listingIDs=result;marker.resolvedSimilarLocations=true;googleMapsV3.showInfoWindow(marker,0);});return;}
googleMapsV3.showInfoWindow(marker,0);return;}
googleMapsV3.zoomchanged=false;googleMapsV3.boundschanged=false;marker.getMap().fitBounds(new google.maps.LatLngBounds(marker.sw,marker.ne));}
else{googleMapsV3.showInfoWindow(marker,0);}});marker.div_=div;var panes=marker.getPanes();panes.overlayImage.appendChild(marker.div_);marker.visible_=true;};marker.draw=function(){var overlayProjection=marker.getProjection();var pixel=overlayProjection.fromLatLngToDivPixel(marker.position);var div=marker.div_;if(marker.listingCount>1){div.style.left=(pixel.x-(marker.width/2))+'px';div.style.top=(pixel.y-(marker.width))+'px';}
else{div.style.left=(pixel.x-13)+'px';div.style.top=(pixel.y-40)+'px';}};marker.setMap(googleMapsV3.map);googleMapsV3.mapMarkerArray[marker.tileKey]={Marker:marker};return marker;},getCentroid:function(points){var sumLat=0;var sumLng=0;for(var i=0;i<points.length;i++){var pos=points[i].position?points[i].position:points[i];sumLat+=pos.lat();sumLng+=pos.lng();}
return new google.maps.LatLng(sumLat/points.length,sumLng/points.length);},getBounds:function(points){var maxLat=-90;var maxLng=-180;var minLat=0;var minLng=180;for(var i=0;i<points.length;i++){var mkr=points[i];var swpos=(mkr.sw)?mkr.sw:(mkr.position)?mkr.position:mkr;var nepos=(mkr.ne)?mkr.ne:(mkr.position)?mkr.position:mkr;if(minLat>swpos.lat())
minLat=swpos.lat();if(maxLat<nepos.lat())
maxLat=nepos.lat();if(minLng>swpos.lng())
minLng=swpos.lng();if(maxLng<nepos.lng())
maxLng=nepos.lng();}
var ne=new google.maps.LatLng(minLat,maxLng);var sw=new google.maps.LatLng(maxLat,minLng);return new google.maps.LatLngBounds(sw,ne);}};;eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2($){$.c.f=2(p){p=$.d({g:"!@#$%^&*()+=[]\\\\\\\';,/{}|\\":<>?~`.- ",4:"",9:""},p);7 3.b(2(){5(p.G)p.4+="Q";5(p.w)p.4+="n";s=p.9.z(\'\');x(i=0;i<s.y;i++)5(p.g.h(s[i])!=-1)s[i]="\\\\"+s[i];p.9=s.O(\'|\');6 l=N M(p.9,\'E\');6 a=p.g+p.4;a=a.H(l,\'\');$(3).J(2(e){5(!e.r)k=o.q(e.K);L k=o.q(e.r);5(a.h(k)!=-1)e.j();5(e.u&&k==\'v\')e.j()});$(3).B(\'D\',2(){7 F})})};$.c.I=2(p){6 8="n";8+=8.P();p=$.d({4:8},p);7 3.b(2(){$(3).f(p)})};$.c.t=2(p){6 m="A";p=$.d({4:m},p);7 3.b(2(){$(3).f(p)})}})(C);',53,53,'||function|this|nchars|if|var|return|az|allow|ch|each|fn|extend||alphanumeric|ichars|indexOf||preventDefault||reg|nm|abcdefghijklmnopqrstuvwxyz|String||fromCharCode|charCode||alpha|ctrlKey||allcaps|for|length|split|1234567890|bind|jQuery|contextmenu|gi|false|nocaps|replace|numeric|keypress|which|else|RegExp|new|join|toUpperCase|ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('|'),0,{}));;jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1;}
if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
value=String(value);return(document.cookie=[encodeURIComponent(key),'=',options.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;};;(function($){$.fn.fixedHeaderTable=function(method){var defaults={width:'100%',height:'100%',borderCollapse:true,themeClass:'fht-default',autoShow:true,loader:false,footer:false,cloneHeadToFoot:false,cloneHeaderToFooter:false,autoResize:false,create:null}
var settings={}
var methods={init:function(options){settings=$.extend({},defaults,options);return this.each(function(){var $self=$(this),self=this;if(helpers._isTable($self)){methods.setup.apply(this,Array.prototype.slice.call(arguments,1));$.isFunction(settings.create)&&settings.create.call(this);}else{$.error('Invalid table mark-up');}});},setup:function(options){var $self=$(this),self=this,$thead=$self.find('thead'),$tfoot=$self.find('tfoot'),$tbody=$self.find('tbody'),$wrapper,$divHead,$divFoot,$divBody,$fixedHeadRow,$temp,tfootHeight=0;settings.scrollbarOffset=helpers._getScrollbarWidth();settings.themeClassName=settings.themeClass;if(settings.width.search('%')>-1){var widthMinusScrollbar=$self.parent().width()-settings.scrollbarOffset;}else{var widthMinusScrollbar=settings.width-settings.scrollbarOffset;}
$self.css({width:widthMinusScrollbar});if(!$self.closest('.fht-table-wrapper').length){$self.addClass('fht-table');$self.wrap('<div class="fht-table-wrapper"></div>');}
$wrapper=$self.closest('.fht-table-wrapper');$wrapper.css({width:settings.width,height:settings.height}).addClass(settings.themeClassName);if(!$self.hasClass('fht-table-init')){$self.wrap('<div class="fht-tbody"></div>');}
$divBody=$self.closest('.fht-tbody');var tableProps=helpers._getTableProps($self);helpers._setupClone($divBody,tableProps.tbody);if(!$self.hasClass('fht-table-init')){$divHead=$('<div class="fht-thead"><table class="fht-table"></table></div>').prependTo($wrapper);$thead.clone().appendTo($divHead.find('table'));}else{$divHead=$wrapper.find('div.fht-thead');}
helpers._setupClone($divHead,tableProps.thead);$self.css({'margin-top':-$thead.outerHeight(true)-tableProps.border});if(settings.footer==true){helpers._setupTableFooter($self,self,tableProps);if(!$tfoot.length){$tfoot=$wrapper.find('div.fht-tfoot table');}
tfootHeight=$tfoot.outerHeight(true);}
var tbodyHeight=$wrapper.height()-$thead.outerHeight(true)-tfootHeight-tableProps.border;$divBody.css({'height':tbodyHeight});if(!settings.autoShow){$wrapper.hide();}
$self.addClass('fht-table-init');if(typeof(settings.altClass)!=='undefined'){$self.find('tbody tr:odd').addClass(settings.altClass);}
helpers._bindScroll($divBody);return self;},resize:function(options){var $self=$(this),self=this;return self;},show:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest('.fht-table-wrapper');if(typeof(arg1)!=='undefined'&&typeof(arg1)==='number'){$wrapper.show(arg1,function(){$.isFunction(arg3)&&arg3.call(this);});return self;}else if(typeof(arg1)!=='undefined'&&typeof(arg1)==='string'&&typeof(arg2)!=='undefined'&&typeof(arg2)==='number'){$wrapper.show(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this);});return self;}
$self.closest('.fht-table-wrapper').show();$.isFunction(arg3)&&arg3.call(this);return self;},hide:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest('.fht-table-wrapper');if(typeof(arg1)!=='undefined'&&typeof(arg1)==='number'){$wrapper.hide(arg1,function(){$.isFunction(arg3)&&arg3.call(this);});return self;}else if(typeof(arg1)!=='undefined'&&typeof(arg1)==='string'&&typeof(arg2)!=='undefined'&&typeof(arg2)==='number'){$wrapper.hide(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this);});return self;}
$self.closest('.fht-table-wrapper').hide();$.isFunction(arg3)&&arg3.call(this);return self;},destroy:function(){var $self=$(this),self=this,$wrapper=$self.closest('.fht-table-wrapper');$self.insertBefore($wrapper).removeAttr('style').append($wrapper.find('tfoot')).removeClass('fht-table fht-table-init').find('.fht-cell').remove();$wrapper.remove();return self;}}
var helpers={_isTable:function($obj){var $self=$obj,hasTable=$self.is('table'),hasThead=$self.find('thead').length>0,hasTbody=$self.find('tbody').length>0;if(hasTable&&hasThead&&hasTbody){return true;}
return false;},_bindScroll:function($obj){var $self=$obj,$thead=$self.siblings('.fht-thead'),$tfoot=$self.siblings('.fht-tfoot');$self.bind('scroll',function(){$thead.find('table').css({'margin-left':-this.scrollLeft});if(settings.cloneHeadToFoot){$tfoot.find('table').css({'margin-left':-this.scrollLeft});}});},_setupTableFooter:function($obj,obj,tableProps){var $self=$obj,self=obj,$wrapper=$self.closest('.fht-table-wrapper'),$tfoot=$self.find('tfoot'),$divFoot=$wrapper.find('div.fht-tfoot');if(!$divFoot.length){$divFoot=$('<div class="fht-tfoot"><table class="fht-table"></table></div>').appendTo($wrapper);}
switch(true){case!$tfoot.length&&settings.cloneHeadToFoot==true&&settings.footer==true:var $divHead=$wrapper.find('div.fht-thead');$divFoot.empty();$divHead.find('table').clone().appendTo($divFoot);break;case $tfoot.length&&settings.cloneHeadToFoot==false&&settings.footer==true:$divFoot.find('table').append($tfoot).css({'margin-top':-tableProps.border});helpers._setupClone($divFoot,tableProps.tfoot);break;}},_getTableProps:function($obj){var tableProp={thead:{},tbody:{},tfoot:{},border:0};tableProp.border=($obj.find('th:first-child').outerWidth()-$obj.find('th:first-child').innerWidth())/2;$obj.find('thead tr:first-child th').each(function(index){tableProp.thead[index]=$(this).width()+tableProp.border;});$obj.find('tfoot tr:first-child td').each(function(index){tableProp.tfoot[index]=$(this).width()+tableProp.border;});$obj.find('tbody tr:first-child td').each(function(index){tableProp.tbody[index]=$(this).width()+tableProp.border;});return tableProp;},_setupClone:function($obj,cellArray){var $self=$obj,selector=($self.find('thead').length)?'thead th':($self.find('tfoot').length)?'tfoot td':'tbody td',$cell;$self.find(selector).each(function(index){$cell=($(this).find('div.fht-cell').length)?$(this).find('div.fht-cell'):$('<div class="fht-cell"></div>').appendTo($(this));$cell.css({'width':parseInt(cellArray[index])});if(!$(this).closest('.fht-tbody').length&&$(this).is(':last-child')){var padding=(($(this).innerWidth()-$(this).width())/2)+settings.scrollbarOffset;$(this).css({'padding-right':padding+'px'});}});},_getScrollbarWidth:function(){var scrollbarWidth=0;if(!scrollbarWidth){if($.browser.msie){var $textarea1=$('<textarea cols="10" rows="2"></textarea>').css({position:'absolute',top:-1000,left:-1000}).appendTo('body'),$textarea2=$('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:'absolute',top:-1000,left:-1000}).appendTo('body');scrollbarWidth=$textarea1.width()-$textarea2.width()+2;$textarea1.add($textarea2).remove();}else{var $div=$('<div />').css({width:100,height:100,overflow:'auto',position:'absolute',top:-1000,left:-1000}).prependTo('body').append('<div />').find('div').css({width:'100%',height:200});scrollbarWidth=100-$div.width();$div.parent().remove();}}
return scrollbarWidth;}}
if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method "'+method+'" does not exist in fixedHeaderTable plugin!');}}})(jQuery);;;(function($){$('.formWidgetInput').live('submit',function(evt){evt.preventDefault();if(_settings.isInEditMode){return;}
var $this=$(this);var $inputForm=$this.find('.formWidgetOuter');$inputForm.find('input,textarea,select,label').each(function(i){var $this=$(this);if($this.attr("id")){$this.attr('id',$this.attr('id').replace(/Layout_Widgets_\d+__/,""));}
if($this.attr("name")){$this.attr('name',$this.attr('name').replace(/Layout.Widgets\[\d+\]./,""));}
if($this.attr("for")){$this.attr('for',$this.attr('for').replace(/Layout_Widgets_\d+__/,""));}});$.ajax({type:$this.attr("method")||"post",cache:false,async:false,data:$this.serialize(),url:$this.attr("action"),success:function(data,textStatus,xhr){$this.removeClass('submitting');$this.html(data);$this.find('.formWidgetOuter').functionName();if(xhr.status===200){var $sid3681=$this.find('[data-sid=3681]');$this.alertDialog('Submission Sent!','<div class="formMessage formSuccess">Thank you for your submission! Your form will be responded to as soon as possible.</div>');}},error:function(xhr,textStatus,errorThrown){$this.alertDialog('Error','An error has occurred. Please try again later.');}});});$('.adminForm').live('submit',function(evt){evt.preventDefault();var $this=$(this);$this.addClass('submitting');var submittingText=$this.attr('data-submitting');if(submittingText){$("#pageContainer").loading(submittingText);}
$.ajax({type:$this.attr("method")||"post",cache:false,async:true,url:$this.attr("action"),success:function(data,textStatus,xhr){$this.removeClass('submitting');if(submittingText){$(this).loaded();}
if(xhr.status===201){var newLocation=xhr.getResponseHeader("Location");window.location=newLocation;}else if(xhr.status===205){window.location.reload(true);}
harcourtsPublic.websiteContent.admin.loadDialog(data);},error:function(xhr,textStatus,errorThrown){$this.removeClass('submitting');if(submittingText){$(this).loaded();}
harcourtsPublic.websiteContent.admin.loadDialog(xhr.responseText);}});});$('.admindialog,a.popupPrivacy').live('click',function(evt){evt.preventDefault();$("#pageContainer").loading();$.ajax({type:"post",cache:false,async:true,url:$(this).attr("href"),dataType:"html",data:$(this).attr("data-parameters")!==undefined?eval($(this).attr("data-parameters")).apply():null,success:function(data,textStatus,xhr){$(this).loaded();if(data.trim()===''){data=harcourtsPublic.websiteContent.errorMessageFormatString.format($.resource('ProcessingErrorMessage'));}
harcourtsPublic.websiteContent.admin.loadDialog(data);},error:function(XMLHttpRequest,textStatus,errorThrown){harcourtsPublic.websiteContent.ajaxError(XMLHttpRequest,textStatus,errorThrown);}});});$('.widgetDelete').live('click',function(evt){evt.preventDefault();var $this=$(this);$this.confirmDialog('Delete widget','Are you sure you wish to delete this widget?',{yesCallback:function(){$.ajax({type:"post",cache:false,async:true,url:$this.attr("href"),dataType:"html",success:function(html){var $parentWidget=$this.closest("[data-sid=3496]");$parentWidget.find('[data-sid=3697]').val('False');$parentWidget.closest("[data-sid=3700]").find(".addWidget").show();$parentWidget.addClass('hidden');$("#pageContainer").height($(document).height());var widgets=$parentWidget.parents('[data-containertypeid]:first').children("div");widgets.each(function(i){var $widget=$(this);harcourtsPublic.websiteContent.widget.showOrHideUpDownDropdowns($widget);});},error:function(XMLHttpRequest,textStatus,errorThrown){harcourtsPublic.websiteContent.ajaxError(XMLHttpRequest,textStatus,errorThrown);}});}});});$('.widgetMoveUp, .widgetMoveDown').live('click',function(evt){evt.preventDefault();var _hasWidgetMoved=false;var $widget=$(this).parents('[data-widgetid]:first');var $container=$(this).parents('[data-containertypeid]:first');var _moveUp=$(this).hasClass('widgetMoveUp');if(_moveUp){var $prevWidget=$widget.prevAll('[data-ismovable=True]:not(.hidden):first');if($prevWidget.length>0){$widget.swapWith($prevWidget);_hasWidgetMoved=true;}}
else{var $nextWidget=$widget.nextAll('[data-ismovable=True]:not(.hidden):first');if($nextWidget.length>0){$widget.swapWith($nextWidget);_hasWidgetMoved=true;}}
if(_hasWidgetMoved){var widgets=$container.children("div,form");widgets.each(function(i){var $this=$(this);$this.find("input[id$=SortOrder]").val(i);harcourtsPublic.websiteContent.widget.showOrHideUpDownDropdowns($this);});widgets.updateWidgetsSortOrder();$container.reindexInputs("div");$container.functionName();}});$('.addWidgetAdmin').live('click',function(evt){evt.preventDefault();var $this=$(this);var $newWidget=harcourtsPublic.websiteContent.container.addWidgetToContainer($('[data-containerid='+$('[data-sid=3251]').val()+']').closest('[data-sid=3700]').find(".addWidget"),parseInt($(this).attr("data-widgettype")));harcourtsPublic.websiteContent.widget.newWidgetAdded=$newWidget;var $parentDiv=$newWidget.closest('[data-sid=3700]').find("div:first");var containerInstanceID=$parentDiv.attr('data-containerid');var sortOrder=$parentDiv.children("div,form").length-1;var isEditable=($newWidget.attr("data-iseditable")===undefined||$newWidget.attr("data-iseditable").toBool());var parameters=$newWidget.attr("data-parameters")!==undefined?$newWidget.attr("data-parameters"):null;if(parameters!==null){if(isEditable){parameters=eval(parameters).apply();}
else{parameters=eval(parameters).apply(window,$.makeArray({containerInstanceID:containerInstanceID,sortOrder:sortOrder}));}}
$("#pageContainer").loading();$.ajax({type:"post",cache:false,async:true,url:$newWidget.attr("href"),data:parameters,dataType:"html",success:function(data,textStatus,xhr){$(this).loaded();if(isEditable){if(data.trim()===''){data=harcourtsPublic.websiteContent.errorMessageFormatString.format($.resource('ProcessingErrorMessage'));}
var $editPage=$(data).wrapAll('<div class="dialogWrapper"></div>').parent();var titleHtml=$editPage.find('.panelHeader').outerHTML();$editPage.find('.panelHeader').remove();$editPage.dialog({modal:true,draggable:true,title:titleHtml});$('.ui-dialog-titlebar').outerHTML(titleHtml);var $dialog=$('.ui-dialog');$dialog.functionName();$('[data-sid=3241],[data-sid=3242]').setupDialogCancel();$dialog.position({my:"center",at:"center",of:window});$editPage.find('[data-sid=3588]').val(containerInstanceID);$editPage.find('[data-sid=3589]').val(sortOrder);}else{var $tempWidget=$(data);$newWidget.replaceWith($tempWidget);$newWidget=$('[data-widgetid='+$tempWidget.attr("data-widgetid")+']');$newWidget.show();$newWidget.functionName();}},error:function(XMLHttpRequest,textStatus,errorThrown){$newWidget.remove();harcourtsPublic.websiteContent.widget.newWidgetAdded=null;harcourtsPublic.websiteContent.ajaxError(XMLHttpRequest,textStatus,errorThrown);}});});$.extend(true,harcourtsPublic,{websiteContent:{admin:{loadDialog:function(data){var $page=$(data).wrapAll('<div class="dialogWrapper"></div>').parent();var $panelHeader=$page.find('.panelHeader');var titleHtml=$panelHeader.outerHTML();$panelHeader.remove();$page.dialog({modal:true,draggable:true,title:titleHtml});var $dialog=$page.closest('.ui-dialog');if(titleHtml!==''){$dialog.find('.ui-dialog-titlebar').outerHTML(titleHtml);}
else{var $firstHeader=$page.find('#staticContent h2:first');var titleText=$page.find('#staticContent h2:first').text();$dialog.find('.ui-dialog-title').text(titleText);$firstHeader.remove();}
$('[data-sid=3241],[data-sid=3242]').setupDialogCancel();$dialog.functionName();$dialog.position({my:"center",at:"center",of:window});if($dialog.position().top<0){$dialog.css({"top":"0px"});}},deletePageButtonInit:function($deleteBtn){$deleteBtn.submit(function(evt){evt.preventDefault();var $this=$(this);$this.confirmDialog('Delete page','Are you sure you want to delete this page?',{yesCallback:function(){$.ajax({url:$this.attr('action'),type:'post',success:function(){window.location="/";},error:function(xhr){harcourtsPublic.websiteContent.admin.loadDialog(xhr.responseText);}});}});});},publishedDialogInit:function(redirectLink){var $dialogElement=redirectLink.closest('.ui-dialog');var redirectUrl=redirectLink.attr('href');$dialogElement.bind("dialogclose",function(){if(window.location.pathname!==redirectUrl){window.location=redirectUrl;}else{window.location.reload(true);}});},dialogInit:function(dialogElement){if(dialogElement.data('already-initialized')){return;}
dialogElement.data('already-initialized',true);dialogElement.find("form").submit(function(evt){evt.preventDefault();var $this=$(this);var submittingText=$this.attr('data-submitting');if(submittingText){$("#pageContainer").loading(submittingText);}
$.ajax({type:$this.attr("method")||"post",cache:false,async:true,url:$this.attr("action"),data:$this.serialize(),success:function(data,textStatus,xhr){if(xhr.status===201){var newLocation=xhr.getResponseHeader("Location");window.location=newLocation;}else if(xhr.status===205){window.location.reload(true);}
else if(xhr.status===200){var newLocation=data;var widgetID=xhr.getResponseHeader("WidgetID");var $widget=$('[data-widgetid='+widgetID+']');if($widget.length===0){$widget=harcourtsPublic.websiteContent.widget.newWidgetAdded;}
$widget.replaceWith(data);$widget=$('[data-widgetid='+widgetID+']');$widget.show();var widgets=$widget.parents('[data-containertypeid]:first').children("div");widgets.each(function(i){var $this=$(this);harcourtsPublic.websiteContent.widget.showOrHideUpDownDropdowns($this);});harcourtsPublic.websiteContent.container.showOrHideAddWidgetArea($widget.closest("[data-sid=3700]"));$widget.functionName();$('.dialogWrapper').closeDialog();$("#pageContainer").loaded();}},error:function(xhr,textStatus,errorThrown){$("#pageContainer").loaded();if(xhr.status===422){var newDialogContents=$(xhr.responseText);newDialogContents.find(".panelHeader").remove();var dialogWrapper=$this.closest(".dialogWrapper");dialogWrapper.children().remove();dialogWrapper.append(newDialogContents);dialogWrapper.functionName();var $firstValidationError=newDialogContents.find('.field-validation-error:first');var $parentTab=$firstValidationError.closest("div[id^='tabs']");var $parentParentTab=$parentTab.parents("div[id^='tabs']:first");if($parentParentTab.length>0){$parentParentTab.parent("div:first").tabs({selected:$parentParentTab.attr("id"),show:function(event,ui){var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}});}
if($parentTab.length>0){$parentTab.parent("div:first").tabs({selected:$parentTab.attr("id"),show:function(event,ui){var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}});}}else if(xhr.status===401){dialogElement.find("#errorBox").remove();dialogElement.prepend('<div id="errorBox">Sorry, you have been signed out of harcourts one, please sign in to continue.</div>');}else{dialogElement.find("#errorBox").remove();var logIdentifier=xhr.getResponseHeader("X-LOG-IDENTIFIER");if(logIdentifier){dialogElement.prepend('<div id="errorBox">Sorry an unknown error has occured.<p id="errorReference" style="display:none"><a href="error site">'+logIdentifier+'</a></p>');}else if(xhr.responseText){var errorText=$('<div id="errorBox">Sorry an unknown error has occured. <a href="#">(Details)</a></div>');errorText.find("a").click(function(evt){var detailedErrorIframe=document.createElement("iframe");$(this).after(detailedErrorIframe);$(this).after("<br/>");$(this).remove();var errorDocument=detailedErrorIframe.contentWindow.document;errorDocument.open();errorDocument.write(xhr.responseText);errorDocument.close();evt.preventDefault();});dialogElement.prepend(errorText);}else{dialogElement.find("#errorBox").remove();dialogElement.prepend('<div id="errorBox">Sorry an unknown error has occured</div>');}}}});});}}}});}(jQuery));;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{bannerWidget:{widgetTypeID:15,websiteImageTypeEnum:3,MAX_BANNER_COUNT:5,currentBanner:null,init:function(div){if(!div.hasClass('hidden')){var obj=harcourtsPublic.websiteContent.bannerWidget;harcourtsPublic.websiteContent.widget.init(div);obj.loadBanners(div);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","bannerWidget");newWidget.attr("data-sid","3496");newWidget.attr("href","/WebsiteContent/BannerWidget/Edit/");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.bannerWidget.init");return newWidget;},editorInit:function(div){var obj=harcourtsPublic.websiteContent.bannerWidget;var widgetID=div.find('[data-sid=3499]').val();if($('[data-widgetid='+widgetID+']').parents('[data-containertypeid=5]').length==0){div.find('[data-sid=3940]').addClass('hidden');}
var urlRegex=/^([hH][tT]{2}[pP][sS]?:\/\/|$)/;var $sid3294=$("[data-sid=3294]");$sid3294.change(function(){var $this=$(this);if(!urlRegex.test($this.val())){$this.val("http://"+$this.val())}});$('[data-sid=3963]').click(function(evt){evt.preventDefault();obj.saveBanner();});$('[data-sid=4033]').click(function(evt){evt.preventDefault();obj.clearFields();});$('[data-sid=4034]').click(function(evt){evt.preventDefault();obj.saveBanner();});$('[data-sid=3966]').live("click",function(evt){evt.preventDefault();$(this).closest('.bannersContent').remove();$('.banners').reindexInputs("div");var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});});$('[data-sid=4032]').live("click",function(evt){evt.preventDefault();var $this=$(this);var bannerContent=$this.closest('.bannersContent');$('[data-sid=3293]').val(bannerContent.find('[data-sid=3967]').val());$('[data-sid=3295]').val(bannerContent.find('[data-sid=3970]').val());$('[data-sid=3294]').val(bannerContent.find('[data-sid=3969]').val());var bannerUrl=bannerContent.find('[data-sid=3968]').val();$('[data-sid=3297]').val(bannerUrl);var $sid3296=$('[data-sid=3296]');$sid3296.attr('src',bannerUrl);$sid3296.removeClass('hidden');$('[data-sid=4033],[data-sid=4034]').removeClass('hidden');$('[data-sid=3963]').addClass('hidden');obj.currentBanner=bannerContent;var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});});},clearFields:function(){var obj=harcourtsPublic.websiteContent.bannerWidget;$('[data-sid=3297]').val('');var $sid3296=$('[data-sid=3296]');$sid3296.attr('src','');$sid3296.addClass('hidden');$('[data-sid=3293]').val('');$("[data-sid=3294]").val('');$('[data-sid=3295]').val($("[data-sid=3295] option:first").val());obj.currentBanner=null;$('[data-sid=4033],[data-sid=4034]').addClass('hidden');$('[data-sid=3963]').removeClass('hidden');var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});},saveBanner:function(){var obj=harcourtsPublic.websiteContent.bannerWidget;var $sid3297=$('[data-sid=3297]');var _imageUrl=$sid3297.val();var $sid3293=$('[data-sid=3293]');var $sid3294=$("[data-sid=3294]");var $sid3295=$('[data-sid=3295]');if(_imageUrl!==''){var $sid3964=$('[data-sid=3964]');var _noOfBanners=$sid3964.find('div.bannersContent').length;if(_noOfBanners===obj.MAX_BANNER_COUNT){var $this=$(this);$this.alertDialog('Max allowed banners exceeded','The max number of banners allowed is '+obj.MAX_BANNER_COUNT);return;}
var banner=$('<div>').attr('class','bannersContent').append($('<div>').attr('class','bannersImg').append($('<img>').attr({'src':$sid3297.val(),'alt':'','data-sid':'3965'}))).append($('<div>').attr('class','bannersInfo').append($('<h4>').attr('class','title').text($sid3293.val()).append($('<a>').attr({'class':'bannerRemove','title':'Remove Banner?','data-sid':'3966'}).text('Remove Banner?')).append($('<a>').attr({'class':'bannerEdit','title':'Edit Banner?','data-sid':'4032'}).text('Edit Banner'))).append($('<span>').attr('class','heading').text($sid3294.val()))).append($('<input>').attr({'name':'Items['+_noOfBanners+'].Title','id':'Items_'+_noOfBanners+'__Title','type':'hidden','value':$sid3293.val(),'data-sid':'3967'})).append($('<input>').attr({'name':'Items['+_noOfBanners+'].ImageUrl','id':'Items_'+_noOfBanners+'__ImageUrl','type':'hidden','value':_imageUrl,'data-sid':'3968'})).append($('<input>').attr({'name':'Items['+_noOfBanners+'].ImageHref','id':'Items_'+_noOfBanners+'__ImageHref','type':'hidden','value':$sid3294.val(),'data-sid':'3969'})).append($('<input>').attr({'name':'Items['+_noOfBanners+'].Target','id':'Items_'+_noOfBanners+'__Target','type':'hidden','value':$sid3295.val(),'data-sid':'3970'}));if(obj.currentBanner===null){$sid3964.append(banner);}
else{obj.currentBanner.outerHTML(banner.outerHTML());}
$sid3964.attr({scrollTop:$sid3964.attr("scrollHeight")});$('.banners').reindexInputs("div");obj.clearFields();}},uploaderInit:function(){harcourtsPublic.websiteContent.uploadify.init($('[data-sid=3298]'),{script:'/WebsiteContent/Upload/UploadImage',fileExt:'*.jpg;*.gif;*.png',fileDesc:'Image Files (.JPG, .GIF, .PNG)',buttonText:'Select File',queueID:'3299',sizeLimit:102400,auto:true,multi:false,onComplete:harcourtsPublic.websiteContent.bannerWidget.onComplete},harcourtsPublic.websiteContent.bannerWidget.websiteImageTypeEnum);},onComplete:function(event,queueId,fileObj,response,data){response=$.parseJSON(response);if(response.Status=='OK'){var $sid3296=$('[data-sid=3296]');$sid3296.attr('src',response.FilePath);$sid3296.removeClass('hidden');var $sid3297=$('[data-sid=3297]');$sid3297.val(response.FilePath);var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}},loadBanners:function(div){var obj=harcourtsPublic.websiteContent.bannerWidget;div.attr("currentlySelected",0);div.find(".bannerImage").each(function(i){var $this=$(this);$this.attr('data-index',i);});obj.initAutoPlay(div);div.find(".bannerImage").hover(function(){obj.pauseAutoPlay(div);},function(){obj.initAutoPlay(div);});},initAutoPlay:function(div){var obj=harcourtsPublic.websiteContent.bannerWidget;if(div.attr('autoPlayInterval')!==undefined&&parseInt(div.attr("autoPlayInterval"))!==0){clearInterval(div.attr("autoPlayInterval"));}
var _autoPlayMax=div.find(".bannerImage").length;div.attr("autoPlayMax",_autoPlayMax);if(_autoPlayMax<=1)
return;div.attr("autoPlayInterval",setInterval(function(){obj.autoPlay(div);},7000));},pauseAutoPlay:function(div){var obj=harcourtsPublic.websiteContent.bannerWidget;clearInterval(div.attr("autoPlayInterval"));div.attr("autoPlayInterval",0);},autoPlay:function(div,evt){if(evt!==undefined){evt.preventDefault();}
var obj=harcourtsPublic.websiteContent.bannerWidget;var next=parseInt(div.attr("currentlySelected"))+1;if(next>=parseInt(div.attr("autoPlayMax")))
next=0;obj.selectBanner(next,div);},scrollLeft:function(div,evt){if(evt!==undefined){evt.preventDefault();}
var obj=harcourtsPublic.websiteContent.bannerWidget;var next=parseInt(div.attr("currentlySelected"))-1;if(next<0)
next=parseInt(div.attr("autoPlayMax"))-1;obj.selectBanner(next,div);},animateLeft:function(current,next,div){var obj=harcourtsPublic.websiteContent.bannerWidget;var width=330;var widthTitle=330;var duration=400;var durationTitle=0;var $current;var $next;var $currentTitle;var $nextTitle;div.find(".bannerImage").each(function(i){if(i==current){$current=$(this);}else if(i==next){$next=$(this);}});div.find(".bannerTitle").each(function(i){if(i==current){$currentTitle=$(this);}else if(i==next){$nextTitle=$(this);}});$next.css("left",width+"px");$next.animate({"left":"0px"},duration,"swing");$current.animate({"left":-width+"px"},duration,"swing");$nextTitle.css("left",widthTitle+"px");$nextTitle.animate({"left":"0px"},durationTitle,"swing");$currentTitle.animate({"left":-1418+"px"},durationTitle,"swing");},selectBanner:function(id,div){var obj=harcourtsPublic.websiteContent.bannerWidget;if(parseInt(div.attr("currentlySelected"))===id)
return;obj.animateLeft(parseInt(div.attr("currentlySelected")),id,div);div.attr("currentlySelected",id);}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{container:{init:function(div){if(_settings.isInEditMode){harcourtsPublic.websiteContent.container.showOrHideAddWidgetArea(div);}},addWidgetToContainer:function(div,widgetTypeID){div.prev().append('<div></div>');var newWidget=div.prev().find("div:last");newWidget.hide();for(var name in harcourtsPublic.websiteContent){var obj=harcourtsPublic.websiteContent[name];if(obj&&obj.widgetTypeID&&obj.widgetTypeID==widgetTypeID&&typeof(obj.createNew)=="function"){newWidget=obj.createNew(newWidget);$('.dialogWrapper').closeDialog();$("#pageContainer").loading();return newWidget;}}
alert("Could not find the widget object. e.g. harcourtsPublic.websiteContent.myWidget. Must have createNew().");return null;},showOrHideAddWidgetArea:function(div){if(div.find("div:first").children("div:visible").length>=parseInt(div.find("[data-sid=3699]").val())||!harcourtsPublic.websiteContent.isHandlerActive){div.find(".addWidget").hide();}
else{div.find(".addWidget").show();}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{featuredPropertiesWidget:{widgetTypeID:12,_maxVisibleItems:6,init:function(div){if(!div.hasClass('hidden')){var obj=harcourtsPublic.websiteContent.featuredPropertiesWidget;harcourtsPublic.websiteContent.widget.init(div);obj.loadFeatures(div);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","featuredPropertiesWidget");newWidget.attr("data-sid","3496");newWidget.attr("href","/WebsiteContent/FeaturedPropertiesWidget/Edit/");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.featuredPropertiesWidget.init");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},editorInit:function(){var isOfficeWebsite=$('[data-sid=3270]').val()==="1";var $sid3274=$('[data-sid=3274]');$('[data-sid=3273],[data-sid=3271],[data-sid=3272]').change(function(){var viewOfficeListings=$('[data-sid=3273]:checked').val()==="1";var $sid3271=$('[data-sid=3271]');var $sid3272=$('[data-sid=3272]');if(isOfficeWebsite||(!isOfficeWebsite&&viewOfficeListings)){var _ouID;if(isOfficeWebsite){if($sid3272.val()!==null){_ouID=$sid3272.val();}}
else{if($sid3271.val()!==null){_ouID=$sid3271.val().split(";")[1];}}
if(_ouID!==undefined){$sid3274.addClass("disabled");$.ajax({url:"/Listing/GetListingsForOrganisationalUnit/"+_ouID,cache:false,dataType:"json",success:function(results){$sid3274.find("option").remove();$.each(results,function(i,result){$sid3274.append($("<option/>").val(result.ListingID).text([result.SuburbName,result.StreetAddress||result.Heading,result.ListingNumber].join(', ')));$sid3274.removeClass("disabled");});}});}}
else if(!isOfficeWebsite){if($sid3271.val()!==null){var _staffID=$sid3271.val().split(";")[0];$sid3274.addClass("disabled");$.ajax({url:"/Listing/GetListingsForStaff/"+_staffID,cache:false,dataType:"json",success:function(results){$sid3274.find("option").remove();$.each(results,function(i,result){$sid3274.append($("<option/>").val(result.ListingID).text([result.SuburbName,result.StreetAddress||result.Heading,result.ListingNumber].join(', ')));$sid3274.removeClass("disabled");});}});}}});$('[data-sid=3275]').click(function(evt){evt.preventDefault();var _listingID=$sid3274.val();if(_listingID!==''){var $sid3278=$('[data-sid=3278]');$.ajax({url:"/Listing/GetListingByID/"+_listingID,cache:false,dataType:"json",success:function(result){var _thumbnailWidth=result.Thumbnail.WidthInPixels;var _thumbnailHeight=result.Thumbnail.HeightInPixels;if(_thumbnailWidth>_thumbnailHeight){_thumbnailHeight=_thumbnailHeight/(_thumbnailWidth/100);_thumbnailWidth=100;}
else{_thumbnailWidth=_thumbnailWidth/(_thumbnailHeight/80);_thumbnailHeight=80;}
$sid3278.append($('<div>').attr('class','listingsContent').append($('<input>').attr({'name':'ListingIDs','type':'hidden','value':_listingID})).append($('<div>').attr('class','listingsImg').append($('<img>').attr({'src':result.Thumbnail.Location,'alt':'','width':_thumbnailWidth,'height':_thumbnailHeight,'data-sid':'3279'}))).append($('<div>').attr('class','listingsInfo').append($('<h4>').attr('class','address').text([result.ListingNumber,result.SuburbName,result.StreetAddress].join(', '))).append($('<span>').attr('class','heading').text(result.Heading)).append($('<a>').attr({'class':'listingRemove','title':'Remove Listing?','data-sid':'3280'}).text('src','Remove Listing?'))));$sid3278.attr({scrollTop:$sid3278.attr("scrollHeight")});var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}});}});$('[data-sid=3280]').live("click",function(){$(this).closest('.listingsContent').remove();});if(isOfficeWebsite){$('[data-sid=3272]').trigger("change");}
else{$('[data-sid=3271]').trigger("change");}},loadFeatures:function(div){var obj=harcourtsPublic.websiteContent.featuredPropertiesWidget;div.attr("currentlySelected",0);div.find("#featured #featProperties div.thumb").each(function(i){var $this=$(this);$this.bind('click',{id:i,div:div},obj.selectFeatureListing);$this.attr('data-index',i);});div.find('#featProperties .btnLeft').click(function(evt){evt.preventDefault();obj.scrollLeft(div);});div.find('#featProperties .btnRight').click(function(evt){evt.preventDefault();obj.autoPlay(div);});div.find("#featured #featProperties div.thumb a").removeAttr('href');div.find("#featured #featImg").css('background-color','black');obj.initAutoPlay(div);div.find("#featured").hover(function(){obj.pauseAutoPlay(div);},function(){obj.initAutoPlay(div);});},initAutoPlay:function(div){var obj=harcourtsPublic.websiteContent.featuredPropertiesWidget;if(div.attr('autoPlayInterval')!==undefined&&parseInt(div.attr("autoPlayInterval"))!==0){clearInterval(div.attr("autoPlayInterval"));}
var _autoPlayMax=div.find("#featured #featProperties div.thumb").length;div.attr("autoPlayMax",_autoPlayMax);if(_autoPlayMax<=1)
return;div.attr("autoPlayInterval",setInterval(function(){obj.autoPlay(div);},7000));},pauseAutoPlay:function(div){var obj=harcourtsPublic.websiteContent.featuredPropertiesWidget;clearInterval(div.attr("autoPlayInterval"));div.attr("autoPlayInterval",0);},autoPlay:function(div,evt){if(evt!==undefined){evt.preventDefault();}
var obj=harcourtsPublic.websiteContent.featuredPropertiesWidget;var next=parseInt(div.attr("currentlySelected"))+1;if(next>=parseInt(div.attr("autoPlayMax")))
next=0;obj.selectFeatureListing({data:{id:next,scrollRight:true,div:div}});},scrollLeft:function(div,evt){if(evt!==undefined){evt.preventDefault();}
var obj=harcourtsPublic.websiteContent.featuredPropertiesWidget;var next=parseInt(div.attr("currentlySelected"))-1;if(next<0)
next=parseInt(div.attr("autoPlayMax"))-1;obj.selectFeatureListing({data:{id:next,scrollRight:false,div:div}});},animateLeft:function(current,next,div){var obj=harcourtsPublic.websiteContent.featuredPropertiesWidget;var width=420;var widthSnippet=420;var duration=400;var durationSnippet=0;var $current;var $next;var $currentSnippet;var $nextSnippet;div.find("#featured #featImg a").each(function(i){if(i==current){$current=$(this);}else if(i==next){$next=$(this);}});div.find("#featSnippet .featDescription").each(function(i){if(i==current){$currentSnippet=$(this);}else if(i==next){$nextSnippet=$(this);}});$next.css("left",width+"px");$next.animate({"left":"0px"},duration,"swing");$current.animate({"left":-width+"px"},duration,"swing");$nextSnippet.css("left",widthSnippet+"px");$nextSnippet.animate({"left":"0px"},durationSnippet,"swing");$currentSnippet.animate({"left":-1418+"px"},durationSnippet,"swing");},selectFeatureListing:function(eventObject){var obj=harcourtsPublic.websiteContent.featuredPropertiesWidget;var id=eventObject.data.id;var scrollRight=eventObject.scrollRight===undefined?true:eventObject.scrollRight;var div=eventObject.data.div;var _rotate=false;if(parseInt(div.attr("currentlySelected"))===id)
return;div.find("#featured #featProperties div.thumb").each(function(i){var $this=$(this);var _isSelectedItem=$this.attr('data-index')==id;$this.toggleClass('selected',_isSelectedItem);if(_isSelectedItem&&i>=obj._maxVisibleItems){_rotate=true;}});if(_rotate){if(scrollRight){var firstDiv=div.find(".arrayWrap").find("div.thumb:first");firstDiv.remove();div.find(".arrayWrap").append(firstDiv);firstDiv.bind('click',{id:parseInt(firstDiv.attr('data-index')),div:div},obj.selectFeatureListing);}
else{var lastDiv=div.find(".arrayWrap").find("div.thumb:last");lastDiv.remove();div.find(".arrayWrap").prepend(lastDiv);lastDiv.bind('click',{id:parseInt(lastDiv.attr('data-index')),div:div},obj.selectFeatureListing);}}
obj.animateLeft(parseInt(div.attr("currentlySelected")),id,div);div.attr("currentlySelected",id);}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{formResults:{init:function($div){if(_settings.isInEditMode){$div.closest(".ui-dialog").addClass('formResultsDisplay');var $sid4021=$("[data-sid=4021]");var $options=$('option',$sid4021);$options.each(function(){$(this).text($(this).text().replace(/\s/g,'\xA0'));});$sid4021.change(function(){if($sid4021.val()!='0'){$.ajax({type:"post",cache:false,async:false,url:'/WebsiteContent/Website/GetFormResultsForWidget/'+$sid4021.val(),success:function(data,textStatus,xhr){$('.widgetFormResults').html(data);var $table=$('.widgetFormResults').find('div.resultFeed table');$table.fixedHeaderTable({height:'500',width:'900',autoShow:true});},error:function(xhr,textStatus,errorThrown){$div.alertDialog('Error','An error has occurred. Please try again later.');}});}
else{$('.widgetFormResults').html('<div class="titlePlaceholder"></div><div class="resultFeed borderHidden"></div>');}});var $sid3139=$('[data-sid=3139]');var $sid4022=$("[data-sid=4022]");$sid4022.change(function(){$.ajax({type:"post",cache:false,async:false,url:'/WebsiteContent/Website/GetFormResults/'+$sid3139.val(),data:{includeInactive:$sid4022.is(":checked")},success:function(data,textStatus,xhr){var formResultsWidget=$('.formResultsWidget');formResultsWidget.outerHTML(data);formResultsWidget.functionName();},error:function(xhr,textStatus,errorThrown){$div.alertDialog('Error','An error has occurred. Please try again later.');}});});var $sid4023=$("[data-sid=4023]");$sid4023.live("click",function(evt){evt.preventDefault();window.location='/WebsiteContent/Website/ExportFormResultsForWidget/'+$sid4021.val();});}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{formWidget:{widgetTypeID:16,currentField:null,isFormModified:false,lastSelected:'0',widgetIndex:0,init:function($div){var obj=harcourtsPublic.websiteContent.formWidget;obj.isFormModified=false;if(!$div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init($div.closest('form'));}
if(!_settings.isInEditMode){$div.find("[data-sid=4017]").val(true);}
$div.find('input,textarea,select,label').each(function(i){var $this=$(this);if($this.attr("id")){if($this.attr("id").startsWith('Layout')){$this.attr('id',$this.attr('id').replace(/Layout_Widgets_\d+__/,"Layout_Widgets_"+obj.widgetIndex+"__"));}
else{$this.attr('id',"Layout_Widgets_"+obj.widgetIndex+"__"+$this.attr('id'));}}
if($this.attr("name")){if($this.attr("name").startsWith('Layout')){$this.attr('name',$this.attr('name').replace(/Layout.Widgets\[\d+\]./,"Layout.Widgets\["+obj.widgetIndex+"]."));}
else{$this.attr('name',"Layout.Widgets\["+obj.widgetIndex+"]."+$this.attr('name'));}}
if($this.attr("for")){if($this.attr("for").startsWith('Layout')){$this.attr('for',$this.attr('for').replace(/Layout_Widgets_\d+__/,"Layout_Widgets_"+obj.widgetIndex+"__"));}
else{$this.attr('for',"Layout_Widgets_"+obj.widgetIndex+"__"+$this.attr('for'));}}});obj.widgetIndex++;},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","formWidget");newWidget.attr("data-sid","3496");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.formWidget.init");newWidget.attr("href","/WebsiteContent/FormWidget/Edit/");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},editInit:function($div){var obj=harcourtsPublic.websiteContent.formWidget;harcourtsPublic.websiteContent.widget.editInit($div);$("#formWidgetTabs").tabs({selected:0,show:function(event,ui){var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}});$div.closest(".ui-dialog").addClass('formContentEdit');var $sid3978=$("[data-sid=3978]");$sid3978.live('keyup',function(){var $this=$(this);if($this.val().trim()===''){$this.parent().find('span.field-validation-error').show();}
else{$this.parent().find('span.field-validation-error').hide();}});$("[data-sid=3989]").live('click',function(evt){evt.preventDefault();$(this).closest('div.fieldContent').remove();obj.refreshFields();});$("[data-sid=3992]").click(function(evt){evt.preventDefault();$("div.formHelp").addClass("hidden");$("div.editField").removeClass("hidden");obj.currentField=null;$('[data-sid=3993]').val('');$('[data-sid=3994]').val($("[data-sid=3994] option:first").val());$('[data-sid=3995]').attr('checked',false);$('div.editField span.field-validation-error').remove();$('[data-sid=3998]').find('li.options div').html('');$('[data-sid=3998]').functionName();});$('.fieldMoveUp, .fieldMoveDown').live('click',function(evt){evt.preventDefault();var _hasfieldMoved=false;var $field=$(this).closest('div.fieldContent');var $formFields=$(this).closest("div.formFields").children();var _moveUp=$(this).hasClass('fieldMoveUp');if(_moveUp){var $prevField=$field.prevAll().first();if($prevField.length>0){$field.swapWith($prevField);_hasfieldMoved=true;}}
else{var $nextField=$field.nextAll().first();if($nextField.length>0){$field.swapWith($nextField);_hasfieldMoved=true;}}
if(_hasfieldMoved){obj.refreshFields();}});$("[data-sid=3988]").live('click',function(evt){obj.currentField=$(this).closest('div');$.ajax({type:"get",cache:false,async:false,url:"/WebsiteContent/FormWidget/LoadField/",data:obj.getFieldModel(),dataType:"html",success:function(html){var $html=$(html);$("div.formHelp").addClass("hidden");$("div.editField").removeClass("hidden");$('div.editField').html($html.outerHTML()).functionName();obj.refreshFields();},error:function(xhr,textStatus,errorThrown){$div.alertDialog('Error','An error has occurred. Please try again later.');}});});$('[data-sid=3994]').live("change",function(evt){var $this=$(this);var $sid3995=$('[data-sid=3995]');if($this.val()==='Dropdown'||$this.val()==='Radio'||$this.val()==='CheckboxList'){$('li.options').removeClass('hidden');}
else{$('li.options').addClass('hidden');}
if($this.val()==='EmailAddress'){$sid3995.attr('checked','checked');}
if($this.val()==='Checkbox'){$sid3995.closest('li').addClass('hidden');}
else{$sid3995.closest('li').removeClass('hidden');}});$("[data-sid=4006]").live('click',function(evt){evt.preventDefault();$(this).closest('div').remove();obj.isFormModified=true;});$("[data-sid=3999]").change(function(evt){var $this=$(this);var changeTemplate=true;if($this.val()!=='0'){if(obj.isFormModified===true){changeTemplate=false;$this.confirmDialog('Confirm template change','Your form has been modified. Changes will be lost. Are you sure you wish to continue?',{yesCallback:function(){changeTemplate=true;obj.getFormTemplate($this);},noCallback:function(){evt.preventDefault();changeTemplate=false;$this.val(obj.lastSelected);return false;}});}
if(changeTemplate){obj.getFormTemplate($this);}}
var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});});obj.refreshFields();$("[data-sid=3978]").focusWithTimeout();},editFieldInit:function($div){var obj=harcourtsPublic.websiteContent.formWidget;$("[data-sid=3996]").unbind('click');$("[data-sid=3996]").click(function(evt){evt.preventDefault();var $currentField=obj.currentField;var sid=$(this).closest('div').sid();$.ajax({type:"post",cache:false,async:false,url:"/WebsiteContent/FormWidget/SaveField/",data:obj.saveFieldModel(),dataType:"html",success:function(html){var $html=$(html);if($html.sid()!==undefined&&$html.sid()===sid){$('div.editField').html($html.outerHTML()).functionName();return;}
var $hiddenFields=$html.find("[data-sid=3983],[data-sid=3984],[data-sid=3985]");$hiddenFields.each(function(i){var $this=$(this);if(!$this.attr('id').startsWith('Fields_FieldList')){$this.attr('id','Fields_FieldList_0__'+$this.attr('id'));}
if(!$this.attr('name').startsWith('Fields_FieldList')){$this.attr('name','Fields.FieldList[0].'+$this.attr('name'));}});$('[data-sid=4000]').each(function(i){var $this=$(this);if(!$this.attr('for').startsWith('Fields_FieldList')){$this.attr('for','Fields_FieldList_0__'+$this.attr('for'));}});if($currentField===null){$("div.formFields").children().append($html);obj.refreshFields();obj.isFormModified=true;}
else{var originalHtml=$currentField.outerHTML();$currentField.html($html.html())
obj.refreshFields();if($currentField.html().toLowerCase()!==originalHtml.toLowerCase()){obj.isFormModified=true;}}
obj.currentField=null;$("div.formHelp").removeClass("hidden");$("div.editField").addClass("hidden");},error:function(xhr,textStatus,errorThrown){$div.alertDialog('Error','An error has occurred. Please try again later.');}});});$("[data-sid=4003]").unbind('click');$('[data-sid=4003]').click(function(evt){evt.preventDefault();var option=$('<input>').attr('type','text').attr('name','Options[0].Option').attr('id','Options_0_Option').attr('data-sid','4004').addClass('option textbox').val('');$('li.options').children('div').append($('<div>').append(option).append($('<a>').attr('href','#').attr('data-sid','4006').addClass('optionRemove').text('Remove Option?')));option.focus();obj.isFormModified=true;});},getFormTemplate:function($dropdown){var obj=harcourtsPublic.websiteContent.formWidget;$.ajax({type:"get",cache:false,async:false,url:"/WebsiteContent/FormWidget/LoadTemplate/",data:{templateID:$dropdown.val()},dataType:"html",success:function(html){var $html=$(html);var $hiddenFields=$html.find("[data-sid=3983],[data-sid=3984],[data-sid=3985]");$hiddenFields.each(function(i){var $this=$(this);if(!$this.attr('id').startsWith('Fields_')){$this.attr('id','Fields_'+$this.attr('id'));}
if(!$this.attr('name').startsWith('Fields_')){$this.attr('name','Fields.'+$this.attr('name'));}});$('[data-sid=4000').each(function(i){var $this=$(this);if(!$this.attr('for').startsWith('Fields_')){$this.attr('for','Fields_'+$this.attr('for'));}});$("div.formHelp").removeClass("hidden");$("div.editField").addClass("hidden");$('div.formFields').html($html.outerHTML()).functionName();obj.refreshFields();obj.isFormModified=false;obj.lastSelected=$dropdown.val();var $sid3978=$("[data-sid=3978]");var changeTitle=$sid3978.val().trim()==='';var $sid3999=$("[data-sid=3999]");var $options=$('option',$sid3999);$options.each(function(){changeTitle=changeTitle||($(this).text().trim()===$sid3978.val().trim());});if(changeTitle===true){$sid3978.val($("[data-sid=3999] :selected").text());}},error:function(xhr,textStatus,errorThrown){$div.alertDialog('Error','An error has occurred. Please try again later.');}});},getFieldModel:function(){var obj=harcourtsPublic.websiteContent.formWidget;var $div=obj.currentField;var optionsArray={};$div.find('[data-sid=4005]').each(function(i){var $this=$(this);optionsArray["options["+i+"].Option"]=$this.val();});var options={label:$div.find('[data-sid=3983]').val(),fieldType:$div.find('[data-sid=3984]').val(),isRequired:$div.find('[data-sid=3985]').val()};$.extend(true,options,optionsArray);return options;},saveFieldModel:function(){var optionsArray={};$('li.options').find('[data-sid=4004]').each(function(i){var $this=$(this);optionsArray["options["+i+"].Option"]=$this.val();});var options={label:$('[data-sid=3993]').val(),fieldType:$('[data-sid=3994]').val(),isRequired:$('[data-sid=3995]').is(":checked")};var $sid3994=$('[data-sid=3994]');if($sid3994.val()==='Dropdown'||$sid3994.val()==='Radio'||$sid3994.val()==='CheckboxList'){$.extend(true,options,optionsArray);}
return options;},refreshFields:function(){var obj=harcourtsPublic.websiteContent.formWidget;var $formFields=$("div.formFields").children();var $fields=$formFields.children("div.fieldContent");$fields.each(function(i){var $this=$(this);$this.find("ul.widgetToolbar > li").hover(function(){$(this).addClass("hover");$('ul:first',this).css('visibility','visible');},function(){$(this).removeClass("hover");$('ul:first',this).css('visibility','hidden');});$this.find('ul.widgetToolbar li ul:first').css('visibility','hidden');$this.find("ul.widgetToolbar").css({'z-index':50-i});obj.showOrHideUpDownDropdowns($this);$this.find("ul.widgetToolbar").find('ul').css('visibility','hidden');});$formFields.reindexInputs("div");$formFields.reindexLabels("div");},showOrHideUpDownDropdowns:function($div){var $prevField=$div.prevAll();var $moveUpParent=$div.find('ul.widgetToolbar a.fieldMoveUp').parent();var $moveDownParent=$div.find('ul.widgetToolbar a.fieldMoveDown').parent();if($prevField.length>0){$moveUpParent.removeClass('hidden');}else{$moveUpParent.addClass('hidden');}
var $nextField=$div.nextAll();if($nextField.length>0){$moveDownParent.removeClass('hidden');}else{$moveDownParent.addClass('hidden');}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{headerWidget:{init:function(div){var $sid3223=$("[data-sid=3223]");$sid3223.addPlaceholder();}}}});})(jQuery);;;(function($){$.fn.alertDialog=function(title,content,callbacks){$(this).genericDialog(false,title,content,callbacks);};$.fn.closeDialog=function(){return this.each(function(){var $this=$(this);$this.dialog('close');$this.remove();});};$.fn.confirmDialog=function(title,content,callbacks){$(this).genericDialog(true,title,content,callbacks);}
$.fn.genericDialog=function(isConfirmDialog,title,content,callbacks){var $cancelButton=isConfirmDialog?$('<a>').addClass('btnLrge btnCancel').text('Cancel').attr('data-sid','3242'):'';var $page=$('<div>').html(content).wrapAll('<div class="dialogWrapper"></div>').append($('<div>').addClass('panelBase').append($cancelButton).append($('<a>').addClass('btnLrge').text('Ok').attr('data-sid','3243'))).parent();$page.dialog({modal:true,draggable:true,title:title});var $dialog=$page.closest('.ui-dialog');$dialog.addClass('confirmDialog');var $titleBar=$dialog.find('.ui-dialog-titlebar');$titleBar.addClass('confirmTitle');$titleBar.find('.ui-dialog-titlebar-close').attr('data-sid','3241');$dialog.position({my:"center",at:"center",of:window});if($dialog.position().top<0){$dialog.css({"top":"0px"});}
$('[data-sid=3241],[data-sid=3242]').click(function(evt){evt.preventDefault();if(callbacks!==undefined&&callbacks.noCallback&&$.isFunction(callbacks.noCallback)){callbacks.noCallback.apply();}
$dialog.closeDialog();});$('[data-sid=3243]').click(function(evt){evt.preventDefault();if(callbacks!==undefined&&callbacks.yesCallback&&$.isFunction(callbacks.yesCallback)){callbacks.yesCallback.apply();}
$dialog.closeDialog();});};$.fn.focusWithTimeout=function(delay){if(delay===undefined){delay=50;}
return this.each(function(){var $this=$(this);setTimeout(function(){$this.focus();},delay);});};$.fn.getCaretPosition=function(){var e=$(this).get(0);e.focus();if(e.selectionStart){return e.selectionStart;}
if(document.selection){var r=document.selection.createRange();if(r==null){return e.value.length;}
var re=e.createTextRange();var rc=re.duplicate();re.moveToBookmark(r.getBookmark());rc.setEndPoint('EndToStart',re);return rc.text.length;}
return e.value.length;},$.fn.setCaretPosition=function(pos){var e=$(this).get(0);e.focus();if(e.setSelectionRange){e.setSelectionRange(pos,pos);}else if(e.createTextRange){var range=e.createTextRange();range.collapse(true);range.moveEnd('character',pos);range.moveStart('character',pos);range.select();}},$.fn.getValOfChildBySid=function(sid){var $this=$(this);return $this.find("[data-sid="+sid+"]").val();};$.fn.loaded=function(){$("[data-sid=3597]").hide();};$.fn.loading=function(message){if(!message){message=$.resource('LoadingDotDotDot');}
var $loading=$("[data-sid=3597]");if($loading.length==0){$loading=$("<div>").attr("class","loadingDynamic").attr("data-sid","3597").css({position:'absolute',display:'block',zIndex:'999999'});$("body").append($loading);}
$loading.html('<table><tr><td><img src="/Areas/WebsiteContent/Images/logoAnimBlue32.gif" /></td><td class="middle">&nbsp;&nbsp;'+message+'</td></tr></table>');var top=(($(window).height()-$loading.innerHeight())/2)+$(window).scrollTop();var left=(($(window).width()-$loading.innerWidth())/2)+$(window).scrollLeft();$loading.css({top:top,left:left});$loading.show();return true;};$.fn.limitChars=function(limit,infoDiv){var text=$(this).val();var textlength=text.length;if(textlength>limit){$(this).val(text.substr(0,limit));if(infoDiv!==undefined){infoDiv.html($.resource("CharacterLimitFormatString").format(limit,limit));}
return false;}
else{if(infoDiv!==undefined){infoDiv.html($.resource("CharacterLimitFormatString").format(limit,textlength));}
return true;}}
$.fn.reindexInputs=function(parentSelector){return this.each(function(){var $this=$(this);var parentElement=null;var index=-1;$this.find(":input").each(function(){var $input=$(this);var inputParentElement=$input.parents(parentSelector).get(0);if(parentElement!=inputParentElement){parentElement=inputParentElement;index++;}
var name=$input.attr("name");if(name){$input.attr("name",name.replace(/\[\d+\](?!.\[\d+\])/,"["+index+"]"));}
var id=$input.attr("id");if(id){$input.attr("id",id.replace(/\_\d+\_(?!.\_\d+\_)/,"_"+index+"_"));}});});};$.fn.reindexLabels=function(parentSelector){return this.each(function(){var $this=$(this);var parentElement=null;var index=-1;$this.find('label').each(function(){var $label=$(this);var labelParentElement=$label.parents(parentSelector).get(0);if(parentElement!=labelParentElement){parentElement=labelParentElement;index++;}
var _for=$label.attr("for");if(_for){$label.attr("for",_for.replace(/\_\d+\_(?!.\_\d+\_)/,"_"+index+"_"));}});});};$.fn.setupDialogCancel=function(noCallback){return this.each(function(){var $this=$(this);$this.unbind("click");$this.click(function(evt){evt.preventDefault();if(noCallback&&$.isFunction(noCallback)){noCallback.apply();}
$this.closest('.ui-dialog').find('.dialogWrapper').remove();$this.closest('.ui-dialog').closeDialog();});});};$.fn.swapWith=function(to){return this.each(function(){var $this=$(this);var copy_to=to.clone();var copy_from=$this.clone();to.replaceWith(copy_from);$this.replaceWith(copy_to);});};$.fn.updateWidgetsSortOrder=function(){var $this=$(this);var containerInstancesArray={};$(this).each(function(i){var $this=$(this);containerInstancesArray["containerInstances["+i+"].containerInstanceWidgetID"]=$this.find("input[id$=ContainerInstanceWidgetID]").val();containerInstancesArray["containerInstances["+i+"].sortOrder"]=$this.find("input[id$=SortOrder]").val();});$.post("/WebsiteContent/BaseWidget/UpdateWidgetSortOrder",$.param(containerInstancesArray),function(html){},"html");};})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{isHandlerActive:true,errorMessageFormatString:'<div id="bodyHtml" class="w230" sid="3240"><b>{0}</b></div>',pageInit:function(){var $sid3216=$("[data-sid=3216]");var _isBackgroundImageTiled=$sid3216.val().toBool()?"":" no-repeat center top";var $sid3217=$('[data-sid=3217]');if($sid3217.val()!==''){$("body").css("background","url('"+$sid3217.val().replace(/ /g,"%20")+"')"+_isBackgroundImageTiled);}
var $sid3948=$('[data-sid=3948]');if($sid3948.val()!==''){$("body").css("background-color",'#'+$sid3948.val());}},masterPageInit:function(){var self=this;if(_settings.isInEditMode){self.setupToolbar();}},setupToolbar:function(){var self=this;var $sid3200=$("[data-sid=3200]");var $collapse_toolbar_icon=$("[data-sid=3203]");var $expand_toolbar_icon=$("[data-sid=3204]");$collapse_toolbar_icon.click(function(){if($(".bannerWidgetOuter").hasClass("toolbarExpanded")){$(".bannerWidgetOuter,.expander,[data-sid=3202],#toolbarPlaceholder").switchClass('toolbarExpanded','toolbarCollapsed',"slow");}
else{$(".expander,[data-sid=3202],#toolbarPlaceholder").switchClass('toolbarExpanded','toolbarCollapsed',"slow");}
self.hideToolbar();$.cookie("toolbar",false,{path:'/'});});$expand_toolbar_icon.click(function(){if($(".bannerWidgetOuter").hasClass("toolbarCollapsed")){$(".bannerWidgetOuter,.expander,[data-sid=3202],#toolbarPlaceholder").switchClass('toolbarCollapsed','toolbarExpanded',"slow");}
else{$(".expander,[data-sid=3202],#toolbarPlaceholder").switchClass('toolbarCollapsed','toolbarExpanded',"slow");}
self.isHandlerActive=true;$("[data-sid=3700]").each(function(){harcourtsPublic.websiteContent.container.showOrHideAddWidgetArea($(this));});$('a.linkheader').hide();$('ul.widgetToolbar').show();$("#pageContainer").height($(document).height());$.cookie("toolbar",true,{path:'/'});});if($.cookie("toolbar")==='false'){if($(".bannerWidgetOuter").hasClass("toolbarExpanded")){$(".bannerWidgetOuter,.expander,[data-sid=3202],#toolbarPlaceholder").switchClass('toolbarExpanded','toolbarCollapsed',0);}
else{$(".expander,[data-sid=3202],#toolbarPlaceholder").switchClass('toolbarExpanded','toolbarCollapsed',0);}
self.hideToolbar();}
$('.harcourtsOne').click(function(){$.cookie("toolbar",null);$.cookie("treeview-sitemap",null);});},hideToolbar:function(){var self=this;self.isHandlerActive=false;$("[data-sid=3700]").each(function(){harcourtsPublic.websiteContent.container.showOrHideAddWidgetArea($(this));});$('ul.widgetToolbar').hide();$('a.linkheader').show();$("#pageContainer").height($(document).height());},ajaxError:function(XMLHttpRequest,textStatus,errorThrown){var _status=XMLHttpRequest.status;if(window.location.hostname!=='localhost'&&_status==530){window.location=_resources.harcourtsOneMvcWebSiteUrl+"/WebsiteAdmin/Management.mvc/";}
else if(_status==530){alert('Unauthorized access');}
else if(XMLHttpRequest.statusText!=null){alert(XMLHttpRequest.statusText);}
else if(textStatus!=null){alert(textStatus);}
$(this).loaded();}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{jwysiwyg:{init:function(div,showYouTube,containerColumns){var self=this;var parent=div.closest(".ui-dialog");if(containerColumns===1){parent.removeClass('mainContentEdit').addClass('sidebarContentEdit');}
else if(containerColumns===2){parent.removeClass('sidebarContentEdit').addClass('mainContentEdit');}
div.wysiwyg({autoSave:true,rmUnwantedBr:true,rmMsWordMarkup:true,removeHeadings:true,initialContent:'<p>Please add your content here.</p>',xhtml5:true,unicode:true,brIE:false,tableFiller:null,websiteImageTypeEnum:containerColumns,events:{beforedeactivate:function(event){div.wysiwyg("save");},blur:function(event){div.wysiwyg("save");}},controls:{html:{visible:true},h1:{"arguments":($.browser.msie||$.browser.safari)?"<h3>":"h3",tags:["h3"],tooltip:"Heading 1"},h2:{"arguments":($.browser.msie||$.browser.safari)?"<h4>":"h4",tags:["h4"],tooltip:"Heading 2"},h3:{visible:false},undo:{visible:$.browser.msie?false:true},redo:{visible:$.browser.msie?false:true},indent:{visible:false},outdent:{visible:false},code:{visible:false},createLink:{},insertHorizontalRule:{},insertTable:{},insertImage:{},paste:{visible:true,tooltip:'Paste plain text',exec:function(){var self=this;if($.wysiwyg.controls&&$.wysiwyg.controls.paste){$.wysiwyg.controls.paste(this);}else if($.wysiwyg.autoload){$.wysiwyg.autoload.control("wysiwyg.paste.js",function(){self.controls.paste.exec.apply(self);});}else{console.error("$.wysiwyg.controls.paste not defined. You need to include wysiwyg.paste.js file");}}},pasteFromWord:{visible:true,groupIndex:8,tooltip:'Paste from Word',exec:function(){var self=this;if($.wysiwyg.controls&&$.wysiwyg.controls.pasteFromWord){$.wysiwyg.controls.pasteFromWord(this);}else if($.wysiwyg.autoload){$.wysiwyg.autoload.control("wysiwyg.pasteFromWord.js",function(){self.controls.pasteFromWord.exec.apply(self);});}else{console.error("$.wysiwyg.controls.pasteFromWord not defined. You need to include wysiwyg.pasteFromWord.js file");}}},quote:{visible:true,groupIndex:2,tooltip:'Quote',tags:["blockQuote"],exec:function(){var self=this;if($.wysiwyg.controls&&$.wysiwyg.controls.quote){$.wysiwyg.controls.quote(this);}else if($.wysiwyg.autoload){$.wysiwyg.autoload.control("wysiwyg.quote.js",function(){self.controls.insertQuote.exec.apply(self);});}else{console.error("$.wysiwyg.controls.quote not defined. You need to include wysiwyg.quote.js file");}}},files:{visible:true,groupIndex:6,tooltip:'Downloadable Files',exec:function(){var self=this;if($.wysiwyg.controls&&$.wysiwyg.controls.files){$.wysiwyg.controls.files.init(this);}else if($.wysiwyg.autoload){$.wysiwyg.autoload.control("wysiwyg.files.js",function(){self.controls.insertFiles.exec.apply(self);});}else{console.error("$.wysiwyg.controls.files not defined. You need to include wysiwyg.files.js file");}}},youTube:{visible:showYouTube,groupIndex:6,tooltip:'Embed a YouTube video',exec:function(){var self=this;if($.wysiwyg.controls&&$.wysiwyg.controls.youTube){$.wysiwyg.controls.youTube.init(this);}else if($.wysiwyg.autoload){$.wysiwyg.autoload.control("wysiwyg.youTube.js",function(){self.controls.insertYouTube.exec.apply(self);});}else{console.error("$.wysiwyg.controls.youTube not defined. You need to include wysiwyg.youTube.js file");}}}}});self.appendCssFileToEditorIframe(div,self.findPath()+"/Areas/WebsiteContent/Css/Rollup/WebsiteContent.css");self.appendCssFileToEditorIframe(div,self.findPath()+"/Areas/WebsiteContent/Css/Rollup/admin.css");self.appendConditionalIECssToEditorIframe(div);var iframeBody$=$("iframe",parent).contents().find("body");if(containerColumns===1){iframeBody$.removeClass('mainContentEdit').addClass('sidebarContentEdit');}
else if(containerColumns===2){iframeBody$.removeClass('sidebarContentEdit').addClass('mainContentEdit');}},findPath:function(){var baseFile=window.location;return baseFile.protocol+'//'+baseFile.host;},appendCssFileToEditorIframe:function(div,pathToFile){var element=$("<link/>").attr({"href":pathToFile,"media":"all","rel":"stylesheet","type":"text/css"});div.parent().find("iframe").contents().find("head").append(element);},appendConditionalIECssToEditorIframe:function(div$){if(!$.browser.msie)
return;var element=$("<link/>").attr({"href":this.findPath()+'/Css/IE'+(1*$.browser.version)+'.css',"media":"screen","rel":"stylesheet","type":"text/css"});div$.parent().find("iframe").contents().find("head").append(element);},onUploadComplete:function(event,queueId,fileObj,response,data){response=$.parseJSON(response);if(response.Status=='OK'){var $sid3225=$('[data-sid=3225]');$sid3225.val(response.FilePath);$sid3225.trigger("change");}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{linkedinWidget:{widgetTypeID:8,init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);var self=this;$.requireScript('http://www.linkedin.com/js/public-profile/widget-os.js',function(){});}},findPath:function(){var baseFile=window.location;return baseFile.protocol+'//'+baseFile.host;},appendCssFile:function(div,pathToFile){var self=this;var element=$("<link/>").attr({"href":pathToFile,"media":"all","rel":"stylesheet","type":"text/css"});setTimeout(function(){self.setCssForWidget(div,element)},5000);},setCssForWidget:function(div,element){var self=this;if(div.find("iframe").length>0){div.find("iframe").contents().find("head").append(element);}
else{setTimeout(function(){self.setCssForWidget(div,element)},5000);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","linkedinWidget");newWidget.attr("data-sid","3496");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.linkedinWidget.init");newWidget.attr("href","/WebsiteContent/LinkedInWidget/Edit/");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},editInit:function(div){harcourtsPublic.websiteContent.widget.editInit(div);$("[data-sid=3218]").focusWithTimeout();}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{listingSearchFormWidget:{widgetTypeID:10,init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","listingSearchFormWidget");newWidget.attr("data-sid","3496");newWidget.attr("href","/WebsiteContent/ListingSearchFormWidget/Edit/");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.listingSearchFormWidget.init");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},editorInit:function(){}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{listingSearchResultsWidget:{widgetTypeID:9,init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","listingSearchResultsWidget");newWidget.attr("data-sid","3496");newWidget.attr("href","/WebsiteContent/ListingSearchResultsWidget/Edit/");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.listingSearchResultsWidget.init");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},editorInit:function(){}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{listingViewWidget:{widgetTypeID:11,init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","listingViewWidget");newWidget.attr("data-sid","3496");newWidget.attr("href","/WebsiteContent/ListingViewWidget/Edit/");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.listingViewWidget.init");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},editorInit:function(){}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{menuWidget:{init:function(ul){var obj=harcourtsPublic.websiteContent;$("ul.dropdown li").hover(function(){$(this).addClass("hover");$('ul:first',this).css('visibility','visible');},function(){$(this).removeClass("hover");$('ul:first',this).css('visibility','hidden');});$("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{navigationWidget:{widgetTypeID:3,init:function($div){if(!$div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init($div);}},createNew:function($newWidget){var obj=harcourtsPublic.websiteContent;$newWidget.attr("id","navigationWidget");$newWidget.attr("data-sid","3496");$newWidget.attr("data-iseditable","false");$newWidget.attr("data-functionname","harcourtsPublic.websiteContent.navigationWidget.init");$newWidget.attr("data-parameters","harcourtsPublic.websiteContent.navigationWidget.getCreateNewParameters");$newWidget.attr("href","/WebsiteContent/NavigationWidget/New/");return $newWidget;},getCreateNewParameters:function(obj){return $.extend(true,obj,{pageID:$('[data-sid=3891]').val()});}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{oneColContainer:{init:function(div){if(_settings.isInEditMode){harcourtsPublic.websiteContent.container.init(div);}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{widgetType:{PhotoBoardWidget:13},photoBoardWidget:{init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","photoBoardWidget");newWidget.attr("data-sid","3496");newWidget.attr("href","/WebsiteContent/PhotoBoardWidget/Edit/");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.photoBoardWidget.init");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},editorInit:function(){}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{profilePhotoAndContactWidget:{widgetTypeID:14,init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","profilePhotoAndContactWidget");newWidget.attr("data-sid","3496");newWidget.attr("href","/WebsiteContent/ProfilePhotoAndContactWidget/Edit/");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.photoBoardWidget.init");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},editorInit:function(){}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{rssWidget:{widgetTypeID:2,init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);if(div.getValOfChildBySid(3679).toBool()){var self=this;self.reloadFeed(div);}}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","rssWidget");newWidget.attr("data-sid","3496");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.rssWidget.init");newWidget.attr("href","/WebsiteContent/RSSWidget/Edit/");return newWidget;},getClassName:function(text){if(text.contains("twitter"))
return"twitter";else if(text.contains("wordpress"))
return"wordpress";else if(text.contains("blogspot"))
return"blogspot";return"blog";},reloadFeed:function(div){var obj=harcourtsPublic.websiteContent.rssWidget;var sid=div.sid();$.ajax({type:"post",cache:false,async:true,url:"/WebsiteContent/RSSWidget/ReloadFeed/"+div.getValOfChildBySid(3499),dataType:"html",success:function(html){var $html=$(html);if($html.sid()==sid){div.html($html.html()).functionName();}}});},editInit:function(div){harcourtsPublic.websiteContent.widget.editInit(div);var obj=harcourtsPublic.websiteContent.rssWidget;$("[data-sid=3667]").focusWithTimeout();$('[data-sid=3668]').change(function(){$('[data-sid=3249]').val(obj.getClassName($(this).val()));});}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{sitemap:{cookieName:'treeview-sitemap',init:function($sitemap){var obj=harcourtsPublic.websiteContent.sitemap;$('#treeviewPages').treeview({collapsed:true,animated:"fast",persist:"cookie",cookieId:obj.cookieName});var $closeButton=$sitemap.closest('.ui-dialog').find('[data-sid=3241]');$closeButton.unbind('click');$closeButton.click(function(){obj.reloadPage(true);});$sitemap.closest('div.dialogWrapper').bind("dialogclose",function(event,ui){obj.reloadPage();});var current=$('ul.treeview').find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});current.parent().addClass("selected").end().addClass("selected").parents("ul, li").add(current.next()).show();$("[data-sid=4025]").click(function(evt){evt.preventDefault();var $this=$(this);$this.loading('Restoring');$.ajax({type:"post",cache:false,async:false,url:"/WebsiteContent/WebsitePage/RestoreFromSiteMap/"+$this.closest('li').attr('data-pageid'),dataType:"html",success:function(html){var $html=$(html);$('div.sitemap').outerHTML($html);$('div.sitemap').functionName();$this.loaded();},error:function(xhr,textStatus,errorThrown){$this.loaded();harcourtsPublic.websiteContent.admin.loadDialog(xhr.responseText);}});});$("[data-sid=4026]").click(function(evt){evt.preventDefault();var $this=$(this);$this.loading('Deleting');$.ajax({type:"post",cache:false,async:false,url:"/WebsiteContent/WebsitePage/DeleteFromSiteMap/"+$this.closest('li').attr('data-pageid'),dataType:"html",success:function(html){var $html=$(html);$('div.sitemap').outerHTML($html);$('div.sitemap').functionName();$this.loaded();},error:function(xhr,textStatus,errorThrown){$this.loaded();harcourtsPublic.websiteContent.admin.loadDialog(xhr.responseText);}});});$("[data-sid=4035]").click(function(evt){evt.preventDefault();var $this=$(this);$this.loading('Moving page');var _hasPageMoved=false;var $page=$this.closest('li');var $parentPage=$page.closest('ul');var $prevWidget=$page.prevAll('li:first');if($prevWidget.length>0){$page.swapWith($prevWidget);_hasPageMoved=true;}
if(_hasPageMoved){obj.saveTreeview();var $pages=$parentPage.children("li");$pages.each(function(i){var $this=$(this);$this.attr("data-sortorder",i);});$.ajax({type:"post",cache:false,async:false,url:"/WebsiteContent/WebsitePage/UpdateSortOrderForSitemap/",data:obj.getPageHeirarchiesForPageChildren($pages),dataType:"html",success:function(html){var $html=$(html);$('div.sitemap').outerHTML($html);$('div.sitemap').functionName();$this.loaded();},error:function(xhr,textStatus,errorThrown){$this.loaded();harcourtsPublic.websiteContent.admin.loadDialog(xhr.responseText);}});}});$("[data-sid=4036]").click(function(evt){evt.preventDefault();var $this=$(this);$this.loading('Moving page');var _hasPageMoved=false;var $page=$this.closest('li');var $parentPage=$page.closest('ul');var $nexWidget=$page.nextAll('li:first');if($nexWidget.length>0){$page.swapWith($nexWidget);_hasPageMoved=true;}
if(_hasPageMoved){obj.saveTreeview();var $pages=$parentPage.children("li");$pages.each(function(i){var $this=$(this);$this.attr("data-sortorder",i);});$.ajax({type:"post",cache:false,async:false,url:"/WebsiteContent/WebsitePage/UpdateSortOrderForSitemap/",data:obj.getPageHeirarchiesForPageChildren($pages),dataType:"html",success:function(html){var $html=$(html);$('div.sitemap').outerHTML($html);$('div.sitemap').functionName();$this.loaded();},error:function(xhr,textStatus,errorThrown){$this.loaded();harcourtsPublic.websiteContent.admin.loadDialog(xhr.responseText);}});}});$sitemap.find('li.draggable').draggable({handle:'span',zIndex:100,helper:'clone',revert:true,start:function(event,ui){$(this).fadeTo(0,0.5);ui.helper.find('img').each(function(i){$(this).remove();});},stop:function(event,ui){$(this).fadeTo(0,1.0);}}).disableSelection();$sitemap.find('li.droppable').droppable({accept:'#treeviewPages li.draggable',tolerance:'pointer',greedy:true,drop:function(event,ui){ui.helper.remove();var $this=$(this);$this.loading('Moving page');$('#treeviewPages').find('span').removeClass('drop-ui-state-hover');if(ui.draggable.closest('ul').children('li').not('.ui-draggable-dragging').length===1){ui.draggable.closest('ul').remove();}
if($this.children('ul').length>0){$this.children('ul:first').append(ui.draggable);}
else{$this.append($('<ul style="display: block;">').append(ui.draggable));}
$this.children('ul').addClass('selected').show();var _sortOrder=$this.children('ul').children('li').length-1;obj.saveTreeview();$.ajax({type:"post",cache:false,async:false,url:"/WebsiteContent/WebsitePage/UpdatePageForSitemap/"+ui.draggable.attr('data-pageid'),data:obj.getPageHeirarchies(ui.helper.closest('ul').children('li').not('[data-pageid='+ui.draggable.attr('data-pageid')+']'),$this.children('ul').children('li').not('[data-pageid='+ui.draggable.attr('data-pageid')+']'),$this.attr('data-pageid'),_sortOrder),dataType:"html",success:function(html){setTimeout(function(){harcourtsPublic.websiteContent.sitemap.reloadSitemap(html,$(ui.draggable))},1);$this.loaded();},error:function(xhr,textStatus,errorThrown){$this.loaded();harcourtsPublic.websiteContent.admin.loadDialog(xhr.responseText);}});},over:function(event,ui){var $this=$(this);$this.find('span:first').addClass('drop-ui-state-hover');},out:function(event,ui){var $this=$(this);$('#treeviewPages').find('span').removeClass('drop-ui-state-hover');}});obj.reindexSortOrder($('#treeviewPages li ul:first'));},getPageHeirarchies:function($sourceLI,$destinationLI,parentPageID,sortOrder){var pageHierarchyArray={};var count=0;$sourceLI.each(function(i){var $this=$(this);pageHierarchyArray["pageHierarchies["+i+"].pageHierarchyID"]=$this.attr('data-pagehierarchyid');pageHierarchyArray["pageHierarchies["+i+"].sortOrder"]=$this.attr('data-sortorder');count++;});$destinationLI.each(function(i){var $this=$(this);pageHierarchyArray["pageHierarchies["+(i+count)+"].pageHierarchyID"]=$this.attr('data-pagehierarchyid');pageHierarchyArray["pageHierarchies["+(i+count)+"].sortOrder"]=i;});var options={parentPageID:parentPageID,sortOrder:sortOrder};$.extend(true,options,pageHierarchyArray);return options;},getPageHeirarchiesForPageChildren:function($sourceLI){var pageHierarchyArray={};$sourceLI.each(function(i){var $this=$(this);pageHierarchyArray["pageHierarchies["+i+"].pageHierarchyID"]=$this.attr('data-pagehierarchyid');pageHierarchyArray["pageHierarchies["+i+"].sortOrder"]=$this.attr('data-sortorder');});return pageHierarchyArray;},reloadSitemap:function(html,$draggable){$draggable.appendTo("body");var $html=$(html);$('div.sitemap').outerHTML($html);$('div.sitemap').functionName();setTimeout(function(){$draggable.remove()},5000);},reindexSortOrder:function($node){var obj=harcourtsPublic.websiteContent.sitemap;var _numOfPages=$node.children('li').length;$node.children('li').each(function(i){var $this=$(this);$this.attr('data-sortorder',i);obj.reindexSortOrder($this.children('ul:first'));var $buttonUp=$this.children('span:first').find("[data-sid=4035]");var $buttonDown=$this.children('span:first').find("[data-sid=4036]");if(i===0){$buttonUp.addClass('hidden');}
if(i===(_numOfPages-1)){$buttonDown.addClass('hidden');}});},saveTreeview:function(){var obj=harcourtsPublic.websiteContent.sitemap;var data=[];$('#treeviewPages li').filter(":has(>ul)").each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(obj.cookieName,data.join(""));},reloadPage:function(closeDialog){$(this).loading('Reloading');$.ajax({type:"post",cache:false,async:true,url:'/WebsiteContent/WebsitePage/ValidatePageExists/',success:function(data,textStatus,xhr){var $this=$(this);$this.loaded();if(xhr.status===201){var newLocation=xhr.getResponseHeader("Location");window.location=newLocation;}else if(xhr.status===205){window.location.reload(true);}
if(closeDialog&&closeDialog===true){$this.closest('.ui-dialog').closeDialog();}},error:function(xhr,textStatus,errorThrown){$this.removeClass('submitting');if(submittingText){$(this).loaded();}
harcourtsPublic.websiteContent.admin.loadDialog(xhr.responseText);}});}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{siteSettings:{backgroundImageUploaderInit:function(){harcourtsPublic.websiteContent.uploadify.init($('[data-sid=3212]'),{script:'/WebsiteContent/Upload/UploadImage',fileExt:'*.jpg;*.gif;*.png',fileDesc:'Image Files (.JPG, .GIF, .PNG)',buttonText:'Select File',queueID:'3213',sizeLimit:307200,auto:true,multi:false,onComplete:harcourtsPublic.websiteContent.siteSettings.onComplete});},onComplete:function(event,queueId,fileObj,response,data){response=$.parseJSON(response);if(response.Status=='OK'){var $sid3214=$('[data-sid=3214]');$sid3214.attr('src',response.FilePath);$sid3214.addClass("selectedBg");var $sid3236=$('[data-sid=3236]');$sid3236.val(response.FilePath);var $sid3199=$('[data-sid=3199]');$sid3199.removeClass("selectedBg");$("[data-sid=3235]").val("1");}},siteSettingsInit:function(){if(_settings.isInEditMode){var self=this;$("#siteSettingTabs").tabs({selected:0,show:function(event,ui){var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}});$(".siteSettingTabsInner").tabs({selected:0,show:function(event,ui){var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}});var $sid3949=$('[data-sid=3949]');$sid3949.numeric({allow:"abcdefABCDEF"}).bind('keyup',function(){$('#colorSelector').ColorPickerSetColor(this.value);$('#colorSelector div').css('backgroundColor','#'+this.value);});$('#colorSelector').ColorPicker({onSubmit:function(hsb,hex,rgb,el){$(el).val(hex);$sid3949.val(hex.toUpperCase());$(el).ColorPickerHide();},onShow:function(colpkr){$(colpkr).fadeIn(500);return false;},onHide:function(colpkr){$(colpkr).fadeOut(500);return false;},onChange:function(hsb,hex,rgb){$('#colorSelector div').css('backgroundColor','#'+hex);}});var initialColor=$sid3949.val()!==''?$sid3949.val():'FFF';$('#colorSelector').ColorPickerSetColor(initialColor);$('#colorSelector div').css('backgroundColor','#'+initialColor);var $sid3236=$('[data-sid=3236]');if($sid3236.val()===''){var $sid3214=$("[data-sid=3214]");$sid3214.attr('src','/Areas/WebsiteContent/Images/Admin/image-placeholder.png');}
var $sid3953=$("[data-sid=3953]");$sid3953.click(function(){var $this=$(this);var $searchSettings=$('div.searchSettings');if($this.is(":checked")){$this.confirmDialog('All searches will be removed','All search widgets and search pages will be removed from your site. Are you sure you wish to continue?',{yesCallback:function(){$this.attr('checked','checked');$searchSettings.addClass('hidden');var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});},noCallback:function(){$this.removeAttr('checked');$searchSettings.removeClass('hidden');}});}
else{$searchSettings.removeClass('hidden');var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}});if($sid3953.is(":checked")){$('div.searchSettings').addClass('hidden');}
var $sid3116=$("[data-sid=3116]");$sid3116.addPlaceholder();var $sid3117=$("[data-sid=3117]");$sid3117.limitChars($sid3117.attr("maxlength"),$("[data-sid=3119]"));$sid3117.keyup(function(){$(this).limitChars($(this).attr("maxlength"),$("[data-sid=3119]"));});var $sid3121=$("[data-sid=3121]");$sid3121.limitChars($sid3121.attr("maxlength"));$sid3121.keyup(function(){$(this).limitChars($(this).attr("maxlength"));});var urlRegex=/^([hH][tT]{2}[pP][sS]?:\/\/|$)/;var $sid3195=$("[data-sid=3195]");$sid3195.change(function(){var $this=$(this);if(!urlRegex.test($this.val())){$this.val("http://"+$this.val())}});var $sid3196=$("[data-sid=3196]");$sid3196.change(function(){var $this=$(this);if(!urlRegex.test($this.val())){$this.val("http://"+$this.val())}});var $sid3197=$("[data-sid=3197]");$sid3197.change(function(){var $this=$(this);if(!urlRegex.test($this.val())){$this.val("http://"+$this.val())}});var $sid3198=$("[data-sid=3198]");$sid3198.change(function(){var $this=$(this);if(!urlRegex.test($this.val())){$this.val("http://"+$this.val())}});var $sidimages=$('[data-sid=3214],[data-sid=3199]');$sidimages.unbind("click");$sidimages.click(function(evt){evt.preventDefault();var $this=$(this);var $sid3236=$('[data-sid=3236]');if($this.sid()==='3214'&&$sid3236.val()===''){return;}
$sidimages.removeClass("selectedBg");$this.addClass("selectedBg");var $sid3235=$("[data-sid=3235]");if($this.sid()==="3199"){$sid3235.val($this.attr("data-typeid"));}
else if($this.sid()==="3214"){$sid3235.val("1");}});var $sid3255=$("[data-sid=3255]");$sid3255.click(function(){var $this=$(this);var listingTypeID=$this.attr("data-value");var $sid3258=$("[data-sid=3258]");var isChecked=$this.attr("checked")==true;var listingTypeRadioButton=$sid3258.filter('[data-value='+listingTypeID+']');if(isChecked&&$sid3258.filter(':checked').length===0){listingTypeRadioButton.attr('checked','checked');}
else if(!isChecked&&listingTypeRadioButton.attr("checked")){listingTypeRadioButton.removeAttr('checked');var firstRadioButton=$sid3258.filter('[data-value='+$("[data-sid=3255]").filter(':checked').first().attr("data-value")+']');firstRadioButton.attr('checked','checked');}});var $sid3258=$("[data-sid=3258]");$sid3258.click(function(){var $this=$(this);var $sid3255=$("[data-sid=3255]");$sid3255.filter('[data-value='+$this.attr("data-value")+']').attr('checked','checked');});}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{textWidget:{widgetTypeID:1,init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","textWidget");newWidget.attr("data-sid","3496");newWidget.attr("href","/WebsiteContent/TextWidget/Edit/");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.textWidget.init");return newWidget;},editorInit:function(div){var showYouTube=false;var containerColumns=1;var widgetID=div.find('[data-sid=3499]').val();if(widgetID===''){var parentDiv=harcourtsPublic.websiteContent.widget.newWidgetAdded.closest('[data-sid=3700]').find("div:first");var containerTypeID=parentDiv.attr('data-containertypeid');if(containerTypeID!=='1'){showYouTube=true;containerColumns=2;}}
else if($('[data-widgetid='+widgetID+']').parents('[data-containertypeid=1]').length===0){showYouTube=true;containerColumns=2;}
harcourtsPublic.websiteContent.jwysiwyg.init($('[data-sid=3532]'),showYouTube,containerColumns);$("[data-sid=3531]").focusWithTimeout();}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{threeColContainer:{init:function(div){if(_settings.isInEditMode){harcourtsPublic.websiteContent.container.init(div);}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{twitterWidget:{widgetTypeID:7,init:function(div){if(!div.hasClass('hidden')){harcourtsPublic.websiteContent.widget.init(div);if(div.getValOfChildBySid(3679).toBool()){var self=this;self.reloadFeed(div);}}},createNew:function(newWidget){var obj=harcourtsPublic.websiteContent;newWidget.attr("id","twitterWidget");newWidget.attr("data-sid","3496");newWidget.attr("data-functionname","harcourtsPublic.websiteContent.twitterWidget.init");newWidget.attr("href","/WebsiteContent/TwitterWidget/Edit/");newWidget.attr("data-parameters","harcourtsPublic.websiteContent.widget.getWebsiteID");return newWidget;},reloadFeed:function(div){var obj=harcourtsPublic.websiteContent.twitterWidget;var sid=div.sid();$.ajax({type:"post",cache:false,async:true,url:"/WebsiteContent/TwitterWidget/ReloadFeed/"+div.getValOfChildBySid(3499),dataType:"html",success:function(html){var $html=$(html);if($html.sid()==sid){div.html($html.html()).functionName();}}});},editInit:function(div){harcourtsPublic.websiteContent.widget.editInit(div);$("[data-sid=3667]").focusWithTimeout();$('[data-sid=3668]').change(function(){var _feedUrl=div.getValOfChildBySid(3668);if(!_feedUrl.startsWith('http://')){$('[data-sid=3668]').val($.resource('TwitterFeedFormatString').format(_feedUrl));}
else{var arrValues=$.resource('TwitterFeedFormatString').split("{0}");$.each(arrValues,function(index,value){_feedUrl=_feedUrl.replaceAll(value,'');});}
$('[data-sid=3252]').val(_feedUrl);});}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{twoColContainer:{init:function(div){if(_settings.isInEditMode){harcourtsPublic.websiteContent.container.init(div);}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{uploadify:{authenticationToken:null,init:function(control,options,websiteImageTypeEnum){var self=this;var _scriptData={authenticationToken:self.authenticationToken,websiteID:$('[data-sid=3139]').val()};if(websiteImageTypeEnum!==undefined){$.extend(true,_scriptData,{websiteImageTypeEnum:websiteImageTypeEnum});}
$.extend(true,options,{width:100,uploader:'/Scripts/Extensions/uploadify/uploadify.swf',cancelImg:'/Scripts/Extensions/uploadify/cancel.png',scriptData:_scriptData});if(!FlashDetect.versionAtLeast(9,0,24)){control.outerHTML($("<a>").attr("href","http://get.adobe.com/flashplayer/").attr("target","_blank").text("Flash is required. Click to download latest version."));}
else{control.uploadify(options);}}}}});})(jQuery);;;(function($){$.extend(true,harcourtsPublic,{websiteContent:{widget:{newWidgetAdded:null,init:function($widget){if(_settings.isInEditMode){$widget.find("ul.widgetToolbar > li").hover(function(){$(this).addClass("hover");$('ul:first',this).css('visibility','visible');},function(){$(this).removeClass("hover");$('ul:first',this).css('visibility','hidden');});$widget.find('ul.widgetToolbar li ul:first').css('visibility','hidden');harcourtsPublic.websiteContent.widget.showOrHideUpDownDropdowns($widget);}},showOrHideUpDownDropdowns:function($widget){var $prevWidget=$widget.prevAll('[data-ismovable=True]:not(.hidden):first');var $moveUpParent=$widget.find('ul.widgetToolbar a.widgetMoveUp').parent();var $moveDownParent=$widget.find('ul.widgetToolbar a.widgetMoveDown').parent();if($prevWidget.length>0){$moveUpParent.removeClass('hidden');}else{$moveUpParent.addClass('hidden');}
var $nextWidget=$widget.nextAll('[data-ismovable=True]:not(.hidden):first');if($nextWidget.length>0){$moveDownParent.removeClass('hidden');}else{$moveDownParent.addClass('hidden');}},editInit:function(div){if(!div.getValOfChildBySid(3589)){div.find('[data-sid=3589]').val(harcourtsPublic.websiteContent.widget.newWidgetAdded.parent("div:first").children("div").length-1);}
if(!div.getValOfChildBySid(3588)){div.find('[data-sid=3588]').val(harcourtsPublic.websiteContent.widget.newWidgetAdded.parent("div:first").attr("data-containerid"));}},addWidgetInit:function(){$("#widgetTabs").tabs({selected:0,show:function(event,ui){var $dialog=$('.ui-dialog');$dialog.position({my:"center",at:"center",of:window});}});},getWebsiteID:function(){return{websiteID:$('[data-sid=3139]').val()};},getParameters:function(obj){return{websiteID:$('[data-sid=3139]').val(),containerInstanceID:obj.containerInstanceID,sortOrder:obj.sortOrder};}}}});})(jQuery);;if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
