var Lat49={numAdHelpers:0,adHelper_golems:{},cycleTimers:{},requests:{},popuplist:{},initAds:function(A){var B=new Lat49.AdHelper(A);Lat49.fetchCSS()},fetchCSS:function(){var A=document.getElementsByTagName("head")[0];var B=document.createElement("link");B.rel="stylesheet";B.type="text/css";B.href=Lat49.Ads.baseURL+"/lat49.css.php?serverURL="+Lat49.SERVER;A.appendChild(B)},fetchJSDependencies:function(B){var A=Lat49.Ads.baseURL;var C=document.getElementsByTagName("head")[0];Lat49.fetchScript(A+"/lat49tile.js",B,C);Lat49.fetchScript(A+"/userUtilities/lat49-yahoo/yui-2_5_2/yahoo-dom-event.js",B,C);Lat49.fetchScript(A+"/userUtilities/lat49-yahoo/yui-2_5_2/animation-min.js",B,C);Lat49.fetchScript(A+"/userUtilities/lat49adpopup.js",B,C)},fetchScript:function(D,B,C){if(B){if(!C){C=document.getElementsByTagName("head")[0]}var A=document.createElement("script");A.type="text/javascript";A.src=D;C.appendChild(A)}else{var A="<script type='text/javascript' src='"+D+"'><\/script>";document.write(A)}},updateAdByLatLon:function(E,B,D,C){if(this.adHelper_golems[0]){var A=new Object();A[E]="";this.adHelper_golems[0].updateMultiAdsByLatLonExtents(A,B,D,C)}},updateMultiAdsByLatLon:function(A,B,D,C){if(this.adHelper_golems[0]){this.adHelper_golems[0].updateMultiAdsByLatLonExtents(A,B,D,C)}},updateAdByLatLonWithExtents:function(B,F,A,E,D,I,C,G){if(this.adHelper_golems[0]){var H=new Object();H[B]="";this.adHelper_golems[0].updateMultiAdsByLatLonExtents(H,F,A,E,D,I,C,G)}},updateMultiAdsByLatLonWithExtents:function(B,E,H,G,D,A,F,C){if(this.adHelper_golems[0]){this.adHelper_golems[0].updateMultiAdsByLatLonExtents(B,E,H,G,D,A,F,C)}},updateAdByTile:function(E,A,D,C){if(this.adHelper_golems[0]){var B=new Object();B[E]="";this.adHelper_golems[0].updateMultiAdsByTile(B,A,D,C)}},updateMultiAdsByTile:function(B,A,D,C){if(this.adHelper_golems[0]){this.adHelper_golems[0].updateMultiAdsByTile(B,A,D,C)}},getAdHelper:function(A){return this.adHelper_golems[A==undefined?0:A]},setAdHelper:function(B,A){this.adHelper_golems[B]=A},showPushPins:function(A,B){this.adHelper_golems[B==undefined?0:B].showPushPin(A)},trackPinClick:function(A,B,C){this.adHelper_golems[C==undefined?0:C].trackPinClicked(A,B)},hidePushPins:function(A,B){this.adHelper_golems[B==undefined?0:B].hidePushPin(A)},onMouseOverShow:function(B,A){this.adHelper_golems[B==undefined?0:B].onMouseOverShow(A)},onMouseOutShow:function(B,A){this.adHelper_golems[B==undefined?0:B].onMouseOutShow(A)},onMouseOverHide:function(B,A){this.adHelper_golems[B==undefined?0:B].onMouseOverHide(A)},onMouseOutHide:function(B,A){this.adHelper_golems[B==undefined?0:B].onMouseOutHide(A)},setCustomMapitPanel:function(B,C,A,D){this.adHelper_golems[D==undefined?0:D].setCustomMapitPanel(B,C,A)},setCustomMapitButton:function(A,B,C){this.adHelper_golems[C==undefined?0:C].setCustomMapitButton(A,B)},setCustomClearButton:function(B,A,C){this.adHelper_golems[C==undefined?0:C].setCustomClearButton(B,A)},setMapitPanelBehaviour:function(A,B){this.adHelper_golems[B==undefined?0:B].setMapitPanelBehaviour(A)},getPushpinCount:function(B,C){var A=this.adHelper_golems[C==undefined?0:C].getPushpinCount(B);return A},getPushpins:function(A,C){var B=this.adHelper_golems[C==undefined?0:C].getPushpins(A);return B},getCampaignId:function(B,C){var A=this.adHelper_golems[C==undefined?0:C].getCampaignId(B);return A},publisherReferrer:function(B,A){this.adHelper_golems[B].publisherRefer(A)},requestAdResponse:function(E){var C=this.requests[E.reqid];var B=0;for(var G in C.args.adtypes){var A=document.getElementById(G);if(A){this.assignAdToDivId(G,E.ads[B],C)}B++}var F=C.args.cacheid;var D=document.getElementById(F+"-script");if(D&&D.parentNode){if(D.timerId){clearTimeout(D.timerId)}setTimeout(function(){if(D.parentNode!=null){D.parentNode.removeChild(D)}},1000)}this.removeRequestState(C.id)},setPinnedPosition:function(A,B){if(B=="top-left"||B=="top-right"){A.style.top="0px"}if(B=="bottom-left"||B=="bottom-right"){A.style.bottom="0px"}if(B=="top-left"||B=="bottom-left"){A.style.left="0px"}if(B=="top-right"||B=="bottom-right"){A.style.right="0px"}},addRequestState:function(A){var B=new Lat49.RequestState(A);this.requests[B.id]=B;return B.id},removeRequestState:function(A){this.requests[A]=null;delete this.requests[A]},validatePopup:function(B,A){var C=document.getElementById(A);if(C==null){C=document.createElement("img");C.id=A;C.name=A;C.style.visibility="hidden";C.src=A;B.appendChild(C)}},isOffMap:function(B){var A=false;if(B==Lat49.Ads.MEDIUM_RECTANGLE||B==Lat49.Ads.LEADERBOARD||B==Lat49.Ads.FULL_BANNER){A=true}return A},assignAdToDivId:function(P,Z,A){var K=A.args.adtypes;var M=A.args.helperid;var O=this.adHelper_golems[M];var L=Z.ad;var S=document.getElementById(P);var B=O.getAdPos(S);var N=(K[P]!="")?true:false;var T=L.template;var R=Z.size;var Y=(T&&L!=0)?Lat49.Ads.create(T,L,N):document.createElement("div");var Q;if(!T||Lat49.isOffMap(R)){Q=Y}else{if(Lat49.popuplist[P]!=null){Lat49.popuplist[P].destroy();Lat49.popuplist[P]=null}if(L.interactive_type=="1"){var V=Lat49.SERVER+L.flyout_image;var G=Lat49AdPopup.createImagePopup(V);var D=L.url;if(D.substring(0,17)=="/stw/stwgetad/hit"){D=Lat49.SERVER+L.url}Lat49.popuplist[P]=new Lat49AdPopup(Y,G,B,D);Q=Lat49.popuplist[P].get()}else{if(L.interactive_type=="2"){var V=Lat49.SERVER+L.flyout_image;var D=L.url;var C=Lat49AdPopup.createFormPopup(V,D,L.interactive,L.publisherid,L.adid);D="";Lat49.popuplist[P]=new Lat49AdPopup(Y,C,B,D);Lat49.YAHOO.util.Event.addListener("popupform"+L.adid,"click",function(){Lat49.popuplist[P].popin(true);Lat49.popuplist[P].clearIntAdFormFields()});C.onmouseout=null;Q=Lat49.popuplist[P].get();Q.popup=Lat49.popuplist[P]}else{if(L.interactive_type=="3"){if(L.custom_flyout){var I=Lat49AdPopup.createCustomPopup("");Lat49.popuplist[P]=new Lat49AdPopup(Y,I,B,D,L.custom_flyout);Q=Lat49.popuplist[P].get()}else{Q=Y}}else{Q=Y}}}if(L.popvalurl!=undefined&&L.popvalurl!=""&&Lat49.popuplist[P]!=null){Lat49.popuplist[P].subscribeToAnimateOutEvent(Lat49.validatePopup,L.popvalurl,Lat49)}}if(A.args.callback){A.args.callback(Q)}else{var E=A.args.cacheid;Q.id=E;Q.name=E;Q.style.display="none";Q.style.position="absolute";Q.style.textAlign="left";Q.className="lat49adwrapper";this.setPinnedPosition(Q,B);if(Q.innerHTML==""&&O.getAdDebug(S)){var W=/(\d{14})/;W.test(E);var U=RegExp.$1;var F=parseInt(U.substring(0,2),10);var H=parseInt(U.substring(2,8),10);var J=parseInt(U.substring(8,14),10);Q.innerHTML="No current ad for "+J+" "+H+" "+F;Q.style.width="226px";Q.style.height="58px"}if(L!=undefined){if(L.lat!=undefined){Q.lat=L.lat;Q.lon=L.lon}if(L.loc!=undefined){Q.loc=L.loc}if(L.headline!=undefined){Q.headline=L.headline}if(L.adid!=undefined){Q.adid=L.adid}if(L.adaccount!=undefined){Q.adaccount=L.adaccount}if(L.branded!=undefined){Q.branded=L.branded}}var X=parseInt(A.id)==parseInt(Lat49.Ads.mostRecentRequest[P][E]);O.cacheAd(P,E,Q,X)}}};Lat49.MAPIT_PANEL_ALWAYS=0;Lat49.MAPIT_PANEL_WITH_ADS=1;Lat49.MAPIT_PANEL_WITH_PUSHPINS=2;Lat49.MAPIT_PANEL_NEVER=-1;Lat49.MAPIT_PANEL_PUSHPIN_DRIVEN=-2;Lat49.VERSION="v1.0";var theHead=document.getElementsByTagName("head")[0];for(i=0;i<theHead.childNodes.length;i++){if(theHead.childNodes[i].nodeName=="SCRIPT"){var res=/(.*)\/lat49\/(v[^\/]+)\/lat49.*\.js/.exec(theHead.childNodes[i].src);if(res){Lat49.SERVER=res[1];Lat49.VERSION=res[2];break}}}if(!Lat49.SERVER){Lat49.SERVER="http://adserver.lat49.com"}Lat49.RequestState=function(A){this.id=Lat49.RequestState.id++;this.args=A};Lat49.RequestState.id=0;Lat49.projMercator=0;Lat49.projUnprojected=1;Lat49.Ads=function(A){var B=A||-1;this.getPublisherId=function(){return B}};Lat49.Ads.mostRecentRequest=new Array(new Array);Lat49.Ads.getAdSizes=function(C){var B="[";var A=1;for(var D in C){if(A>1){B+=","}B+=C[D];A++}B+="]";return B};Lat49.Ads.getAdDivIds=function(C){var B="[";var A=1;for(var D in C){if(A>1){B+=","}B+=D;A++}B+="]";return B};Lat49.Ads.isCustomTemplate=function(A){var B=false;if(A==Lat49.Ads.CUSTOM_HALF_BANNER||A==Lat49.Ads.CUSTOM_BUTTON||A==Lat49.Ads.CUSTOM_MEDIUM_RECTANGLE||A==Lat49.Ads.CUSTOM_LEADERBOARD||A==Lat49.Ads.CUSTOM_FULL_BANNER){B=true}return B};Lat49.Ads.prototype.showErrorMsg=function(E,B){var A=document.getElementById(E);if(A){var D=A.getAttribute("lat49debug",false);var C=(D!=null&&D);if(C){A.innerHTML=B;A.style.backgroundColor="#ffffff"}}};Lat49.Ads.prototype.requestAd=function(K,J,I,Q,C,G,D){var E=document.getElementsByTagName("head")[0];var S=document.createElement("script");var N=this.getPublisherId();if(N<0){var B="Invalid or missing publisherId: "+N;this.showErrorMsg(C.adcontainerid,B)}else{S.type="text/javascript";if(C.cacheid==null){C.cacheid=Lat49.Ads.hashTileIndices(K,J,I)}if(C.adtypes==null){C.adtypes={};C.adtypes[C.adcontainerid]=""}var F=Lat49.Ads.getAdSizes(C.adtypes);var L=Lat49.addRequestState(C);var T={};for(var M in C.adtypes){if(Lat49.Ads.mostRecentRequest[M]==undefined){Lat49.Ads.mostRecentRequest[M]=[]}Lat49.Ads.mostRecentRequest[M][C.cacheid]=L;var O=C.adtypes[M];var P=document.getElementById(M);T[O==""?"default":O]=(P&&P.getAttribute("onlat49pushpin"))?"true":"false"}S.id=C.cacheid+"-script";var U=[];for(var R in T){U.push('"'+R+'":'+T[R])}var A="{"+U.join(",")+"}";var H=Lat49.Ads.serverURL+"/getad2?publisher="+N+"&x="+K+"&y="+J+"&z="+I+"&ad_sizes="+F+"&pushpins="+A+"&reqid="+L;if(G!=undefined&&D!=undefined){H+="&lat="+G+"&lon="+D}H+="&api_ver=1000000&rand="+Math.random()+"&";if(Q){H+="debug=1&"}S.src=H;S.timerId=setTimeout('Lat49.Ads.cleanScript("'+S.id+'")',30000);E.appendChild(S)}};Lat49.Ads.prototype.trackmapit=function(A){var D=document.getElementsByTagName("head")[0];var C=document.createElement("script");var B=this.getPublisherId();C.type="text/javascript";C.id="trackmapit"+Math.round(Math.random()*1000);C.src=Lat49.Ads.serverURL+"/trackmapit?p="+B+"&ad="+A+"&key=a&rand="+Math.random()+"&";C.timerId=setTimeout('Lat49.Ads.cleanScript("'+C.id+'")',30000);D.appendChild(C)};Lat49.Ads.cleanScript=function(B){var A=document.getElementById(B);if(A&&A.parentNode&&A.parentNode!=null){A.parentNode.removeChild(A)}};Lat49.Ads.serverURL=Lat49.SERVER+"/stw/stwgetad";Lat49.Ads.baseURL=Lat49.SERVER+"/lat49/"+Lat49.VERSION;Lat49.Ads.CUSTOM_HALF_BANNER=1;Lat49.Ads.IMAGE_BANNER=2;Lat49.Ads.IMAGE_BUTTON=3;Lat49.Ads.TEXT_IMAGE_HORIZ=4;Lat49.Ads.TEXT_IMAGE_BUTTON=5;Lat49.Ads.TEXT_BANNER=6;Lat49.Ads.CUSTOM_BUTTON=7;Lat49.Ads.IMAGE_MEDIUM_RECTANGLE=8;Lat49.Ads.CUSTOM_MEDIUM_RECTANGLE=9;Lat49.Ads.IMAGE_LEADERBOARD=10;Lat49.Ads.CUSTOM_LEADERBOARD=11;Lat49.Ads.IMAGE_FULL_BANNER=12;Lat49.Ads.CUSTOM_FULL_BANNER=13;Lat49.Ads.BUTTON=1;Lat49.Ads.HALF_BANNER=2;Lat49.Ads.MEDIUM_RECTANGLE=4;Lat49.Ads.LEADERBOARD=5;Lat49.Ads.FULL_BANNER=6;Lat49.Ads.create=function(B,J,M){var K=null;var E=Lat49.SERVER;var F=navigator.userAgent,I,D=-1;I=F.match(/MSIE\s([^;]*)/);if(I&&I[1]){D=parseFloat(I[1])}var H=D>0&&D<7;var A="src='"+E+J.image+"'";if(B!=Lat49.Ads.TEXT_BANNER&&H&&J.image.substr(J.image.length-3).toLowerCase()=="png"){A="src='http://lat49.com/lat49/blank.gif' style='width:"+J.imagesize.w+"px;height:"+J.imagesize.h+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+E+J.image+'", sizingMethod="scale")\';'}var G=Lat49.Ads.isCustomTemplate(B);if(M){K=Lat49.Ads.createAdWithSizeSpecified(B,J,A,G)}else{K=Lat49.Ads.createAdWithNoSizeSpecified(B,J,A,G)}if(J.advalurl!=undefined&&J.advalurl!=""){var O=document.createElement("img");O.className="hidden_img";O.src=J.advalurl;K.appendChild(O)}var N=document.createElement("div");if(G){N.appendChild(K)}else{if(K.className!=""){var C=J.url;if(C.substring(0,17)=="/stw/stwgetad/hit"){C=Lat49.SERVER+J.url}if(D>0){switch(parseInt(B)){case Lat49.Ads.IMAGE_BANNER:case Lat49.Ads.IMAGE_BUTTON:K.onclick=function(){window.open(C)};break}}var L=document.createElement("a");L.href=C;L.target="_blank";L.style.textDecoration="none";if(J.adbroker!=undefined){L.onclick=function(){var Q=document.getElementsByTagName("head")[0];var P=document.createElement("script");P.type="text/javascript";P.id="brokerhit"+J.reqid;P.src=Lat49.Ads.serverURL+"/brokerhit?p="+J.publisherid+"&broker="+J.adbroker+"&si="+J.serveid;P.timerId=setTimeout('Lat49.Ads.cleanScript("'+P.id+'")',30000);Q.appendChild(P)}}L.appendChild(K);N.appendChild(L)}else{N.appendChild(K)}}return N};Lat49.Ads.hashTileIndices=function(A,E,D){if(typeof (A)=="string"){A=parseInt(A)}var B=D*1000000000000+E*1000000+A;var C=B.toString();if(D<10){C="0"+C}return"lat49ad-"+C};Lat49.Ads.createAdWithSizeSpecified=function(B,F,E,A){var C=document.createElement("div");if(B==Lat49.Ads.TEXT_BANNER){C.className="container_text-h";C.innerHTML="<div class='copy_text-h'><b><u>"+F.headline+"</span></u></b><br>"+F.message+"</div>"}else{if(B==Lat49.Ads.IMAGE_BANNER){C.className="container_adsize";C.innerHTML="<div class='container_adsize_img'><img id='adimage' class='img-h' "+E+"/></div>"}else{if(B==Lat49.Ads.IMAGE_BUTTON){C.className="container_adsize";C.innerHTML="<div class='container_adsize_img'><img id='adimage' class='img-sq' "+E+"/></div>"}else{if(B==Lat49.Ads.TEXT_IMAGE_BUTTON){C.className="container_adsize_textimg-sq-s";C.innerHTML="<div class='container_adsize_img_textimg-sq'><div class='center1_textimg-sq'><div class='center2_textimg-sq'><div class='center3_textimg-sq'><img class='img_textimg-sq' id='adimage' "+E+"/></div></div></div></div><div class='copy_textimg-sq'><b><u>"+F.headline+"</u></b><br>"+F.message+"</div>"}else{if(A){var D=F.headline;C.className="container_"+D;C.innerHTML="<div class='container_img_"+D+"'><div class='center1_"+D+"'><div class='center2_"+D+"'><div class='center3_"+D+"'>"+F.message+"</div></div></div></div>"}else{C.className="container_adsize";C.innerHTML="<div class='container_adsize_img'><img id='adimage' class='img-h' "+E+"/></div>"}}}}}return C};Lat49.Ads.createAdWithNoSizeSpecified=function(C,G,F,B){var D=document.createElement("div");var A="";if(C==Lat49.Ads.TEXT_BANNER){D.className="container_text-h";D.innerHTML="<div class='copy_text-h'><b><u>"+G.headline+"</span></u></b><br>"+G.message+"</div>"}else{if(C==Lat49.Ads.IMAGE_BANNER){D.className="container_img-h";D.innerHTML="<div class='container_img_img-h'><div class='center1_img-h'><div class='center2_img-h'><div class='center3_img-h'><img id='adimage' class='img-h' "+F+"/></div></div></div></div>"}else{if(C==Lat49.Ads.IMAGE_BUTTON){D.className="container_img-sq";D.innerHTML="<div class='container_img_img-sq'><div class='center1_img-sq'><div class='center2_img-sq'><div class='center3_img-sq'><img id='adimage' class='img-sq' "+F+"/></div></div></div></div>"}else{if(C==Lat49.Ads.TEXT_IMAGE_BUTTON){D.className="container_textimg-sq";D.innerHTML="<div class='container_img_textimg-sq'><div class='center1_textimg-sq'><div class='center2_textimg-sq'><div class='center3_textimg-sq'><img class='img_textimg-sq' id='adimage' "+F+"/></div></div></div></div><div class='copy_textimg-sq'><b><u>"+G.headline+"</u></b><br>"+G.message+"</div>"}else{if(C==Lat49.Ads.TEXT_IMAGE_HORIZ){D.className="container_textimg-h";D.innerHTML="<div class='container_img_textimg-h'><div class='center1_textimg-h'><div class='center2_textimg-h'><div class='center3_textimg-h'><img class='img_textimg-h' id='adimage' "+F+"/></div></div></div></div><div class='copy_textimg-h'><b><u>"+G.headline+"</u></b><br>"+G.message+"</div>"}else{if(B){var E=G.headline;D.className="container_"+E;D.innerHTML="<div class='container_img_"+E+"'><div class='center1_"+E+"'><div class='center2_"+E+"'><div class='center3_"+E+"'>"+G.message+"</div></div></div></div>"}}}}}}return D};Lat49.CycleTimer=function(G,H){var D=G;var A=H;var F,E;var B;var C;var I;this.updateNext=function(){var J=document.getElementById(A);if(J==null){B=null;return }var O=D.getAdZoomLevel(D.zoomlevel);if(O==-1){D.clearAd(A)}else{var M=Math.floor(Lat49.Tile.lonToXAtZ(D.lonmin,O));var K=Math.floor(Lat49.Tile.lonToXAtZ(D.lonmax,O));var P=Math.floor(Lat49.Tile.latToYAtZ(D.latmax,O));var N=Math.floor(Lat49.Tile.latToYAtZ(D.latmin,O));if(F==null||F<M){F=M}else{F++}if(E==null){E=P}else{if(F>K){E++;F=M}}if(E<P||E>N){E=P}D.updateAdByTile(A,F,E,O)}var L=A+"-"+D.num;B=setTimeout('Lat49.cycleTimers["'+L+'"].updateNext()',C*1000)};this.setCycleInterval=function(J){if(typeof (J)=="string"){J=parseInt(J)}C=J;if(B){clearTimeout(B);B=null;D.clearAd(A)}if(C>0){this.updateNext()}};this.updateNextMulti=function(){var N=D.getAdZoomLevel(D.zoomlevel);if(N==-1){}else{var L=Math.floor(Lat49.Tile.lonToXAtZ(D.lonmin,N));var J=Math.floor(Lat49.Tile.lonToXAtZ(D.lonmax,N));var O=Math.floor(Lat49.Tile.latToYAtZ(D.latmax,N));var M=Math.floor(Lat49.Tile.latToYAtZ(D.latmin,N));if(F==null||F<L){F=L}else{F++}if(E==null){E=O}else{if(F>J){E++;F=L}}if(E<O||E>M){E=O}D.updateMultiAdsByTile(I,F,E,N)}var K=Lat49.CycleTimer.getMultiCycleTimerKey(I);B=setTimeout('Lat49.cycleTimers["'+K+'"].updateNextMulti()',C*1000)};this.setAdtypes=function(J){I=J};this.setMultiCycleInterval=function(K){if(typeof (K)=="string"){K=parseInt(K)}C=K;if(B){clearTimeout(B);B=null;for(var J in I){D.clearAd(J)}}if(C>0){this.updateNextMulti(I)}}};Lat49.CycleTimer.getMultiCycleTimerKey=function(B){var C=Lat49.Ads.getAdSizes(B);var A=Lat49.Ads.getAdDivIds(B)+C;return A};Lat49.AdHelper=function(A){this.screenWidth=0;this.screenHeight=0;this.latmin=0;this.lonmin=0;this.latmax=0;this.lonmax=0;this.zoomlevel=-1;this.cache=new Array(new Array);this.cacheSize=0;this.maxCacheSize=0;this.hidepinflag=false;this.showpinflag=false;this.pid=A;this.mapitClickedAds=new Array();this.mapextents=null;this.adtypes=new Array();this.mapitPanelBehaviour=Lat49.MAPIT_PANEL_WITH_PUSHPINS;this.ads=new Lat49.Ads(A);this.num=Lat49.numAdHelpers++;Lat49.setAdHelper(this.num,this)};Lat49.AdHelper.prototype.setMaxCacheSize=function(A){if(A<this.cacheSize){this.removeNCacheItems(this.cacheSize-A)}this.maxCacheSize=A};Lat49.AdHelper.prototype.removeFirstCacheItem=function(){this.removeNCacheItems(1)};Lat49.AdHelper.prototype.removeNCacheItems=function(D){var C=0;for(var A in this.cache){for(var B in this.cache[A]){if(C<D){this.cache[A][B]=null;delete this.cache[A][B];this.cacheSize--}else{break}C++}}};Lat49.AdHelper.prototype.ensureCacheSpace=function(){if(this.cacheSize>=this.maxCacheSize){var A=this.maxCacheSize;this.setMaxCacheSize(Math.floor(A/2));this.setMaxCacheSize(A)}};Lat49.AdHelper.prototype.getAdPos=function(B){var E="top-left";var C=B.getAttribute("lat49adposition",false);if(C){if(C.indexOf("centre")!=-1||C.indexOf("center")!=-1){E="top-left"}else{var D=C.indexOf("right")!=-1;var A=C.indexOf("bottom")!=-1||C.indexOf("lower")!=-1;E=(A?"bottom":"top")+"-"+(D?"right":"left")}}return E};Lat49.AdHelper.prototype.getAdDebug=function(A){var B=A.getAttribute("lat49debug",false);return(B!=null&&B)};Lat49.AdHelper.prototype.updateAdByTile=function(B,A,H,F){var D=document.getElementById(B);if(D==null){return }var G=this.getAdPos(D);var C=this.getAdDebug(D);A=Lat49.Tile.normTileIndex(A,F);H=Lat49.Tile.normTileIndex(H,F);var E=Lat49.Ads.hashTileIndices(A,H,F);if(this.cache[B]==undefined){this.cache[B]=new Array()}this.cache[B][E]="waiting-for-request";this.ads.requestAd(A,H,F,C,{helperid:this.num,cacheid:E,adcontainerid:B})};Lat49.AdHelper.prototype.isValidAdSize=function(A){var B=false;if(A==Lat49.Ads.BUTTON||A==Lat49.Ads.HALF_BANNER||A==Lat49.Ads.MEDIUM_RECTANGLE||A==Lat49.Ads.LEADERBOARD||A==Lat49.Ads.FULL_BANNER){B=true}return B};Lat49.AdHelper.prototype.updateMultiAdsByTile=function(N,M,L,J,K,C){M=Lat49.Tile.normTileIndex(M,J);L=Lat49.Tile.normTileIndex(L,J);var E=Lat49.Ads.getAdSizes(N);var F=Lat49.Ads.hashTileIndices(M,L,J)+E;var I=false;var B=false;var A=false;for(var O in N){if(N[O]!=""){I=this.isValidAdSize(N[O]);if(!I){var G="Invalid ad size requested.";this.ads.showErrorMsg(O,G);N[O]=Lat49.Ads.HALF_BANNER}}var H=document.getElementById(O);if(H){var D=this.getAdDebug(H);if(D){B=true}}if(this.cache[O]==undefined){this.cache[O]=new Array()}if(this.cache[O][F]==undefined){this.cache[O][F]="waiting-for-request";A=true}}A=true;if(A){this.ads.requestAd(M,L,J,B,{helperid:this.num,cacheid:F,adcontainerid:"",adtypes:N},K,C)}else{for(var O in N){if(this.cache[O][F]!="waiting-for-request"){this.finalizeUpdateByAdTile(O,F)}}}};Lat49.AdHelper.prototype.finalizeUpdateByAdTile=function(divId,hashIndex){var adDiv=document.getElementById(divId);var newAd=this.cache[divId][hashIndex];if((adDiv==null)||(newAd==null)){return }if(adDiv.popup){adDiv.popup.popin(true);adDiv.popup.clearIntAdFormFields()}var child=adDiv.firstChild;while(child){var childID=child.id;if(childID&&(childID.substring(0,7)=="lat49ad")){newAd.style.display="";if(child.popup){child.popup.popin(true);child.popup.clearIntAdFormFields()}child.style.display="none";adDiv.removeChild(child)}child=child.nextSibling}if(adDiv.firstChild&&this.getAdPos(adDiv).substring(0,6)=="bottom"){adDiv.insertBefore(newAd,adDiv.firstChild)}else{adDiv.appendChild(newAd)}newAd.style.display="";this.updateMapitPanel(adDiv,hashIndex,divId);var callbackAttr=adDiv.getAttribute("onlat49update",false);if(callbackAttr!=null){var contents=this.cache[divId][hashIndex].innerHTML;var hasContents=!(contents==""||contents.substring(0,17)=="No current ad for");var callback=callbackAttr+"("+hasContents+");";eval(callback)}};Lat49.AdHelper.prototype.updateMapitPanel=function(F,E,G){var C;var I;var H=this.cache[G][E];var A=this.num;if(H.loc!=undefined){F.setAttribute("lat49locations",H.loc);F.setAttribute("lat49adaccount",H.adaccount);F.setAttribute("lat49adid",H.adid)}else{F.removeAttribute("lat49locations")}var D=F.getAttribute("onlat49pushpin",false);if(D!=null&&this.mapitPanelBehaviour>=Lat49.MAPIT_PANEL_ALWAYS){var B=document.getElementById("pushpindivid"+this.num+"-"+F.id);if(B==null){B=this.createMapitPanel(F,C,I);if(this.getAdPos(F).indexOf("right")!=-1){B.style.right="0px"}else{B.style.left="0px"}if(F.firstChild&&this.getAdPos(F).substring(0,3)=="top"){B.style.top="0px";F.insertBefore(B,F.firstChild)}else{B.style.bottom="0px";F.appendChild(B)}}if(this.getAdPos(F).substring(0,3)=="top"){H.style.top="23px"}else{H.style.bottom="23px"}}this.handleMapitPanel(F)};Lat49.AdHelper.prototype.createMapitPanel=function(C,D,B){var A=document.createElement("div");A.id="pushpindivid"+this.num+"-"+C.id;A.style.fontSize="8pt";A.style.backgroundColor="transparent";A.style.position="absolute";A.style.width="133px";A.style.height="23px";A.style.display="block";D=this.createMapitPanelShowLink(C,A);B=this.createMapitPanelHideLink(C,A);var G=this.num;var E=this.pid;var F=this.createLogo(G,E);A.appendChild(F);return A};Lat49.AdHelper.prototype.createLogo=function(C,A){var B=document.createElement("img");B.id="logoid"+C;this.filterPNG(B,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/lat49_58x23.png","58px","23px");B.onclick=function(){Lat49.publisherReferrer(C,A)};B.style.cursor="pointer";return B};Lat49.AdHelper.prototype.isPublisherBranded=function(A){var C=false;if(A!=null){var D=A.firstChild;while(D){var B=D.id;if(B&&(B.substring(0,7)=="lat49ad")){if(D.branded!=undefined&&D.branded=="1"){C=true;break}}D=D.nextSibling}}return C};Lat49.AdHelper.prototype.createMapitPanelShowLink=function(B,A){var D=this.num;var C=document.createElement("img");C.id="lat49showpinid"+this.num+"-"+B.id;C.onclick=function(){Lat49.showPushPins(B,D)};C.style.cursor="pointer";var E=B.id;C.onmouseover=function(){Lat49.onMouseOverShow(D,E)};C.onmouseout=function(){Lat49.onMouseOutShow(D,E)};C.src="";A.appendChild(C);return C};Lat49.AdHelper.prototype.createMapitPanelHideLink=function(C,A){var D=this.num;var B=document.createElement("img");B.id="lat49hidepinid"+D+"-"+C.id;var E=C.id;B.onmouseover=function(){Lat49.onMouseOverHide(D,E)};B.onmouseout=function(){Lat49.onMouseOutHide(D,E)};A.appendChild(B);return B};Lat49.AdHelper.prototype.filterPNG=function(C,H,B,E){if(C!=null){var D=navigator.userAgent,A,G=-1;A=D.match(/MSIE\s([^;]*)/);if(A&&A[1]){G=parseFloat(A[1])}var F=G>0&&G<7;if(F){C.src=Lat49.SERVER+"/lat49/blank.gif";C.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+H+'", sizingMethod="scale")\''}else{C.src=H}C.style.width=B;C.style.height=E}};Lat49.AdHelper.prototype.trackPinClicked=function(C,D){var B=document.getElementsByTagName("head")[0];var A=document.createElement("script");A.type="text/javascript";A.id="43";A.src=Lat49.Ads.serverURL+"/trackpinclicked?p="+D+"&pinid="+C+"&rand="+Math.random()+"&";A.timerId=setTimeout('Lat49.Ads.cleanScript("'+A.id+'")',30000);B.appendChild(A)};Lat49.AdHelper.prototype.showPushPin=function(adDiv){var adid=adDiv.getAttribute("lat49adid",false);this.ads.trackmapit(adid);var callbackAttr=adDiv.getAttribute("onlat49pushpin",false);if(callbackAttr!=null){var loc=eval(adDiv.getAttribute("lat49locations",false));var i=0;for(i=0;i<loc.length;i++){loc[i].pinurl=Lat49.SERVER+loc[i].pinurl}if(loc.length>0){var adaccount=adDiv.getAttribute("lat49adid",false);this.mapitClickedAds.push(adaccount);this.hidepinflag=true;if(this.mapitPanelBehaviour!=Lat49.MAPIT_PANEL_PUSHPIN_DRIVEN){this.handleMapitPanel(adDiv)}var callback=callbackAttr+"(loc);";eval(callback)}}},Lat49.AdHelper.prototype.containedInBounds=function(B,A,C){var D=false;if(B>C.south&&A>C.west&&B<C.north&&A<C.east){D=true}return D},Lat49.AdHelper.prototype.arePinsWithinMapBounds=function(C,B){var A=false;var D=0;while(D<C.length&&A==false){A=this.containedInBounds(C[D].lat,C[D].lon,this.mapextents);D++}return A},Lat49.AdHelper.prototype.findDistanceToPin=function(H,I){var B=null;var A=null;var L=null;var D=null;var C=null;var E=I.firstChild;while(E){var K=E.id;if(K&&(K.substring(0,7)=="lat49ad")){var J=/(\d{14})/;J.test(K);var F=RegExp.$1;L=parseInt(F.substring(0,2),10);A=parseInt(F.substring(2,8),10);B=parseInt(F.substring(8,14),10)}E=E.nextSibling}for(var G=0;G<H.length;G++){D=Lat49.Tile.lonToXAtZ(H[G].lon,L);C=Lat49.Tile.latToYAtZ(H[G].lat,L);H[G].dist=this.getDistanceBetweenAdPin(B,A,D,C)}};Lat49.AdHelper.prototype.getDistanceBetweenAdPin=function(A,E,C,B){var D=((A+0.5)-(C))*((A+0.5)-(C))+((E+0.5)-(B))*((E+0.5)-(B));return D};Lat49.AdHelper.prototype.sortByDistance=function(C,B){var A=C.dist;var D=B.dist;return((A<D)?-1:((A>D)?1:0))};Lat49.AdHelper.prototype.hidePushPin=function(adDiv){var callbackAttr=adDiv.getAttribute("onlat49hidepushpin",false);this.mapitClickedAds=null;this.mapitClickedAds=new Array();if(callbackAttr!=null){this.hidepinflag=false;if(this.mapitPanelBehaviour!=Lat49.MAPIT_PANEL_PUSHPIN_DRIVEN){this.handleMapitPanel(adDiv);this.setPanelState(adDiv)}var callback=callbackAttr+"();";eval(callback)}};Lat49.AdHelper.prototype.onMouseOverShow=function(B){if(this.showpinflag){var A=document.getElementById("lat49showpinid"+this.num+"-"+B);this.filterPNG(A,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/mapit_40x23_hover.png","40px","23px")}};Lat49.AdHelper.prototype.onMouseOutShow=function(B){if(this.showpinflag){var A=document.getElementById("lat49showpinid"+this.num+"-"+B);this.filterPNG(A,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/mapit_40x23_on.png","40px","23px")}};Lat49.AdHelper.prototype.onMouseOverHide=function(B){if(this.hidepinflag){var A=document.getElementById("lat49hidepinid"+this.num+"-"+B);this.filterPNG(A,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/clear_35x23_hover.png","35px","23px")}};Lat49.AdHelper.prototype.onMouseOutHide=function(B){if(this.hidepinflag){var A=document.getElementById("lat49hidepinid"+this.num+"-"+B);this.filterPNG(A,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/clear_35x23_on.png","35px","23px")}};Lat49.AdHelper.prototype.publisherRefer=function(A){window.open("http://lat49.com/index.php?pubid="+A)};Lat49.AdHelper.prototype.getInnerAd=function(A){var B=null;if(A!=null){var D=A.firstChild;while(D){var C=D.id;if(C&&(C.substring(0,7)=="lat49ad")){B=D;break}D=D.nextSibling}}return B};Lat49.AdHelper.prototype.isAdVisible=function(A){var B=true;if(A!=null){var D=A.firstChild;while(D){var C=D.id;if(C&&(C.substring(0,7)=="lat49ad")){if(D.childNodes.length==0||D.style.display=="none"){B=false}}D=D.nextSibling}}return B};Lat49.AdHelper.prototype.setPanelVisibility=function(B){var F=null;var A="pushpindivid"+this.num+"-"+B.id;var E=true;F=document.getElementById(A);if(F!=null){switch(this.mapitPanelBehaviour){case Lat49.MAPIT_PANEL_ALWAYS:break;case Lat49.MAPIT_PANEL_WITH_ADS:F.style.display=(this.isAdVisible(B))?"block":"none";E=(F.style.display=="block")?true:false;break;case Lat49.MAPIT_PANEL_WITH_PUSHPINS:E=false;var D=this.getInnerAd(B);try{B.removeChild(F);if(this.getAdPos(B).substring(0,3)=="top"){D.style.top="0px"}else{D.style.bottom="0px"}if(this.isAdVisible(B)){if(this.hidepinflag||this.showpinflag){B.appendChild(F);F.style.display="block";E=true;if(this.getAdPos(B).substring(0,3)=="top"){D.style.top="23px"}else{D.style.bottom="23px"}}}}catch(C){}break;case Lat49.MAPIT_PANEL_NEVER:F.style.display="none";E=false;break;default:F.style.display="none";E=false}if(this.isAdVisible(B)){this.updateBranding(F,B)}}return E};Lat49.AdHelper.prototype.handleThisMapitPanel=function(adDiv){var showpinimg=document.getElementById("lat49showpinid"+this.num+"-"+adDiv.id);if(showpinimg!=null){this.showpinflag=adDiv.getAttribute("lat49locations",false)!=null;if(this.showpinflag==true){this.showpinflag=this.mapitAlreadyClicked(adDiv)}this.setPanelState(adDiv)}if(this.mapitPanelBehaviour==Lat49.MAPIT_PANEL_PUSHPIN_DRIVEN&&this.isAdVisible(adDiv)){var mapiton=this.mapitAlreadyClicked(adDiv);if(mapiton){var loc=eval(adDiv.getAttribute("lat49locations",false));if(loc&&loc.length>0){this.showPushPin(adDiv)}}}else{this.setPanelVisibility(adDiv)}};Lat49.AdHelper.prototype.handleMapitPanel=function(A){for(var C in this.adtypes){var B=document.getElementById(C);if(B!=null){this.handleThisMapitPanel(B)}}};Lat49.AdHelper.prototype.mapitAlreadyClicked=function(adDiv){var adaccount=adDiv.getAttribute("lat49adid",false);var enableMapit=true;for(var i=0;i<this.mapitClickedAds.length;i++){if(adaccount==this.mapitClickedAds[i]){enableMapit=false}}if(this.mapextents!=null){var loc=eval(adDiv.getAttribute("lat49locations",false));enableMapit=enableMapit&&this.arePinsWithinMapBounds(loc,adDiv)}return enableMapit};Lat49.AdHelper.prototype.setPanelState=function(adDiv){var showpinimg=document.getElementById("lat49showpinid"+this.num+"-"+adDiv.id);var hidepinimg=document.getElementById("lat49hidepinid"+this.num+"-"+adDiv.id);if(this.showpinflag&&this.isAdVisible(adDiv)){var loc=eval(adDiv.getAttribute("lat49locations",false));if(loc){if(loc.length<=0){this.showpinflag=false}}}else{this.showpinflag=false}this.enableShowImg(this.showpinflag,adDiv);this.enableHideImg(this.hidepinflag,adDiv)};Lat49.AdHelper.prototype.updateBranding=function(C,A){C.style.width=(this.isPublisherBranded(A))?"133px":"85px";var B=document.getElementById("logoid"+this.num);if(!this.isPublisherBranded(A)){if(B!=null){C.removeChild(B)}}else{if(B==null){B=this.createLogo(this.num,this.pubid);if(B!=null){C.appendChild(B)}}}};Lat49.AdHelper.prototype.enableShowImg=function(B,A){var D=this.num;var C=document.getElementById("lat49showpinid"+D+"-"+A.id);if(C!=null){if(B){this.filterPNG(C,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/mapit_40x23_on.png","40px","23px");C.style.cursor="pointer";C.onclick=function(){Lat49.showPushPins(A,D)}}else{this.filterPNG(C,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/mapit_40x23_off.png","40px","23px");C.style.cursor="default";C.onclick=function(){return false}}}};Lat49.AdHelper.prototype.enableHideImg=function(B,A){var D=this.num;var C=document.getElementById("lat49hidepinid"+D+"-"+A.id);if(C!=null){if(B){this.filterPNG(C,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/clear_35x23_on.png","35px","23px");C.style.cursor="pointer";C.onclick=function(){Lat49.hidePushPins(A,D)}}else{this.filterPNG(C,Lat49.SERVER+"/lat49/"+Lat49.VERSION+"/img/clear_35x23_off.png","35px","23px");C.style.cursor="default";C.onclick=function(){return false}}}};Lat49.AdHelper.prototype.setMapitPanelBehaviour=function(A){this.mapitPanelBehaviour=A};Lat49.AdHelper.prototype.setCustomMapitPanel=function(C,E,A){var B=document.getElementById(C);var F=document.getElementById(E);var G=document.getElementById(A);var D=this.num;F.onclick=function(){Lat49.showPushPins(B,D)};G.onclick=function(){Lat49.hidePushPins(B,D)};this.mapitPanelBehaviour=Lat49.MAPIT_PANEL_NEVER};Lat49.AdHelper.prototype.setCustomMapitButton=function(B,D){var A=document.getElementById(B);var E=document.getElementById(D);var C=this.num;E.onclick=function(){Lat49.showPushPins(A,C)}};Lat49.AdHelper.prototype.setCustomClearButton=function(C,A){var B=document.getElementById(C);var E=document.getElementById(A);var D=this.num;E.onclick=function(){Lat49.hidePushPins(B,D)}};Lat49.AdHelper.prototype.getPushpinCount=function(adDivId){var count=0;var div=document.getElementById(adDivId);var loc=eval(div.getAttribute("lat49locations",false));if(loc!=null){count=loc.length}return count};Lat49.AdHelper.prototype.getPushpins=function(adDivId){var div=document.getElementById(adDivId);var loc=eval(div.getAttribute("lat49locations",false));return loc};Lat49.AdHelper.prototype.getCampaignId=function(adDivId){var div=document.getElementById(adDivId);var campaignId=eval(div.getAttribute("lat49adid",false));return campaignId};Lat49.AdHelper.prototype.cacheAd=function(A,C,D,B){if(B==null){B=true}this.ensureCacheSpace();this.cache[A][C]=D;this.cacheSize++;if(B){this.finalizeUpdateByAdTile(A,C)}};Lat49.AdHelper.prototype.clearAd=function(A){var B=document.getElementById(A);if(B==null){return }var D=B.firstChild;while(D){var C=D.id;if(C&&(C.substring(0,7)=="lat49ad")){D.style.display="none"}D=D.nextSibling}};Lat49.AdHelper.prototype.normLon=function(A){while(A<-180){A+=360}while(A>=180){A-=360}return A};Lat49.AdHelper.prototype.getAdZoomLevel=function(B){var A=7+3*Math.floor((B-5)/3);if(A>16){A=16}else{if(A<7){A=-1}}return A};Lat49.AdHelper.prototype.updateMultiAdsByLatLon=function(A,B,D,C){this.updateMultiAdsByLatLon(A,B,D,C)};Lat49.AdHelper.prototype.updateMultiAdsByLatLonExtents=function(L,H,A,G,F,M,D,I){if(F!=undefined){this.mapextents={south:F,west:M,north:D,east:I}}for(var B in L){this.adtypes[B]=L[B]}A=this.normLon(A);var C=this.getAdZoomLevel(G);if(C==-1){for(var N in L){this.clearAd(N);var E=document.getElementById(N);this.handleMapitPanel(E)}return }var K=Math.floor(Lat49.Tile.lonToXAtZ(A,C));var J=Math.floor(Lat49.Tile.latToYAtZ(H,C));this.updateMultiAdsByTile(L,K,J,C,H,A)};Lat49.AdHelper.prototype.updateAdByLatLon=function(B,E,G,F){G=this.normLon(G);var D=this.getAdZoomLevel(F);if(D==-1){this.clearAd(B);var C=document.getElementById(B);this.handleMapitPanel(C);return }var A=Math.floor(Lat49.Tile.lonToXAtZ(G,D));var H=Math.floor(Lat49.Tile.latToYAtZ(E,D));this.updateAdByTile(B,A,H,D)};Lat49.AdHelper.prototype.setScreenSpace=function(B,A){this.screenWidth=B;this.screenHeight=A;this.computeZoomLevel()};Lat49.AdHelper.prototype.setLatLonSpace=function(A,B,D,E,C){this.latmin=A;this.lonmin=B;this.latmax=D;this.lonmax=E;while(this.lonmin>this.lonmax){this.lonmin-=360}if(C==undefined){this.proj=Lat49.projMercator}else{this.proj=C}this.computeZoomLevel()};Lat49.AdHelper.prototype.computeZoomLevel=function(){if((this.screenWidth<=0)||(this.lonmax<=this.lonmin)){this.zoomlevel=-1}else{var A=(this.latmin+this.latmax)/2;this.zoomlevel=Lat49.Tile.computeZoomLevel(A,this.lonmin,A,this.lonmax,this.screenWidth)}};Lat49.AdHelper.prototype.updateAdByPixel=function(C,B,H){if(zoomLevel!=-1){var E,F;switch(this.proj){case Lat49.projMercator:F=this.lonmin+(this.lonmax-this.lonmin)*B/this.screenWidth;var D=Lat49.Tile.latToYAtZ(this.latmax,zoomLevel);var A=Lat49.Tile.latToYAtZ(this.latmin,zoomLevel);var G=D+(A-D)*H/this.screenHeight;E=Lat49.Tile.yToLatAtZ(G,zoomLevel);break;case Lat49.projUnprojected:F=this.lonmin+(this.lonmax-this.lonmin)*B/this.screenWidth;E=this.latmax+(this.latmin-this.latmax)*H/this.screenHeight;break;default:return }this.updateAdByLatLon(C,E,F,this.zoomlevel)}};Lat49.AdHelper.prototype.cycleAdsForScreen=function(A,B){var C=A+"-"+this.num;if(Lat49.cycleTimers[C]==undefined){Lat49.cycleTimers[C]=new Lat49.CycleTimer(this,A)}Lat49.cycleTimers[C].setCycleInterval(B)};Lat49.AdHelper.prototype.cycleMultiAdsForScreen=function(C,A){var B=Lat49.CycleTimer.getMultiCycleTimerKey(C);if(Lat49.cycleTimers[B]==undefined){Lat49.cycleTimers[B]=new Lat49.CycleTimer(this);Lat49.cycleTimers[B].setAdtypes(C)}Lat49.cycleTimers[B].setMultiCycleInterval(A)};if(typeof Lat49=="undefined"||!Lat49){var Lat49={}}Lat49.Tile=function(){function B(D){return D*Math.PI/180}function C(D){return D*180/Math.PI}function A(D){return 2*Math.PI/(1<<D)}return{latToYAtZ:function(F,D){var E=Math.sin(B(F));return(Math.PI-0.5*Math.log((1+E)/(1-E)))/A(D)},yToLatAtZ:function(F,D){var E=Math.atan(Math.exp(F*A(D)-Math.PI));return C(Math.PI/2-2*E)},lonToXAtZ:function(E,D){return(B(E)+Math.PI)/A(D)},xToLonAtZ:function(D,E){return C(D*A(E)-Math.PI)},computeZoomLevel:function(O,G,E,L,H){var J=0;var F=Lat49.Tile.lonToXAtZ(G,J);var D=Lat49.Tile.lonToXAtZ(L,J);var N=Lat49.Tile.latToYAtZ(O,J);var M=Lat49.Tile.latToYAtZ(E,J);var I=256*Math.sqrt((D-F)*(D-F)+(M-N)*(M-N));var K=Math.round(Math.log(H/I)/Math.LN2);if(K<0){K=0}return K},convertGMapZoom:function(D){return 17-D},convertGMap2Zoom:function(D){return D},convertLiveZoom:function(D){return D},convertYahooZoom:function(D){return 18-D},convertMapQuestZoom:function(D){return(D>=4)?D+3:((D>=2)?D+2:D+1)},normTileIndex:function(F,E){var D=1<<E;while(F<0){F+=D}while(F>=D){F-=D}return F}}}();if(typeof Lat49=="undefined"||!Lat49){var Lat49={}}if(typeof Lat49.YAHOO=="undefined"||!Lat49.YAHOO){Lat49.YAHOO={}}(function(){var A=Lat49.YAHOO;if(typeof A=="undefined"||!A){var A={}}A.namespace=function(){var F=arguments,G=null,I,J,H;for(I=0;I<F.length;I=I+1){H=F[I].split(".");G=A;for(J=(H[0]=="YAHOO")?1:0;J<H.length;J=J+1){G[H[J]]=G[H[J]]||{};G=G[H[J]]}}return G};A.log=function(F,E,G){var H=A.widget.Logger;if(H&&H.log){return H.log(F,E,G)}else{return false}};A.register=function(M,R,J){var N=A.env.modules;if(!N[M]){N[M]={versions:[],builds:[]}}var L=N[M],O=J.version,P=J.build,Q=A.env.listeners;L.name=M;L.version=O;L.build=P;L.versions.push(O);L.builds.push(P);L.mainClass=R;for(var K=0;K<Q.length;K=K+1){Q[K](L)}if(R){R.VERSION=O;R.BUILD=P}else{A.log("mainClass is undefined for module "+M,"warn")}};A.env=A.env||{modules:[],listeners:[]};A.env.getVersion=function(B){return A.env.modules[B]||null};A.env.ua=function(){var E={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var F=navigator.userAgent,D;if((/KHTML/).test(F)){E.webkit=1}D=F.match(/AppleWebKit\/([^\s]*)/);if(D&&D[1]){E.webkit=parseFloat(D[1]);if(/ Mobile\//.test(F)){E.mobile="Apple"}else{D=F.match(/NokiaN[^\/]*/);if(D){E.mobile=D[0]}}D=F.match(/AdobeAIR\/([^\s]*)/);if(D){E.air=D[0]}}if(!E.webkit){D=F.match(/Opera[\s\/]([^\s]*)/);if(D&&D[1]){E.opera=parseFloat(D[1]);D=F.match(/Opera Mini[^;]*/);if(D){E.mobile=D[0]}}else{D=F.match(/MSIE\s([^;]*)/);if(D&&D[1]){E.ie=parseFloat(D[1])}else{D=F.match(/Gecko\/([^\s]*)/);if(D){E.gecko=1;D=F.match(/rv:([^\s\)]*)/);if(D&&D[1]){E.gecko=parseFloat(D[1])}}}}}return E}();(function(){A.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var H=YAHOO_config.listener,E=A.env.listeners,F=true,G;if(H){for(G=0;G<E.length;G=G+1){if(E[G]==H){F=false;break}}if(F){E.push(H)}}}})();A.lang=A.lang||{};(function(){var D=A.lang,E=["toString","valueOf"],F={isArray:function(B){if(B){return D.isNumber(B.length)&&D.isFunction(B.splice)}return false},isBoolean:function(B){return typeof B==="boolean"},isFunction:function(B){return typeof B==="function"},isNull:function(B){return B===null},isNumber:function(B){return typeof B==="number"&&isFinite(B)},isObject:function(B){return(B&&(typeof B==="object"||D.isFunction(B)))||false},isString:function(B){return typeof B==="string"},isUndefined:function(B){return typeof B==="undefined"},_IEEnumFix:(A.env.ua.ie)?function(I,J){for(var K=0;K<E.length;K=K+1){var B=E[K],C=J[B];if(D.isFunction(C)&&C!=Object.prototype[B]){I[B]=C}}}:function(){},extend:function(C,B,J){if(!B||!C){throw new Error("extend failed, please check that all dependencies are included.")}var K=function(){};K.prototype=B.prototype;C.prototype=new K();C.prototype.constructor=C;C.superclass=B.prototype;if(B.prototype.constructor==Object.prototype.constructor){B.prototype.constructor=B}if(J){for(var L in J){if(D.hasOwnProperty(J,L)){C.prototype[L]=J[L]}}D._IEEnumFix(C.prototype,J)}},augmentObject:function(C,J){if(!J||!C){throw new Error("Absorb failed, verify dependencies.")}var M=arguments,K,B,L=M[2];if(L&&L!==true){for(K=2;K<M.length;K=K+1){C[M[K]]=J[M[K]]}}else{for(B in J){if(L||!(B in C)){C[B]=J[B]}}D._IEEnumFix(C,J)}},augmentProto:function(B,C){if(!C||!B){throw new Error("Augment failed, verify dependencies.")}var I=[B.prototype,C.prototype];for(var H=2;H<arguments.length;H=H+1){I.push(arguments[H])}D.augmentObject.apply(this,I)},dump:function(B,O){var R,P,M=[],C="{...}",S="f(){...}",N=", ",Q=" => ";if(!D.isObject(B)){return B+""}else{if(B instanceof Date||("nodeType" in B&&"tagName" in B)){return B}else{if(D.isFunction(B)){return S}}}O=(D.isNumber(O))?O:3;if(D.isArray(B)){M.push("[");for(R=0,P=B.length;R<P;R=R+1){if(D.isObject(B[R])){M.push((O>0)?D.dump(B[R],O-1):C)}else{M.push(B[R])}M.push(N)}if(M.length>1){M.pop()}M.push("]")}else{M.push("{");for(R in B){if(D.hasOwnProperty(B,R)){M.push(R+Q);if(D.isObject(B[R])){M.push((O>0)?D.dump(B[R],O-1):C)}else{M.push(B[R])}M.push(N)}}if(M.length>1){M.pop()}M.push("}")}return M.join("")},substitute:function(C,g,Z){var c,d,e,W,V,T,X=[],f,b="dump",Y=" ",B="{",U="}";for(;;){c=C.lastIndexOf(B);if(c<0){break}d=C.indexOf(U,c);if(c+1>=d){break}f=C.substring(c+1,d);W=f;T=null;e=W.indexOf(Y);if(e>-1){T=W.substring(e+1);W=W.substring(0,e)}V=g[W];if(Z){V=Z(W,V,T)}if(D.isObject(V)){if(D.isArray(V)){V=D.dump(V,parseInt(T,10))}else{T=T||"";var a=T.indexOf(b);if(a>-1){T=T.substring(4)}if(V.toString===Object.prototype.toString||a>-1){V=D.dump(V,parseInt(T,10))}else{V=V.toString()}}}else{if(!D.isString(V)&&!D.isNumber(V)){V="~-"+X.length+"-~";X[X.length]=f}}C=C.substring(0,c)+V+C.substring(d+1)}for(c=X.length-1;c>=0;c=c-1){C=C.replace(new RegExp("~-"+c+"-~"),"{"+X[c]+"}","g")}return C},trim:function(C){try{return C.replace(/^\s+|\s+$/g,"")}catch(B){return C}},merge:function(){var B={},H=arguments;for(var C=0,I=H.length;C<I;C=C+1){D.augmentObject(B,H[C],true)}return B},later:function(M,S,C,Q,P){M=M||0;S=S||{};var R=C,N=Q,O,B;if(D.isString(C)){R=S[C]}if(!R){throw new TypeError("method undefined")}if(!D.isArray(N)){N=[Q]}O=function(){R.apply(S,N)};B=(P)?setInterval(O,M):setTimeout(O,M);return{interval:P,cancel:function(){if(this.interval){clearInterval(B)}else{clearTimeout(B)}}}},isValue:function(B){return(D.isObject(B)||D.isString(B)||D.isNumber(B)||D.isBoolean(B))}};D.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(C,B){return C&&C.hasOwnProperty(B)}:function(C,B){return !D.isUndefined(C[B])&&C.constructor.prototype[B]!==C[B]};F.augmentObject(D,F,true);A.util.Lang=D;D.augment=D.augmentProto;A.augment=D.augmentProto;A.extend=D.extend})();A.register("yahoo",A,{version:"2.5.2",build:"1076"});(function(){var R=A.util,X,Z,Y={},c={},V=window.document;A.env._id_counter=A.env._id_counter||0;var Q=A.env.ua.opera,W=A.env.ua.webkit,S=A.env.ua.gecko,b=A.env.ua.ie;var d={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var U=function(C){if(!d.HYPHEN.test(C)){return C}if(Y[C]){return Y[C]}var B=C;while(d.HYPHEN.exec(B)){B=B.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase())}Y[C]=B;return B};var T=function(B){var C=c[B];if(!C){C=new RegExp("(?:^|\\s+)"+B+"(?:\\s+|$)");c[B]=C}return C};if(V.defaultView&&V.defaultView.getComputedStyle){X=function(E,B){var C=null;if(B=="float"){B="cssFloat"}var D=E.ownerDocument.defaultView.getComputedStyle(E,"");if(D){C=D[U(B)]}return E.style[B]||C}}else{if(V.documentElement.currentStyle&&b){X=function(F,D){switch(U(D)){case"opacity":var B=100;try{B=F.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(C){try{B=F.filters("alpha").opacity}catch(C){}}return B/100;case"float":D="styleFloat";default:var E=F.currentStyle?F.currentStyle[D]:null;return(F.style[D]||E)}}}else{X=function(C,B){return C.style[B]}}}if(b){Z=function(D,C,B){switch(C){case"opacity":if(A.lang.isString(D.style.filter)){D.style.filter="alpha(opacity="+B*100+")";if(!D.currentStyle||!D.currentStyle.hasLayout){D.style.zoom=1}}break;case"float":C="styleFloat";default:D.style[C]=B}}}else{Z=function(D,C,B){if(C=="float"){C="cssFloat"}D.style[C]=B}}var P=function(C,B){return C&&C.nodeType==1&&(!B||B(C))};A.util.Dom={get:function(C){if(C&&(C.nodeType||C.item)){return C}if(A.lang.isString(C)||!C){return V.getElementById(C)}if(C.length!==undefined){var B=[];for(var D=0,E=C.length;D<E;++D){B[B.length]=R.Dom.get(C[D])}return B}return C},getStyle:function(D,B){B=U(B);var C=function(E){return X(E,B)};return R.Dom.batch(D,C,R.Dom,true)},setStyle:function(E,C,B){C=U(C);var D=function(F){Z(F,C,B)};R.Dom.batch(E,D,R.Dom,true)},getXY:function(C){var B=function(D){if((D.parentNode===null||D.offsetParent===null||this.getStyle(D,"display")=="none")&&D!=D.ownerDocument.body){return false}return a(D)};return R.Dom.batch(C,B,R.Dom,true)},getX:function(C){var B=function(D){return R.Dom.getXY(D)[0]};return R.Dom.batch(C,B,R.Dom,true)},getY:function(C){var B=function(D){return R.Dom.getXY(D)[1]};return R.Dom.batch(C,B,R.Dom,true)},setXY:function(E,B,C){var D=function(G){var H=this.getStyle(G,"position");if(H=="static"){this.setStyle(G,"position","relative");H="relative"}var J=this.getXY(G);if(J===false){return false}var F=[parseInt(this.getStyle(G,"left"),10),parseInt(this.getStyle(G,"top"),10)];if(isNaN(F[0])){F[0]=(H=="relative")?0:G.offsetLeft}if(isNaN(F[1])){F[1]=(H=="relative")?0:G.offsetTop}if(B[0]!==null){G.style.left=B[0]-J[0]+F[0]+"px"}if(B[1]!==null){G.style.top=B[1]-J[1]+F[1]+"px"}if(!C){var I=this.getXY(G);if((B[0]!==null&&I[0]!=B[0])||(B[1]!==null&&I[1]!=B[1])){this.setXY(G,B,true)}}};R.Dom.batch(E,D,R.Dom,true)},setX:function(B,C){R.Dom.setXY(B,[C,null])},setY:function(C,B){R.Dom.setXY(C,[null,B])},getRegion:function(C){var B=function(E){if((E.parentNode===null||E.offsetParent===null||this.getStyle(E,"display")=="none")&&E!=E.ownerDocument.body){return false}var D=R.Region.getRegion(E);return D};return R.Dom.batch(C,B,R.Dom,true)},getClientWidth:function(){return R.Dom.getViewportWidth()},getClientHeight:function(){return R.Dom.getViewportHeight()},getElementsByClassName:function(F,B,E,D){B=B||"*";E=(E)?R.Dom.get(E):null||V;if(!E){return[]}var I=[],J=E.getElementsByTagName(B),C=T(F);for(var H=0,G=J.length;H<G;++H){if(C.test(J[H].className)){I[I.length]=J[H];if(D){D.call(J[H],J[H])}}}return I},hasClass:function(C,D){var E=T(D);var B=function(F){return E.test(F.className)};return R.Dom.batch(C,B,R.Dom,true)},addClass:function(C,D){var B=function(E){if(this.hasClass(E,D)){return false}E.className=A.lang.trim([E.className,D].join(" "));return true};return R.Dom.batch(C,B,R.Dom,true)},removeClass:function(C,D){var E=T(D);var B=function(G){if(!D||!this.hasClass(G,D)){return false}var F=G.className;G.className=F.replace(E," ");if(this.hasClass(G,D)){this.removeClass(G,D)}G.className=A.lang.trim(G.className);return true};return R.Dom.batch(C,B,R.Dom,true)},replaceClass:function(C,E,F){if(!F||E===F){return false}var D=T(E);var B=function(G){if(!this.hasClass(G,E)){this.addClass(G,F);return true}G.className=G.className.replace(D," "+F+" ");if(this.hasClass(G,E)){this.replaceClass(G,E,F)}G.className=A.lang.trim(G.className);return true};return R.Dom.batch(C,B,R.Dom,true)},generateId:function(D,B){B=B||"yui-gen";var C=function(F){if(F&&F.id){return F.id}var E=B+A.env._id_counter++;if(F){F.id=E}return E};return R.Dom.batch(D,C,R.Dom,true)||C.apply(R.Dom,arguments)},isAncestor:function(C,B){C=R.Dom.get(C);B=R.Dom.get(B);if(!C||!B){return false}if(C.contains&&B.nodeType&&!W){return C.contains(B)}else{if(C.compareDocumentPosition&&B.nodeType){return !!(C.compareDocumentPosition(B)&16)}else{if(B.nodeType){return !!this.getAncestorBy(B,function(D){return D==C})}}}return false},inDocument:function(B){return this.isAncestor(V.documentElement,B)},getElementsBy:function(B,H,G,E){H=H||"*";G=(G)?R.Dom.get(G):null||V;if(!G){return[]}var F=[],C=G.getElementsByTagName(H);for(var D=0,I=C.length;D<I;++D){if(B(C[D])){F[F.length]=C[D];if(E){E(C[D])}}}return F},batch:function(E,B,C,G){E=(E&&(E.tagName||E.item))?E:R.Dom.get(E);if(!E||!B){return false}var F=(G)?C:window;if(E.tagName||E.length===undefined){return B.call(F,E,C)}var D=[];for(var H=0,I=E.length;H<I;++H){D[D.length]=B.call(F,E[H],C)}return D},getDocumentHeight:function(){var B=(V.compatMode!="CSS1Compat")?V.body.scrollHeight:V.documentElement.scrollHeight;var C=Math.max(B,R.Dom.getViewportHeight());return C},getDocumentWidth:function(){var B=(V.compatMode!="CSS1Compat")?V.body.scrollWidth:V.documentElement.scrollWidth;var C=Math.max(B,R.Dom.getViewportWidth());return C},getViewportHeight:function(){var C=self.innerHeight;var B=V.compatMode;if((B||b)&&!Q){C=(B=="CSS1Compat")?V.documentElement.clientHeight:V.body.clientHeight}return C},getViewportWidth:function(){var C=self.innerWidth;var B=V.compatMode;if(B||b){C=(B=="CSS1Compat")?V.documentElement.clientWidth:V.body.clientWidth}return C},getAncestorBy:function(C,B){while(C=C.parentNode){if(P(C,B)){return C}}return null},getAncestorByClassName:function(C,D){C=R.Dom.get(C);if(!C){return null}var B=function(E){return R.Dom.hasClass(E,D)};return R.Dom.getAncestorBy(C,B)},getAncestorByTagName:function(C,D){C=R.Dom.get(C);if(!C){return null}var B=function(E){return E.tagName&&E.tagName.toUpperCase()==D.toUpperCase()};return R.Dom.getAncestorBy(C,B)},getPreviousSiblingBy:function(C,B){while(C){C=C.previousSibling;if(P(C,B)){return C}}return null},getPreviousSibling:function(B){B=R.Dom.get(B);if(!B){return null}return R.Dom.getPreviousSiblingBy(B)},getNextSiblingBy:function(C,B){while(C){C=C.nextSibling;if(P(C,B)){return C}}return null},getNextSibling:function(B){B=R.Dom.get(B);if(!B){return null}return R.Dom.getNextSiblingBy(B)},getFirstChildBy:function(D,B){var C=(P(D.firstChild,B))?D.firstChild:null;return C||R.Dom.getNextSiblingBy(D.firstChild,B)},getFirstChild:function(C,B){C=R.Dom.get(C);if(!C){return null}return R.Dom.getFirstChildBy(C)},getLastChildBy:function(D,B){if(!D){return null}var C=(P(D.lastChild,B))?D.lastChild:null;return C||R.Dom.getPreviousSiblingBy(D.lastChild,B)},getLastChild:function(B){B=R.Dom.get(B);return R.Dom.getLastChildBy(B)},getChildrenBy:function(D,B){var C=R.Dom.getFirstChildBy(D,B);var E=C?[C]:[];R.Dom.getNextSiblingBy(C,function(F){if(!B||B(F)){E[E.length]=F}return false});return E},getChildren:function(B){B=R.Dom.get(B);if(!B){}return R.Dom.getChildrenBy(B)},getDocumentScrollLeft:function(B){B=B||V;return Math.max(B.documentElement.scrollLeft,B.body.scrollLeft)},getDocumentScrollTop:function(B){B=B||V;return Math.max(B.documentElement.scrollTop,B.body.scrollTop)},insertBefore:function(B,C){B=R.Dom.get(B);C=R.Dom.get(C);if(!B||!C||!C.parentNode){return null}return C.parentNode.insertBefore(B,C)},insertAfter:function(B,C){B=R.Dom.get(B);C=R.Dom.get(C);if(!B||!C||!C.parentNode){return null}if(C.nextSibling){return C.parentNode.insertBefore(B,C.nextSibling)}else{return C.parentNode.appendChild(B)}},getClientRegion:function(){var C=R.Dom.getDocumentScrollTop(),D=R.Dom.getDocumentScrollLeft(),B=R.Dom.getViewportWidth()+D,E=R.Dom.getViewportHeight()+C;return new R.Region(C,B,E,D)}};var a=function(){if(V.documentElement.getBoundingClientRect){return function(C){var B=C.getBoundingClientRect();var D=C.ownerDocument;return[B.left+R.Dom.getDocumentScrollLeft(D),B.top+R.Dom.getDocumentScrollTop(D)]}}else{return function(C){var B=[C.offsetLeft,C.offsetTop];var D=C.offsetParent;var E=(W&&R.Dom.getStyle(C,"position")=="absolute"&&C.offsetParent==C.ownerDocument.body);if(D!=C){while(D){B[0]+=D.offsetLeft;B[1]+=D.offsetTop;if(!E&&W&&R.Dom.getStyle(D,"position")=="absolute"){E=true}D=D.offsetParent}}if(E){B[0]-=C.ownerDocument.body.offsetLeft;B[1]-=C.ownerDocument.body.offsetTop}D=C.parentNode;while(D.tagName&&!d.ROOT_TAG.test(D.tagName)){if(D.scrollTop||D.scrollLeft){if(!d.OP_SCROLL.test(R.Dom.getStyle(D,"display"))){if(!Q||R.Dom.getStyle(D,"overflow")!=="visible"){B[0]-=D.scrollLeft;B[1]-=D.scrollTop}}}D=D.parentNode}return B}}}()})();A.util.Region=function(G,F,E,H){this.top=G;this[1]=G;this.right=F;this.bottom=E;this.left=H;this[0]=H};A.util.Region.prototype.contains=function(B){return(B.left>=this.left&&B.right<=this.right&&B.top>=this.top&&B.bottom<=this.bottom)};A.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};A.util.Region.prototype.intersect=function(G){var I=Math.max(this.top,G.top);var H=Math.min(this.right,G.right);var F=Math.min(this.bottom,G.bottom);var J=Math.max(this.left,G.left);if(F>=I&&H>=J){return new A.util.Region(I,H,F,J)}else{return null}};A.util.Region.prototype.union=function(G){var I=Math.min(this.top,G.top);var H=Math.max(this.right,G.right);var F=Math.max(this.bottom,G.bottom);var J=Math.min(this.left,G.left);return new A.util.Region(I,H,F,J)};A.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}")};A.util.Region.getRegion=function(J){var H=A.util.Dom.getXY(J);var K=H[1];var I=H[0]+J.offsetWidth;var G=H[1]+J.offsetHeight;var L=H[0];return new A.util.Region(K,I,G,L)};A.util.Point=function(C,D){if(A.lang.isArray(C)){D=C[1];C=C[0]}this.x=this.right=this.left=this[0]=C;this.y=this.top=this.bottom=this[1]=D};A.util.Point.prototype=new A.util.Region();A.register("dom",A.util.Dom,{version:"2.5.2",build:"1076"});A.util.CustomEvent=function(H,J,I,F){this.type=H;this.scope=J||window;this.silent=I;this.signature=F||A.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var G="_YUICEOnSubscribe";if(H!==G){this.subscribeEvent=new A.util.CustomEvent(G,this,true)}this.lastError=null};A.util.CustomEvent.LIST=0;A.util.CustomEvent.FLAT=1;A.util.CustomEvent.prototype={subscribe:function(F,E,D){if(!F){throw new Error("Invalid callback for subscriber to '"+this.type+"'")}if(this.subscribeEvent){this.subscribeEvent.fire(F,E,D)}this.subscribers.push(new A.util.Subscriber(F,E,D))},unsubscribe:function(J,H){if(!J){return this.unsubscribeAll()}var I=false;for(var L=0,G=this.subscribers.length;L<G;++L){var K=this.subscribers[L];if(K&&K.contains(J,H)){this._delete(L);I=true}}return I},fire:function(){this.lastError=null;var T=[],Z=this.subscribers.length;if(!Z&&this.silent){return true}var V=[].slice.call(arguments,0),X=true,N,U=false;if(!this.silent){}var O=this.subscribers.slice(),Q=A.util.Event.throwErrors;for(N=0;N<Z;++N){var R=O[N];if(!R){U=true}else{if(!this.silent){}var S=R.getScope(this.scope);if(this.signature==A.util.CustomEvent.FLAT){var P=null;if(V.length>0){P=V[0]}try{X=R.fn.call(S,P,R.obj)}catch(Y){this.lastError=Y;if(Q){throw Y}}}else{try{X=R.fn.call(S,this.type,V,R.obj)}catch(W){this.lastError=W;if(Q){throw W}}}if(false===X){if(!this.silent){}break}}}return(X!==false)},unsubscribeAll:function(){for(var B=this.subscribers.length-1;B>-1;B--){this._delete(B)}this.subscribers=[];return B},_delete:function(C){var D=this.subscribers[C];if(D){delete D.fn;delete D.obj}this.subscribers.splice(C,1)},toString:function(){return"CustomEvent: '"+this.type+"', scope: "+this.scope}};A.util.Subscriber=function(F,E,D){this.fn=F;this.obj=A.lang.isUndefined(E)?null:E;this.override=D};A.util.Subscriber.prototype.getScope=function(B){if(this.override){if(this.override===true){return this.obj}else{return this.override}}return B};A.util.Subscriber.prototype.contains=function(C,D){if(D){return(this.fn==C&&this.obj==D)}else{return(this.fn==C)}};A.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }"};if(!A.util.Event){A.util.Event=function(){var Q=false;var P=[];var O=[];var R=[];var T=[];var L=0;var S=[];var M=[];var N=0;var K={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:A.env.ua.webkit,webkit:A.env.ua.webkit,isIE:A.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var C=this;var B=function(){C._tryPreloadAttach()};this._interval=setInterval(B,this.POLL_INTERVAL)}},onAvailable:function(E,H,D,F,G){var C=(A.lang.isString(E))?[E]:E;for(var B=0;B<C.length;B=B+1){S.push({id:C[B],fn:H,obj:D,override:F,checkReady:G})}L=this.POLL_RETRYS;this.startInterval()},onContentReady:function(E,C,D,B){this.onAvailable(E,C,D,B,true)},onDOMReady:function(C,D,B){if(this.DOMReady){setTimeout(function(){var E=window;if(B){if(B===true){E=D}else{E=B}}C.call(E,"DOMReady",[],D)},0)}else{this.DOMReadyEvent.subscribe(C,D,B)}},addListener:function(c,e,E,J,d){if(!E||!E.call){return false}if(this._isValidCollection(c)){var D=true;for(var I=0,G=c.length;I<G;++I){D=this.on(c[I],e,E,J,d)&&D}return D}else{if(A.lang.isString(c)){var Z=this.getEl(c);if(Z){c=Z}else{this.onAvailable(c,function(){A.util.Event.on(c,e,E,J,d)});return true}}}if(!c){return false}if("unload"==e&&J!==this){O[O.length]=[c,e,E,J,d];return true}var B=c;if(d){if(d===true){B=J}else{B=d}}var b=function(U){return E.call(B,A.util.Event.getEvent(U,c),J)};var C=[c,e,E,b,B,J,d];var H=P.length;P[H]=C;if(this.useLegacyEvent(c,e)){var a=this.getLegacyIndex(c,e);if(a==-1||c!=R[a][0]){a=R.length;M[c.id+e]=a;R[a]=[c,e,c["on"+e]];T[a]=[];c["on"+e]=function(U){A.util.Event.fireLegacyEvent(A.util.Event.getEvent(U),a)}}T[a].push(C)}else{try{this._simpleAdd(c,e,b,false)}catch(F){this.lastError=F;this.removeListener(c,e,E);return false}}return true},fireLegacyEvent:function(G,I){var E=true,U,C,D,B,F;C=T[I].slice();for(var J=0,H=C.length;J<H;++J){D=C[J];if(D&&D[this.WFN]){B=D[this.ADJ_SCOPE];F=D[this.WFN].call(B,G);E=(E&&F)}}U=R[I];if(U&&U[2]){U[2](G)}return E},getLegacyIndex:function(B,D){var C=this.generateId(B)+D;if(typeof M[C]=="undefined"){return -1}else{return M[C]}},useLegacyEvent:function(B,D){if(this.webkit&&("click"==D||"dblclick"==D)){var C=parseInt(this.webkit,10);if(!isNaN(C)&&C<418){return true}}return false},removeListener:function(X,Y,D){var I,F,B;if(typeof X=="string"){X=this.getEl(X)}else{if(this._isValidCollection(X)){var C=true;for(I=X.length-1;I>-1;I--){C=(this.removeListener(X[I],Y,D)&&C)}return C}}if(!D||!D.call){return this.purgeElement(X,false,Y)}if("unload"==Y){for(I=O.length-1;I>-1;I--){B=O[I];if(B&&B[0]==X&&B[1]==Y&&B[2]==D){O.splice(I,1);return true}}return false}var H=null;var G=arguments[3];if("undefined"===typeof G){G=this._getCacheIndex(X,Y,D)}if(G>=0){H=P[G]}if(!X||!H){return false}if(this.useLegacyEvent(X,Y)){var J=this.getLegacyIndex(X,Y);var W=T[J];if(W){for(I=0,F=W.length;I<F;++I){B=W[I];if(B&&B[this.EL]==X&&B[this.TYPE]==Y&&B[this.FN]==D){W.splice(I,1);break}}}}else{try{this._simpleRemove(X,Y,H[this.WFN],false)}catch(E){this.lastError=E;return false}}delete P[G][this.WFN];delete P[G][this.FN];P.splice(G,1);return true},getTarget:function(D,B){var C=D.target||D.srcElement;return this.resolveTextNode(C)},resolveTextNode:function(B){try{if(B&&3==B.nodeType){return B.parentNode}}catch(C){}return B},getPageX:function(B){var C=B.pageX;if(!C&&0!==C){C=B.clientX||0;if(this.isIE){C+=this._getScrollLeft()}}return C},getPageY:function(C){var B=C.pageY;if(!B&&0!==B){B=C.clientY||0;if(this.isIE){B+=this._getScrollTop()}}return B},getXY:function(B){return[this.getPageX(B),this.getPageY(B)]},getRelatedTarget:function(B){var C=B.relatedTarget;if(!C){if(B.type=="mouseout"){C=B.toElement}else{if(B.type=="mouseover"){C=B.fromElement}}}return this.resolveTextNode(C)},getTime:function(D){if(!D.time){var B=new Date().getTime();try{D.time=B}catch(C){this.lastError=C;return B}}return D.time},stopEvent:function(B){this.stopPropagation(B);this.preventDefault(B)},stopPropagation:function(B){if(B.stopPropagation){B.stopPropagation()}else{B.cancelBubble=true}},preventDefault:function(B){if(B.preventDefault){B.preventDefault()}else{B.returnValue=false}},getEvent:function(E,C){var B=E||window.event;if(!B){var D=this.getEvent.caller;while(D){B=D.arguments[0];if(B&&Event==B.constructor){break}D=D.caller}}return B},getCharCode:function(B){var C=B.keyCode||B.charCode||0;if(A.env.ua.webkit&&(C in K)){C=K[C]}return C},_getCacheIndex:function(E,D,F){for(var G=0,B=P.length;G<B;G=G+1){var C=P[G];if(C&&C[this.FN]==F&&C[this.EL]==E&&C[this.TYPE]==D){return G}}return -1},generateId:function(C){var B=C.id;if(!B){B="yuievtautoid-"+N;++N;C.id=B}return B},_isValidCollection:function(B){try{return(B&&typeof B!=="string"&&B.length&&!B.tagName&&!B.alert&&typeof B[0]!=="undefined")}catch(C){return false}},elCache:{},getEl:function(B){return(typeof B==="string")?document.getElementById(B):B},clearCache:function(){},DOMReadyEvent:new A.util.CustomEvent("DOMReady",this),_load:function(B){if(!Q){Q=true;var C=A.util.Event;C._ready();C._tryPreloadAttach()}},_ready:function(B){var C=A.util.Event;if(!C.DOMReady){C.DOMReady=true;C.DOMReadyEvent.fire();C._simpleRemove(document,"DOMContentLoaded",C._ready)}},_tryPreloadAttach:function(){if(S.length===0){L=0;clearInterval(this._interval);this._interval=null;return }if(this.locked){return }if(this.isIE){if(!this.DOMReady){this.startInterval();return }}this.locked=true;var E=!Q;if(!E){E=(L>0&&S.length>0)}var F=[];var D=function(V,J){var W=V;if(J.override){if(J.override===true){W=J.obj}else{W=J.override}}J.fn.call(W,J.obj)};var B,C,G,H,I=[];for(B=0,C=S.length;B<C;B=B+1){G=S[B];if(G){H=this.getEl(G.id);if(H){if(G.checkReady){if(Q||H.nextSibling||!E){I.push(G);S[B]=null}}else{D(H,G);S[B]=null}}else{F.push(G)}}}for(B=0,C=I.length;B<C;B=B+1){G=I[B];D(this.getEl(G.id),G)}L--;if(E){for(B=S.length-1;B>-1;B--){G=S[B];if(!G||!G.id){S.splice(B,1)}}this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false},purgeElement:function(G,F,D){var I=(A.lang.isString(G))?this.getEl(G):G;var E=this.getListeners(I,D),H,C;if(E){for(H=E.length-1;H>-1;H--){var B=E[H];this.removeListener(I,B.type,B.fn)}}if(F&&I&&I.childNodes){for(H=0,C=I.childNodes.length;H<C;++H){this.purgeElement(I.childNodes[H],F,D)}}},getListeners:function(I,U){var F=[],J;if(!U){J=[P,O]}else{if(U==="unload"){J=[O]}else{J=[P]}}var D=(A.lang.isString(I))?this.getEl(I):I;for(var G=0;G<J.length;G=G+1){var B=J[G];if(B){for(var E=0,C=B.length;E<C;++E){var H=B[E];if(H&&H[this.EL]===D&&(!U||U===H[this.TYPE])){F.push({type:H[this.TYPE],fn:H[this.FN],obj:H[this.OBJ],adjust:H[this.OVERRIDE],scope:H[this.ADJ_SCOPE],index:E})}}}}return(F.length)?F:null},_unload:function(D){var J=A.util.Event,G,H,I,E,F,C=O.slice();for(G=0,E=O.length;G<E;++G){I=C[G];if(I){var B=window;if(I[J.ADJ_SCOPE]){if(I[J.ADJ_SCOPE]===true){B=I[J.UNLOAD_OBJ]}else{B=I[J.ADJ_SCOPE]}}I[J.FN].call(B,J.getEvent(D,I[J.EL]),I[J.UNLOAD_OBJ]);C[G]=null;I=null;B=null}}O=null;if(P){for(H=P.length-1;H>-1;H--){I=P[H];if(I){J.removeListener(I[J.EL],I[J.TYPE],I[J.FN],H)}}I=null}R=null;J._simpleRemove(window,"unload",J._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var C=document.documentElement,B=document.body;if(C&&(C.scrollTop||C.scrollLeft)){return[C.scrollTop,C.scrollLeft]}else{if(B){return[B.scrollTop,B.scrollLeft]}else{return[0,0]}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(E,D,B,C){E.addEventListener(D,B,(C))}}else{if(window.attachEvent){return function(E,D,B,C){E.attachEvent("on"+D,B)}}else{return function(){}}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(E,D,B,C){E.removeEventListener(D,B,(C))}}else{if(window.detachEvent){return function(B,D,C){B.detachEvent("on"+D,C)}}else{return function(){}}}}()}}();(function(){var B=A.util.Event;B.on=B.addListener;if(B.isIE){A.util.Event.onDOMReady(A.util.Event._tryPreloadAttach,A.util.Event,true);var C=document.createElement("p");B._dri=setInterval(function(){try{C.doScroll("left");clearInterval(B._dri);B._dri=null;B._ready();C=null}catch(D){}},B.POLL_INTERVAL)}else{if(B.webkit&&B.webkit<525){B._dri=setInterval(function(){var D=document.readyState;if("loaded"==D||"complete"==D){clearInterval(B._dri);B._dri=null;B._ready()}},B.POLL_INTERVAL)}else{B._simpleAdd(document,"DOMContentLoaded",B._ready)}}B._simpleAdd(window,"load",B._load);B._simpleAdd(window,"unload",B._unload);B._tryPreloadAttach()})()}A.util.EventProvider=function(){};A.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(G,K,H,I){this.__yui_events=this.__yui_events||{};var J=this.__yui_events[G];if(J){J.subscribe(K,H,I)}else{this.__yui_subscribers=this.__yui_subscribers||{};var L=this.__yui_subscribers;if(!L[G]){L[G]=[]}L[G].push({fn:K,obj:H,override:I})}},unsubscribe:function(M,K,I){this.__yui_events=this.__yui_events||{};var H=this.__yui_events;if(M){var J=H[M];if(J){return J.unsubscribe(K,I)}}else{var N=true;for(var L in H){if(A.lang.hasOwnProperty(H,L)){N=N&&H[L].unsubscribe(K,I)}}return N}return false},unsubscribeAll:function(B){return this.unsubscribe(B)},createEvent:function(P,J){this.__yui_events=this.__yui_events||{};var M=J||{};var N=this.__yui_events;if(N[P]){}else{var O=M.scope||this;var R=(M.silent);var L=new A.util.CustomEvent(P,O,R,A.util.CustomEvent.FLAT);N[P]=L;if(M.onSubscribeCallback){L.subscribeEvent.subscribe(M.onSubscribeCallback)}this.__yui_subscribers=this.__yui_subscribers||{};var Q=this.__yui_subscribers[P];if(Q){for(var K=0;K<Q.length;++K){L.subscribe(Q[K].fn,Q[K].obj,Q[K].override)}}}return N[P]},fireEvent:function(K,L,H,M){this.__yui_events=this.__yui_events||{};var I=this.__yui_events[K];if(!I){return null}var N=[];for(var J=1;J<arguments.length;++J){N.push(arguments[J])}return I.fire.apply(I,N)},hasEvent:function(B){if(this.__yui_events){if(this.__yui_events[B]){return true}}return false}};A.util.KeyListener=function(G,H,L,K){if(!G){}else{if(!H){}else{if(!L){}}}if(!K){K=A.util.KeyListener.KEYDOWN}var J=new A.util.CustomEvent("keyPressed");this.enabledEvent=new A.util.CustomEvent("enabled");this.disabledEvent=new A.util.CustomEvent("disabled");if(typeof G=="string"){G=document.getElementById(G)}if(typeof L=="function"){J.subscribe(L)}else{J.subscribe(L.fn,L.scope,L.correctScope)}function I(B,C){if(!H.shift){H.shift=false}if(!H.alt){H.alt=false}if(!H.ctrl){H.ctrl=false}if(B.shiftKey==H.shift&&B.altKey==H.alt&&B.ctrlKey==H.ctrl){var E;if(H.keys instanceof Array){for(var D=0;D<H.keys.length;D++){E=H.keys[D];if(E==B.charCode){J.fire(B.charCode,B);break}else{if(E==B.keyCode){J.fire(B.keyCode,B);break}}}}else{E=H.keys;if(E==B.charCode){J.fire(B.charCode,B)}else{if(E==B.keyCode){J.fire(B.keyCode,B)}}}}}this.enable=function(){if(!this.enabled){A.util.Event.addListener(G,K,I);this.enabledEvent.fire(H)}this.enabled=true};this.disable=function(){if(this.enabled){A.util.Event.removeListener(G,K,I);this.disabledEvent.fire(H)}this.enabled=false};this.toString=function(){return"KeyListener ["+H.keys+"] "+G.tagName+(G.id?"["+G.id+"]":"")}};A.util.KeyListener.KEYDOWN="keydown";A.util.KeyListener.KEYUP="keyup";A.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};A.register("event",A.util.Event,{version:"2.5.2",build:"1076"});A.register("yahoo-dom-event",A,{version:"2.5.2",build:"1076"})}());(function(){var A=Lat49.YAHOO;(function(){var D=A.util;var C=function(H,I,G,B){if(!H){}this.init(H,I,G,B)};C.NAME="Anim";C.prototype={toString:function(){var E=this.getEl()||{};var B=E.id||E.tagName;return(this.constructor.NAME+": "+B)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(G,B,F){return this.method(this.currentFrame,B,F-B,this.totalFrames)},setAttribute:function(G,B,F){if(this.patterns.noNegatives.test(G)){B=(B>0)?B:0}D.Dom.setStyle(this.getEl(),G,B+F)},getAttribute:function(M){var K=this.getEl();var I=D.Dom.getStyle(K,M);if(I!=="auto"&&!this.patterns.offsetUnit.test(I)){return parseFloat(I)}var L=this.patterns.offsetAttribute.exec(M)||[];var B=!!(L[3]);var J=!!(L[2]);if(J||(D.Dom.getStyle(K,"position")=="absolute"&&B)){I=K["offset"+L[0].charAt(0).toUpperCase()+L[0].substr(1)]}else{I=0}return I},getDefaultUnit:function(B){if(this.patterns.defaultUnit.test(B)){return"px"}return""},setRuntimeAttribute:function(N){var B;var M;var L=this.attributes;this.runtimeAttributes[N]={};var J=function(E){return(typeof E!=="undefined")};if(!J(L[N]["to"])&&!J(L[N]["by"])){return false}B=(J(L[N]["from"]))?L[N]["from"]:this.getAttribute(N);if(J(L[N]["to"])){M=L[N]["to"]}else{if(J(L[N]["by"])){if(B.constructor==Array){M=[];for(var K=0,O=B.length;K<O;++K){M[K]=B[K]+L[N]["by"][K]*1}}else{M=B+L[N]["by"]*1}}}this.runtimeAttributes[N].start=B;this.runtimeAttributes[N].end=M;this.runtimeAttributes[N].unit=(J(L[N].unit))?L[N]["unit"]:this.getDefaultUnit(N);return true},init:function(U,P,Q,M){var B=false;var T=null;var R=0;U=D.Dom.get(U);this.attributes=P||{};this.duration=!A.lang.isUndefined(Q)?Q:1;this.method=M||D.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=D.AnimMgr.fps;this.setEl=function(E){U=D.Dom.get(E)};this.getEl=function(){return U};this.isAnimated=function(){return B};this.getStartTime=function(){return T};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(D.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1}D.AnimMgr.registerElement(this);return true};this.stop=function(E){if(!this.isAnimated()){return false}if(E){this.currentFrame=this.totalFrames;this._onTween.fire()}D.AnimMgr.stop(this)};var N=function(){this.onStart.fire();this.runtimeAttributes={};for(var E in this.attributes){this.setRuntimeAttribute(E)}B=true;R=0;T=new Date()};var O=function(){var E={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};E.toString=function(){return("duration: "+E.duration+", currentFrame: "+E.currentFrame)};this.onTween.fire(E);var F=this.runtimeAttributes;for(var G in F){this.setAttribute(G,this.doMethod(G,F[G].start,F[G].end),F[G].unit)}R+=1};var S=function(){var F=(new Date()-T)/1000;var E={duration:F,frames:R,fps:R/F};E.toString=function(){return("duration: "+E.duration+", frames: "+E.frames+", fps: "+E.fps)};B=false;R=0;this.onComplete.fire(E)};this._onStart=new D.CustomEvent("_start",this,true);this.onStart=new D.CustomEvent("start",this);this.onTween=new D.CustomEvent("tween",this);this._onTween=new D.CustomEvent("_tween",this,true);this.onComplete=new D.CustomEvent("complete",this);this._onComplete=new D.CustomEvent("_complete",this,true);this._onStart.subscribe(N);this._onTween.subscribe(O);this._onComplete.subscribe(S)}};D.Anim=C})();A.util.AnimMgr=new function(){var I=null;var J=[];var F=0;this.fps=1000;this.delay=1;this.registerElement=function(B){J[J.length]=B;F+=1;B._onStart.fire();this.start()};this.unRegister=function(B,C){C=C||G(B);if(!B.isAnimated()||C==-1){return false}B._onComplete.fire();J.splice(C,1);F-=1;if(F<=0){this.stop()}return true};this.start=function(){if(I===null){I=setInterval(this.run,this.delay)}};this.stop=function(B){if(!B){clearInterval(I);for(var C=0,D=J.length;C<D;++C){this.unRegister(J[0],0)}J=[];I=null;F=0}else{this.unRegister(B)}};this.run=function(){for(var B=0,D=J.length;B<D;++B){var C=J[B];if(!C||!C.isAnimated()){continue}if(C.currentFrame<C.totalFrames||C.totalFrames===null){C.currentFrame+=1;if(C.useSeconds){H(C)}C._onTween.fire()}else{A.util.AnimMgr.stop(C,B)}}};var G=function(B){for(var C=0,D=J.length;C<D;++C){if(J[C]==B){return C}}return -1};var H=function(L){var C=L.totalFrames;var D=L.currentFrame;var E=(L.currentFrame*L.duration*1000/L.totalFrames);var M=(new Date()-L.getStartTime());var B=0;if(M<L.duration*1000){B=Math.round((M/E-1)*L.currentFrame)}else{B=C-(D+1)}if(B>0&&isFinite(B)){if(L.currentFrame+B>=C){B=C-(D+1)}L.currentFrame+=B}}};A.util.Bezier=new function(){this.getPosition=function(I,J){var H=I.length;var K=[];for(var L=0;L<H;++L){K[L]=[I[L][0],I[L][1]]}for(var G=1;G<H;++G){for(L=0;L<H-G;++L){K[L][0]=(1-J)*K[L][0]+J*K[parseInt(L+1,10)][0];K[L][1]=(1-J)*K[L][1]+J*K[parseInt(L+1,10)][1]}}return[K[0][0],K[0][1]]}};(function(){var E=function(D,I,C,B){E.superclass.constructor.call(this,D,I,C,B)};E.NAME="ColorAnim";var G=A.util;A.extend(E,G.Anim);var F=E.superclass;var H=E.prototype;H.patterns.color=/color$/i;H.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;H.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;H.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;H.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;H.parseColor=function(C){if(C.length==3){return C}var B=this.patterns.hex.exec(C);if(B&&B.length==4){return[parseInt(B[1],16),parseInt(B[2],16),parseInt(B[3],16)]}B=this.patterns.rgb.exec(C);if(B&&B.length==4){return[parseInt(B[1],10),parseInt(B[2],10),parseInt(B[3],10)]}B=this.patterns.hex3.exec(C);if(B&&B.length==4){return[parseInt(B[1]+B[1],16),parseInt(B[2]+B[2],16),parseInt(B[3]+B[3],16)]}return null};H.getAttribute=function(I){var C=this.getEl();if(this.patterns.color.test(I)){var B=A.util.Dom.getStyle(C,I);if(this.patterns.transparent.test(B)){var D=C.parentNode;B=G.Dom.getStyle(D,I);while(D&&this.patterns.transparent.test(B)){D=D.parentNode;B=G.Dom.getStyle(D,I);if(D.tagName.toUpperCase()=="HTML"){B="#fff"}}}}else{B=F.getAttribute.call(this,I)}return B};H.doMethod=function(L,B,K){var C;if(this.patterns.color.test(L)){C=[];for(var D=0,M=B.length;D<M;++D){C[D]=F.doMethod.call(this,L,B[D],K[D])}C="rgb("+Math.floor(C[0])+","+Math.floor(C[1])+","+Math.floor(C[2])+")"}else{C=F.doMethod.call(this,L,B,K)}return C};H.setRuntimeAttribute=function(L){F.setRuntimeAttribute.call(this,L);if(this.patterns.color.test(L)){var D=this.attributes;var B=this.parseColor(this.runtimeAttributes[L].start);var K=this.parseColor(this.runtimeAttributes[L].end);if(typeof D[L]["to"]==="undefined"&&typeof D[L]["by"]!=="undefined"){K=this.parseColor(D[L].by);for(var C=0,M=B.length;C<M;++C){K[C]=B[C]+K[C]}}this.runtimeAttributes[L].start=B;this.runtimeAttributes[L].end=K}};G.ColorAnim=E})();A.util.Easing={easeNone:function(H,E,F,G){return F*H/G+E},easeIn:function(H,E,F,G){return F*(H/=G)*H+E},easeOut:function(H,E,F,G){return -F*(H/=G)*(H-2)+E},easeBoth:function(H,E,F,G){if((H/=G/2)<1){return F/2*H*H+E}return -F/2*((--H)*(H-2)-1)+E},easeInStrong:function(H,E,F,G){return F*(H/=G)*H*H*H+E},easeOutStrong:function(H,E,F,G){return -F*((H=H/G-1)*H*H*H-1)+E},easeBothStrong:function(H,E,F,G){if((H/=G/2)<1){return F/2*H*H*H*H+E}return -F/2*((H-=2)*H*H*H-2)+E},elasticIn:function(M,H,I,J,N,K){if(M==0){return H}if((M/=J)==1){return H+I}if(!K){K=J*0.3}if(!N||N<Math.abs(I)){N=I;var L=K/4}else{var L=K/(2*Math.PI)*Math.asin(I/N)}return -(N*Math.pow(2,10*(M-=1))*Math.sin((M*J-L)*(2*Math.PI)/K))+H},elasticOut:function(M,H,I,J,N,K){if(M==0){return H}if((M/=J)==1){return H+I}if(!K){K=J*0.3}if(!N||N<Math.abs(I)){N=I;var L=K/4}else{var L=K/(2*Math.PI)*Math.asin(I/N)}return N*Math.pow(2,-10*M)*Math.sin((M*J-L)*(2*Math.PI)/K)+I+H},elasticBoth:function(M,H,I,J,N,K){if(M==0){return H}if((M/=J/2)==2){return H+I}if(!K){K=J*(0.3*1.5)}if(!N||N<Math.abs(I)){N=I;var L=K/4}else{var L=K/(2*Math.PI)*Math.asin(I/N)}if(M<1){return -0.5*(N*Math.pow(2,10*(M-=1))*Math.sin((M*J-L)*(2*Math.PI)/K))+H}return N*Math.pow(2,-10*(M-=1))*Math.sin((M*J-L)*(2*Math.PI)/K)*0.5+I+H},backIn:function(J,F,G,H,I){if(typeof I=="undefined"){I=1.70158}return G*(J/=H)*J*((I+1)*J-I)+F},backOut:function(J,F,G,H,I){if(typeof I=="undefined"){I=1.70158}return G*((J=J/H-1)*J*((I+1)*J+I)+1)+F},backBoth:function(J,F,G,H,I){if(typeof I=="undefined"){I=1.70158}if((J/=H/2)<1){return G/2*(J*J*(((I*=(1.525))+1)*J-I))+F}return G/2*((J-=2)*J*(((I*=(1.525))+1)*J+I)+2)+F},bounceIn:function(H,E,F,G){return F-A.util.Easing.bounceOut(G-H,0,F,G)+E},bounceOut:function(H,E,F,G){if((H/=G)<(1/2.75)){return F*(7.5625*H*H)+E}else{if(H<(2/2.75)){return F*(7.5625*(H-=(1.5/2.75))*H+0.75)+E}else{if(H<(2.5/2.75)){return F*(7.5625*(H-=(2.25/2.75))*H+0.9375)+E}}}return F*(7.5625*(H-=(2.625/2.75))*H+0.984375)+E},bounceBoth:function(H,E,F,G){if(H<G/2){return A.util.Easing.bounceIn(H*2,0,F,G)*0.5+E}return A.util.Easing.bounceOut(H*2-G,0,F,G)*0.5+F*0.5+E}};(function(){var G=function(D,E,C,B){if(D){G.superclass.constructor.call(this,D,E,C,B)}};G.NAME="Motion";var I=A.util;A.extend(G,I.ColorAnim);var H=G.superclass;var K=G.prototype;K.patterns.points=/^points$/i;K.setAttribute=function(D,B,C){if(this.patterns.points.test(D)){C=C||"px";H.setAttribute.call(this,"left",B[0],C);H.setAttribute.call(this,"top",B[1],C)}else{H.setAttribute.call(this,D,B,C)}};K.getAttribute=function(C){if(this.patterns.points.test(C)){var B=[H.getAttribute.call(this,"left"),H.getAttribute.call(this,"top")]}else{B=H.getAttribute.call(this,C)}return B};K.doMethod=function(F,B,E){var C=null;if(this.patterns.points.test(F)){var D=this.method(this.currentFrame,0,100,this.totalFrames)/100;C=I.Bezier.getPosition(this.runtimeAttributes[F],D)}else{C=H.doMethod.call(this,F,B,E)}return C};K.setRuntimeAttribute=function(B){if(this.patterns.points.test(B)){var T=this.getEl();var R=this.attributes;var U;var F=R.points["control"]||[];var S;var E,C;if(F.length>0&&!(F[0] instanceof Array)){F=[F]}else{var Q=[];for(E=0,C=F.length;E<C;++E){Q[E]=F[E]}F=Q}if(I.Dom.getStyle(T,"position")=="static"){I.Dom.setStyle(T,"position","relative")}if(J(R.points["from"])){I.Dom.setXY(T,R.points["from"])}else{I.Dom.setXY(T,I.Dom.getXY(T))}U=this.getAttribute("points");if(J(R.points["to"])){S=L.call(this,R.points["to"],U);var D=I.Dom.getXY(this.getEl());for(E=0,C=F.length;E<C;++E){F[E]=L.call(this,F[E],U)}}else{if(J(R.points["by"])){S=[U[0]+R.points["by"][0],U[1]+R.points["by"][1]];for(E=0,C=F.length;E<C;++E){F[E]=[U[0]+F[E][0],U[1]+F[E][1]]}}}this.runtimeAttributes[B]=[U];if(F.length>0){this.runtimeAttributes[B]=this.runtimeAttributes[B].concat(F)}this.runtimeAttributes[B][this.runtimeAttributes[B].length]=S}else{H.setRuntimeAttribute.call(this,B)}};var L=function(D,B){var C=I.Dom.getXY(this.getEl());D=[D[0]-C[0]+B[0],D[1]-C[1]+B[1]];return D};var J=function(B){return(typeof B!=="undefined")};I.Motion=G})();(function(){var F=function(D,I,C,B){if(D){F.superclass.constructor.call(this,D,I,C,B)}};F.NAME="Scroll";var H=A.util;A.extend(F,H.ColorAnim);var G=F.superclass;var E=F.prototype;E.doMethod=function(I,B,D){var C=null;if(I=="scroll"){C=[this.method(this.currentFrame,B[0],D[0]-B[0],this.totalFrames),this.method(this.currentFrame,B[1],D[1]-B[1],this.totalFrames)]}else{C=G.doMethod.call(this,I,B,D)}return C};E.getAttribute=function(D){var B=null;var C=this.getEl();if(D=="scroll"){B=[C.scrollLeft,C.scrollTop]}else{B=G.getAttribute.call(this,D)}return B};E.setAttribute=function(I,B,C){var D=this.getEl();if(I=="scroll"){D.scrollLeft=B[0];D.scrollTop=B[1]}else{G.setAttribute.call(this,I,B,C)}};H.Scroll=F})();A.register("animation",A.util.Anim,{version:"2.5.2",build:"1076"})}());Lat49AdPopup=function(K,g,D,F,p){var a=false;var B=false;var H=false;var G=true;var b;var A,j;var P;var e=(typeof (Lat49)!="undefined"&&Lat49&&typeof (Lat49.YAHOO)!="undefined"&&Lat49.YAHOO)?Lat49.YAHOO:YAHOO;var C=1;var J=0.5;var n=e.util.Easing.easeOutStrong;var R=e.util.Easing.easeInStrong;var Y=0.5;var f=false;var Z;var d;var S=new e.util.CustomEvent("animateOutEvent",this,true,e.util.CustomEvent.FLAT);T();this.setPopupDiv=W;this.popin=V;this.popout=E;this.subscribeToAnimateOutEvent=function(s,t,r){S.subscribe(s,t,r)};this.get=function(){return d};this.destroy=function(){if(H){V(true)}if(K!=null){K.onmouseover=null;K.onmouseout=null}if(Z!=null){Z.onclick=null}if(g!=null){g.onmouseover=null;g.onmouseout=null}if(Z!=null){Z=null}if(K!=null){K=null}if(d!=null){d=null}};this.setAdPos=function(r){D=r;Lat49AdPopup.setPinnedPosition(K,D);Lat49AdPopup.setPinnedPosition(Z,D);Lat49AdPopup.setReversedPinnedPosition(g,D)};this.reset=function(){this.popin();this.setTransitionEnabled(true)};this.setTransitionEnabled=function(r){G=r};this.setAnimationOutTime=function(r){C=r};this.setAnimationInTime=function(r){J=r};this.setMouseOverDelay=function(r){Y=r};this.setAnimationOutMethod=function(r){n=r};this.setAnimationInMethod=function(r){R=r};this.setDebugCallback=function(r){P=r};this.clearIntAdFormFields=function(){var t=this.get();if(t!=null){var r=t.getElementsByTagName("input");if(r.length>0){for(var s=0;s<r.length;s++){r[s].value=""}}}};function T(){d=document.createElement("div");Z=document.createElement("div");K.style.position="absolute";K.style.cursor="pointer";Z.style.position="absolute";Z.style.overflow="hidden";Lat49AdPopup.setPinnedPosition(K,D);Lat49AdPopup.setPinnedPosition(Z,D);O(Z);K.onmouseover=I;K.onmouseout=m;if(F){var r=function(){if(H){V(true)}};Z.onclick=function(){if(H){V(true)}window.open(F).focus()}}W(g);d.appendChild(K);d.appendChild(Z)}function W(r){if(g.parentNode==Z){g.onmouseover=null;g.onmouseout=null;Z.removeChild(g)}Lat49AdPopup.setReversedPinnedPosition(r,D);r.style.position="absolute";r.style.width="300px";r.style.height="250px";r.onmouseover=L;r.onmouseout=N;g=r}function o(){if(!f){if(g.innerHTML==""&&p){g.innerHTML=p}Z.appendChild(g)}f=true}function V(r){if(K!=null){G=typeof (r)=="undefined"?false:r;B=false;H=false;A.stop();j.stop();K.style.visibility="visible";Z.style.width="0px";Z.style.height="0px"}}function E(r){G=typeof (r)=="undefined"?false:r;o();H=true;A.stop();j.stop();K.style.visibility="hidden";Z.style.width="300px";Z.style.height="250px"}function h(){o();A.stop();j.animate();Lat49AdPopup.playFlashMovie();S.fire(d);H=true;setTimeout(c,C*1000)}function l(){Lat49AdPopup.playFlashMovie(1);B=false;if(H){j.stop();A.animate();H=false}}function U(r){if(P){P(r)}}function O(r){j=new e.util.Anim(r,{width:{to:300},height:{to:250}});j.duration=C;j.method=n;j.onTween.subscribe(Q);A=new e.util.Anim(r,{width:{to:0},height:{to:0}});A.duration=J;A.method=R;A.onTween.subscribe(X)}function Q(r,s){if(s[0].currentFrame>(C*1000)-(C*500)){K.style.visibility="hidden"}}function X(r,s){if(s[0].currentFrame>(J*1000)-(J*500)){K.style.visibility="visible"}}function I(r){if(!G){return }if(!r&&event){r=event}a=true;b=setTimeout(function(){if(a&&!H){h()}},Y*1000)}function c(){if(!G){return }if(!B&&!a){l()}}function m(r){if(!G){return }if(!r&&event){r=event}a=false;if(!H){clearTimeout(b)}}function L(r){if(!G){return }if(!r&&event){r=event}if(!k(this,r)){return }B=true}function N(r){if(!G){return }if(!r&&event){r=event}if(!q(this,r)){return }l()}function k(s,r){if(s.contains&&r.fromElement){return !s.contains(r.fromElement)}else{if(r.relatedTarget){return !M(s,r.relatedTarget)}}}function q(s,r){if(s.contains&&r.toElement){return !s.contains(r.toElement)}else{if(r.relatedTarget){return !M(s,r.relatedTarget)}}}function M(r,u){var s=false;do{if((s=r==u)){break}try{u=u.parentNode}catch(t){return true}}while(u!=null);return s}};Lat49AdPopup.setPinnedPosition=function(A,B){A.style.top=A.style.left=A.style.bottom=A.style.right="";if(B=="top-left"||B=="top-right"){A.style.top="0px"}if(B=="bottom-left"||B=="bottom-right"){A.style.bottom="0px"}if(B=="top-left"||B=="bottom-left"){A.style.left="0px"}if(B=="top-right"||B=="bottom-right"){A.style.right="0px"}};Lat49AdPopup.setReversedPinnedPosition=function(A,B){A.style.top=A.style.left=A.style.bottom=A.style.right="";if(B=="top-left"||B=="top-right"){A.style.bottom="0px"}if(B=="bottom-left"||B=="bottom-right"){A.style.top="0px"}if(B=="top-left"||B=="bottom-left"){A.style.right="0px"}if(B=="top-right"||B=="bottom-right"){A.style.left="0px"}};Lat49AdPopup.createImagePopup=function(D,C){var E=navigator.userAgent,B,H=-1;B=E.match(/MSIE\s([^;]*)/);if(B&&B[1]){H=parseFloat(B[1])}var G=H>0&&H<7;var F=document.createElement("img");var A=G&&D.substr(D.length-3).toLowerCase()=="png";F.src=A?"http://lat49.com/lat49/blank.gif":D;if(A){F.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+D+"', sizingMethod='scale')"}F.style.width="300px";F.style.height="250px";F.style.cursor="pointer";return F};Lat49AdPopup.validateForm=function(F,B,E){var D=[];var A=false;for(var C=1;C<=B;C++){if(E[C-1]==1){D[C]=document.getElementById("finput"+C+"_"+F).value;if(D[C]==""){var H=document.getElementById("finput"+C+"_"+F);var G=document.getElementById("flabel"+C+"_"+F);H.className=H.className+" fInputErr";G.className=G.className+" fLabelErr";A=true}}}return A};Lat49AdPopup.submitForm=function(D,U,K,H,T,R,Q,P,O,M,J){if(!this.validateForm(D,U,P)){var G=document.getElementById("finput1_"+D);var F=document.getElementById("finput2_"+D);var C=document.getElementById("finput3_"+D);var B=(G)?this.addslashes(G.value):"";var A=(F)?this.addslashes(F.value):"";var W=(C)?this.addslashes(C.value):"";var N="['"+B+"','"+A+"','"+W+"']";var L="['"+T+"','"+R+"','"+Q+"']";var P=[];var I=document.getElementsByTagName("head")[0];var S=document.createElement("script");S.type="text/javascript";var V=D;K=escape(K);H=escape(H);L=escape(L);N=escape(N);O=escape(O);var E="adid="+J+"&publisher="+M+"&number="+D+"&numfields="+U+"&headline="+K+"&emailto="+H+"&fieldlabels="+L+"&fieldvalues="+N+"&requiredfields="+P+"&url="+O+"&";S.id=V+"-script";S.src=Lat49.Ads.serverURL+"/sendInteractiveAdForm?"+E;I.appendChild(S)}};Lat49AdPopup.interactiveFormResponse=function(B){if(B.responsecode=="0"){var A=document.getElementById("formContainer_"+B.number);A.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" border="0" class="standardTable"><tr><td class="standardCell" colspan="2" style="text-align:center;padding-top:40px"><strong>Thank you!</strong><br /> Your information has been sent.</td></tr><tr><td style="padding-top:50px"><p class="fplink"><a href="'+B.url+'" id="fpurl" target="_blank">Website</a></p></td></tr></table>'}};Lat49AdPopup.addslashes=function(A){A=A.replace(/\'/g,"\\'");return A};Lat49AdPopup.createFormPopup=function(C,X,S,P,F,a,M){var W=navigator.userAgent,T,A=-1;T=W.match(/MSIE\s([^;]*)/);if(T&&T[1]){A=parseFloat(T[1])}var H=A>0&&A<7;var N=document.createElement("div");var Z=H&&C.substr(C.length-3).toLowerCase()=="png";N.src=Z?"http://lat49.com/lat49/blank.gif":C;if(Z){N.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+C+"', sizingMethod='scale')"}N.style.width="300px";N.style.height="250px";N.style.zIndex="0";N.style.paddingTop=M?"60px":"";N.style.background="url('"+C+"') no-repeat";var D=[S.field1,S.field2,S.field3];var R="'"+S.field1+"'";var Q="'"+S.field2+"'";var O="'"+S.field3+"'";var K=[];if(S.field1req==1){D[0]=D[0]+"*";K[0]=1}if(S.field2req==1){D[1]=D[1]+"*";K[1]=1}if(S.field3req==1){D[2]=D[2]+"*";K[2]=1}var Y="["+K[0]+","+K[1]+","+K[2]+"]";N.innerHTML="";N.innerHTML+='<form name="iaf_'+S.number+'">';var E=(typeof (Lat49)!="undefined"&&Lat49)?Lat49.SERVER+"/lat49/v0.10/img/close_11x11.gif":Session.docroot+"/img/common/close_11x11.gif";var L=S.number;var G=S.headline;var B=S.emailto;var b=S.numfields;fieldsHtml="";for(var V=1;V<=b;V++){var U="flabel"+V+"_"+L;var I="finput"+V+"_"+L;fieldsHtml+='<tr style="height:10px"><td class="standardCell" style="width:100px"><div id="'+U+'" class="flabel">'+D[V-1]+'</div></td><td class="standardCell" style="width:180px"><div class="finput"><input id="'+I+'" class="standardInput finput" type="text" value="" /></div></td></tr>'}var J=(typeof (a)=="undefined")?"position:absolute; top: 0px; left:0px;":J;N.innerHTML+='<div style="'+J+'width:300px;height:178px;padding-top:2px;z-index:1;"><div id="popupform'+F+'" style="position:relative;float:right;padding:3px;cursor:pointer;'+(M?"margin-top:-60px":"")+'"><img src="'+E+'" /></div><div id="formContainer_'+L+'" style="height:176px;*height:178px;border: 1px #817e7e solid;'+(!M?"margin-top:60px;":"")+'padding: 10px 0px 0px 10px;background-color: #ffffff;"><table width="100%" cellpadding="0" cellspacing="0" border="0" class="standardTable"><tr><td class="standardCell" colspan="2"><div class="fheadline">'+G+"</div></td></tr>"+fieldsHtml+'<tr><td class="standardCell"></td><td class="standardCell"><input type="image" style="margin-right: 5px; cursor: pointer;" class="button66x18" src="http://lat49.com/utilities/img/submit_66x18.gif" onclick="'+(M?"":"Lat49AdPopup.submitForm("+L+","+b+",'"+G+"','"+B+"',"+R+","+Q+","+O+","+Y+",'"+X+"',"+P+","+F+")")+'" onmousedown="this.src=\'http://lat49.com/utilities/img/submit_66x18_pressed.gif\'" onmouseup="this.src=\'http://lat49.com/utilities/img/submit_66x18.gif\'" onmouseout="this.src=\'http://lat49.com/utilities/img/submit_66x18.gif\'" alt=""/></td></tr><tr><td></td><td><p class="fplink"><a href="'+X+'" id="fpurl" target="_blank">Website</a></p></td></tr><tr><td></td><td></td></tr></table></div></div>';N.innerHTML+="</form>";return N};Lat49AdPopup.createCustomPopup=function(A){var B=document.createElement("div");B.style.width="300px";B.style.height="250px";B.style.zIndex="99998";B.innerHTML=A;B.id="Lat49CustomAd";return B};Lat49AdPopup.playFlashMovie=function(C){var A="Lat49FlashAdId";var E=null;var B=navigator.userAgent;if(B.indexOf("Mac")!=-1){return }if(navigator.appName.indexOf("Microsoft")!=-1){E=window[A]}else{E=window.document[A]}if(!E){E=document.getElementById(A)}if(E){try{if(C){E.StopPlay()}else{E.Play()}}catch(D){}}};
