﻿(function(a){a.ns("Util.DOM");Util.DOM.CreateTagEngine=function(d,c){this.doc=d||window.document;var b=c||["a","br","button","canvas","div","fieldset","form","iframe","link","h1","h2","h3","hr","img","input","label","legend","li","ol","optgroup","option","p","pre","select","span","strong","table","tbody","td","textarea","tfoot","th","thead","tr","tt","ul"];this.initTags(b)};a.nodeType=Util.DOM.NodeType={Element:1,Attribute:2,Text:3,CData:4,Comment:8,Document:9};Util.DOM.CreateTagEngine.prototype={chars:{NBSP:"\u00a0"},initTags:function(b){for(var c=b.length-1;c>=0;c--){this._defineTag(b[c])}},removeNode:function(b){b.parentNode.removeChild(b)},_defineTag:function(b){var c=b.toUpperCase();this[c]=function(){return this._createNode(c,arguments)}},_createNode:function(b,d){var g=null;var c=d[0];if(d.length==0||c==null){g=this._createElement(b)}else{if(c.tagName||typeof c=="string"||typeof c=="number"){g=this._createElement(b);this._appendChilds(g,d,0)}else{g=this._createElement(b,c.name,c.checked);try{this._applyAttr(g,c)}catch(f){this._processError(g,f,b);g=null}this._appendChilds(g,d,1)}}return g},_processError:function(d,c,b){var f;if(d==null){f=b}else{f=d.tagName+(d.id?' id="'+d.id+'"':"")+(d.className?' class="'+d.className+'"':"")}alert("DOM Error: Cannot create <"+f+"> element:\n\n"+c.toString())},_appendChilds:function(h,f,k){for(var g=k;g<f.length;g++){var b=f[g];if(b==null){continue}if(b.constructor!=Array){this._append(h,b)}else{var c=b.length;for(var d=0;d<c;d++){this._append(h,b[d])}}}},_applyAttr:function(d,c){for(var b in c){var f=c[b];switch(b.toLowerCase()){case"style":this._applyStyle(d,f);continue;case"events":this._applyEvents(d,f);continue}a.attr(d,b,f)}},_applyStyle:function(c,d){if(typeof d=="object"){try{a(c).css(d)}catch(b){throw"Некорректное значение в css-свойствах!"}}else{a.attr(c,"style",d)}},_applyEvents:function(d,c){if(typeof c=="object"){for(var b in c){if(typeof c[b]!="function"){throw'Значение для события "'+b+'" должно быть функцией!'}a(d).bind(b,c[b])}}},_createElement:(a.browser.msie?function(b,c,e){if(b=="INPUT"){var d="<INPUT"+(c?' name="'+c+'"':"")+(e?' checked="'+e+'"':"")+">";return this.doc.createElement(d)}else{return this.doc.createElement(b)}}:function(b,c,d){return this.doc.createElement(b)}),_append:function(c,b){if(c==null||b==null){return}switch(typeof b){case"number":b=""+b;case"string":b=this.doc.createTextNode(b);break}c.appendChild(b)}};a.dom=new Util.DOM.CreateTagEngine()})(jQuery);
Type.registerNamespace("SoftClub.UI");if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<7){document.execCommand("BackgroundImageCache",false,true)}SoftClub.UI._Page=function(){SoftClub.UI._Page.initializeBase(this);this._divPageTop=null;this._divPageTopNav=null;this._divPageFooter=null;this._divPageBody=null;this._divPageBodyContent=null;this._divPageBodyHeightFix=null;this._resizeHandler=null;this._tbSearch=null;this._imgSearchButton=null;this._typeSearchTextHandler=null;this._searchHandler=null};SoftClub.UI._Page.prototype={pageBodyBorder:1,initialize:function SoftClub$UI$_Page$initialize(){SoftClub.UI._Page.callBaseMethod(this,"initialize");this._divPageBodyHeightFix=document.createElement("DIV");var a=this._divPageBodyHeightFix.style;a.overflow="hidden";a.borderWidth="0px";a.height="0px";a.margin="0px";a.padding="0px";this._resizeHandler=Function.createDelegate(this,this._onLayout)},dispose:function SoftClub$UI$_Page$dispose(){this._divPageTop=null;this._divPageTopNav=null;this._divPageFooter=null;this._divPageBody=null;this._divPageBodyContent=null;this._divPageBodyHeightFix=null;try{if(this._resizeHandler!=null){$removeHandler(window,"resize",this._resizeHandler);this._resizeHandler=null}}catch(a){}if(null!=this._imgSearchButton){$clearHandlers(this._imgSearchButton)}if(null!=this._tbSearch){$clearHandlers(this._tbSearch)}this._tbSearch=null;this._imgSearchButton=null;this._typeSearchTextHandler=null;this._searchHandler=null;SoftClub.UI._Page.callBaseMethod(this,"dispose")},createLayer:function SoftClub$UI$_Page$createLayer(c,d){var g=Function._validateParams(arguments,[{name:"className",type:String,mayBeNull:true},{name:"styles",type:Object,optional:true}]);if(g){throw g}var h=document.createElement("DIV");if(c!=null){h.className=c}var b=h.style;for(var a in d){var f=d[a];b[a]=f}return h},addLayer:function SoftClub$UI$_Page$addLayer(a){var b=Function._validateParams(arguments,[{name:"el",domElement:true}]);if(b){throw b}document.body.insertBefore(a,document.body.firstChild)},getClientBounds:function SoftClub$UI$_Page$getClientBounds(){var a,b;switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:a=document.documentElement.clientWidth;b=document.documentElement.clientHeight;break;case Sys.Browser.Safari:a=window.innerWidth;b=window.innerHeight;break;case Sys.Browser.Opera:a=Math.min(window.innerWidth,document.body.clientWidth);b=Math.min(window.innerHeight,document.body.clientHeight);break;default:a=Math.min(window.innerWidth,document.documentElement.clientWidth);b=Math.min(window.innerHeight,document.documentElement.clientHeight);break}return new Sys.UI.Bounds(0,0,a,b)},Layout:function SoftClub$UI$_Page$InitLayout(){this._initSearch()},_onSearch:function SoftClub$UI$_Page$_onSearch(a){Sys.Debug.trace("_onSearch");this._search()},_onTypeSearchText:function SoftClub$UI$_Page$_onTypeSearchText(a){Sys.Debug.trace("_onTypeSearchText");if(a.charCode==Sys.UI.Key.enter){a.stopPropagation();a.preventDefault();this._search()}},_onLayout:function SoftClub$UI$_Page$_onLayout(){this._layout()},_initSearch:function SoftClub$UI$_Page$_initSearch(){Sys.Debug.trace("_initSearch");this._tbSearch=$get("tbSearch");this._imgSearchButton=$get("imgSearchButton");this._searchHandler=Function.createDelegate(this,this._onSearch);this._typeSearchTextHandler=Function.createDelegate(this,this._onTypeSearchText);$addHandler(this._imgSearchButton,"click",this._searchHandler);$addHandler(this._tbSearch,"keypress",this._typeSearchTextHandler)},_search:function SoftClub$UI$_Page$_search(){Sys.Debug.trace("_search");var a=this._tbSearch.value.trim();if(a.length==0){alert("Введите строку поиска!");return}var b=window.location.host;if(b.indexOf("localhost")!=-1||b.indexOf(".its")!=-1){b="softclub.ru.its"}else{b="www.softclub.ru"}b="http://"+b;window.location.href=b+"/games/default.asp?sval="+a},_initLayout:function SoftClub$UI$_Page$_initLayout(){this._divPageTop=$get("divPageTop");this._divPageTopNav=$get("divPageTopNav");this._divPageFooter=$get("divPageFooter");this._divPageBody=$get("divPageBody");this._divPageBodyContent=$get("divPageBodyContent");this._divPageBody.appendChild(this._divPageBodyHeightFix)},_layout:function SoftClub$UI$_Page$_layout(){var b=this._divPageTop.offsetHeight+this._divPageTopNav.offsetHeight+this._divPageFooter.offsetHeight;var d=this.getClientBounds();var c=this._divPageBodyContent.offsetHeight;var a;if((b+c)<=d.height){a=Math.max((d.height-b-this.pageBodyBorder),c)}else{a=c+this.pageBodyBorder}if(this._divPageBody.offsetHeight!=a){this._divPageBodyHeightFix.style.height=""+(a-c)+"px"}}};SoftClub.UI._Page.registerClass("SoftClub.UI._Page",Sys.Component);SoftClub.UI.ImageRollover=function(){SoftClub.UI.ImageRollover.initializeBase(this);this._appLoadHandler=null;this._rolloverImages=null};SoftClub.UI.ImageRollover.prototype={rolloverClassName:"rollover",rolloverAttrOverName:"srcOver",rolloverAttrOutName:"srcOut",rolloverSufixName:"_over",initialize:function SoftClub$UI$ImageRollover$initialize(){SoftClub.UI.ImageRollover.callBaseMethod(this,"initialize");this._appLoadHandler=Function.createDelegate(this,this._onAppLoad);Sys.Application.add_load(this._appLoadHandler);this._rolloverImages=[]},dispose:function SoftClub$UI$ImageRollover$dispose(){if(this._rolloverImages!=null){var a=this._rolloverImages.length;for(var b=0;b<a;b++){if(this._rolloverImages[b][2]){$clearHandlers(this._rolloverImages[b][0])}Array.clear(this._rolloverImages[b])}Array.clear(this._rolloverImages)}if(this._appLoadHandler!=null){Sys.Application.remove_load(this._appLoadHandler);this._appLoadHandler=null}SoftClub.UI.ImageRollover.callBaseMethod(this,"dispose")},initImageState:function SoftClub$UI$ImageRollover$initImageState(a){this._initImageState(a,false)},over:function SoftClub$UI$ImageRollover$over(a){var b=Function._validateParams(arguments,[{name:"img",domElement:true}]);if(b){throw b}a.src=a.getAttribute(this.rolloverAttrOverName)},out:function SoftClub$UI$ImageRollover$out(a){var b=Function._validateParams(arguments,[{name:"img",domElement:true}]);if(b){throw b}a.src=a.getAttribute(this.rolloverAttrOutName)},_initImageState:function SoftClub$UI$ImageRollover$_initImageState(a,c){var e=a.src;var b=e.lastIndexOf(".");var f=e.substring(0,b)+this.rolloverSufixName+e.substring(b);var d=new Image();d.src=f;a.setAttribute(this.rolloverAttrOutName,e);a.setAttribute(this.rolloverAttrOverName,f);Array.add(this._rolloverImages,[a,d,c])},_onAppLoad:function SoftClub$UI$ImageRollover$_onAppLoad(){var a=document.images;var b=a.length;for(var d=0;d<b;d++){var c=a[d];if(Sys.UI.DomElement.containsCssClass(c,this.rolloverClassName)){this._initImageState(c,true);$addHandlers(c,{mouseover:this._onRolloverOver,mouseout:this._onRolloverOut},this)}}},_onRolloverOver:function SoftClub$UI$ImageRollover$_onRolloverOver(a){this.over(a.target)},_onRolloverOut:function SoftClub$UI$ImageRollover$_onRolloverOut(a){this.out(a.target)}};SoftClub.UI.ImageRollover.registerClass("SoftClub.UI.ImageRollover",Sys.Component);var $page=$create(SoftClub.UI._Page);var $rollover=$create(SoftClub.UI.ImageRollover);$(document).ready(function(){$page.Layout()});
var menuContent={News:{shift:0,width:111,items:[["Новости","/news/default.asp?sec=1"],["Статьи","/news/default.asp?sec=2"],["Поиск","/news/search.asp"],["Подписка","/news/subscribe.asp"]]},Catalog:{shift:0,width:118,items:[["Игры для PC","/games/section.asp?platform=PC"],["Игры для PS2","/games/section.asp?platform=PS2"],["Игры для PS3","/games/section.asp?platform=PS3"],["Игры для PSP","/games/section.asp?platform=PSP"],["Игры для Xbox 360","/games/section.asp?platform=X360"],["Игры для Wii","/games/section.asp?platform=Wii"],["Поиск","/games/default.asp"],["График выхода","/games/releases.aspx"]]},User:{shift:0,width:113,items:[["Регистрация игр","/users/default.asp"],["Личный кабинет","/personal/default.aspx"],["Поддержка","/users/support.asp"],["FAQ","/users/support-faq.aspx"],["Где купить","/users/shops.asp"],["Вакансии","/users/job.asp"]]},Partner:{shift:0,width:111,items:[["Прессе","/partners/press.asp"],["Стать дилером","/partners/newpartner.asp"]]}};Type.registerNamespace("SoftClub.UI");SoftClub.UI.TopMenu=function(){SoftClub.UI.TopMenu.initializeBase(this);this._structure=null;this._overHandler=null;this._outHandler=null;this._loadHandler=null;this._showTimerHandler=null;this._hideTimerHandler=null;this._vTimeout=null;this._hTimeout=null;this._curentImgName=null;this._showName=null;this._hideName=null;this._host=null};SoftClub.UI.TopMenu.prototype={controlPrefix:"menu",controlPrefixLength:4,attrItemName:"menuItem",layerClassName:"menuLayer",showDelay:500,hideDelay:500,get_structure:function SoftClub$UI$TopMenu$get_structure(){return this._structure},set_structure:function SoftClub$UI$TopMenu$set_structure(a){this._structure=a},initialize:function SoftClub$UI$TopMenu$initialize(){SoftClub.UI.TopMenu.callBaseMethod(this,"initialize");var a=window.location.host;if(a=="forum.softclub.ru"){this._host="http://www.softclub.ru"}else{this._host="http://softclub.ru.its"}this._overHandler=Function.createDelegate(this,this._onMouseOver);this._outHandler=Function.createDelegate(this,this._onMouseOut);this._showTimerHandler=Function.createDelegate(this,this._show);this._hideTimerHandler=Function.createDelegate(this,this._hide);this._loadHandler=Function.createDelegate(this,this._onAppLoad);Sys.Application.add_load(this._loadHandler)},dispose:function SoftClub$UI$TopMenu$dispose(){for(var a in this._structure){var b=this._structure[a];if(b.img){$clearHandlers(b.img);b.img=null;b.layer=null}}this._structure=null;this._overHandler=null;this._outHandler=null;this._showTimerHandler=null;this._hideTimerHandler=null;if(this._loadHandler!=null){Sys.Application.remove_load(this._loadHandler);this._loadHandler=null}SoftClub.UI.TopMenu.callBaseMethod(this,"dispose")},_onAppLoad:function SoftClub$UI$TopMenu$_onAppLoad(){for(var b in this._structure){var c=this._structure[b];var a=$get(this._getImageId(b));a.setAttribute(this.attrItemName,b);$rollover.initImageState(a);this._applyHandlers(a,b);c.img=a;c.layer=null}},_onMouseOver:function SoftClub$UI$TopMenu$_onMouseOver(b){var a=this._getMenuName(b.target);this._startShowTimeout(a)},_onMouseOut:function SoftClub$UI$TopMenu$_onMouseOut(b){var a=this._getMenuName(b.target);this._startHideTimeout(a)},_show:function SoftClub$UI$TopMenu$_show(d){var a=(typeof(d)=="string")?d:this._showName;var b=this._structure[a];if(b.layer==null){var c=this._createLayer(b);this._applyHandlers(c,a);b.layer=c}this._setTopLevelPosition(b);b.layer.style.display="block";this._curentImgName=a;if(this._sTimeout!=null){this._clearShowTimeout()}},_startShowTimeout:function SoftClub$UI$TopMenu$_startShowTimeout(b){if(this._sTimeout!=null&&this._showName!=b){this._clearShowTimeout()}var a=this._structure[b].img;if(this._curentImgName==null){this._showName=b;this._sTimeout=window.setTimeout(this._showTimerHandler,this.showDelay);if(this._hideName!=null){$rollover.out(this._structure[this._hideName].img);this._clearHideTimeout()}$rollover.over(a)}else{if(this._curentImgName==b){this._clearHideTimeout()}else{$rollover.out(this._structure[this._curentImgName].img);if(b!=this._curentImgName){this._clearHideTimeout();this._hide(this._curentImgName)}$rollover.over(a);this._show(b)}}},_clearShowTimeout:function SoftClub$UI$TopMenu$_clearShowTimeout(){window.clearTimeout(this._sTimeout);this._sTimeout=null;this._showName=null},_hide:function SoftClub$UI$TopMenu$_hide(c){var a=(typeof(c)=="string")?c:this._hideName;var b=this._structure[a];if(b.layer!=null){b.layer.style.display="none"}$rollover.out(b.img);this._curentImgName=null;if(this._hTimeout!=null){this._clearHideTimeout()}},_startHideTimeout:function SoftClub$UI$TopMenu$_startHideTimeout(a){if(this._sTimeout!=null&&this._showName==a){this._clearShowTimeout();this._hide(a)}else{if(this._hTimeout!=null){this._clearHideTimeout()}this._hideName=a;this._hTimeout=window.setTimeout(this._hideTimerHandler,this.hideDelay)}},_clearHideTimeout:function SoftClub$UI$TopMenu$_clearHideTimeout(){window.clearTimeout(this._hTimeout);this._hTimeout=null;this._hideName=null},_getImageId:function SoftClub$UI$TopMenu$_getImageId(a){return this.controlPrefix+a},_getMenuName:function SoftClub$UI$TopMenu$_getMenuName(a){var b=a;if(b.tagName=="A"){b=b.parentNode.parentNode}else{if(b.tagName=="DIV"&&Sys.UI.DomElement.containsCssClass(b,this.attrItemName)){b=b.parentNode}}return b.getAttribute(this.attrItemName)},_applyHandlers:function SoftClub$UI$TopMenu$_applyHandlers(b,a){b.setAttribute(this.attrItemName,a);$addHandlers(b,{mouseover:this._overHandler,mouseout:this._outHandler},this)},_createLayer:function SoftClub$UI$TopMenu$_createLayer(d){var f=$page.createLayer(this.layerClassName,{display:"none",width:d.width+"px"});var b=d.items;var a=b.length;for(var c=0;c<a;c++){var e=this._createItem(b[c]);f.appendChild(e)}$page.addLayer(f);return f},_createItem:function SoftClub$UI$TopMenu$_createItem(a){var b=$page.createLayer("menuItem");b.innerHTML=String.format('<a href="{1}">{0}</a>',a[0],this._host+a[1]);return b},_setTopLevelPosition:function SoftClub$UI$TopMenu$_setTopLevelPosition(f){var a=Sys.UI.DomElement.getBounds(f.img);var c=a.x+f.shift;var d=a.y+a.height-1;var e=f.layer.style;e.top=d+"px";e.left=c+"px"}};SoftClub.UI.TopMenu.registerClass("SoftClub.UI.TopMenu",Sys.Component);var $topMenu=$create(SoftClub.UI.TopMenu,{structure:menuContent});
(function(g){var c=[];var n=-1;var o="hg:key";var l="data:platforms";var a=(window.location.host=="forum.softclub.ru")?"http://www.softclub.ru":"http://softclub.ru.its";a+="/games/game.asp?id=";var j=null;g(document).ready(function(){j=g("div#hotgames A").each(function(p){g(this).attr(o,"_"+p).click(m)})});function m(s){var p=g(this);var r=p.attr(o);var q=c[r];if(typeof q=="undefined"){q=f(p);c[r]=q}if(q!=null){b();d(p,q);s.preventDefault()}}function d(p,q){p.addClass("selected").parent().bind("mouseleave",i).bind("mouseenter",e);q.show()}function k(p){p.removeClass("selected").parent().unbind("mouseleave",i).unbind("mouseenter",e);var q=c[p.attr(o)];if(q!=null){q.hide()}}function b(){if(n!=-1){clearTimeout(n);n=-1}j.filter(".selected").each(function(p){k(g(this))})}var h=b.slidingCall(g.fx.speeds.slow);function f(v){var t=null;var s=v.attr(l);if(s){s=s.split("|");var y=g.dom;var p=s.length;var u=y.UL();for(var r=0;r<p;r++){var q=s[r].split(",");u.appendChild(y.LI(y.A({href:a+q[1]},q[0])))}t=g(y.DIV({className:"hg-layer"},y.DIV("Выберите платформу:"),u));if(g.browser.msie&&!g.boxModel){t.css({height:"1%",width:"1%"})}t.hide().appendTo(v.parent()).css("top",v.outerHeight());var x=Math.max(v.outerWidth(),t.outerWidth());if(g.boxModel){x-=4}t.width(x)}return t}function i(){n=h()}function e(){if(n!=-1){clearTimeout(n);n=-1}}})(jQuery);
