﻿/*
*  (C) Copyright 2007 CheatServer.com.  All Rights Reserved.
'   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
'   ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
'   THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
'   PARTICULAR PURPOSE.
'
'   The contents of this file are considered the intellectual property
'   of CheatServer.com.
*/
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};String.prototype.ltrim=function(){return this.replace(/^\s+/,"");};String.prototype.rtrim=function(){return this.replace(/\s+$/,"");};try{document.execCommand("BackgroundImageCache",false,true);}catch(ex){}YAHOO.namespace("CheatServer.UI");var CS=YAHOO.CheatServer;var Y=YAHOO;CS.log=function(msg,cat,fileName){cat=cat||"info";fileName=fileName||"CheatServer.js";YAHOO.log(msg,cat,fileName);};var ua=navigator.userAgent.toLowerCase();CS.Browser={isOpera:(ua.indexOf('opera')>-1),isSafari:(ua.indexOf('safari')>-1),isGecko:(!this.isOpera&&!this.isSafari&&ua.indexOf('gecko')>-1),isIE:(!this.isOpera&&ua.indexOf('msie')>-1)};(
function(){var Dom=Y.util.Dom;window.$=function(id){return Dom.get(id);};})();CS.pageUnloadEvent=new Y.util.CustomEvent("gfPageUnload",CS,true);CS.cleanUpEvent=new Y.util.CustomEvent("gfCleanUp",CS,true);CS.cleanUpEvent.subscribe=(
function(){var protoSubscribe=Y.util.CustomEvent.prototype.subscribe;var isIE6OrBelow=false;var version=navigator.appVersion,indexOfMsie,indexOfSemColon,subVerStr;if(CS.Browser.isIE){indexOfMsie=version.indexOf("MSIE");indexOfSemColon=version.indexOf(";",indexOfMsie);subVerStr=version.substring(indexOfMsie+4,indexOfSemColon);version=parseInt(subVerStr,10);if(7>version){isIE6OrBelow=true;}}var newSubscribe=function(fn,obj,override){if(isIE6OrBelow){CS.log("actually subscribing");protoSubscribe.call(this,fn,obj,override);}};return newSubscribe;})();if(YAHOO.util.Event){YAHOO.util.Event.addListener(window,"unload",function(){CS.pageUnloadEvent.fire();CS.cleanUpEvent.fire();try{window.CollectGarbage();}catch(ex){}},CS.pageUnloadEvent,true);}CS.nullify=function(obj){if(obj){for(var i in obj){try{obj[i]=null;}catch(ex){}}}};YAHOO.namespace("CheatServer.util");var CSUtil=CS.util;(
function(){var DOM=YAHOO.util.Dom;CSUtil.$classNameAndIndex=function(className,tagName,parentEl,index){parentEl=parentEl||document.body;if(!index){index=0;}return DOM.getElementsByClassName(className,tagName,parentEl)[index];};CSUtil.getOrCreateSpecificEl=function(el,tagName){var specEl=null;if(el){specEl=DOM.get(el);if(specEl!==null&&specEl.tagName.toUpperCase()===tagName.toUpperCase()){return specEl;}specEl=null;}if(!specEl){specEl=document.createElement(tagName);}return specEl;};CSUtil.hide=function(element){DOM.setStyle(element,"display","none");};CSUtil.show=function(element){if(!element){throw new Error("Param element is null");}DOM.setStyle(element,"display","");};CSUtil.isElementDisplayed=function(element){if(DOM.getStyle(element,"display").toLowerCase()!=="none"){return true;}return false;};CSUtil.getDefaultDisplay=function(element){var displayStyle=this.getStyle(element,"display");displayStyle=("none"===displayStyle.toLowerCase())?"inherit":displayStyle;displayStyle=("inherit"===displayStyle&&window.ActiveXObject)?"":displayStyle;return displayStyle;};CSUtil.createEl=function(tagName){var el=document.createElement(tagName);for(var i=1;i<arguments.length;i++){DOM.addClass(el,arguments[i]);}return el;};CSUtil.createTxt=function(text){return document.createTextNode(text);};CSUtil.createNamedElement=function(tagName,elName){var el=null;var markUp="<"+tagName+" name=\""+elName+"\" />";try{el=document.createElement(markUp);}catch(ex){el=document.createElement(tagName);el.name=elName;}return el;};CSUtil.createInputEl=function(iType,iName,iValue,iId){var input=DOM.createNamedElement("input",iName);input.type=iType;input.value=iValue;input.id=iId;return input;};})();CS.UI.ElementCache=(
function(){var _hash={};var _keys=[];var TheConstructor=function(){};TheConstructor.prototype={insert:function(element,key){if(!(element)){throw new Error("param element must not be null or undefined");}if(typeof key!=="string"){throw new Error("param key must be of type string");}if(this[key]&&this[key]!==element){throw new Error("Hash collision and element is already stored at that key");}_keys[_keys.length]=key;_hash[key]=element;},getElement:function(key){return _hash[key];}};CS.cleanUpEvent.subscribe(function(){var eventUtil=YAHOO.util.Event;var el;for(var i in _hash){eventUtil.purgeElement(_hash[i]);_hash[i]=null;}_hash=null;_keys=null;},CS.UI.ElementCache,true);var singleton=new TheConstructor();return singleton;})();CS.util.isNullOrEmptyString=function(str){var bIsNullOrEmpty=(null===str||0===str.length||""===str);return bIsNullOrEmpty;};CS.util.getScrollX=function(){var scrollX=window.pageXOffset;if(scrollX||0===scrollX){return scrollX;}var docElScroll=document.documentElement.scrollLeft;var bodyElScroll=document.body.scrollLeft;if(docElScroll>bodyElScroll){return docElScroll;}return bodyElScroll;};CS.util.getScrollY=function(){var scrollY=window.pageYOffset;if(scrollY||0===scrollY){return scrollY;}var docElScroll=document.documentElement.scrollTop;var bodyElScroll=document.body.scrollTop;if(docElScroll>bodyElScroll){return docElScroll;}return bodyElScroll;};YAHOO.namespace("CheatServer.Xml");CS.Xml.getInnerXml=function(xmlNode){var innerXml="";var childNodes=xmlNode.childNodes;var length=childNodes.length;var n,xmlSerializer,i;if(xmlNode.xml){for(i=0;i<length;i++){n=childNodes[i];if(4===n.nodeType){innerXml+=n.nodeValue;}else{innerXml+=n.xml;}}}else{xmlSerializer=new XMLSerializer();for(i=0;i<length;i++){n=childNodes[i];if(4===n.nodeType){innerXml+=n.nodeValue;}else{innerXml+=xmlSerializer.serializeToString(n);}}}return innerXml;};CS.Enum={};CS.UI.SHADOWED_DRAG_PROXY_ID="proxyParent";CS.Enum.isDefined=function(enumValue,enumeration){if(!enumeration){throw new Error("param enumeration is null");}if(!enumValue&&0!==enumValue){throw new Error("param enumValue is null");}var isDefined=false;var enumValueType=typeof enumValue;var i;for(i in enumeration){if(typeof enumeration[i]===enumValueType){if(enumeration[i]===enumValue){isDefined=true;break;}}}return isDefined;};CS.createLogReader=function(){var myDiv=document.createElement("div");document.body.appendChild(myDiv);var myLogger=new Y.widget.LogReader(myDiv);};CS.stopAnimation=function(anim,bgoToFinalFrame){if(anim&&anim.isAnimated()){anim.stop(bgoToFinalFrame);}};CS.UI.handleAjaxError=function(o){var httpStatus=o.status;var popUpFactory;var title;var content;var popUpId;if(CS.UI.SimplePopUpFactory){popUpFactory=CS.UI.SimplePopUpFactory.Singleton;}switch(httpStatus){case 403:case 404:popUpId="error404";title="404 Not Found";content="<p>We've received a 404 error in trying to complete your request.</p><p>Have you lost your internet connectivity?</p>";break;case 500:case 502:case 503:popUpId="error500";title="Our Bad";content="<p>Our apologies but an error on our end is preventing us from fulfilling your request.</p><p>Technical support has been notified of the problem.</p>";break;default:popUpId="error500";title="Request Error";content="<p>Our apologies but an error on our end is preventing us from fulfilling your request.</p>";content+="<p>Technical support has been notified of the problem.</p>";}if(popUpFactory){try{popUpFactory.getPopUp(popUpId).show();return;}catch(ex){CS.log("Exception: "+ex.message);}}var popUp,alertTxt;if(CS.UI.SimplePopUp){popUp=new CS.UI.SimplePopUp();popUp.title(title);popUp.content(content);popUp.show();}else{alertTxt=title;alertTxt+="\n";alertTxt+=content;alert(alertTxt);}};CS.isBrowserUIReady=function(){return true;};
function cheatserver(id){if(document.images){(new Image()).src="/go/games.asp?cheats="+id;}}

CS.StringsUI={TxtBoxSearchPrompt:"Enter your game..."};

CS.UI.Element=function(el,tagName,map){var wrappedElement=CS.util.getOrCreateSpecificEl(el,tagName);if(!wrappedElement.id){if("string"===typeof el){wrappedElement.id=el;}else{wrappedElement.id=tagName+"_"+CS.UI.Element.InstanceCount;}}CS.UI.Element.superclass.constructor.call(this,wrappedElement,map);CS.UI.Element.InstanceCount++;CS.cleanUpEvent.subscribe(this._destroy,this,true);};YAHOO.extend(CS.UI.Element,YAHOO.util.Element);CS.UI.Element.InstanceCount=0;CS.UI.Element.prototype.element=function(){return this.get("element");};CS.UI.Element.prototype._destroy=function(){try{YAHOO.util.Event.purgeElement(this.element(),true);}catch(ex){CS.nullify(this.element());}var cfg=this._configs;try{cfg._destroy();}catch(ex){for(var i in cfg){CS.nullify(cfg[i]);}CS.nullify(cfg);}try{CS.nullify(this);}catch(ex){}};

CS.UI.Button=(
function(){var base=null;var attrIsDisabled="isDisabled";var Lang=YAHOO.lang;var TheConstructor=function(el,tagName,isDisabled,map){base.constructor.call(this,el,tagName);this.on("mouseover",this._handleBtnEvent,this,true);this.on("mouseout",this._handleBtnEvent,this,true);this.on("mousedown",this._handleBtnEvent,this,true);this.on("mouseup",this._handleBtnEvent,this,true);this.on("click",this._handleBtnEvent,this,true);isDisabled=isDisabled||false;this.setAttributeConfig(attrIsDisabled,{value:isDisabled,validator:function(value){return("boolean"===typeof value);}},true);this.on(attrIsDisabled+"Change",this._onIsDisabledChange,this,true);};YAHOO.extend(TheConstructor,CS.UI.Element);base=TheConstructor.superclass;var proto=TheConstructor.prototype;proto._handleBtnEvent=function(evt){if(this.get(attrIsDisabled)){return;}var type=evt.type;if("mouseover"===type){this._handleMouseOver(evt);}else if("mouseout"===type){this._handleMouseOut(evt);}else if("mousedown"===type){this._handleMouseDown(evt);}else if("mouseup"===type){this._handleMouseUp(evt);}};proto._handleMouseOver=function(evt){};proto._handleMouseOut=function(evt){};proto._handleMouseDown=function(evt){};proto._handleMouseUp=function(evt){};proto._handleClick=function(evt){};proto._onIsDisabledChange=function(changeArgs){};return TheConstructor;})();

CS.UI.ImgInputButton=(
function(){var base;var attrSrc="src";var TheConstructor=function(el,name,activeImgSrc,disabledImgSrc,clickImgSrc){var btn=el;if(!btn){btn=CS.util.createInputEl("image",name,"","");}try{var images=[new Image(activeImgSrc),new Image(clickImgSrc),new Image(disabledImgSrc)];}catch(ex){}this._activeImgSrc=activeImgSrc;this._disabledImgSrc=disabledImgSrc;this._clickImgSrc=clickImgSrc;base.constructor.call(this,btn,"input");};YAHOO.extend(TheConstructor,CS.UI.Button,{_handleMouseDown:function(e){this.set(attrSrc,this._clickImgSrc);},_handleMouseUp:function(e){this.set(attrSrc,this._activeImgSrc);},_handleMouseOut:function(e){this._handleMouseUp(e);},_onIsDisabledChange:function(changeArgs){var imgSrc=changeArgs.newValue?this._disabledImgSrc:this._activeImgSrc;this.set(attrSrc,imgSrc);}});base=TheConstructor.superclass;return TheConstructor;})();

CS.UI.CssButton=(
function(){var base;var Dom=YAHOO.util.Dom;var TheConstructor=function(el,tagName,activeCss,disabledCss,clickCss){var isDisabled=false;if(el){el=Dom.get(el);}if(el){if(YAHOO.util.Dom.hasClass(el,disabledCss)){isDisabled=true;}}base.constructor.call(this,el,tagName,isDisabled);this._activeCss=activeCss;this._disabledCss=disabledCss;this._clickCss=clickCss;};YAHOO.extend(TheConstructor,CS.UI.Button,{_handleMouseDown:function(e){this.removeClass(this._activeCss);this.addClass(this._clickCss);},_handleMouseUp:function(e){this.removeClass(this._clickCss);this.addClass(this._activeCss);},_handleMouseOut:function(e){this._handleMouseUp(e);},_onIsDisabledChange:function(changeArgs){if(changeArgs.newValue){this.replaceClass(this._activeCss,this._disabledCss);}else{this.replaceClass(this._disabledCss,this._activeCss);}}});base=TheConstructor.superclass;return TheConstructor;})();

CS.UI.Page=(
function(){var elIds={txtSearch:"txtSearch",btnGo:"go",pager:"pagerBtm",btnPrev:"btnPrevPg",btnNext:"btnNextPg",btnSubmit:"submitContact"};var domUtil=CS.util;var Dom=YAHOO.util.Dom;var eventUtil=YAHOO.util.Event;var TheConstructor=function(){var txtSearch=new CS.UI.Element($(elIds.txtSearch),"input");$(elIds.txtSearch).value=CS.StringsUI.TxtBoxSearchPrompt;txtSearch.on("focus",function(e,me){var el=this.element();if(CS.StringsUI.TxtBoxSearchPrompt===el.value.trim()){el.value="";}},this);txtSearch.on("blur",function(e,me){var el=this.element();var txt=el.value;txt=txt.trim();if(""===txt){el.value=CS.StringsUI.TxtBoxSearchPrompt;}},this);var formSearch=txtSearch.element().parentNode;while(formSearch&&"form"!==formSearch.tagName.toLowerCase()){formSearch=formSearch.parentNode;}if("form"===formSearch.tagName.toLowerCase()){eventUtil.on(formSearch,"submit",function(e,txtBox){var val=txtBox.value;val=val.trim();if(""===val||CS.StringsUI.TxtBoxSearchPrompt===val){eventUtil.stopEvent(e);}else if(val.length<2){txtBox.value=CS.StringsUI.TxtBoxSearchPrompt;eventUtil.stopEvent(e);}},txtSearch.element());}var btnEl=$(elIds.btnGo);var btnGo=new CS.UI.ImgInputButton(btnEl,btnEl.name,btnEl.src,null,"/img/bttn_go_down_39x26.gif");var pagerEl=$(elIds.pager),btnPrev,btnNext;if(pagerEl){btnNext=new CS.UI.CssButton($(elIds.btnNext),"a","nextPage","nextPage-disabled","nextPage-pressed");btnPrev=new CS.UI.CssButton($(elIds.btnPrev),"a","prevPage","prevPage-disabled","prevPage-pressed");}var btnSubmitEl=$(elIds.btnSubmit),btnSubmit;if(btnSubmitEl){btnSubmit=new CS.UI.ImgInputButton(btnSubmitEl,btnSubmitEl.name,btnSubmitEl.src,null,"/img/bttn_submit_down72x27.gif");}};return TheConstructor;})();YAHOO.util.Event.addListener(window,"load",
function(){var pg=new CS.UI.Page();},window);
