(function(A){A.flashPlayerVersion=function(){var D,B=null,I=false,H="ShockwaveFlash.ShockwaveFlash";if(!(D=navigator.plugins["Shockwave Flash"])){try{B=new ActiveXObject(H+".7")}catch(G){try{B=new ActiveXObject(H+".6");D=[6,0,21];B.AllowScriptAccess="always"}catch(F){if(D&&D[0]===6){I=true}}if(!I){try{B=new ActiveXObject(H)}catch(E){D="X 0,0,0"}}}if(!I&&B){try{D=B.GetVariable("$version")}catch(C){}}}else{D=D.description}D=D.match(/^[A-Za-z\s]*?(\d+)(\.|,)(\d+)(\s+r|\s+d|,)(\d+)/);return[D[1]*1,D[3]*1,D[5]*1]}();A.flashExpressInstaller="/img/expressInstall.swf";A.hasFlashPlayer=(A.flashPlayerVersion[0]!==0);A.hasFlashPlayerVersion=function(C){var B=A.flashPlayerVersion;C=(/string|integer/.test(typeof C))?C.toString().split("."):C;return(C)?(B[0]>=(C.major||C[0]||B[0])&&B[1]>=(C.minor||C[1]||B[1])&&B[2]>=(C.release||C[2]||B[2])):(B[0]!==0)};A.flash=function(P){var B=false;if(!A.hasFlashPlayer){B=true}var D=P.url||"",N=P.type||"swf",M=P.params||{},G=document.createElement("body"),C,O,J,E,L,K,I,H;var F=P.urlParams||false;delete P.urlParams;if(typeof (F)=="object"){str=[];for(up in F){str.push(up+"="+F[up])}F=str.join("&")}P.height=P.height||180;P.width=P.width||320;if(B||(P.hasVersion&&!A.hasFlashPlayerVersion(P.hasVersion))){A.extend(P,{id:"SWFObjectExprInst",height:Math.max(P.height,137),width:Math.max(P.width,214)});D=P.expressInstaller||A.flashExpressInstaller;M={flashvars:{MMredirectURL:window.location.href,MMplayerType:(A.browser.msie&&A.browser.win)?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}if(P.flashvars&&typeof M==="object"){A.extend(M,{flashvars:P.flashvars})}for(L in (K=["url","type","expressInstall","hasVersion","params","flashvars"])){delete P[K[L]]}C=[];for(L in P){if(typeof P[L]==="object"){O=[];for(K in P[L]){O.push(K.replace(/([A-Z])/,"-$1").toLowerCase()+":"+P[L][K]+";")}P[L]=O.join("")}C.push(L+"=\""+P[L]+"\"")}P=C.join(" ");if(typeof M==="object"){C=[];for(L in M){if(typeof M[L]==="object"){O=[];for(K in M[L]){if(typeof M[L][K]==="object"){J=[];for(I in M[L][K]){if(typeof M[L][K][I]==="object"){E=[];for(H in M[L][K][I]){E.push(H.replace(/([A-Z])/,"-$1").toLowerCase()+":"+M[L][K][I][H]+";")}M[L][K][I]=E.join("")}J.push(I+"{"+M[L][K][I]+"}")}M[L][K]=J.join("")}O.push(window.escape(K)+"="+window.escape(M[L][K]))}M[L]=O.join("&amp;")}C.push("<PARAM NAME=\""+L+"\" VALUE=\""+M[L]+"\">")}M=C.join("")}if(N=="swf"){if(!(/style=/.test(P))){P+=" style=\"vertical-align:text-top;\""}if(!(/style=(.*?)vertical-align/.test(P))){P=P.replace(/style="/,"style=\"vertical-align:text-top;")}}if(A.browser.msie){if(N=="swf"){P+=" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"";M="<PARAM NAME=\"movie\" VALUE=\""+D+"\">"+M}else{if(F){if(D.indexOf("?")==-1){D+="?"+F}else{D+="&"+F}}P+=" classid=\"clsid:233C1507-6A77-46A4-9443-F871F945D258\"";M="<PARAM NAME=\"src\" VALUE=\""+D+"\">"+M}}else{if(N=="swf"){P+=" type=\"application/x-shockwave-flash\" data=\""+D+"\""}else{if(F){if(D.indexOf("?")==-1){D+="?"+F}else{D+="&"+F}}P+=" type=\"application/x-director\" data=\""+D+"\""}}return B==true?false:"<OBJECT "+P+">"+M+"</OBJECT>"};A.fn.flash=function(C){if(!A.hasFlashPlayer){return this}var B=0,D;while((D=this.eq(B++))[0]){D.html(A.flash(A.extend({},C)));if(D[0].firstChild.getAttribute("id")==="SWFObjectExprInst"){B=this.length}}return this}}(jQuery));(function(E){var W={adWidth:300,adHeight:250,resizeBar:-40,showAd:true,forcePreroll:false,usePercentsInPreroll:true,loadingBar:true,fileType:"swf",contentId:"#flashobj",preloadId:"#flashobj_mc",beforeCallback:null,afterCallback:null,skipCallback:null,gameInsertCallback:null,loadingText:"Loading game...",afterLoadingText:"Game loaded. Click here to start the game\u2026",progressbarText:"The game will start in %d seconds",closeText:"Close the advertisement and go on to the game.",advertisementText:"Advertisement",tickInterval:200,progressTime:15000,showSkipTime:0,barWidth:300,adType:"iframe",adCode:""};var A=0;var D=0;var V=0;var H=this;var K=0;var R=false;var O=false;var M=false;var U,a,F,S,L,Y,Z,C;var P=function(){if(U!=null){clearInterval(U);U=null}if(C!=null){clearTimeout(C);C=null}if(F!=null){clearTimeout(F);F=null}E(a).remove();if(W.afterCallback!=null){W.afterCallback.call(H,W)}if(W.fileType!="swf"||W.forcePreroll){W.gameInsertCallback.call(H)}else{E(W.contentId).css({width:L,height:Y})}};var Q=function(){if(W.skipCallback!=null){W.skipCallback.call(H,W)}setTimeout(function(){P()},10)};var J=function(b){R=b?false:R;if(V<=0&&!R){if(Z){if(!O){E("#ap_skiptext").empty().append(E("<a href=\"javascript:void(0);\">"+W.closeText+"</a>").click(Q));O=true}}else{if(b){if(!O){E("#ap_skiptext").empty().append(E("<a href=\"javascript:void(0);\">"+W.afterLoadingText+"</a>").click(Q));O=true}}else{E("#ap_skiptext").empty().append(W.loadingText)}}R=true;return }else{if(V>0&&!Z&&!b&&!R){E("#ap_skiptext").empty().append(W.loadingText);R=true}}V-=W.tickInterval};var X=function(){E(a).css({width:(W.adWidth+"px")});E(a).prepend("<div id=\"ap_adtext\">"+W.advertisementText+"</div>");if(W.adType=="iframe"){E(a).append("<div id=\"ap_adframe\"></div>");E("#ap_adframe").css({width:(W.adWidth+"px"),height:(W.adHeight+"px")});E("#ap_adframe").append(W.adCode)}else{E("#ap_adframe").css({width:(W.adWidth+"px"),height:(W.adHeight+"px")})}if(W.loadingBar&&!M){E(a).append("<div id=\"ap_progressbar\"><div class=\"bleft\"><div class=\"bright\"></div></div></div>");E("#ap_progressbar").css("width",W.barWidth+W.resizeBar+"px");E("div#ap_progressbar div.bright").css({"background-position":(W.barWidth+W.resizeBar-5)+"px -52px"});E("#ap_progressbar").reportprogress(0,100,"0%",W.barWidth)}if(!M){E(a).append("<div id=\"ap_skiptext\"></div>")}J()};var N=function(){D+=W.tickInterval;A=Math.round(100*D/W.progressTime);E("#ap_progressbar").reportprogress(A,100,A+"%");J();if(A>=100){if(!M){P()}}};var I=function(c){var b=E(W.preloadId)[0].PercentLoaded();if(c==b){if(!M){P()}if(F!=null){clearTimeout(sometime);F=null}}};var G=function(){var b=parseInt((W.progressTime-S)*100/W.progressTime);var c=E(W.preloadId)[0].PercentLoaded();if(c<0){c=100}A=b<c?b:c;E("#ap_progressbar").reportprogress(A,100,A+"%");S-=W.tickInterval;if(b>=100){F=setTimeout(function(){I(c)},2500)}if(A<100){if(c>=100){J(true)}else{J()}}else{if(!M){P()}}};var B;B=function(){K++;try{var b=E(W.preloadId)[0].PercentLoaded();U=setInterval(G,W.tickInterval);X()}catch(c){if(K<=3){setTimeout(B,1000)}else{if(!M){P()}}}};var T=function(){if(W.beforeCallback!=null){W.beforeCallback.call(H,W)}V=W.showSkipTime;if(W.fileType!="swf"||W.forcePreroll){Z=true;U=setInterval(N,W.tickInterval);X()}else{W.gameInsertCallback.call(H);Y=E(W.contentId).css("height");L=E(W.contentId).css("width");E(W.contentId).css({width:"0px",height:"0px"});Z=false;B();S=W.progressTime}};E.spiPreloaderNeoEdge=function(b){return function(c){if(c=="AD_STARTED"){if(parent){M=true}C=setTimeout(P,b||30000)}if(c=="AD_COMPLETED"){P()}}};E.fn.spiPreloader=function(b){a=E(this);E.extend(W,b);if(W.showAd==true){T()}else{if(W.beforeCallback!=null){W.beforeCallback.call(H,W)}W.gameInsertCallback.call(H,W);if(W.afterCallback!=null){W.afterCallback.call(H,W)}}}})(jQuery);(function(A){A.fn.reportprogress=function(E,G,D,F){var B=100;var C=F||300;if(G){B=G}return this.each(function(){var J=A(this);var I=J.find(".progress");if(I.length!=1){I=A("<div class='progress'></div>");J.after("<div id='ap_pb_text' class='text'>&nbsp;</div>");A("<span class='text'>&nbsp;</span>").css("width",J.css("width")).appendTo(I);A("div.bright",J).append(I)}var H=Math.round(E/B*100);I.css("width",H+"%");if(D){A("div#ap_pb_text").html(D)}})}})(jQuery);function getAbsoluteLeft(B){var C=B.offsetLeft;var A=B.offsetParent;while(A!=null){C+=A.offsetLeft;A=A.offsetParent}return C}var _isFF=false;var _isIE=false;var _isOpera=false;var _isKHTML=false;var _isMacOS=false;if(navigator.userAgent.indexOf("Macintosh")!=-1){_isMacOS=true}if((navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("Konqueror")!=-1)){var _KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(_KHTMLrv>525){_isFF=true;var _FFrv=1.9}else{_isKHTML=true}}else{if(navigator.userAgent.indexOf("Opera")!=-1){_isOpera=true;_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))}else{if(navigator.appName.indexOf("Microsoft")!=-1){_isIE=true;if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"){_isIE=8}}else{_isFF=true;var _FFrv=parseFloat(navigator.userAgent.split("rv:")[1])}}}dhtmlxEventable=function(obj){obj.dhx_SeverCatcherPath="";obj.attachEvent=function(name,catcher,callObj){name="ev_"+name.toLowerCase();if(!this[name]){this[name]=new this.eventCatcher(callObj||this)}return(name+":"+this[name].addEvent(catcher))};obj.callEvent=function(name,arg0){name="ev_"+name.toLowerCase();if(this[name]){return this[name].apply(this,arg0)}return true};obj.checkEvent=function(name){return(!!this["ev_"+name.toLowerCase()])};obj.eventCatcher=function(obj){var dhx_catch=[];var z=function(){var res=true;for(var i=0;i<dhx_catch.length;i++){if(dhx_catch[i]!=null){var zr=dhx_catch[i].apply(obj,arguments);res=res&&zr}}return res};z.addEvent=function(ev){if(typeof (ev)!="function"){ev=eval(ev)}if(ev){return dhx_catch.push(ev)-1}return false};z.removeEvent=function(id){dhx_catch[id]=null};return z};obj.detachEvent=function(id){if(id!=false){var list=id.split(":");this[list[0]].removeEvent(list[1])}}};function dhtmlxSlider(H,J,I,B,C,F,G,A){if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(D){}}if(!H){var E="slider_div_"+(new Date()).valueOf()+Math.random(1000);var H=document.createElement("div");H.setAttribute("id",E);document.body.appendChild(H)}else{if(typeof (H)!="object"){H=document.getElementById(H)}}if(typeof (J)=="object"){I=J.skin;C=J.min;F=J.max;A=J.step;B=J.vertical;G=J.value;J=J.size}this.size=J;this.value=G||0;this.vMode=B||false;this.skin=I||"";this.parent=H;this.isInit=false;this.value=G||C||0;this.inputPriority=true;this.stepping=false;this.imgURL=window.dhx_globalImgPath||"/img/_/zoomslider/";this._def=[C,F,A,G,J];dhtmlxEventable(this);return this}dhtmlxSlider.prototype.createStructure=function(){if(this.con){this.con.parentNode.removeChild(this.con);this.con=null}if(this.vMode){this._sW="height";this._sH="width";this._sL="top";this._sT="left";var A=this.imgURL+"skins/"+(this.skin==""?"default":this.skin)+"/vertical/"}else{this._sW="width";this._sH="height";this._sL="left";this._sT="top";var A=this.imgURL+"skins/"+(this.skin==""?"default":this.skin)+"/"}this.con=document.createElement("DIV");this.con.onselectstart=function(){return false};this.con._etype="slider";this.con.className="dhtmlxSlider"+(this.skin?"_"+this.skin:this.skin);this.drag=document.createElement("DIV");this.drag._etype="drag";this.drag.className="selector";this.drag.style.backgroundImage="url("+A+"selector.gif)";var D=document.createElement("DIV");D.className="leftSide";D.style.background="url("+A+"leftside_bg.gif)";this.leftZone=document.createElement("DIV");this.leftZone.className="leftZone";this.leftZone.style.background="url("+A+"leftzone_bg.gif)";this.leftZone.style.width=Math.abs(this.value)+"px";var E=document.createElement("DIV");E.className="rightSide";E.style.background="url("+A+"rightside_bg.gif)";this.rightZone=document.createElement("DIV");this.rightZone.className="rightZone";this.rightZone.style.background="url("+A+"rightzone_bg.gif)";this.con.appendChild(D);this.con.appendChild(this.leftZone);this.con.appendChild(this.rightZone);this.con.appendChild(E);this.con.appendChild(this.drag);this.parent.appendChild(this.con);if(!this.parent.parentNode||!this.parent.parentNode.tagName){document.body.appendChild(this.parent)}if(this.vMode){this._sW="height";this._sH="width";this._sL="top";this._sT="left";this.con.style.width=this.con.offsetHeight+"px";for(var C=0;C<this.con.childNodes.length;C++){this.con.childNodes[C].style.fontSize="0";var B=this.con.childNodes[C].offsetWidth;this.con.childNodes[C].style.width=this.con.childNodes[C].offsetHeight+"px";this.con.childNodes[C].style.height=B+"px";B=this.con.childNodes[C].offsetLeft;this.con.childNodes[C].style.left=this.con.childNodes[C].offsetTop+"px";this.con.childNodes[C].style.top=B+"px"}E.style.top=this.size-E.offsetHeight+"px";this.zoneSize=this.size-E.offsetHeight;this.dragLeft=this.drag.offsetTop;this.dragWidth=this.drag.offsetHeight;this.rightZone.style.height=this.zoneSize+"px"}else{this.zoneSize=this.size-E.offsetWidth;this.dragLeft=this.drag.offsetLeft;this.dragWidth=this.drag.offsetWidth;this.rightZone.style.width=this.zoneSize+"px"}this.con.style[this._sW]=this.size+"px";this.con.onmousedown=this._onMouseDown;this.con.onmouseup=this.con.onmouseout=function(){clearInterval(this.that._int)};this.con.that=this;this._aCalc(this._def);this.setValue(this.value)};dhtmlxSlider.prototype._aCalc=function(A){if(!this.isInit){return }this.shift=A[0]||0;this.limit=(A[1]||100)-this.shift;this._mod=(A[4]-this.dragLeft*2-this.dragWidth)/this.limit;this._step=(A[2]||1);this.step=this._step*this._mod;this._xlimit=A[4]-this.dragLeft*2-this.dragWidth;if(!this.posX){this.posX=this._xlimit*((A[3]||0)-this.shift)/this.limit}this._applyPos(true);return this};dhtmlxSlider.prototype.setMin=function(A){this._def[0]=A;this._aCalc(this._def)};dhtmlxSlider.prototype.setMax=function(A){this._def[1]=A;this._aCalc(this._def)};dhtmlxSlider.prototype.setStep=function(A){this._def[2]=A;this._aCalc(this._def)};dhtmlxSlider.prototype._applyPos=function(C){if(!this.isInit){return }if(this.posX<0){this.posX=0}if(this.value<(this._def[0]||0)){this.value=this._def[0]||0}if(this.value>this._def[1]){this.value=this._def[1]}if(this.posX>this._xlimit){this.posX=this._xlimit}if(this.step!=1){this.posX=Math.round(this.posX/this.step)*this.step}var B=this.drag.style[this._sL];this.drag.style[this._sL]=this.posX+this.dragLeft*1+"px";this.leftZone.style[this._sW]=this.posX+this.dragLeft*1+"px";this.rightZone.style[this._sL]=this.posX+this.dragLeft*1+1+"px";this.rightZone.style[this._sW]=this.zoneSize-(this.posX+this.dragLeft*1)+"px";var A=this.getValue();if(this._link){if(this._linkBoth){this._link.value=A}else{this._link.innerHTML=A}}C=false;if((!C)&&this.checkEvent("onChange")&&(B!=this.drag.style[this._sL])){this.callEvent("onChange",[A,this])}this.value=this.getValue();if(!this._dttp){this._setTooltip(A)}};dhtmlxSlider.prototype._setTooltip=function(A){this.con.title=A};dhtmlxSlider.prototype.setSkin=function(A){this.skin=(A?A:"");if(this.isInit){this.createStructure()}};dhtmlxSlider.prototype.startDrag=function(B){if(this._busy){return }if((B.button===0)||(B.button===1)){this.drag_mx=B.clientX;this.drag_my=B.clientY;this.drag_cx=this.posX;this.d_b_move=document.body.onmousemove;this.d_b_up=document.body.onmouseup;var A=this;document.body.onmouseup=function(C){A.stopDrag(C||event);A=null};document.body.onmousemove=function(C){A.onDrag(C||event)};this._busy=true}};dhtmlxSlider.prototype.onDrag=function(A){if(this._busy){if(!this.vMode){this.posX=this.drag_cx+A.clientX-this.drag_mx}else{this.posX=this.drag_cx+A.clientY-this.drag_my}this._applyPos()}};dhtmlxSlider.prototype.stopDrag=function(A){var A=A||event;document.body.onmousemove=this.d_b_move?this.d_b_move:null;document.body.onmouseup=this.d_b_up?this.d_b_up:null;this.d_b_move=this.d_b_up=null;this._busy=false;this.callEvent("onSlideEnd",[this.getValue()])};dhtmlxSlider.prototype.getValue=function(){if((!this._busy)&&(this.inputPriority)){return Math.round(this.value/this._step)*this._step}return Math.round((Math.round((this.posX/this._mod)/this._step)*this._step+this.shift*1)*10000)/10000};dhtmlxSlider.prototype.setValue=function(A){this.value=A;this._applyPos(this.posX=(Math.round(((A||0)-this.shift)*this._mod)))};dhtmlxSlider.prototype._getActionElement=function(A){if(A._etype){return A}if(A.parentNode){return this._getActionElement(A.parentNode)}return null};dhtmlxSlider.prototype._onMouseDown=function(C){C=C||event;var B=this.that;var A=B._getActionElement(_isIE?C.srcElement:C.target);switch(A._etype){case"slider":if(B.vMode){var D=C.clientY-(getAbsoluteTop(B.con)-document.body.scrollTop)}else{var D=C.clientX-(getAbsoluteLeft(B.con)-document.body.scrollLeft)}var E=B.posX;B.posX=D-B.dragLeft-B.dragWidth/2;B.direction=B.posX>E?1:-1;if(B.stepping){clearInterval(B._int);B.setValue(B.value+B._step*B.direction);B._int=setInterval(function(){B.setValue(B.value+B._step*B.direction)},600)}else{B._busy=true;B._applyPos();B._busy=false;B.callEvent("onSlideEnd",[B.getValue()])}break;case"drag":B.startDrag(C||event);break}return false};dhtmlxSlider.prototype.setOnChangeHandler=function(A){this.attachEvent("onChange",A)};dhtmlxSlider.prototype._linkFrom=function(){this.setValue(parseFloat(this._link.value))};dhtmlxSlider.prototype.linkTo=function(D){D=(typeof (D)!="object")?document.getElementById(D):D;this._link=D;var B=D.tagName.toString().toLowerCase();this._linkBoth=(((B=="input")||(B=="select")||(B=="textarea"))?1:0);if(this._linkBoth){var A=this;var C=function(){if(this._nextSlider){window.clearTimeout(this._nextSlider)}this._nextSlider=window.setTimeout(function(){A._linkFrom()},500)};D.onblur=D.onkeypress=D.onchange=C}this._applyPos()};dhtmlxSlider.prototype.enableTooltip=function(A){this._dttp=(!convertStringToBoolean(A));this._setTooltip(this._dttp?"":this.getValue())};dhtmlxSlider.prototype.setImagePath=function(A){this.imgURL=A};dhtmlxSlider.prototype.init=function(){this.isInit=true;this.createStructure()};dhtmlxSlider.prototype.setInputPriority=function(A){this.inputPriority=A};dhtmlxSlider.prototype.setSteppingMode=function(A){this.stepping=A};(function(){jQuery.fn.closeAd=function(A){var A=$.extend({closeText:"close ad",className:"closeleaderboard",appendMethod:"append",height:15,callbackBefore:false,callbackAfter:false},A);return this.each(function(E,F){var D=$(this);var B=D.height();D.height(B+A.height);var C=$("<div class=\""+A.className+"\"><a href=\"#close-ad\">"+A.closeText+"</a></div>");if(A.appendMethod=="prepend"){D.prepend(C)}else{D.append(C)}$("div."+A.className+" a",D).click(function(){if(A.callbackBefore!==false){A.callbackBefore()}D.hide().remove();if(A.callbackAfter!==false){A.callbackAfter()}return false})})}})(jQuery);(function(C){var A=C.scrollTo=function(F,E,D){C(window).scrollTo(F,E,D)};A.defaults={axis:"xy",duration:parseFloat(C.fn.jquery)>=1.3?0:1};A.window=function(D){return C(window).scrollable()};C.fn.scrollable=function(){return this.map(function(){var E=this,D=!E.nodeName||C.inArray(E.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!D){return E}var F=(E.contentWindow||E).document||E.ownerDocument||E;return C.browser.safari||F.compatMode=="BackCompat"?F.body:F.documentElement})};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}if(typeof D=="function"){D={onAfter:D}}if(F=="max"){F=9000000000}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this.scrollable().each(function(){var M=this,K=C(M),L=F,J,H={},N=K.is("html,body");switch(typeof L){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(L)){L=B(L);break}L=C(L,this);case"object":if(L.is||L.style){J=(L=C(L)).offset()}}C.each(D.axis.split(""),function(R,S){var T=S=="x"?"Left":"Top",U=T.toLowerCase(),Q="scroll"+T,O=M[Q],P=S=="x"?"Width":"Height";if(J){H[Q]=J[U]+(N?0:O-K.offset()[U]);if(D.margin){H[Q]-=parseInt(L.css("margin"+T))||0;H[Q]-=parseInt(L.css("border"+T+"Width"))||0}H[Q]+=D.offset[U]||0;if(D.over[U]){H[Q]+=L[P.toLowerCase()]()*D.over[U]}}else{H[Q]=L[U]}if(/^\d+$/.test(H[Q])){H[Q]=H[Q]<=0?0:Math.min(H[Q],G(P))}if(!R&&D.queue){if(O!=H[Q]){I(D.onAfterFirst)}delete H[Q]}});I(D.onAfter);function I(O){K.animate(H,E,D.easing,O&&function(){O.call(this,F,D)})}function G(S){var P="scroll"+S;if(!N){return M[P]}var R="client"+S,Q=M.ownerDocument.documentElement,O=M.ownerDocument.body;return Math.max(Q[P],O[P])-Math.min(Q[R],O[R])}}).end()};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);(function(D){var B=location.href.replace(/#.*/,"");var C=D.localScroll=function(E){D("body").localScroll(E)};C.defaults={duration:1000,axis:"y",event:"click",stop:true};C.hash=function(E){E=D.extend({},C.defaults,E);E.hash=false;if(location.hash){setTimeout(function(){A(0,location,E)},0)}};D.fn.localScroll=function(F){F=D.extend({},C.defaults,F);return(F.persistent||F.lazy)?this.bind(F.event,function(H){var G=D([H.target,H.target.parentNode]).filter(E)[0];G&&A(H,G,F)}):this.find("a,area").filter(E).bind(F.event,function(G){A(G,this,F)}).end().end();function E(){return !!this.href&&!!this.hash&&this.href.replace(this.hash,"")==B&&(!F.filter||D(this).is(F.filter))}};function A(I,H,F){var J=H.hash.slice(1),G=document.getElementById(J)||document.getElementsByName(J)[0];if(G){I&&I.preventDefault();var E=D(F.target||D.scrollTo.window());if(F.lock&&E.is(":animated")||F.onBefore&&F.onBefore.call(H,I,G,E)===false){return }if(F.stop){E.queue("fx",[]).stop()}E.scrollTo(G,F).trigger("notify.serialScroll",[G]);if(F.hash){E.queue(function(){location=H.hash;D(this).dequeue()})}}}})(jQuery);function CreateBookmarkLink(A,B){if(window.sidebar&&!document.all){window.sidebar.addPanel(B,A,"")}else{if(window.external){window.external.AddFavorite(A,B)}else{if(window.opera&&window.print){return false}}}}function SWFtoJS(A){this.m_oCallFuntions=new Object();this.m_bDebug=false;if(A!=null){SWFtoJS.instance().parse(A)}}SWFtoJS.m_oSWFtoJS=null;SWFtoJS.instance=function(A){if(SWFtoJS.m_oSWFtoJS==null){SWFtoJS.m_oSWFtoJS=new SWFtoJS();if(A){SWFtoJS.m_oSWFtoJS.m_bDebug=true}}return SWFtoJS.m_oSWFtoJS};SWFtoJS.prototype.addCallFunction=function(A,B){if(typeof B=="function"){this.m_oCallFuntions[A]=B}};SWFtoJS.prototype.parse=function(B){try{if(B.call){switch(B.call){case"MULTI":for(i=0;i<p_oData.calls.length;i++){SWFtoJS(B.calls[i])}break;default:if(this.m_oCallFuntions[B.call]){if(!B.params){B.params={}}this.m_oCallFuntions[B.call](B.params)}else{throw"call: "+B.call+" not found in call functions!"}break}}else{throw"call attribute not found in CallObject!"}}catch(A){if(this.m_bDebug){alert(A)}}};var haHighscoresTab=false;$(function(){$(".gamepage_ha_highscore_button").click(function(){if(!haHighscoresTab){jQuery.nTooltipEnabled=false;$("#gamepage_ha_awards_anim").animate({top:-392},1000,"swing",function(){$(this).hide()});$("#gamepage_ha_highscore_btn").animate({top:0},1000,"swing",function(){$(this).hide();$(".gamepage_ha_awards_button").attr("id","gamepage_ha_awards_switch");haHighscoresTab=true;jQuery.nTooltipEnabled=true})}return false});$(".gamepage_ha_awards_button").click(function(){if(haHighscoresTab){jQuery.nTooltipEnabled=false;$("#gamepage_ha_awards_anim").show().animate({top:0},1000,"swing");$("#gamepage_ha_highscore_btn").show().animate({top:392},1000,"swing",function(){$(".gamepage_ha_awards_button").removeAttr("id");haHighscoresTab=false;jQuery.nTooltipEnabled=true})}return false});var B=0;$("div.sharefield label").each(function(){if(B<$(this).width()){B=$(this).width()}});var A=375-B;$("div#gamedetailsbox label").css("width",(B+2)+"px");$("div#gamedetailsbox .gamelink, div#gamedetailsbox .gameembed").css("width",A+"px");$(function(){$("div.sharefield input, div.sharefield textarea").focus(function(){$(this).select()}).click(function(){$(this).select()})});$("#anchorlinks").localScroll();$("div#gamelanding div.play_btn").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});if($.browser.msie==true){$("div#social_bookmarks li.iebookmark").show()}});var oSWFtoJS=SWFtoJS.instance();var InternetExplorer=navigator.appName.indexOf("Microsoft")!=-1;function myFlash_DoFSCommand(B,A){var C=InternetExplorer?myFlash:document.myFlash;if(B=="endgame"){addresult(A)}}if(navigator.appName&&navigator.appName.indexOf("Microsoft")!=-1&&navigator.userAgent.indexOf("Windows")!=-1&&navigator.userAgent.indexOf("Windows 3.1")==-1){document.write("<SCRIPT LANGUAGE=VBScript> \n");document.write("on error resume next \n");document.write("Sub myFlash_FSCommand(ByVal command, ByVal args)\n");document.write(" call myFlash_DoFSCommand(command, args)\n");document.write("end sub\n");document.write("</SCRIPT> \n")}function endgame(A){addresult(A)}function addresult(A){if(!$.cookie("userid")){return false}$.get("/ajax/addresult.php?wo",{val:A},function(B,C){if(B.status==1){$("#ha_award_normal_logged span").html(B.awards.length);type_1=type_2=type_3=type_4=type_5=type_6=0;for(i=0;i<B.awards.length;i++){switch(parseInt(B.awards[i].type)){case 1:type_1++;break;case 2:type_2++;break;case 3:type_3++;break;case 4:type_4++;break;case 5:type_5++;break;case 6:type_6++;break;default:break}}if(type_1>0){$(".achievement_box_content li[tag=tag_award1]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award1] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award1] span.points span").html(type_1)}if(type_2>0){$(".achievement_box_content li[tag=tag_award2]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award2] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award2] span.points span").html(type_2)}if(type_3>0){$(".achievement_box_content li[tag=tag_award3]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award3] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award3] span.points span").html(type_3)}if(type_4>0){$(".achievement_box_content li[tag=tag_award4]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award4] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award4] span.points span").html(type_4)}if(type_5>0){$(".achievement_box_content li[tag=tag_award5]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award5] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award5] span.points span").html(type_5)}if(type_6>0){$(".achievement_box_content li[tag=tag_award6]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award6] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award6] span.points span").html(type_6)}score_str="";for(i=0;i<B.score.length;i++){if(i%2==0){score_str+="<li class=\"odd\">"}else{score_str+="<li class=\"even\">"}score_str+="<span class=\"position\">"+(i+1)+"</span><span class=\"avatar\"><a href=\"/user_profile.html?u="+B.score[i].username+"\"><span class=\"cropper\"><img height=\"32\" width=\"32\" border=\"0\" alt=\""+B.score[i].username+"\" src=\""+B.score[i].avatar_small+"\" class=\"avatar\"><span class=\"rounder\">&nbsp;</span></span></a></span><span class=\"username\"><a href=\"/user_profile.html?u="+B.score[i].username+"\">"+B.score[i].username+"</a></span><span class=\"score\">"+B.score[i].score+"</span></li>"}$(".highscore_box_content ol").html(score_str);$(".gamepage_ha_highscore_button").click();$(".my_highscore span.avatar a").attr("href","/user_profile.html?u="+$.cookie("username"));$(".my_highscore img.avatar").attr("src",$.cookie("avatar"));$(".my_highscore span#myscore").html(B.my_score);$(".my_highscore span#rank").html(B.my_ranking);$(".my_highscore").fadeIn("slow").fadeOut("slow").fadeIn("slow").fadeOut("slow").fadeIn("slow").fadeOut("slow").fadeIn("slow")}else{alert(B.status)}},"json")}function getHighScore(){if($.cookie("userid")){$(".achievement_box_content li[tag=tag_award6]").show();$("#achievement_box div.viewbar").html("<p id=\"ha_award_normal_logged\">You've won<br><span>0</span> of Awards.</p><div class=\"ha_gray\"></div>");$("#highscore_box div.loginbar").html("")}else{$(".achievement_box_content li[tag=tag_award6]").hide();$("#achievement_box div.viewbar").html("<p id=\"ha_award_normal_guest1\">This game has awards!</p><div class=\"ha_login_trigger\" id=\"ha_award_normal_guest2\">  <p>You need to sign in to win awards.</p>  <div class=\"login_button\">   <div class=\"centerHack\">    <div class=\"centered\"> <a href=\"#\" id=\"login\" class=\"login\">Sign in</a> <div class=\"login_right\">&nbsp;</div>  <span class=\"or\">or</span><a href=\"/register.html\" class=\"register\">Sign up!</a>    </div>   </div>  </div> </div><div class=\"ha_gray\"></div>");$("#highscore_box div.loginbar").html("<p id=\"ha_hs_normal_guest\">This game tracks high scores.</p><div class=\"ha_login_trigger\" id=\"ha_highscore_login\">  <p>You aren't signed in.</p>  <div class=\"login_button\">   <div class=\"centerHack\">    <div class=\"centered\">     <a id=\"login\" href=\"#\" class=\"login\">Sign in</a>     <div class=\"login_right\">&nbsp;</div>     <span class=\"or\">or</span><a href=\"/register.html\" class=\"register\">Sign up!</a>    </div>   </div>  </div> </div>")}$("#achievement_box div.viewbar #login").mouseover(function(){$("#achievement_box div.viewbar .login_right").addClass("hover")}).mouseout(function(){$("#achievement_box div.viewbar .login_right").removeClass("hover")});$("#highscore_box div.loginbar #login").mouseover(function(){$("#highscore_box div.loginbar .login_right").addClass("hover")}).mouseout(function(){$("#highscore_box div.loginbar .login_right").removeClass("hover")});$.get("/ajax/getresult.php?wo",{},function(A,B){if(A.status==1){$("#ha_award_normal_logged span").html(A.awards.length);type_1=type_2=type_3=type_4=type_5=type_6=0;for(i=0;i<A.awards.length;i++){switch(parseInt(A.awards[i].type)){case 1:type_1++;break;case 2:type_2++;break;case 3:type_3++;break;case 4:type_4++;break;case 5:type_5++;break;case 6:type_6++;break;default:break}}if(type_1>0){$(".achievement_box_content li[tag=tag_award1]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award1] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award1] span.points span").html(type_1)}if(type_2>0){$(".achievement_box_content li[tag=tag_award2]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award2] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award2] span.points span").html(type_2)}if(type_3>0){$(".achievement_box_content li[tag=tag_award3]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award3] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award3] span.points span").html(type_3)}if(type_4>0){$(".achievement_box_content li[tag=tag_award4]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award4] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award4] span.points span").html(type_4)}if(type_5>0){$(".achievement_box_content li[tag=tag_award5]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award5] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award5] span.points span").html(type_5)}if(type_6>0){$(".achievement_box_content li[tag=tag_award6]").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award6] div:first").attr("class","unlocked");$(".achievement_box_content li[tag=tag_award6] span.points span").html(type_6)}score_str="";for(i=0;i<A.score.length;i++){if(i%2==0){score_str+="<li class=\"odd\">"}else{score_str+="<li class=\"even\">"}score_str+="<span class=\"position\">"+(i+1)+"</span><span class=\"avatar\"><a href=\"/user_profile.html?u="+A.score[i].username+"\"><span class=\"cropper\"><img height=\"32\" width=\"32\" border=\"0\" alt=\""+A.score[i].username+"\" src=\""+A.score[i].avatar_small+"\" class=\"avatar\"><span class=\"rounder\">&nbsp;</span></span></a></span><span class=\"username\"><a href=\"/user_profile.html?u="+A.score[i].username+"\">"+A.score[i].username+"</a></span><span class=\"score\">"+A.score[i].score+"</span></li>"}$(".highscore_box_content ol").html(score_str)}else{}},"json")}$(function(){getHighScore();$(".fave_add_button").click(function(){if(!$.cookie("userid")){$("#addtofave").css("display","none");$("#mygamesloginbox").css("display","block");return false}$.post("/ajax/addfave.php?wo",{gameid:gameid},function(A,B){if(A.status==1){alert(A.message)}else{alert(A.status)}},"json");return false});$.post("/ajax/synchronous.php?a=game",{fileid:gameid},function(B,C){if(B.status==1){if(B.pointadd==1){var A=Math.round(83/100*B.points);$("div#usernav td.info div.logged span.bar span.filled").css("width",A+"px");$("div#usernav td.info div.logged td.points var").html(B.points);if($.cookie("remember")==1){$.cookie("points",B.points,{expires:365,path:"/"})}else{$.cookie("points",B.points,{path:"/"})}}if(B.leveladd==1){$("div#usernav td.info div.logged td.level").html("Level "+B.level);if($.cookie("remember")==1){$.cookie("level",B.level,{expires:365,path:"/"})}else{$.cookie("level",B.level,{path:"/"})}}}},"json")})

