
var SysreqManager=SysreqManager||{};SysreqManager.PluginVersion='2.03.2030';SysreqManager.IsPluginInit=false;SysreqManager.IsOldPlugin=false;SysreqManager.DataUrl='http://st.playfast.ru/all_requirements.xml';SysreqManager.CurrentGameReq=null;SysreqManager.CurrentGameReqInstalledTemplate='<li><span class="sw_name">{name}</span><ins class="com sw"></ins></li>';SysreqManager.CurrentGameReqNotInstalledTemplate='<li><span class="sw_name">{name}</span><a href="{url}"><ins class="com download"></ins></a></li>';SysreqManager.CurrentGameReqBoxTemplate='<li><span class="sw_group_name color_ni">{textNotInstalled}</span></li>{notinstalled}<li><span class="sw_group_name color_i">{textInstalled}</span></li>{installed}';SysreqManager.PluginInit=function(){if(drm.initialize())SysreqManager.CheckStatus();else{$('#retest_but').hide();$('#sw_check_container').hide();}};SysreqManager.CheckStatus=function(){try{SysreqManager.IsPluginInit=true;if(ProdownFrame.getVersion()<SysreqManager.PluginVersion){SysreqManager.IsPluginInit=false;SysreqManager.IsOldPlugin=true;}else{if(String.IsNullOrEmpty(drm.getHardwareId())){SysreqManager.IsPluginInit=false;SysreqManager.IsOldPlugin=true;}}}
catch(e){SysreqManager.IsPluginInit=false;SysreqManager.IsOldPlugin=false;}};SysreqManager.GetData=function(){var result=drm.testRequirements(SysreqManager.DataUrl,null);var data;if(window.ActiveXObject){data=new ActiveXObject('Microsoft.XMLDOM');data.async=false;data.loadXML('<?xml version="1.0" encoding="utf-8"?>\n'+result);}else data=result;return data;};SysreqManager.Check=function(){var data=SysreqManager.GetData();var result=new Array();$('Requirements > File',data).each(function(i,_item){var item=$(_item);var name=item.attr('name');var status=item.attr('ok')=='true';var url=item.attr('cure');if(SysreqManager.CurrentGameReq.contains(name)){result.push({name:name,status:status,url:url});}});var name='';var status='';var url='';$('Requirements > Or',data).each(function(y,__item){$('File',__item).each(function(i,_item){var item=$(_item);var status_temp=item.attr('ok')=='true';name=item.attr('name');url=item.attr('cure');if(status_temp){status='true';}});if(SysreqManager.CurrentGameReq.contains(name)){result.push({name:name,status:status,url:url});}});return result;};SysreqManager.FillGameReq=function(){if($('#sw_check').length>0){var showRetestBut=false;var result=String.Empty;var installed=String.Empty;var notinstalled=String.Empty;var data=SysreqManager.Check();for(var i=0;i<data.length;i++){if(!data[i].status){showRetestBut=true;notinstalled+=SysreqManager.CurrentGameReqNotInstalledTemplate.template({cur_page:cur_page,download:download,url:data[i].url,name:data[i].name,src:'cancel'});}
else{installed+=SysreqManager.CurrentGameReqInstalledTemplate.template({cur_page:cur_page,url:data[i].url,name:data[i].name,src:'accept'});}}
result=SysreqManager.CurrentGameReqBoxTemplate.template({notinstalled:notinstalled,installed:installed,textNotInstalled:(notinstalled)?textNotInstalled:String.Empty,textInstalled:(installed)?textInstalled:String.Empty});if(!result.IsEmpty()){$('#sw_check_container').show();$('#sw_check').html(result);if(!showRetestBut)$('#retest_but').hide();}
else{$('#retest_but').hide();}}};$(document).ready(function(){SysreqManager.PluginInit();});;Array.prototype.contains=function(element){for(var i=0;i<this.length;i++){if(this[i]==element){return true;}}return false;};;Number.prototype.Numeral=function(string1,string2,string3)
{var ost10=this%10;var ost100=this%100;if(ost10==1&&ost100!=11){return string1;}
if(ost100>11&&ost100<15){return string3;}
if(ost10>1&&ost10<5){return string2;}
return string3;};Number.prototype.Pixels=function(){return'{value}px'.template({value:parseInt(this)});};;String.Empty='';String.prototype.template=function(obj){return this.replace(/{([^{}]+)}/g,function(full,word){return((typeof obj[word]==='string'||typeof obj[word]==='number')?obj[word]:full);});};String.IsNullOrEmpty=function(s){if(s==null)return true;return $.trim(s)==String.Empty;};String.prototype.IsEmpty=function(){return String.IsNullOrEmpty(this);};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,String.Empty);};String.prototype.isEmailAddress=function(){return this.IsEmpty()||(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(this);};String.RandomString=function(string_length){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var randomstring=String.Empty;for(var i=0;i<string_length;i++)
{var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1);}
return randomstring;};String.prototype.Pixels=function(){return isNaN(this)?this:parseInt(this).Pixels();};;Boolean.parse=function(b){var a=b.trim().toLowerCase();if(a==="false")return false;if(a==="true")return true};;var LicenseType=LicenseType||{Play:'play',Load:'load'};;var Effects=Effects||{};Effects.Shake=function(container){if($(container).css('left').indexOf('%')!='-1'){var maringLeft=$(container).css('margin-left');maringLeft=maringLeft.substring(0,(maringLeft.length-2));$(container).css('left',($(container).offset().left-maringLeft).Pixels());}
$(container).animate({left:"+=10px"},50,'linear').animate({left:"-=20px"},50,'linear').animate({left:"+=10px"},50,'linear');};;var Cookie=Cookie||{};Cookie.BaseName='account';Cookie.Get=function(name){try{return $.parseJSON($.cookie(name));}
catch(err){$.cookie(name,null);return null;};};Cookie.Set=function(name,value,params){$.cookie(name,$.toJSON(value),params);};Cookie.Delete=function(name,params){$.cookie(name,null,params);};;Function.createDelegate=function(a,b){return function(){return b.apply(a,arguments)}};Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c<e;c++)d[c]=arguments[c];d[e]=a;return b.apply(this,d)}return b.call(this,a)}};Function.emptyFunction=Function.emptyMethod=function(){};function ReloadWindow(url,pluginReload){if(pluginReload&&!(jQuery.browser.msie&&jQuery.browser.version==7)&&navigator.plugins.refresh)navigator.plugins.refresh(false);if(String.IsNullOrEmpty(url))window.location.reload();else window.location=url;};function isEnterKey(e){return(e.keyCode?e.keyCode:e.which)==13;};function isTabKey(e){return(e.keyCode?e.keyCode:e.which)==9;};function GetGlobalImagePath(name){return'{cur_page}/skins/img/glob_img/{name}'.template({cur_page:cur_page,name:name});};function ReloadIfBuy(){var uri_params=uri.split('/');if(uri_params.contains('?buy=1')){var last_param=uri_params.pop();var new_uri=uri_params.join('/');ReloadWindow(new_uri,false);}};var Events=Events||{Download:{Plugin:'Download.Plugin'},Game:{Play:'Game.Play',Tracker:'Game.GameTracker',Buy:'Game.Buy',Rent:'Game.Rent',ShortPlay:'Game.ShortPlay',LongPlay:'Game.LongPlay',Details:'Game.Details',DetailsDemo:'Game.DetailsDemo',PluginTrue:'Game.PluginTrue',PluginFalse:'Game.PluginFalse',SysReqTrue:'Game.SysReqTrue',SysReqFalse:'Game.SysReqFalse',SysReqFalseOverride:'Game.SysReqFalseOverride'},Login:{PageSubmit:'Login.PageSubmit',PageSuccess:'Login.PageSuccess',PageFail:'Login.PageFail',WizardOpen:'Login.WizardOpen',WizardSubmit:'Login.WizardSubmit',WizardSuccess:'Login.WizardSuccess',WizardFail:'Login.WizardFail',WizardCancel:'Login.WizardCancel'},Register:{PageOpen:'Register.PageOpen',PageSubmit:'Register.PageSubmit',PageSuccess:'Register.PageSuccess',PageFail:'Register.PageFail',WizardOpen:'Register.WizardOpen',WizardSubmit:'Register.WizardSubmit',WizardSuccess:'Register.WizardSuccess',WizardFail:'Register.WizardFail',WizardCancel:'Register.WizardCancel'},SimpleRegister:{WizardOpen:'SimpleRegister.WizardOpen',WizardSubmit:'SimpleRegister.WizardSubmit',WizardSuccess:'SimpleRegister.WizardSuccess',WizardFail:'SimpleRegister.WizardFail',WizardCancel:'SimpleRegister.WizardCancel'},Buy:{Open:'Buy.Open',Close:'Buy.Close',WebMoney:'Buy.WebMoney',YandexMoney:'Buy.YandexMoney',Qiwi:'Buy.Qiwi',MoneyMail:'Buy.MoneyMail',RbkMoney:'Buy.RbkMoney',W1:'Buy.W1',PromoCode:'Buy.PromoCode',Sms:'Buy.Sms',Success:'Buy.Success',Fail:'Buy.Fail'},Consultant:{Click:'Consultant.Click'},Search:{Click:'Search.Click'},Plugin:{Enabled:'Plugin.Enabled',Disabled:'Plugin.Disabled',Idle:'STATUS_IDLE',Loading:'STATUS_LOADING',Launched:'STATUS_LAUNCHED',Stopping:'STATUS_STOPPING',Ready:'STATUS_READY'},GameList:{GamePlay:'GameList.GamePlay',GamePlay:'GameList.GameDowloaded'},User:{Ready:'User.Ready'}};;function UserManager(){this.init();};UserManager.prototype={init:function(){this.user=null;this.user_id=user_id;this.onLoginSuccess=Function.createDelegate(this,this.OnLoginSuccess);this.onRegSuccess=Function.createDelegate(this,this.OnRegSuccess);this.onGameLoad=Function.createDelegate(this,this.OnGameLoad);this.setUser=Function.createDelegate(this,this.SetUser);$(document).one(Events.Plugin.Loading,this.onGameLoad);},SetUser:function(user)
{this.user=user;$(document).trigger(Events.User.Ready);},Populate:function()
{if(!this.user_id)
return false;if(this.user==null)
{$.ajax({type:"GET",dataType:'json',url:'{cur_page}/classes/user.php?id={id}'.template({cur_page:cur_page,id:this.user_id}),success:this.setUser});}
else
$(document).trigger(Events.User.Ready);return true;},GetUserParameter:function(parameter_name)
{if(this.user!==null)
return this.user[parameter_name];return false;},OnGameLoad:function(e,game_data){if(game_data&&game_data.gameUUID)
$.ajax({type:"GET",url:'{cur_page}/classes/user_history.php?add={game_uuid}'.template({cur_page:cur_page,game_uuid:game_data.gameUUID})});},OnLoginSuccess:function(response,type,onSuccess,onFail){if(response=='OK'){$.ajax({type:"GET",url:'{cur_page}/classes/auth.php?a=login&lang={lang}'.template({cur_page:cur_page,lang:language}),success:function(data){anonim=false;$.ajax({type:"GET",url:'{cur_page}/classes/reg_anonim.php'.template({cur_page:cur_page}),success:function(response){user_id=response;onSuccess(data);$('#my_games_menu_td').show()},error:WindowManager.ShowErrorWindow});},error:WindowManager.ShowErrorWindow});}
else{$(document).trigger({type:eval("Events.Login.{type}Fail".template({type:type}))});onFail();}},Login:function(login,password,type,onSuccess,onFail){var me=this;$.ajax({type:"GET",url:'{cur_page}/classes/auth.php?email={email}&passw={passw}&lang={lang}&rand={rand}'.template({cur_page:cur_page,lang:language,email:login,passw:escape(password),rand:String.RandomString(5)}),success:function(response){me.onLoginSuccess(response,type,onSuccess,onFail);},error:WindowManager.ShowErrorWindow});},Logout:function(){},OnRegSuccess:function(response,type,onSuccess,onFail){if(response=='OK'){$(document).trigger({type:eval("Events.Register.{type}Success".template({type:type}))});this.OnLoginSuccess(response,type,onSuccess,onFail);}
else{$(document).trigger({type:eval("Events.Register.{type}Fail".template({type:type}))});onFail(response);}},Register:function(email,password,password_c,nick,rm,type,onSuccess,onFail){var me=this;$.ajax({type:"GET",url:'{cur_page}/classes/reg.php?email={email}&passw={passw}&passwc={passwc}&nick={nick}&rm={rm}&lang={lang}&hw_id={hw_id}'.template({cur_page:cur_page,lang:language,email:email,passw:password,passwc:password_c,nick:nick,rm:rm,hw_id:drm.getHardwareId()}),success:function(response){me.onRegSuccess(response,type,onSuccess,onFail);},error:WindowManager.ShowErrorWindow});},IsAnonym:function(){return anonim;},GetUser:function(){}};$(document).ready(function(){userManager=new UserManager();});;var API=API||{};API.URL="{cur_page}/apiManager.php?api={api_action}{params}";API.RentUseParams="&game_id={game_id}&rent_id={rent_id}";API.GetLicense=function(license){drm.acquireLicense(alQuery.template({api_url:api_url,license:license.license,uuid:license.uuid,userid:user_id}));switch(license.type){case LicenseType.Play:GameManager.Play(license);break;case LicenseType.Load:GameManager.Load(license);break;default:break;};RatingManager.Rate({cur_page:cur_page,uuid:uuid});};API.ActivateRent=function(obj){$.ajax({type:"GET",url:API.URL.template({cur_page:cur_page,api_action:"ru",params:API.RentUseParams.template({game_id:obj.game_id,rent_id:obj.rent_id})}),success:Function.emptyFunction});};;var GameManager=GameManager||{};GameManager.URL="{cur_page}/classes/get_game_attributes.php?id={id}";GameManager.RegisterAnonim="{cur_page}/classes/reg_anonim.php";GameManager.Attributes={};GameManager.Attributes.uuid='uuid';GameManager.Attributes.license='license';GameManager.Attributes.playUUID='play_id';GameManager.Init=function(uuid){this.preorder=Function.createDelegate(this,this.Preorder);this.uuid=uuid||null;this.license_type=null;this.is_initiated=true;}
GameManager.GetGameAttributes=function(id,callback){$.ajax({type:"GET",url:GameManager.URL.template({cur_page:cur_page,id:id}),success:function(data){var data=$.parseJSON(data);if(callback)callback(data);},error:WindowManager.ShowErrorWindow});}
GameManager.OnPlayClick=function(){GameManager.GetGameAttributes(Cookie.Get('runGame'),function(data){if(data!=null)GameManager.Play(data);});}
GameManager.OnLoadClick=function(obj,callback){var me=obj;GameManager.GetGameAttributes(($(obj).attr(GameManager.Attributes.uuid)),function(data){$.ajax({type:"GET",url:GameManager.RegisterAnonim.template({cur_page:cur_page}),success:function(response){user_id=response;data.license=$(me).attr(GameManager.Attributes.license);data.playUUID=$(me).attr(GameManager.Attributes.playUUID);GameManager.Load(data);if(callback)callback();},error:WindowManager.ShowErrorWindow});});}
GameManager.OnDeleteClick=function(obj){GameManager.GetGameAttributes($(obj).attr(GameManager.Attributes.uuid),GameManager.Delete);}
GameManager.Play=function(data){ProdownFrame.player.downloadUrl=data.DownloadURL;ProdownFrame.player.image=data.FileImg;ProdownFrame.player.commandLine=data.CommandLine;ProdownFrame.player.hintUpload=data.HintUpload;ProdownFrame.player.name=data.ImgName;ProdownFrame.player.minHintTime="1";ProdownFrame.player.autoStop="true";ProdownFrame.player.throttle=false;ProdownFrame.player.autoLaunch=36000;ProdownFrame.Launch();};GameManager.Load=function(data){GameManager.GetLicense(data);Cookie.Set("gameTitle",data.FullName,{path:"/"});Cookie.Set("gameType",data.license,{path:"/"});Cookie.Set("runGame",data.UUID,{path:"/"});if(typeof(data.playUUID)!='undefined')ProdownFrame.player.id=data.playUUID;ProdownFrame.player.downloadUrl=data.DownloadURL;ProdownFrame.player.image=data.FileImg;ProdownFrame.player.commandLine=data.CommandLine;ProdownFrame.player.hintUpload=data.HintUpload;ProdownFrame.player.name=data.ImgName;ProdownFrame.player.minHintTime="1";ProdownFrame.player.autoStop="false";ProdownFrame.player.throttle=false;ProdownFrame.player.autoLaunch=0;ProdownFrame.Load();};GameManager.Delete=function(data){jConfirm(gameDeleteConfirmMsg,gameDeleteConfirmHeader,function(r){if(r){ProdownFrame.player.image=data.FileImg;ProdownFrame.Delete();drm.deleteCatalog(data.UUID);UpdateCatalog();}});};GameManager.GetLicense=function(data){drm.acquireLicense(alQuery.template({api_url:api_url,license:data.license,uuid:data.UUID,userid:user_id}));data.rate='play';RatingManager.Rate(data);};GameManager.IsInitiated=function()
{return(typeof this.is_initiated!=="undefined"&&this.is_initiated);}
GameManager.OnPreorderClick=function(){if(this.IsInitiated())
{$(document).one(Events.User.Ready,this.preorder);userManager.Populate();}}
GameManager.Preorder=function(){if(this.IsInitiated())
buyWizard.Start(null,null,{uuid:this.uuid,license_type:"preorder"});}
$(document).ready(function(){});;var RatingManager=RatingManager||{};RatingManager.SetRatingURL='{cur_page}/classes/setrating.php?i={rate}&id={id}';RatingManager.Rate=function(data){$.ajax({url:RatingManager.SetRatingURL.template({cur_page:cur_page,id:data.UUID,rate:data.rate})});};;var TagCloudManager=TagCloudManager||{};TagCloudManager.ListID='tagList';TagCloudManager.BaseID='tag_cloud';TagCloudManager.Show=function(){$.ajax({type:"GET",url:cur_page+'/classes/tags.php',success:function(xml){TagCloudManager.ParseData(xml);}});};TagCloudManager.ParseData=function(xml){var data=Xml2Object.parseXML(xml);$("<ul>").attr("id",TagCloudManager.ListID).appendTo("#"+TagCloudManager.BaseID);var tagsTemp=data.children;var length=tagsTemp.length;var _li=$("<li>");var a=$("<a>");for(var i=0;i<length;i++){var tag=tagsTemp[i];var li=_li.clone();a.clone().attr({href:tag.url,title:tag.name}).text(tag.name).appendTo(li);li.appendTo("#"+TagCloudManager.ListID);var size=(tag.size.IsEmpty())?"1":tag.size;li.children().addClass('lvl{size}'.template({size:size}));}};;function CommentManager(target){this.buttonsTemplate='\
        <div class="fr">\
            <a class="commentShow_but">{langComments}: <span class="comment_count"></span></a>\
            <a class="commentPost_but">{langCommentAdd}</a>\
        </div>\
    ';this.containerTemplate='\
        <div class="refresh">\
            <a class="com_refresh">{langCommentRefresh}</a><span class="loader_2"></span>\
        </div>\
        <div class="container"></div>\
        <div class="postCommentBlock"></div>\
        <span>\
            <a class="com_next">{langCommentNext} &#9660;</a><span class="loader"></span>\
            <a href="#comments" class="com_totop">{langCommentToTop} &#9650;</a>\
        </span>\
    ';this.commentTemplate='\
        <div class="block-comment">\
            <div class="header">\
                <span class="nickname">{nick}</span>\
                <span class="date">{langSent}: {date}</span>\
                <span class="com_rating_block">\
                        <span id="com_rating_{id}" class="com_rating_value {color_class}">{rating}</span> |\
                    <span class="com_rating">\
                        <a class="com_rating_up" com_id="{id}">+1</a> /\
                        <a class="com_rating_down" com_id="{id}">-1</a> |\
                    </span>\
                    <span class="com_number"><img class="link-icon" width="16" height="16" align="top" alt="" src="{cur_page}/skins/img/glob_img/link-icon.png" /></span>\
                </span>\
            </div>\
            <div class="com_body">{text}</div>\
        </div>\
    ';this.addCommentTemplate='\
        <div class="block-commentpost">\
            <div class="compost_error"></div>\
            <div class="message"><textarea name="com_message" class="com_message"></textarea></div>\
            <div class="captcha"><input type="text" name="com_captcha" class="com_captcha"><img class="captcha_img" src="{cur_page}/classes/captcha.php?width=91&height=22&font_size_min=13&font_size_max=13&char_align=17&captcha=com" width="100" height="22" alt="" /></div>\
            <div class="buttons"><input type="button" class="postbutton ui-button ui-widget ui-state-default ui-corner-all" value="{langPost}" /></div>\
        </div>\
    ';this.Attributes={};this.Attributes.type_id='type_id';this.Attributes.obj_id='obj_id';this.Attributes.com_id='com_id';this.perpage=5;this.phpUrl="{cur_page}/classes/comments.php?act={action}&type={type}&obj={obj}&id={id}&text={text}&captcha={captcha}&step={step}&from={from}&stamp={stamp}";this.context=null;this.target=$(target);this.init();};CommentManager.prototype={init:function(){this.onRateUpClick=Function.createDelegate(this,this.OnRateUpClick);this.onRateDownClick=Function.createDelegate(this,this.OnRateDownClick);this.onNextClick=Function.createDelegate(this,this.OnNextClick);this.onRefreshClick=Function.createDelegate(this,this.OnRefreshClick);this.onReplyClick=Function.createDelegate(this,this.OnReplyClick);this.onActionClick=Function.createDelegate(this,this.OnActionClick);this.prepareHtml=Function.createDelegate(this,this.PrepareHtml);this.onShowForm=Function.createDelegate(this,this.OnShowForm);this.onShowComm=Function.createDelegate(this,this.OnShowComm);this.CommentCountContainer=null;this.CommentsContainer=null;this.CommentPostContainer=null;this.NextCommentsBut=null;this.toUp=false;this.FrameworkRender();this.action='show';this.type=this.target.attr(this.Attributes.type_id);this.obj=this.target.attr(this.Attributes.obj_id);this.text=String.Empty;this.captcha=String.Empty;this.id=String.Empty;this.from=String.Empty;this.step=this.perpage;this.GetData(0,this.step,this.prepareHtml);this.GetForm();},FrameworkRender:function(){this.target.html(this.buttonsTemplate.template({langComments:langComments,langCommentAdd:langCommentAdd})).append(this.containerTemplate.template({cur_page:cur_page,langCommentNext:langCommentNext,langCommentToTop:langCommentToTop,langCommentRefresh:langCommentRefresh}));this.CommentCountContainer=$('span.comment_count',this.target);this.CommentsContainer=$('div.container',this.target);this.CommentPostContainer=$('div.postCommentBlock',this.target);this.NextCommentsBut=$('a.com_next',this.target);this.RefreshCommentsBut=$('a.com_refresh',this.target);this.Loader=$('.loader',this.target);this.Loader2=$('.loader_2',this.target);var spinner=new Spinner();spinner.Start(this.Loader,Spinner.Size.Small,"white");var spinner2=new Spinner();spinner2.Start(this.Loader2,Spinner.Size.Small,"white");this.Loader.css('visibility','hidden');this.Loader2.css('visibility','hidden');this.RefreshCommentsBut.hide();this.NextCommentsBut.hide();$('.com_totop',this.target).hide();this.NextCommentsBut.click(this.onNextClick);$('a.commentPost_but',this.target).click(this.onShowForm);$('a.commentShow_but',this.target).click(this.onShowComm);this.RefreshCommentsBut.click(this.onRefreshClick);},BuildUrl:function(){return this.phpUrl.template({cur_page:cur_page,action:this.action,type:this.type,obj:this.obj,text:this.text,captcha:this.captcha,id:this.id,step:this.step,from:this.from,stamp:String.RandomString(7)});},GetForm:function(){this.CommentPostContainer.append(this.addCommentTemplate.template({cur_page:cur_page,langPost:langPost}));$('.postbutton',this.target).click(this.onReplyClick);},GetNewData:function(onSuccess){this.Loader2.css('visibility','visible');var me=this;this.action='new';$.ajax({type:"GET",url:this.BuildUrl(),success:function(data){onSuccess(me.ParseData(data));}});},GetData:function(from,step,onSuccess){this.Loader.css('visibility','visible');this.toUp=false;var me=this;this.action='show';this.step=step;this.from=from;$.ajax({type:"GET",url:this.BuildUrl(),success:function(data){onSuccess(me.ParseData(data));}});},ParseData:function(xml){return Xml2Object.parseXML(xml);},PrepareHtml:function(data){var result=new Array();var commentsTemp=data.children;if(commentsTemp!=null){this.CommentCountContainer.html(data.count);var com_length=commentsTemp.length;for(var i=0;i<com_length;i++){var comment=commentsTemp[i];if(comment.nick!=String.Empty){if(parseInt(comment.rating)>0)var color_class='green';else if(parseInt(comment.rating)<0)var color_class='red';else var color_class='gray';var com_rating=comment.rating;var rating=(com_rating>=0)?com_rating.toString():com_rating.toString().substring(1);result.push(this.commentTemplate.template({cur_page:cur_page,text:comment.text,date:comment.date,nick:comment.nick,rating:rating,id:comment.com_id,color_class:color_class,langComments:langComments,langCommentAdd:langCommentAdd,langSent:langSent,langCitata:langCitata,langOnlyNick:langOnlyNick,langOnlyMarked:langOnlyMarked,langReply:langReply}));}}
if(data.last)
this.NextCommentsBut.hide();else if(!this.toUp)
this.NextCommentsBut.show();}
this.CommentsContainer.show();this.CommentPostContainer.hide();if(this.toUp)
this.ShowNew(result);else
this.Show(result);},ShowNew:function(comments){this.Loader2.css('visibility','hidden');$('.block-comment:first-child',this.target).before(comments.join(String.Empty));if(anonim){$('.com_rating',this.target).hide();$('.nickname',this.target).css('width','385px');}
$('a.com_rating_up',this.target).filter(':Event(!click)').click(this.onRateUpClick);$('a.com_rating_down',this.target).filter(':Event(!click)').click(this.onRateDownClick);},Show:function(comments){this.Loader.css('visibility','hidden');this.CommentsContainer.append(comments.join(String.Empty));this.IncreaseFrom(comments.length);this.RefreshCommentsBut.show();if(anonim){$('.com_rating',this.target).hide();$('.nickname',this.target).css('width','385px');}
$('a.com_rating_up',this.target).filter(':Event(!click)').click(this.onRateUpClick);$('a.com_rating_down',this.target).filter(':Event(!click)').click(this.onRateDownClick);},OnShowComm:function(){this.ShowComm();return false;},ShowComm:function(){this.RefreshCommentsBut.show();this.target.attr('from','0');this.CommentsContainer.html('');this.GetData(0,this.perpage,this.prepareHtml);},OnShowForm:function(){this.ShowForm();return false;},ShowForm:function(){this.RefreshCommentsBut.hide();this.target.attr('from','0');this.CommentsContainer.html('');this.CommentsContainer.hide();this.NextCommentsBut.hide();this.CommentPostContainer.show();},IncreaseFrom:function(step){var t=parseInt(this.target.attr('from'));this.target.attr('from',t+step);},OnRateUpClick:function(e){var id=$(e.currentTarget).attr(this.Attributes.com_id);var me=this;this.action='up';this.id=id;this.step=String.Empty;this.from=String.Empty;this.text=String.Empty;this.captcha=String.Empty;this.obj=String.Empty;this.type=String.Empty;$.ajax({type:"GET",url:this.BuildUrl(),success:function(data){var rateStatus=me.ParseData(data).status;if(rateStatus==1){var ratingBox=$('#com_rating_'+id,me.target);var curRateValue=parseInt(ratingBox.html());var rateValue=curRateValue+1;if(curRateValue==0){ratingBox.removeClass('gray');ratingBox.addClass('green');}
else if(curRateValue==-1){ratingBox.removeClass('red');ratingBox.addClass('gray');}
var result=(rateValue>=0)?rateValue.toString():rateValue.toString().substring(1);ratingBox.html(result);}}});},OnRateDownClick:function(e){var id=$(e.currentTarget).attr(this.Attributes.com_id);var me=this;this.action='down';this.id=id;this.step=String.Empty;this.from=String.Empty;this.text=String.Empty;this.captcha=String.Empty;this.obj=String.Empty;this.type=String.Empty;$.ajax({type:"GET",url:this.BuildUrl(),success:function(data){var rateStatus=me.ParseData(data).status;if(rateStatus==1){var ratingBox=$('#com_rating_'+id,me.target);var curRateValue=parseInt(ratingBox.html());var rateValue=curRateValue-1;if(curRateValue==1){ratingBox.removeClass('green');ratingBox.addClass('gray');}
else if(curRateValue==0){ratingBox.removeClass('gray');ratingBox.addClass('red');}
var result=(rateValue>=0)?rateValue.toString():rateValue.toString().substring(1);ratingBox.html(result);}}});},OnReplyClick:function(context){var text=$('.com_message',this.target).val();var captcha=$('.com_captcha',this.target).val();var me=this;this.action='save';this.id=String.Empty;this.step=String.Empty;this.from=String.Empty;this.text=text;this.captcha=captcha;$.ajax({type:"GET",url:this.BuildUrl(),success:function(data){var response=me.ParseData(data);var count=response.count;var description=response.description;var status=response.status;if(status==1&&description==''){me.GetData(0,me.perpage,me.prepareHtml);me.RefreshCommentsBut.show();}
else{$('.compost_error',me.target).html(description);}}});},OnNextClick:function(){var from=this.target.attr('from');this.GetData(from,this.perpage,this.prepareHtml);},OnRefreshClick:function(){this.toUp=true;this.GetNewData(this.prepareHtml);},OnActionClick:function(){var action=$(this).attr('action');if(action=='show')
this.GetData(0,this.perpage,this.prepareHtml);else if(action=='add')
this.ShowForm();}};;var WindowManager=WindowManager||{};WindowManager.ShowErrorWindow=function(XMLHttpRequest,textStatus,errorThrown){(new InfoForm()).ShowForm(Function.emptyFunction,Function.emptyFunction,{header:'Error',message:'{textStatus} - {errorThrown}'.template({textStatus:textStatus,errorThrown:errorThrown})});};;var StatManager=StatManager||{};StatManager.IsActive=false;StatManager.TrackName=String.Empty;StatManager.SearchID='s';StatManager.CookieName={LoadTracker:'LoadTracker',PlayTracker:'PlayTracker',TestCookie:'__utmc'};StatManager.GameAttrURL='{cur_page}/classes/get_game_attributes.php?id={id}';StatManager.TrackEvent={PageView:'_trackPageview',Event:'_trackEvent',SetAccount:'_setAccount',CookiesAllowed:'Cookies allowed'};StatManager.Action={Register:{Category:'register',Actions:{PageOpen:{Name:'page.register.open',Label:'page_register_open '},PageSubmit:{Name:'page.register.submit',Label:'page_register_submit'},PageOk:{Name:'page.register.ok',Label:'page_register_ok'},PageFailure:{Name:'page.register.failure',Label:'page_register_failure'},WizardOpen:{Name:'wizard.register.open',Label:'wizard_register_open '},WizardSubmit:{Name:'wizard.register.submit',Label:'wizard_register_submit'},WizardOk:{Name:'wizard.register.ok',Label:'wizard_register_ok'},WizardFailure:{Name:'wizard.register.failure',Label:'wizard_register_failure'},WizardClose:{Name:'wizard.register.close',Label:'wizard_register_close'}}},SimpleRegister:{Category:'simple.register',Actions:{WizardOpen:{Name:'wizard.register.open',Label:'wizard_simpleregister_open '},WizardSubmit:{Name:'wizard.register.submit',Label:'wizard_simpleregister_submit'},WizardOk:{Name:'wizard.register.ok',Label:'wizard_simpleregister_ok'},WizardFailure:{Name:'wizard.register.failure',Label:'wizard_simpleregister_failure'},WizardClose:{Name:'wizard.register.close',Label:'wizard_simpleregister_close'}}},Login:{Category:'login',Actions:{PageSubmit:{Name:'page.login.submit',Label:'page_login_submit'},PageOk:{Name:'page.login.ok',Label:'page_login_ok'},PageFailure:{Name:'page.login.failure',Label:'page_login_failure'},WizardOpen:{Name:'wizard.login.open',Label:'wizard_login_open'},WizardSubmit:{Name:'wizard.login.submit',Label:'wizard_login_submit'},WizardOk:{Name:'wizard.login.ok',Label:'wizard_login_ok'},WizardFailure:{Name:'wizard.login.failure',Label:'wizard_login_failure'},WizardClose:{Name:'wizard.login.close',Label:'wizard_login_close'}}},Download:{Category:'download',Actions:{Plugin:{Name:'download.plugin ',Label:'download_plugin'}}},Consultant:{Category:'consultant',Actions:{Click:{Name:'consultant.click',Label:'consultant_click'}}},Search:{Category:'search',Actions:{Click:{Name:'search.click'}}},Game:{Category:'game',Actions:{Demo:{Name:'game.demo.game_demo',Label:'game_demo'},DemoPluginTrue:{Name:'game.demo.plugin_true',Label:'game_demo_plugin_true'},DemoPluginFalse:{Name:'game.demo.plugin_false',Label:'game_demo_plugin_false'},DemoSysTrue:{Name:'game.demo.sys_true',Label:'game_demo_sys_true'},DemoSysFalse:{Name:'game.demo.sys_false',Label:'game_demo_sys_false'},DemoSysFalseOverride:{Name:'game.demo.sys_false_override',Label:'game_demo_sys_false_override'},Full:{Name:'game.full',Label:'game_full'},LoadTime:{Name:'game.loadtime',Label:'game_loadtime'},PlayTime:{Name:'game.playtime',Label:'game_playtime'},Buy:{Name:'game.buy',Label:'game_buy'},Rent:{Name:'game.rent',Label:'game_rent'},ShortPlay:{Name:'game.shortplay'},LongPlay:{Name:'game.longplay'},Details:{Name:'game.details'},DetailsDemo:{Name:'game.details.demo'}}},Buy:{Category:'buy',Actions:{WebMoney:{Name:'buy.webmoney',Label:'buy_webmoney'},YandexMoney:{Name:'buy.yandex.money',Label:'buy_yandex.money'},Qiwi:{Name:'buy.qiwi',Label:'buy_qiwi'},MoneyMail:{Name:'buy.moneymail',Label:'buy_moneymail'},RbkMoney:{Name:'buy.rbkmoney',Label:'buy_rbkmoney'},W1:{Name:'buy.w1',Label:'buy_w1'},PromoCode:{Name:'buy.promocode',Label:'buy_promocode'},Sms:{Name:'buy.sms',Label:'buy_sms'},Open:{Name:'buy.open',Label:'buy_open'},Close:{Name:'buy.close',Label:'buy_close'},Ok:{Name:'buy.ok',Label:'buy_ok'},Failure:{Name:'buy.failure',Label:'buy_failure'}}}};StatManager.OnDownloadPlugin=function(){StatManager.PushEvent([StatManager.Action.Download.Category,StatManager.Action.Download.Actions.Plugin.Name,StatManager.Action.Download.Actions.Plugin.Label]);};StatManager.OnConsultantClick=function(){StatManager.PushEvent([StatManager.Action.Consultant.Category,StatManager.Action.Consultant.Actions.Click.Name,StatManager.Action.Consultant.Actions.Click.Label]);};StatManager.OnSearchClick=function(){StatManager.PushEvent([StatManager.Action.Search.Category,StatManager.Action.Search.Actions.Click.Name,$('#'+StatManager.SearchID).val()]);};StatManager.OnPageRegisterOpen=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.PageOpen.Name,StatManager.Action.Register.Actions.PageOpen.Label]);};StatManager.OnPageRegisterSubmit=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.PageSubmit.Name,StatManager.Action.Register.Actions.PageSubmit.Label]);};StatManager.OnPageRegisterSuccess=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.PageOk.Name,StatManager.Action.Register.Actions.PageOk.Label]);};StatManager.OnPageRegisterFail=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.PageFailure.Name,StatManager.Action.Register.Actions.PageFailure.Label]);};StatManager.OnWizardRegisterOpen=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.WizardOpen.Name,StatManager.Action.Register.Actions.WizardOpen.Label]);};StatManager.OnWizardRegisterSubmit=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.WizardSubmit.Name,StatManager.Action.Register.Actions.WizardSubmit.Label]);};StatManager.OnWizardRegisterSuccess=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.WizardOk.Name,StatManager.Action.Register.Actions.WizardOk.Label]);};StatManager.OnWizardRegisterFail=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.WizardFailure.Name,StatManager.Action.Register.Actions.WizardFailure.Label]);};StatManager.OnWizardRegisterCancel=function(){StatManager.PushEvent([StatManager.Action.Register.Category,StatManager.Action.Register.Actions.WizardClose.Name,StatManager.Action.Register.Actions.WizardClose.Label]);};StatManager.OnWizardSimpleRegisterOpen=function(){StatManager.PushEvent([StatManager.Action.SimpleRegister.Category,StatManager.Action.SimpleRegister.Actions.WizardOpen.Name,StatManager.Action.SimpleRegister.Actions.WizardOpen.Label]);};StatManager.OnWizardSimpleRegisterSubmit=function(){StatManager.PushEvent([StatManager.Action.SimpleRegister.Category,StatManager.Action.SimpleRegister.Actions.WizardSubmit.Name,StatManager.Action.SimpleRegister.Actions.WizardSubmit.Label]);};StatManager.OnWizardSimpleRegisterSuccess=function(){StatManager.PushEvent([StatManager.Action.SimpleRegister.Category,StatManager.Action.SimpleRegister.Actions.WizardOk.Name,StatManager.Action.SimpleRegister.Actions.WizardOk.Label]);};StatManager.OnWizardSimpleRegisterFail=function(){StatManager.PushEvent([StatManager.Action.SimpleRegister.Category,StatManager.Action.SimpleRegister.Actions.WizardFailure.Name,StatManager.Action.SimpleRegister.Actions.WizardFailure.Label]);};StatManager.OnWizardSimpleRegisterCancel=function(){StatManager.PushEvent([StatManager.Action.SimpleRegister.Category,StatManager.Action.SimpleRegister.Actions.WizardClose.Name,StatManager.Action.SimpleRegister.Actions.WizardClose.Label]);};StatManager.OnPageLoginSubmit=function(){StatManager.PushEvent([StatManager.Action.Login.Category,StatManager.Action.Login.Actions.PageSubmit.Name,StatManager.Action.Login.Actions.PageSubmit.Label]);};StatManager.OnPageLoginSuccess=function(){StatManager.PushEvent([StatManager.Action.Login.Category,StatManager.Action.Login.Actions.PageOk.Name,StatManager.Action.Login.Actions.PageOk.Label]);};StatManager.OnPageLoginFail=function(){StatManager.PushEvent([StatManager.Action.Login.Category,StatManager.Action.Login.Actions.PageFailure.Name,StatManager.Action.Login.Actions.PageFailure.Label]);};StatManager.OnWizardLoginOpen=function(){StatManager.PushEvent([StatManager.Action.Login.Category,StatManager.Action.Login.Actions.WizardOpen.Name,StatManager.Action.Login.Actions.WizardOpen.Label]);};StatManager.OnWizardLoginSubmit=function(){StatManager.PushEvent([StatManager.Action.Login.Category,StatManager.Action.Login.Actions.WizardSubmit.Name,StatManager.Action.Login.Actions.WizardSubmit.Label]);};StatManager.OnWizardLoginSuccess=function(){StatManager.PushEvent([StatManager.Action.Login.Category,StatManager.Action.Login.Actions.WizardOk.Name,StatManager.Action.Login.Actions.WizardOk.Label]);};StatManager.OnWizardLoginFail=function(){StatManager.PushEvent([StatManager.Action.Login.Category,StatManager.Action.Login.Actions.WizardFailure.Name,StatManager.Action.Login.Actions.WizardFailure.Label]);};StatManager.OnWizardLoginCancel=function(){StatManager.PushEvent([StatManager.Action.Login.Category,StatManager.Action.Login.Actions.WizardClose.Name,StatManager.Action.Login.Actions.WizardClose.Label]);};StatManager.OnPlayClick=function(data){if(data.license=='buy'){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.Full.Name,StatManager.Action.Game.Actions.Full.Label]);}
else{StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.Demo.Name,StatManager.Action.Game.Actions.Demo.Label]);}};StatManager.OnBuyClick=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.Buy.Name,StatManager.Action.Game.Actions.Buy.Label]);};StatManager.OnRentClick=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.Rent.Name,StatManager.Action.Game.Actions.Rent.Label]);};StatManager.OnPluginTrue=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.DemoPluginTrue.Name,StatManager.Action.Game.Actions.DemoPluginTrue.Label]);};StatManager.OnPluginFalse=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.DemoPluginFalse.Name,StatManager.Action.Game.Actions.DemoPluginFalse.Label]);};StatManager.OnSysReqTrue=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.DemoSysTrue.Name,StatManager.Action.Game.Actions.DemoSysTrue.Label]);};StatManager.OnSysReqFalse=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.DemoSysFalse.Name,StatManager.Action.Game.Actions.DemoSysFalse.Label]);};StatManager.OnSysReqFalseOverride=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.DemoSysFalseOverride.Name,StatManager.Action.Game.Actions.DemoSysFalseOverride.Label]);};StatManager.GameTracker=function(data){switch(data.status){case Events.Plugin.Loading:case Events.Plugin.Ready:if(!StatManager.IsStartTime(loadTracker)){StatManager.StartTrackAndSet(loadTracker,StatManager.CookieName.LoadTracker);}
break;case Events.Plugin.Stopping:case Events.Plugin.Idle:if(StatManager.IsStartTime(playTracker)){StatManager.StopTrackAndDelete(playTracker,StatManager.CookieName.PlayTracker);}
else if(StatManager.IsStartTime(loadTracker)){StatManager.StopTrackAndDelete(loadTracker,StatManager.CookieName.LoadTracker);}
break;case Events.Plugin.Launched:if(!StatManager.IsStartTime(playTracker)){if(StatManager.IsStartTime(loadTracker)){StatManager.StopTrackAndDelete(loadTracker,StatManager.CookieName.LoadTracker);}
StatManager.StartTrackAndSet(playTracker,StatManager.CookieName.PlayTracker);}
break;}};StatManager.GameLoadtime=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.LoadTime.Name,StatManager.Action.Game.Actions.LoadTime.Label]);};StatManager.GamePlaytime=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.PlayTime.Name,StatManager.Action.Game.Actions.PlayTime.Label]);};StatManager.OnShortPlay=function(){var runGame=Cookie.Get('runGame');$.ajax({type:"GET",url:StatManager.GameAttrURL.template({cur_page:cur_page,id:runGame}),success:function(response){var response=$.parseJSON(response);StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.ShortPlay.Name,response.FullName]);}});};StatManager.OnLongPlay=function(){var runGame=Cookie.Get('runGame');$.ajax({type:"GET",url:StatManager.GameAttrURL.template({cur_page:cur_page,id:runGame}),success:function(response){var response=$.parseJSON(response);StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.LongPlay.Name,response.FullName]);}});};StatManager.OnDetailPageLoad=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.Details.Name,$("#page_header").html()]);};StatManager.OnDetailDemoPageLoad=function(){StatManager.PushEvent([StatManager.Action.Game.Category,StatManager.Action.Game.Actions.DetailsDemo.Name,$("#page_header").html()]);};StatManager.OnWebMoneyClick=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.WebMoney.Name,StatManager.Action.Buy.Actions.WebMoney.Label]);};StatManager.OnYandexMoneyClick=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.YandexMoney.Name,StatManager.Action.Buy.Actions.YandexMoney.Label]);};StatManager.OnQiwiClick=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.Qiwi.Name,StatManager.Action.Buy.Actions.Qiwi.Label]);};StatManager.OnMoneyMailClick=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.MoneyMail.Name,StatManager.Action.Buy.Actions.MoneyMail.Label]);};StatManager.OnRbkMoneyClick=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.RbkMoney.Name,StatManager.Action.Buy.Actions.RbkMoney.Label]);};StatManager.OnW1Click=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.W1.Name,StatManager.Action.Buy.Actions.W1.Label]);};StatManager.OnPromoCodeClick=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.PromoCode.Name,StatManager.Action.Buy.Actions.PromoCode.Label]);};StatManager.OnSmsClick=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.Sms.Name,StatManager.Action.Buy.Actions.Sms.Label]);};StatManager.OnBuyOpen=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.Open.Name,StatManager.Action.Buy.Actions.Open.Label]);};StatManager.OnBuyClose=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.Close.Name,StatManager.Action.Buy.Actions.Close.Label]);};StatManager.OnBuySuccess=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.Ok.Name,StatManager.Action.Buy.Actions.Ok.Label]);};StatManager.OnBuyFail=function(){StatManager.PushEvent([StatManager.Action.Buy.Category,StatManager.Action.Buy.Actions.Failure.Name,StatManager.Action.Buy.Actions.Failure.Label]);};StatManager.PushEvent=function(data){_gaq.push([StatManager.TrackEvent.PageView,data[0]]);data.unshift(StatManager.TrackEvent.Event);_gaq.push(data);};StatManager.IsStartTime=function(obj){return typeof(obj.startTime_)!='undefined'&&obj.startTime_!=null;};StatManager.StopTrackAndDelete=function(obj,cookieName){obj._recordEndTime();obj._track();Cookie.Delete(cookieName,{path:'/'});obj.startTime_=null;};StatManager.StartTrackAndSet=function(obj,cookieName){obj._recordStartTime();Cookie.Set(cookieName,obj.startTime_,{path:'/'});};$(document).ready(function(){if(ga_active=='1'){_gaq=_gaq||[];_gaq.push([StatManager.TrackEvent.SetAccount,ga]);_gaq.push([StatManager.TrackEvent.PageView]);playTracker=new TimeTracker(null,StatManager.Action.Game.Category,StatManager.Action.Game.Actions.PlayTime.Name,StatManager.Action.Game.Actions.PlayTime.Label);var playTrackerTime=Cookie.Get(StatManager.CookieName.PlayTracker);if(playTrackerTime)playTracker.startTime_=playTrackerTime;loadTracker=new TimeTracker(null,StatManager.Action.Game.Category,StatManager.Action.Game.Actions.LoadTime.Name,StatManager.Action.Game.Actions.LoadTime.Label);var loadTrackerTime=Cookie.Get(StatManager.CookieName.LoadTracker);if(loadTrackerTime)loadTracker.startTime_=loadTrackerTime;pageTracker=_gaq._getAsyncTracker();var availableCookiesCheck=Cookie.Get(StatManager.CookieName.TestCookie);var availableCookies=(availableCookiesCheck)?'Yes':'No';pageTracker._setCustomVar(1,StatManager.TrackEvent.CookiesAllowed,availableCookies,1);$(document).bind(Events.Download.Plugin,StatManager.OnDownloadPlugin);$(document).bind(Events.Consultant.Click,StatManager.OnConsultantClick);$(document).bind(Events.Search.Click,StatManager.OnSearchClick);$(document).bind(Events.Register.PageOpen,StatManager.OnPageRegisterOpen);$(document).bind(Events.Register.PageSubmit,StatManager.OnPageRegisterSubmit);$(document).bind(Events.Register.PageSuccess,StatManager.OnPageRegisterSuccess);$(document).bind(Events.Register.PageFail,StatManager.OnPageRegisterFail);$(document).bind(Events.Register.WizardOpen,StatManager.OnWizardRegisterOpen);$(document).bind(Events.Register.WizardSubmit,StatManager.OnWizardRegisterSubmit);$(document).bind(Events.Register.WizardSuccess,StatManager.OnWizardRegisterSuccess);$(document).bind(Events.Register.WizardFail,StatManager.OnWizardRegisterFail);$(document).bind(Events.Register.WizardCancel,StatManager.OnWizardRegisterCancel);$(document).bind(Events.SimpleRegister.WizardOpen,StatManager.OnWizardSimpleRegisterOpen);$(document).bind(Events.SimpleRegister.WizardSubmit,StatManager.OnWizardSimpleRegisterSubmit);$(document).bind(Events.SimpleRegister.WizardSuccess,StatManager.OnWizardSimpleRegisterSuccess);$(document).bind(Events.SimpleRegister.WizardFail,StatManager.OnWizardSimpleRegisterFail);$(document).bind(Events.SimpleRegister.WizardCancel,StatManager.OnWizardSimpleRegisterCancel);$(document).bind(Events.Login.PageSubmit,StatManager.OnPageLoginSubmit);$(document).bind(Events.Login.PageSuccess,StatManager.OnPageLoginSuccess);$(document).bind(Events.Login.PageFail,StatManager.OnPageLoginFail);$(document).bind(Events.Login.WizardOpen,StatManager.OnWizardLoginOpen);$(document).bind(Events.Login.WizardSubmit,StatManager.OnWizardLoginSubmit);$(document).bind(Events.Login.WizardSuccess,StatManager.OnWizardLoginSuccess);$(document).bind(Events.Login.WizardFail,StatManager.OnWizardLoginFail);$(document).bind(Events.Login.WizardCancel,StatManager.OnWizardLoginCancel);$(document).bind(Events.Game.Play,StatManager.OnPlayClick);$(document).bind(Events.Game.PluginTrue,StatManager.OnPluginTrue);$(document).bind(Events.Game.PluginFalse,StatManager.OnPluginFalse);$(document).bind(Events.Game.SysReqTrue,StatManager.OnSysReqTrue);$(document).bind(Events.Game.SysReqFalse,StatManager.OnSysReqFalse);$(document).bind(Events.Game.SysReqFalseOverride,StatManager.OnSysReqFalseOverride);$(document).bind(Events.Game.Buy,StatManager.OnBuyClick);$(document).bind(Events.Game.Rent,StatManager.OnRentClick);$(document).bind(Events.Game.Tracker,StatManager.GameTracker);$(document).bind(Events.Game.ShortPlay,StatManager.OnShortPlay);$(document).bind(Events.Game.LongPlay,StatManager.OnLongPlay);$(document).bind(Events.Game.Details,StatManager.OnDetailPageLoad);$(document).bind(Events.Game.DetailsDemo,StatManager.OnDetailDemoPageLoad);$(document).bind(Events.Buy.WebMoney,StatManager.OnWebMoneyClick);$(document).bind(Events.Buy.YandexMoney,StatManager.OnYandexMoneyClick);$(document).bind(Events.Buy.Qiwi,StatManager.OnQiwiClick);$(document).bind(Events.Buy.MoneyMail,StatManager.OnMoneyMailClick);$(document).bind(Events.Buy.RbkMoney,StatManager.OnRbkMoneyClick);$(document).bind(Events.Buy.W1,StatManager.OnW1Click);$(document).bind(Events.Buy.PromoCode,StatManager.OnPromoCodeClick);$(document).bind(Events.Buy.Sms,StatManager.OnSmsClick);$(document).bind(Events.Buy.Open,StatManager.OnBuyOpen);$(document).bind(Events.Buy.Close,StatManager.OnBuyClose);$(document).bind(Events.Buy.Success,StatManager.OnBuySuccess);$(document).bind(Events.Buy.Fail,StatManager.OnBuyFail);}});;function PluginManager(){this.log=false;this.timeout=1000;this.status=null;this.subStatus=null;this.preloadTimeLeft=null;this.loadPercentsComplete=null;this.preloadPercentsLeft=null;this.loadSizeComplete=null;this.size=null;this.bandwidth=null;this.imageName=null;this.gameUUID=null;this.queryCatalog=null;this.DRM=null;this.init();}
PluginManager.prototype={init:function(){this.request=Function.createDelegate(this,this.Request);if(this.IsInstalled())
this.Request();},Connect:function(){setTimeout(this.request,this.timeout);},IsInstalled:function()
{return SysreqManager.IsPluginInit;},Request:function(){var query_status=ProdownFrame.player.queryStatus();var response=XMLEnvironment.createDocument();response.async=false;response.loadXML(query_status);this.QueryStatusOnReceive(response);this.Connect();},QueryStatusOnReceive:function(query_status){var status=$("Status",query_status).attr("status");var substatus=$("Status",query_status).attr("subStatus");substatus=(typeof substatus=="undefined")?null:substatus;var event_type=null;switch(status)
{case Events.Plugin.Idle:event_type=Events.Plugin.Idle;break;case Events.Plugin.Launched:case Events.Plugin.Loading:case Events.Plugin.Ready:this.SetLoadPercentsComplete(query_status);this.SetPreloadTimeLeft(query_status);this.SetPreloadPercentsLeft(query_status);this.SetBandwidth(query_status);this.SetLoadSizeComplete(query_status);if(this.status!=status)
this.SetImageName(query_status);if(this.subStatus!=substatus)
this.SetSize(query_status);this.SetGameUUID(query_status);event_type=status;break;case Events.Plugin.Stopping:event_type=Events.Plugin.Stopping;this.Reset();break;}
if(event_type!=null)
{if(this.status!=status||this.subStatus!=substatus)
{this.Log("Status change: "+this.status+" ("+this.subStatus+") > "+status+"("+substatus+")");this.status=status;this.subStatus=substatus;}
$(document).trigger({type:event_type},this.GetStatusData());}},Reset:function()
{this.preloadTimeLeft=null;this.loadPercentsComplete=null;this.preloadPercentsLeft=null;this.loadSizeComplete=null;this.size=null;this.bandwidth=null;this.imageName=null;this.queryCatalog=null;},SetGameUUID:function(query_status)
{var game_uuid=$("Game",query_status).attr("id");if(typeof game_uuid!=="undefined"&&game_uuid)
this.gameUUID=game_uuid;else
if(this.imageName!==null)
this.gameUUID=$("Game[image="+this.imageName+"]",this.getQueryCatalog()).attr("id");this.Log("Query: Game UUID: "+this.gameUUID);},SetLoadPercentsComplete:function(query_status)
{var read_point=$("Status",query_status).attr("readPoint");var end_point=$("Status",query_status).attr("endPoint");if(typeof read_point!=="undefined"&&end_point)
this.loadPercentsComplete=Math.floor((read_point/end_point)*100);this.Log("Query: Load percents complete: "+this.loadPercentsComplete);},SetPreloadPercentsLeft:function(query_status)
{if($("Status",query_status).attr("status")==Events.Plugin.Ready)
{this.preloadPercentsLeft=0;}
else
{var remaining_preload=$("Status",query_status).attr("remainingPreload");var end_point=$("Status",query_status).attr("endPoint");if(typeof remaining_preload!=="undefined"&&end_point)
this.preloadPercentsLeft=Math.floor((remaining_preload/end_point)*100);}
this.Log("Query: Preload percents left: "+this.preloadPercentsLeft);},SetPreloadTimeLeft:function(query_status)
{if($("Status",query_status).attr("status")==Events.Plugin.Ready)
{this.preloadTimeLeft=0;}
else
{var remaining_preload=$("Status",query_status).attr("remainingPreload");var current_bandwith=$("Status",query_status).attr("currentBandwidth");if(typeof remaining_preload!=="undefined"&&current_bandwith)
{this.preloadTimeLeft=remaining_preload/current_bandwith;}}
this.Log("Query: Preload time left: "+this.preloadTimeLeft);},SetBandwidth:function(query_status)
{var current_bandwidth=$("Status",query_status).attr("currentBandwidth");if(typeof current_bandwidth!=="undefined")
this.bandwidth=Math.round(current_bandwidth/1000);else
this.bandwidth=null;this.Log("Query: Bandwidth: "+this.bandwidth);},SetSize:function(query_status)
{var size=$("Status",query_status).attr("endPoint");if(typeof size!=="undefined")
this.size=size;else
this.size=null;this.Log("Query: Size: "+this.size);},SetLoadSizeComplete:function(query_status)
{if(this.size&&this.loadPercentsComplete)
this.loadSizeComplete=this.size*this.loadPercentsComplete/100;this.Log("Query: Size loaded: "+this.loadSizeComplete);},SetImageName:function(query_status)
{var image_name=$("Load",query_status).attr("image");if(typeof image_name!=="undefined")
this.imageName=image_name;else
this.imageName=null;this.Log("Query: Image name: "+this.imageName);},GetLoadPercentsComplete:function()
{return(this.loadPercentsComplete===null)?false:this.loadPercentsComplete;},GetStatusData:function()
{return{preloadTimeLeft:this.preloadTimeLeft,loadPercentsComplete:this.loadPercentsComplete,preloadPercentsLeft:this.preloadPercentsLeft,size:this.size,loadSizeComplete:this.loadSizeComplete,bandwidth:this.bandwidth,imageName:this.imageName,gameUUID:this.gameUUID};},Stop:function()
{ProdownFrame.Stop();},GetGameData:function(game_uuid)
{var $game=$(this.getQueryCatalogGameByUUID(game_uuid));if($game.length)
return{preloadTimeLeft:null,loadPercentsComplete:null,preloadPercentsLeft:null,size:null,loadSizeComplete:null,bandwidth:null,imageName:$game.attr("image")};return false;},getQueryCatalogGameByUUID:function(game_uuid)
{return $("Game[id="+game_uuid+"]",this.getQueryCatalog());},getQueryCatalog:function()
{if(true||this.queryCatalog===null)
{var query_catalog=this.getDRM().queryCatalog();var response=XMLEnvironment.createDocument();response.async=false;response.loadXML(query_catalog);this.queryCatalog=response;}
return this.queryCatalog;},getDRM:function()
{if(this.DRM===null)
this.DRM=new DRM();return this.DRM;},Log:function(message)
{if(this.log)
console.log("PluginManager: "+message);}}
var pluginManager={self:null,getInstance:function()
{if(this.self===null)
this.self=new PluginManager();return this.self;},init:function()
{this.getInstance();}}
$(document).ready(function(){pluginManager.init();});;function TextRotator(){this.fadingTime=700;this.pauseTime=(typeof(textRotatorPauseTime)!='undefined')?textRotatorPauseTime:2000;this.init();};TextRotator.prototype={init:function(){},Start:function(container,data){this.ProccessImgLoad(data);this.FadeInOutString(container,data,null);},FadeInOutString:function(container,data,index){var me=this;index=index==null?-1:index;container.hide().html(data[this.GetNextIndex(data,index)]).fadeIn(this.fadingTime,function(){window.setTimeout(function(){container.fadeOut(me.fadingTime,function(){me.FadeInOutString(container,data,me.GetNextIndex(data,index));});},me.pauseTime);});},GetNextIndex:function(data,index){return(index+1<data.length)?index+1:0;},ProccessImgLoad:function(data){for(var i=0;i<data.length-1;i++){var imgSrc=($('img',data[0]).prevObject[0])?$('img',data[0]).prevObject[0].src:null;if(imgSrc)$('<img />').attr('src',imgSrc);}}};$(document).ready(function(){textRotator=new TextRotator();});;var ZeroClipboard={version:"1.0.7",clients:{},moviePath:'ZeroClipboard.swf',nextId:1,$:function(thingy){if(typeof(thingy)=='string')thingy=document.getElementById(thingy);if(!thingy.addClass){thingy.hide=function(){this.style.display='none';};thingy.show=function(){this.style.display='';};thingy.addClass=function(name){this.removeClass(name);this.className+=' '+name;};thingy.removeClass=function(name){var classes=this.className.split(/\s+/);var idx=-1;for(var k=0;k<classes.length;k++){if(classes[k]==name){idx=k;k=classes.length;}}
if(idx>-1){classes.splice(idx,1);this.className=classes.join(' ');}
return this;};thingy.hasClass=function(name){return!!this.className.match(new RegExp("\\s*"+name+"\\s*"));};}
return thingy;},setMoviePath:function(path){this.moviePath=path;},dispatch:function(id,eventName,args){var client=this.clients[id];if(client){client.receiveEvent(eventName,args);}},register:function(id,client){this.clients[id]=client;},getDOMObjectPosition:function(obj,stopObj){var info={left:0,top:0,width:obj.width?obj.width:obj.offsetWidth,height:obj.height?obj.height:obj.offsetHeight};while(obj&&(obj!=stopObj)){info.left+=obj.offsetLeft;info.top+=obj.offsetTop;obj=obj.offsetParent;}
return info;},Client:function(elem){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId='ZeroClipboardMovie_'+this.id;ZeroClipboard.register(this.id,this);if(elem)this.glue(elem);}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:'',handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(elem,appendElem,stylesToAdd){this.domElement=ZeroClipboard.$(elem);var zIndex=99;if(this.domElement.style.zIndex){zIndex=parseInt(this.domElement.style.zIndex,10)+1;}
if(typeof(appendElem)=='string'){appendElem=ZeroClipboard.$(appendElem);}
else if(typeof(appendElem)=='undefined'){appendElem=document.getElementsByTagName('body')[0];}
var box=ZeroClipboard.getDOMObjectPosition(this.domElement,appendElem);this.div=document.createElement('div');var style=this.div.style;style.position='absolute';style.left=''+box.left+'px';style.top=''+box.top+'px';style.width=''+box.width+'px';style.height=''+box.height+'px';style.zIndex=zIndex;if(typeof(stylesToAdd)=='object'){for(addedStyle in stylesToAdd){style[addedStyle]=stylesToAdd[addedStyle];}}
appendElem.appendChild(this.div);this.div.innerHTML=this.getHTML(box.width,box.height);},getHTML:function(width,height){var html='';var flashvars='id='+this.id+'&width='+width+'&height='+height;if(navigator.userAgent.match(/MSIE/)){var protocol=location.href.match(/^https/i)?'https://':'http://';html+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';}
else{html+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';}
return html;},hide:function(){if(this.div){this.div.style.left='-2000px';}},show:function(){this.reposition();},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML='';var body=document.getElementsByTagName('body')[0];try{body.removeChild(this.div);}catch(e){;}
this.domElement=null;this.div=null;}},reposition:function(elem){if(elem){this.domElement=ZeroClipboard.$(elem);if(!this.domElement)this.hide();}
if(this.domElement&&this.div){var box=ZeroClipboard.getDOMObjectPosition(this.domElement);var style=this.div.style;style.left=''+box.left+'px';style.top=''+box.top+'px';}},setText:function(newText){this.clipText=newText;if(this.ready)this.movie.setText(newText);},addEventListener:function(eventName,func){eventName=eventName.toString().toLowerCase().replace(/^on/,'');if(!this.handlers[eventName])this.handlers[eventName]=[];this.handlers[eventName].push(func);},setHandCursor:function(enabled){this.handCursorEnabled=enabled;if(this.ready)this.movie.setHandCursor(enabled);},setCSSEffects:function(enabled){this.cssEffects=!!enabled;},receiveEvent:function(eventName,args){eventName=eventName.toString().toLowerCase().replace(/^on/,'');switch(eventName){case'load':this.movie=document.getElementById(this.movieId);if(!this.movie){var self=this;setTimeout(function(){self.receiveEvent('load',null);},1);return;}
if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var self=this;setTimeout(function(){self.receiveEvent('load',null);},100);this.ready=true;return;}
this.ready=true;this.movie.setText(this.clipText);this.movie.setHandCursor(this.handCursorEnabled);break;case'mouseover':if(this.domElement&&this.cssEffects){this.domElement.addClass('hover');if(this.recoverActive)this.domElement.addClass('active');}
break;case'mouseout':if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass('active')){this.domElement.removeClass('active');this.recoverActive=true;}
this.domElement.removeClass('hover');}
break;case'mousedown':if(this.domElement&&this.cssEffects){this.domElement.addClass('active');}
break;case'mouseup':if(this.domElement&&this.cssEffects){this.domElement.removeClass('active');this.recoverActive=false;}
break;}
if(this.handlers[eventName]){for(var idx=0,len=this.handlers[eventName].length;idx<len;idx++){var func=this.handlers[eventName][idx];if(typeof(func)=='function'){func(this,args);}
else if((typeof(func)=='object')&&(func.length==2)){func[0][func[1]](this,args);}
else if(typeof(func)=='string'){window[func](this,args);}}}}};;var Xml2Object=Xml2Object||{};Xml2Object.parseXML=function(xml){return Xml2Object.getObject(xml.documentElement,{});}
Xml2Object.getAttributes=function(node,obj){if(node.attributes.length>0){for(var i=0;i<node.attributes.length;i++){var attribute=node.attributes[i];obj[attribute.nodeName]=attribute.nodeValue;}}}
Xml2Object.getText=function(node,obj){return node.text;}
Xml2Object.getObject=function(node,obj){Xml2Object.getAttributes(node,obj);if(node.childNodes.length!=1){var children=new Array();for(var i=0;i<node.childNodes.length;i++){var child=node.childNodes[i];if(child.nodeType==1){children.push(Xml2Object.getObject(child,{}));}}
obj.children=children;}
else{obj.text=Xml2Object.getText(node,obj);}
return obj;};function Spinner(){this.template='<i class="spinner {size} {color}" id="{randomId}"><i></i></i>';this.delay=110;this.documentId=null;this.isRunning=false;this.target=null;this.init();};var Spinner=Spinner||{};Spinner.Size={Big:{Name:'big',Value:32,Frames:11},Small:{Name:'small',Value:16,Frames:11}};Spinner.prototype={init:function(){},Animate:function(preloader,preloaderImg,size,frames)
{try
{var me=this;var curTop=preloaderImg.offset().top-preloader.offset().top;var newTop=curTop<=(size*(-frames))?0:curTop-size;preloaderImg.css('margin-top',newTop.Pixels());if(preloader.is(':visible')&&this.isRunning)
{setTimeout(function(){me.Animate(preloader,preloaderImg,size,frames)},this.delay);}}
catch(err)
{alert(err);}},Start:function(target,size,color)
{var me=this;this.target=target;this.documentId=String.RandomString(7);$(target).append(this.template.template({size:size.Name,randomId:this.documentId,color:color}));var preloader=$('#'+this.documentId).css({'margin-left':((target.width()-size.Value)/2).Pixels(),'margin-top':((target.height()-size.Value)/2).Pixels()});var preloaderImg=preloader.children();target.block({message:null});this.isRunning=true;this.Animate(preloader,preloaderImg,size.Value,size.Frames);},Stop:function()
{var me=this;this.isRunning=false;$('#'+this.documentId).remove();this.target.unblock({onUnblock:function(){me.target=null;}});}};;var players=[];function player_register($player){players[players.length]=$player;}
function players_refresh(){var i,l=players.length;for(i=0;i<l;i++){players[i].Refresh();}}
function Player(){var type="highlights";var id=0;if(genre_page!=="false"){type="genre";id=genre_page;}
if(game_page!==false){type="game";id=document.getElementById('buy_but').getAttribute("uuid");}
if(publisher_page!=="false"){type="publisher";id=publisher_page;}
this.container=null;this.previewContainer=null;this.middleContainer=null;this.url=('{cur_page}/classes/player.php?id={id}&type={type}').template({cur_page:cur_page,id:id,type:type});this.data=null;this.timer=null;this.middleContainerTemplate='<div class="view"></div>';this.previewContainerTemplate='<div class="preview"></div>';this.scrollContainerTemplate='<div class="scroll-pane"></div>';this.menuItemTemplate='<div class="bg_menu"></div><div class="menu">{items}</div>';this.menuItemDelimiterTemplate='<span>|</span>';this.titleTemplate='<div class="bg_title"></div><div class="title"><span>{title}</span></div>';this.commonLinkTemplate='<a href="{link}">{title}</a>';this.cachedImageCount=0;this.init();};Player.prototype={init:function(){this.onGetData=Function.createDelegate(this,this.OnGetData);this.goToNextSlide=Function.createDelegate(this,this.GoToNextSlide);},Start:function(container){player_register(this);this.container=$(container);this.middleContainer=$(this.middleContainerTemplate).appendTo(this.container);this.previewContainer=$(this.previewContainerTemplate).appendTo(this.container);this.scrollContainer=$(this.scrollContainerTemplate).appendTo(this.previewContainer);this.GetData();},Refresh:function(){var nodes=$('li[showRegistered=false]',this.previewContainer);if(!userManager.IsAnonym()){nodes.hide();}else{nodes.show();};$('ul li:visible:first',this.previewContainer).click();},GetData:function(){var me=this;$.ajax({url:this.url,success:function(data){me.onGetData($(data));},error:function(data){me.Remove();}});},OnGetData:function(data){if(data.length==0)
this.Remove();else if(!data.children("items").length){this.container.html($(data));if($(data).hasClass("preorder"))
this.container.addClass("preorder").append("<span class='preorder-stripe' />");}
else this.ImageCache(data);},Remove:function(){var me=this;this.container.animate({height:0},'slow',function(){me.container.remove();});},ImageCache:function(data){var me=this;var images=new Array();var spinner=new Spinner();spinner.Start(this.container,Spinner.Size.Big);$.each($('images,image',data).children('[src]'),function(){var src=$(this).attr('src');if(src.length>0&&!images.contains(src)){images.push(src);};});this.cachedImageCount=images.length;$.cacheImage(images,{complete:function(e){me.cachedImageCount--;if(me.cachedImageCount==1){spinner.Stop();me.OnImageCache(data);}}});},OnImageCache:function(data){this.AddPreviewImages(data);this.scrollContainer.jScrollPane({showArrows:true,reinitialiseOnImageLoad:true,scrollbarWidth:4,animateTo:true,animateStep:2,animateInterval:40});this.previewContainer.mouseenter(function(){$('.jScrollPaneTrack',this.scrollContainer).show();$('.jScrollArrowUp',this.scrollContainer).show();$('.jScrollArrowDown',this.scrollContainer).show();}).mouseleave(function(){$('.jScrollPaneTrack',this.scrollContainer).hide();$('.jScrollArrowUp',this.scrollContainer).hide();$('.jScrollArrowDown',this.scrollContainer).hide();});$('ul li:visible:first',this.previewContainer).click();},ChangeMiddle:function(node){var me=this;var middleNode=this.GetImageNode(node,'middle');var largeNode=this.GetImageNode(node,'large');var middleImageLinkNode=this.GetLinkNode(node,'middleImage');var image=$(new Image());image.attr({src:middleNode.attr('src'),width:middleNode.attr('width'),height:middleNode.attr('height'),alt:middleNode.attr('alt')}).addClass('gray').css({width:middleNode.attr('width'),height:middleNode.attr('height')});this.middleContainer.fadeOut('fast',function(obj,node){return function(){var temp=middleImageLinkNode.length>0?$(obj.commonLinkTemplate.template({title:String.Empty,link:obj.GetLink(middleImageLinkNode.attr('href'))})).append(image):image;temp.mouseenter(function(){window.clearTimeout(me.timer)}).mouseleave(function(){me.timer=window.setTimeout(me.goToNextSlide,node.attr('delay'));});me.middleContainer.removeClass("preorder").children().remove();if($(node).attr("preorder")==1){temp.append("<span class='preorder-stripe' />");}
me.middleContainer.append(temp);var viewMenuHtml=me.GetViewMenuHtml(node);if(viewMenuHtml!=null){me.middleContainer.append(viewMenuHtml);}
var viewTitleHtml=me.GetViewTitleHtml(node);if(viewTitleHtml!=null)me.middleContainer.append(viewTitleHtml);me.middleContainer.fadeIn('fast');}}(this,node));},AddPreviewImages:function(data){var head=$('<ul></ul>');var nodes=data.find('item');for(var i=0;i<nodes.length;i++){var itemNode=$(nodes[i]);var showRegisteredAttr=itemNode.attr('showRegistered');var showRegistered=Boolean.parse(showRegisteredAttr==undefined?'true':showRegisteredAttr);var smallNode=this.GetImageNode(itemNode,'small');var listItem=$('<li></li>').attr('showRegistered',showRegistered).click(Function.createCallback(this.OnPreviewClick,{context:this,itemNode:itemNode}));if((!userManager.IsAnonym()&&!showRegistered))listItem.hide();var image=$(new Image()).attr({src:smallNode.attr('src'),width:smallNode.attr('width'),height:smallNode.attr('height')}).load(function(height,width){return function(){$(this).width(width);$(this).height(height);}},(smallNode.attr('height'),smallNode.attr('width')));head.append(listItem.append(image));this.scrollContainer.append(head);};},OnPreviewClick:function(obj,context){with(context){window.clearTimeout(context.timer);$('ul,li',context.previewContainer).removeClass('selected');$(obj.currentTarget).addClass('selected');context.ChangeMiddle(itemNode);context.timer=window.setTimeout(context.goToNextSlide,itemNode.attr('delay'));};},GetLink:function(link){return'{cur_page}{language}{link}'.template({cur_page:cur_page,language:language,link:link});},GoToNextSlide:function(){var nextElement=$('li.selected ~ li:visible:first',this.previewContainer);nextElement=nextElement.length>0?nextElement:$('ul li:visible:first',this.previewContainer);if(this.scrollContainer[0].scrollTo)
this.scrollContainer[0].scrollTo(nextElement.selector);nextElement.click();},GetImageNode:function(node,size){return $('images,image',node).children('[size={size}]'.template({size:size}));},GetLinkNode:function(node,type){return $('links,link',node).children('[type={type}]'.template({type:type}));},GetMenuNode:function(node,type){var menuNode=$('menus,menu',node);return(menuNode)?menuNode.children('[type={type}]'.template({type:type})):null;},GetViewMenuHtml:function(node){var menuNode=this.GetMenuNode(node,'view');var result=String.Empty;if(menuNode.length>0){var menuItems=menuNode.attr('content').split(',');var temp=new Array();for(var i=0;i<menuItems.length;i++){var linkNode=this.GetLinkNode(node,menuItems[i]);temp.push(this.commonLinkTemplate.template({link:this.GetLink(linkNode.attr('href')),title:linkNode.attr('title')}));};result=this.menuItemTemplate.template({items:temp.join(this.menuItemDelimiterTemplate)});};return result==String.Empty?null:result;},GetViewTitleHtml:function(node){var title=node.attr('title');return title==String.Empty?null:this.titleTemplate.template({title:title});}};;function Progressbar(wrapper,game_uuid,image_name){this.log=false;this.container="<div></div>";this.wrapper=$(wrapper);this.bar=null;this.progress=null;this.progressPercents=null;this.progressSize=null;this.imageName=image_name;this.gameUUID=game_uuid;this.preloadTimeLeft=null;this.loadPercentsComplete=null;this.loadSizeComplete=null;this.size=null;this.sizeMode="MB";this.preloadPercentsLeft=null;this.bandwidth=null;this.Init();}
Progressbar.prototype={Init:function()
{this.bar=$(this.container).addClass("bar").appendTo(this.wrapper);this.progress=$(this.container).addClass("progress").appendTo(this.bar);this.preload=$(this.container).addClass("preload").appendTo(this.bar);$("<em />").appendTo(this.preload);this.progressPercents=$(this.container).addClass("progress-percents").appendTo(this.wrapper);this.progressSize=$(this.container).addClass("progress-size").appendTo(this.wrapper);this.refresh=Function.createDelegate(this,this.Refresh);this.onPlayClick=Function.createDelegate(this,this.OnPlayClick);$(document).bind(Events.Plugin.Loading,this.refresh);$(document).bind(Events.Plugin.Ready,this.refresh);$(document).bind(Events.Plugin.Launched,this.refresh);$(document).bind(Events.GameList.GamePlay,this.onPlayClick);},OnPlayClick:function(progress_event,game_uuid)
{if(game_uuid==this.gameUUID)
{if(this.loadPercentsComplete===null)
{this.loadPercentsComplete=0;this.Redraw();}}},Refresh:function(progress_event,progress_data)
{if(progress_data.imageName==this.imageName||progress_data.gameUUID==this.gameUUID)
{if((typeof progress_data.preloadTimeLeft!=="undefined")&&progress_data.preloadTimeLeft!==null)
this.preloadTimeLeft=progress_data.preloadTimeLeft;if((typeof progress_data.loadPercentsComplete!=="undefined")&&progress_data.loadPercentsComplete!==null)
this.loadPercentsComplete=progress_data.loadPercentsComplete;if((typeof progress_data.preloadPercentsLeft!=="undefined")&&progress_data.preloadPercentsLeft!==null)
this.preloadPercentsLeft=progress_data.preloadPercentsLeft;if(progress_data.bandwidth)
this.bandwidth=progress_data.bandwidth;if(progress_data.loadSizeComplete)
this.loadSizeComplete=progress_data.loadSizeComplete;if((typeof progress_data.size!=="undefined")&&progress_data.size!==null)
{this.size=progress_data.size;if((this.size/1048576)>1000)
this.sizeMode="GB";}
this.Redraw();}},Redraw:function()
{if(this.preloadPercentsLeft===0)
this.progress.addClass("preloaded");if(this.loadPercentsComplete!==null)
{this.progress.css("width",this.loadPercentsComplete+"%");this.progressPercents.html(this.loadPercentsComplete+"%");}
if(this.preloadPercentsLeft)
this.preload.css("width",this.preloadPercentsLeft+"%").show();else
this.preload.hide();if(this.size!==null||this.loadSizeComplete!==null)
this.progressSize.html(this.ViewSize(this.loadSizeComplete)+" / "+this.ViewSize(this.size));},ViewSize:function(bytes)
{var size=bytes/1048576;var label="MB";if(this.sizeMode=="GB")
{size=Math.round(size/10.24)/100;label="GB";}
else
size=Math.round(size);return size+" "+label;}};function GameList(wrapper){this.container="<div></div>";this.wrapper=$(wrapper);this.GetGridWrapper().html("");this.games=new Array();this.shopUUID=shop_id||"";this.userPage=cur_page||"";this.userLanguage=language||"";this.classes={loading:"is-loading"};this.Init();}
GameList.prototype={Init:function()
{this.draw=Function.createDelegate(this,this.Draw);this.resort=Function.createDelegate(this,this.Resort);if(pluginManager.getInstance().IsInstalled())
{var catalog=pluginManager.getInstance().getQueryCatalog();var game_uuids=new Array();var games=$("Game",catalog),l=games.length,i;for(i=0;i<l;i++)
game_uuids.push($(games[i]).attr("id"));this.wrapper.children().hide();this.wrapper.addClass(this.classes.loading);$.ajax({type:"POST",dataType:'json',url:"{cur_page}/classes/gamelist.php?lang={lang}".template({cur_page:this.userPage,lang:this.userLanguage}),data:'catalog='+$.toJSON(game_uuids),success:this.draw});}
else
{this.wrapper.addClass("message").html(plugin_error);this.wrapper.removeClass(this.classes.loading);(new SysReqForm()).ShowForm(Function.emptyFunction,Function.emptyFunction);}},GetGridWrapper:function()
{return $(".games-grid tbody",this.wrapper);},Draw:function(games_data)
{if(games_data)
{$(document).bind(Events.GameList.GamePlay,this.resort);var l=games_data.length,i;var grid_wrapper=this.GetGridWrapper();this.wrapper.children(".error").remove();this.wrapper.removeClass("message").children().show();for(i=0;i<l;i++)
this.games.push(new GameRow(games_data[i]));l=this.games.length;for(i=0;i<l;i++)
{grid_wrapper.append(this.games[i].GetView());}}
else
{this.wrapper.children().hide();$("<span />").addClass("error").text(no_games_installed).appendTo(this.wrapper.addClass("message"));}
this.wrapper.removeClass(this.classes.loading);},Resort:function(e,loading_game_uuid)
{}}
function GameRow(game){this.game=game;this.Init();}
GameRow.prototype={Init:function()
{this.check=Function.createDelegate(this,this.Check);this.quit=Function.createDelegate(this,this.Quit);this.bindQuit=Function.createDelegate(this,this.BindQuit);this.controlsOnPlayClick=Function.createDelegate(this,this.ControlsOnPlayClick);this.controlsOnBuyClick=Function.createDelegate(this,this.ControlsOnBuyClick);this.controlsOnRentClick=Function.createDelegate(this,this.ControlsOnRentClick);this.controlsOnSubscribeClick=Function.createDelegate(this,this.ControlsOnSubscribeClick);this.controlsOnDeleteClick=Function.createDelegate(this,this.ControlsOnDeleteClick);this.play=Function.createDelegate(this,this.Play);this.wrapper=$("<tr />").addClass("game-row");this.container="<td />";this.progressbar=null;this.controls=null;this.controls_play=null;this.is_playing=false;this.is_checked=false;this.view=null;},GetView:function()
{if(this.view==null)
{var game_info=$(this.container).addClass("game-info");var game_description=$("<p />").html(this.game.title);if(this.game.img)
$("<img />").attr("src",this.game.img).prependTo(game_info);game_description.appendTo(game_info)
var game_progress=$(this.container).addClass("game-progress");var progressbar=$("<div />").addClass("progressbar");this.progressbar=new Progressbar(progressbar,this.game.uuid,this.game.image_name);progressbar.appendTo(game_progress);this.controls=$(this.container).addClass("game-controls");var game_controls_wrapper=$("<ul />").addClass("game-man");this.controls_play=$("<li />").addClass("stopped");$(document).one(Events.Plugin.Loading,this.check);$(document).one(Events.Plugin.Ready,this.check);$(document).one(Events.Plugin.Launched,this.check);$("<a />").addClass("game-btn-playback").click(this.controlsOnPlayClick).appendTo(this.controls_play);this.controls_play.appendTo(game_controls_wrapper);if(this.game.actions.buy&&this.game.actions.buy!==false)
{var controls_buy=$("<li />");$("<a />").addClass("game-btn-buy").click(this.controlsOnBuyClick).appendTo(controls_buy);controls_buy.appendTo(game_controls_wrapper);}
if(this.game.actions.subscribe&&this.game.actions.subscribe!==false)
{var controls_subscribe=$("<li />");$("<a />").addClass("game-btn-subscribe").click(this.controlsOnSubscribeClick).appendTo(controls_subscribe);controls_subscribe.appendTo(game_controls_wrapper);}
if(this.game.actions.rent&&this.game.actions.rent!==false)
{var controls_rent=$("<li />");$("<a />").addClass("game-btn-rent").click(this.controlsOnRentClick).appendTo(controls_rent);controls_rent.appendTo(game_controls_wrapper);}
var controls_delete=$("<li />");$("<a />").addClass("game-btn-delete").click(this.controlsOnDeleteClick).appendTo(controls_delete);controls_delete.appendTo(game_controls_wrapper);game_controls_wrapper.appendTo(this.controls);this.view=this.wrapper.append(game_info).append(game_progress).append(this.controls);}
return this.view;},Check:function(e,data)
{if((e.type==Events.Plugin.Loading||e.type==Events.Plugin.Ready||e.type==Events.Plugin.Launched)&&!this.is_checked&&!this.is_playing&&data.imageName==this.game.image_name)
{this.is_checked=true;this.Refresh();}
this.is_checked=true;},Quit:function(e,data)
{if(e.type==Events.Plugin.Stopping&&this.is_playing)
this.Refresh();},BindQuit:function(e,data)
{if((e.type==Events.Plugin.Loading||e.type==Events.Plugin.Ready||e.type==Events.Plugin.Launched)&&this.is_playing)
$(document).one(Events.Plugin.Stopping,this.quit);},Refresh:function()
{if(this.is_playing==true)
{$(document).unbind(Events.GameList.GamePlay,this.controlsOnPlayClick);this.is_playing=false;$(document).unbind(Events.Plugin.Loading,this.bindQuit);$(document).unbind(Events.Plugin.Stopping,this.quit);this.controls_play.removeClass("playing").addClass("stopped");}
else
{$(document).one(Events.GameList.GamePlay,this.controlsOnPlayClick);this.is_playing=true;$(document).one(Events.Plugin.Loading,this.bindQuit);$(document).one(Events.Plugin.Stopping,this.bindQuit);this.controls_play.removeClass("stopped").addClass("playing");}},ControlsOnPlayClick:function()
{if(this.is_playing==true)
{this.Refresh();this.Stop();}
else
{$(document).trigger(Events.GameList.GamePlay,this.game.uuid);this.Refresh();$(document).one(Events.Plugin.Idle,this.play);}},ControlsOnBuyClick:function()
{buyWizard.Start(null,null,{uuid:this.game.uuid,pp_param:"game_id"});},ControlsOnSubscribeClick:function()
{buyWizard.Start(Function.emptyFunction,Function.emptyFunction,{uuid:this.game.actions.subscribe,pp_param:'sub_id'});},ControlsOnRentClick:function()
{buyWizard.Start(Function.emptyFunction,Function.emptyFunction,{uuid:this.game.actions.rent,pp_param:'rent_id',game_id:this.game.uuid,free_rent:this.game.actions.rent_free});},ControlsOnDeleteClick:function()
{GameManager.OnDeleteClick($("<a />").attr(GameManager.Attributes.uuid,this.game.uuid));},Stop:function()
{ProdownFrame.Stop();},Play:function()
{if(!this.is_playing)
return false;Cookie.Set('autoStart','true',{path:'/'});SysreqManager.CheckStatus();SysreqManager.CurrentGameReq=this.game.software;(new SysReqForm()).ShowForm(Function.emptyFunction,Function.emptyFunction,$("<a />").attr("uuid",this.game.uuid).attr("license1",this.game.license).attr("license",this.game.license).get(0));}};function Showcase(wrapper){this.wrapper=$(wrapper);this.games_per_row=3;this.userPage=cur_page||"";this.userLanguage=language||"";this.gridWrapperContainer="<table />";this.gridItemWrapperContainer="<tr />";this.classes={loading:"is-loading",showcase:"showcase-grid"};this.Init();}
Showcase.prototype={Init:function()
{this.draw=Function.createDelegate(this,this.Draw);this.games=new Array();this.wrapper.addClass(this.classes.loading);$.ajax({type:"POST",url:"{cur_page}/classes/showcase.php?lang={lang}".template({cur_page:this.userPage,lang:this.userLanguage}),success:this.draw});},GetGridWrapper:function()
{if(!$("."+this.classes.showcase,this.wrapper).length)
this.wrapper.append($(this.gridWrapperContainer).addClass(this.classes.showcase));return $("."+this.classes.showcase,this.wrapper);},Draw:function(games_data)
{this.wrapper.html(games_data).removeClass(this.classes.loading);}}
function ShowcaseGame(game){this.game=game;this.wrapperContainer="<td />";this.Init();}
ShowcaseGame.prototype={Init:function()
{this.view=null;},GetView:function()
{if(this.view==null)
{var $game_title=$("<a />").addClass("header").attr("href",this.game.link).attr("title",this.game.title).text(this.game.title);var $game_img=$("<a />").addClass("teaser").attr("href",this.game.link).attr("title",this.game.title).append($("<img />").load(function(){$(this).height(119).width(206).show()}).attr("src",this.game.img).attr("alt",this.game.title).height(119).width(206).hide());var $action_link=$("<a />").attr("title",this.game.actions.label).text(this.game.actions.label);if(this.game.actions.buy)
$action_link.attr("href",this.game.actions.buy);if(this.game.actions.play)
$action_link.attr("href",this.game.actions.play);var $action=$("<li />").addClass("controls-action").append($action_link);var $details=$("<li />").addClass("controls-details").append($("<a />").attr("title",this.game.link_label).text(this.game.link_label).attr("href",this.game.link));var $game_controls=$("<div />").append($("<ul />").append($action).append($details)).addClass("controls");this.view=$(this.wrapperContainer).append($("<div />").addClass("wrapper").append($game_title).append($game_img).append($game_controls));}
return this.view;}};(function(A){A.jScrollPane={active:[]};A.fn.jScrollPane=function(C){C=A.extend({},A.fn.jScrollPane.defaults,C);var B=function(){return false};return this.each(function(){var O=A(this);O.css("overflow","hidden");var X=this;if(A(this).parent().is(".jScrollPaneContainer")){var Ac=C.maintainPosition?O.position().top:0;var L=A(this).parent();var d=L.innerWidth();var Ad=L.outerHeight();var M=Ad;A(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",L).remove();O.css({top:0})}else{var Ac=0;this.originalPadding=O.css("paddingTop")+" "+O.css("paddingRight")+" "+O.css("paddingBottom")+" "+O.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(O.css("paddingLeft"))||0)+(parseInt(O.css("paddingRight"))||0);var d=O.innerWidth();var Ad=O.innerHeight();var M=Ad;O.wrap(A("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:Ad+"px",width:d+"px"}));A(document).bind("emchange",function(Ae,Af,p){O.jScrollPane(C)})}if(C.reinitialiseOnImageLoad){var N=A.data(X,"jScrollPaneImagesToLoad")||A("img",O);var G=[];if(N.length){N.each(function(p,Ae){A(this).bind("load",function(){if(A.inArray(p,G)==-1){G.push(Ae);N=A.grep(N,function(Ag,Af){return Ag!=Ae});A.data(X,"jScrollPaneImagesToLoad",N);C.reinitialiseOnImageLoad=false;O.jScrollPane(C)}}).each(function(Af,Ag){if(this.complete||this.complete===undefined){this.src=this.src}})})}}var o=this.originalSidePaddingTotal;var l={height:"auto",width:d-C.scrollbarWidth-C.scrollbarMargin-o+"px"};if(C.scrollbarOnLeft){l.paddingLeft=C.scrollbarMargin+C.scrollbarWidth+"px"}else{l.paddingRight=C.scrollbarMargin+"px"}O.css(l);var m=O.outerHeight();var i=Ad/m;if(i<0.99){var H=O.parent();H.append(A("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:C.scrollbarWidth+"px"}),A("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:C.scrollbarWidth+"px"}))));var z=A(">.jScrollPaneTrack",H);var P=A(">.jScrollPaneTrack .jScrollPaneDrag",H);if(C.showArrows){var g;var Ab;var S;var r;var j=function(){if(r>4||r%4==0){y(u+Ab*b)}r++};var K=function(p){A("html").unbind("mouseup",K);g.removeClass("jScrollActiveArrowButton");clearInterval(S)};var Z=function(){A("html").bind("mouseup",K);g.addClass("jScrollActiveArrowButton");r=0;j();S=setInterval(j,100)};H.append(A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:C.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){g=A(this);Ab=-1;Z();this.blur();return false}).bind("click",B),A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:C.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){g=A(this);Ab=1;Z();this.blur();return false}).bind("click",B));var Q=A(">.jScrollArrowUp",H);var J=A(">.jScrollArrowDown",H);if(C.arrowSize){M=Ad-C.arrowSize-C.arrowSize;z.css({height:M+"px",top:C.arrowSize+"px"})}else{var s=Q.height();C.arrowSize=s;M=Ad-s-J.height();z.css({height:M+"px",top:s+"px"})}}var w=A(this).css({position:"absolute",overflow:"visible"});var D;var Y;var b;var u=0;var V=i*Ad/2;var a=function(Ae,Ag){var Af=Ag=="X"?"Left":"Top";return Ae["page"+Ag]||(Ae["client"+Ag]+(document.documentElement["scroll"+Af]||document.body["scroll"+Af]))||0};var f=function(){return false};var v=function(){n();D=P.offset(false);D.top-=u;Y=M-P[0].offsetHeight;b=2*C.wheelSpeed*Y/m};var E=function(p){v();V=a(p,"Y")-u-D.top;A("html").bind("mouseup",T).bind("mousemove",h);if(A.browser.msie){A("html").bind("dragstart",f).bind("selectstart",f)}return false};var T=function(){A("html").unbind("mouseup",T).unbind("mousemove",h);V=i*Ad/2;if(A.browser.msie){A("html").unbind("dragstart",f).unbind("selectstart",f)}};var y=function(Ae){Ae=Ae<0?0:(Ae>Y?Y:Ae);u=Ae;P.css({top:Ae+"px"});var Af=Ae/Y;w.css({top:((Ad-m)*Af)+"px"});O.trigger("scroll");if(C.showArrows){Q[Ae==0?"addClass":"removeClass"]("disabled");J[Ae==Y?"addClass":"removeClass"]("disabled")}};var h=function(p){y(a(p,"Y")-D.top-V)};var q=Math.max(Math.min(i*(Ad-C.arrowSize*2),C.dragMaxHeight),C.dragMinHeight);P.css({height:q+"px"}).bind("mousedown",E);var k;var R;var I;var t=function(){if(R>8||R%4==0){y((u-((u-I)/2)))}R++};var Aa=function(){clearInterval(k);A("html").unbind("mouseup",Aa).unbind("mousemove",e)};var e=function(p){I=a(p,"Y")-D.top-V};var U=function(p){v();e(p);R=0;A("html").bind("mouseup",Aa).bind("mousemove",e);k=setInterval(t,100);t()};z.bind("mousedown",U);H.bind("mousewheel",function(Ae,Ag){v();n();var Af=u;y(u-Ag*b);var p=Af!=u;return!p});var F;var W;function c(){var p=(F-u)/C.animateStep;if(p>1||p<-1){y(u+p)}else{y(F);n()}}var n=function(){if(W){clearInterval(W);delete F}};var x=function(Af,p){if(typeof Af=="string"){$e=A(Af,O);if(!$e.length){return}Af=$e.offset().top-O.offset().top}H.scrollTop(0);n();var Ae=-Af/(Ad-m)*Y;if(p||!C.animateTo){y(Ae)}else{F=Ae;W=setInterval(c,C.animateInterval)}};O[0].scrollTo=x;O[0].scrollBy=function(Ae){var p=-parseInt(w.css("top"))||0;x(p+Ae)};v();x(-Ac,true);A("*",this).bind("focus",function(Ah){var Ag=A(this);var Aj=0;while(Ag[0]!=O[0]){Aj+=Ag.position().top;Ag=Ag.offsetParent()}var p=-parseInt(w.css("top"))||0;var Ai=p+Ad;var Af=Aj>p&&Aj<Ai;if(!Af){var Ae=Aj-C.scrollbarMargin;if(Aj>p){Ae+=A(this).height()+15+C.scrollbarMargin-Ad}x(Ae)}});if(location.hash){x(location.hash)}A(document).bind("click",function(Ae){$target=A(Ae.target);if($target.is("a")){var p=$target.attr("href");if(p.substr(0,1)=="#"){x(p)}}});A.jScrollPane.active.push(O[0])}else{O.css({height:Ad+"px",width:d-this.originalSidePaddingTotal+"px",padding:this.originalPadding});O.parent().unbind("mousewheel")}})};A.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};A(window).bind("unload",function(){var C=A.jScrollPane.active;for(var B=0;B<C.length;B++){C[B].scrollTo=C[B].scrollBy=null}})})(jQuery);;function BuyWizard(){this.init();};BuyWizard.prototype={init:function(){},Start:function(onSucces,onFail,obj){if(obj.license_type=="preorder")
obj.pp_param='game_id';$(document).trigger({type:Events.Game.Buy});var me=this;userManager.IsAnonym()?this.ShowRegister(Function.createDelegate({onSucces:onSucces,onFail:onFail,context:obj},function(){if(obj.pp_param=='game_id'){obj.anonim=true;$.ajax({type:"GET",url:'{cur_page}/classes/check_game.php?id={game_id}'.template({cur_page:cur_page,game_id:obj.uuid}),success:function(data){if(data!='OK'){me.ShowBuyWindow(this.onSucces,this.onFail,obj);}
else{var infoForm=new InfoForm();infoForm.ShowForm(function(){ReloadWindow(null,false);},Function.emptyFunction,{header:boughtGameHeader,message:boughtGameBody});}},error:WindowManager.ShowErrorWindow});}
else me.ShowBuyWindow(this.onSucces,this.onFail,obj);}),onFail,obj):this.ShowBuyWindow(onSucces,onFail,obj);},ShowLogin:function(onSucces,onFail,obj){var loginForm=new LoginForm();loginForm.ShowForm(onSucces,onFail,obj);},ShowRegister:function(onSucces,onFail,obj){var registerForm=new SimpleRegisterForm();registerForm.ShowForm(onSucces,onFail,obj);},ShowRemind:function(onSucces,onFail,obj){var remindForm=new RemindForm();remindForm.ShowForm(onSucces,onFail,obj);},ShowBuyWindow:function(onSucces,onFail,obj){var buyWindow=new BuyWindow();buyWindow.ShowForm(onSucces,onFail,obj);}};$(document).ready(function(){buyWizard=new BuyWizard();});;function LoginWizard(){this.init();};LoginWizard.prototype={init:function(){},Start:function(onSucces,onFail,obj){userManager.IsAnonym()?this.ShowRegister(onSucces,onFail,obj):onFail();},ShowLogin:function(onSucces,onFail,obj){var loginForm=new LoginForm();loginForm.ShowForm(onSucces,onFail,obj);},ShowRegister:function(onSucces,onFail,obj){var registerForm=new RegisterForm();registerForm.ShowForm(onSucces,onFail,obj);},ShowRemind:function(onSucces,onFail,obj){var remindForm=new RemindForm();remindForm.ShowForm(onSucces,onFail,obj);}};$(document).ready(function(){loginWizard=new LoginWizard();});;var uagent=navigator.userAgent.toLowerCase();var is_safari=((uagent.indexOf('safari')!=-1)||(navigator.vendor=="Apple Computer, Inc."));var is_opera=(uagent.indexOf('opera')!=-1);var is_webtv=(uagent.indexOf('webtv')!=-1);var is_ie=((uagent.indexOf('msie')!=-1)&&(!is_opera)&&(!is_safari)&&(!is_webtv));var is_ie4=((is_ie)&&(uagent.indexOf("msie 4.")!=-1));var is_moz=((navigator.product=='Gecko')&&(!is_opera)&&(!is_webtv)&&(!is_safari));var is_ns=((uagent.indexOf('compatible')==-1)&&(uagent.indexOf('mozilla')!=-1)&&(!is_opera)&&(!is_webtv)&&(!is_safari));var is_ns4=((is_ns)&&(parseInt(navigator.appVersion)==4));var is_kon=(uagent.indexOf('konqueror')!=-1);var is_win=((uagent.indexOf("win")!=-1)||(uagent.indexOf("16bit")!=-1));var is_mac=((uagent.indexOf("mac")!=-1)||(navigator.vendor=="Apple Computer, Inc."));var ua_vers=parseInt(navigator.appVersion);function show_element(_id){var el=document.getElementById(_id);el.style.display="block";}
function hide_element(_id){var el=document.getElementById(_id);el.style.display="none";}
function showhide_element(_id){with($('#'+_id)){if(hasClass('hidden'))removeClass('hidden');else addClass('hidden');}}
function checkPass(value1,value2,_id){var val1=document.getElementById(value1).value;var val2=document.getElementById(value2).value;var _img=document.getElementById(_id);if(!val1||!val2)_img.src=cur_page+'/skins/img/glob_img/spacer.gif';else if(val1==val2)_img.src=cur_page+'/skins/img/glob_img/accept.png';else _img.src=cur_page+'/skins/img/glob_img/cancel.png';}
function checkEmail(email){var response=(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(email);if(response==true)return'OK';else if(response==false)return'FALSE';}
function formatText(index,panel){return index+"";}
$(document).ready(function(){var payment_result=Cookie.Get('x-json');if(payment_result){var buyWindow=new BuyWindow();buyWindow.OnBuy(payment_result);Cookie.Delete('x-json',{path:'/'});}
TagCloudManager.Show();if($('#d_clip_button').size()){ZeroClipboard.setMoviePath('http://st.playfast.ru/ZeroClipboard10.swf');var clip=new ZeroClipboard.Client();clip.glue('d_clip_button','d_clip_container');}
if($('#promo_text').size()&&!SysreqManager.IsPluginInit){$('#promo_text').html($('#promo_text').html()+promoPlugin);}
$('#get_promocode').bind('click.getpromocode',function(){if(SysreqManager.IsPluginInit){var but=$(this);but.val(promocodeRequest);$.ajax({type:"GET",url:cur_page+'/classes/get_promocode.php',data:'hardware_id='+drm.getHardwareId()+'&lang='+language,success:function(xml){$(xml).find("account_promocode_response").each(function(){if($(this).attr("result")=='OK'){but.hide();if($(this).attr("used")){jAlert(promocodeUsed,alert_header2);$('#promo_text').html(promocodeReceived+$(this).attr("code")+'<br />'+promocodeUsed);}
else{var _txt=promocodeReceived+'<span id="promoValue" class="aquired_fields2">'+$(this).attr("code")+'</span>'+promocodeExplanation;$('#promo_text').html(_txt);$('#d_clip_container').css({visibility:'visible',float:'none'});$('#d_clip_container div').mouseover(function(){$('#d_clip_button').addClass('ui-state-hover');}).mouseout(function(){$('#d_clip_button').removeClass('ui-state-hover');}).mousedown(function(){$('#d_clip_button').addClass('ui-state-active');}).mouseup(function(){$('#d_clip_button').removeClass('ui-state-active');});clip.setText($("#promoValue").text());}}
if($(this).attr("result")=='ERROR'){jAlert(promocodeError,alert_header);but.val(promocodeGet);but.blur();}});}});}
else
(new SysReqForm()).ShowForm(Function.emptyFunction,Function.emptyFunction,null);return false;});});;var launched=false;var stopped=false;var showMsgStartGame=(Cookie.Get('showMsgStartGame'))?Cookie.Get('showMsgStartGame'):'false';var startTime;var finishTime;var playTime;function checkstatus(){var status=ProdownFrame.getStatus();$(document).trigger({type:Events.Game.Tracker,status:status});var gameTitle=Cookie.Get("gameTitle");switch(status){case Events.Plugin.Loading:case Events.Plugin.Ready:case Events.Plugin.Launched:$("#gameButtons").hide();$("#plugin_error").hide();$("#loader").show();$("#prodownstatus").show();$("#block_stop").show();$("#game_title").text(gameTitle);$("#buy_game_title").text(gameTitle);$("#head_loader").show();$("#body_loader").show();$("#loader_block").show();$(".play_btn").hide();$(".buy_btn").hide();$(".load_btn").hide();$(".delete_btn").hide();$(".button.play_ex_ser").hide();if(status==Events.Plugin.Launched){if(!launched){startTime=parseInt(new Date().getTime()/1000);launched=true;}
$("#block_play").hide();}
if(status==Events.Plugin.Ready){if(Cookie.Get('autoStart')=='true')
GameManager.OnPlayClick();else if(showMsgStartGame=='false'){(new StartGameForm()).ShowForm(Function.emptyFunction,Function.emptyFunction,null);Cookie.Set('showMsgStartGame','true',{path:'/'});showMsgStartGame='true';}
if(Cookie.Get('runGame')!=null)$("#block_play").show();}
break;case Events.Plugin.Stopping:$("#block_stop").hide();Cookie.Delete('showMsgStartGame',{path:'/'});Cookie.Delete('autoStart',{path:'/'});if(launched&&!stopped){finishTime=parseInt(new Date().getTime()/1000);playTime=finishTime-startTime;if(playTime>=180){if(Cookie.Get('gameType')=='free')(new GlobalBuyForm()).ShowForm(Function.emptyFunction,Function.emptyFunction,null);else Cookie.Delete('runGame',{path:'/'});}
else{if(Cookie.Get('gameType')=='free')(new GlobalProblemForm()).ShowForm(Function.emptyFunction,Function.emptyFunction,null);else Cookie.Delete('runGame',{path:'/'});}
stopped=true;}
break;case Events.Plugin.Idle:$("#gameButtons").show();$("#loader").hide();$("#head_loader").hide();$("#body_loader").hide();$("#loader_block").hide();$("#block_play").hide();$(".play_btn").show();$(".buy_btn").show();$(".load_btn").show();$(".delete_btn").show();$(".button.play_ex_ser").show();break;}
status=null;gameTitle=null;return null;}
$(document).ready(function(){if(SysreqManager.IsPluginInit){var localImagesTimer=$.timer(1000,function(timer){checkstatus();timer.reset(1000);});$('#guide_block').hide();$('#guide_block_header').hide();if(Cookie.Get('pluginUninstalled')==true)
Cookie.Set('pluginUninstalled',false,{path:'/'});}
else{if(Cookie.Get('pluginUninstalled')!==true)
Cookie.Set('pluginUninstalled',true,{path:'/'});$("#loader").hide();var temp_lang=language.substring(1,language.length);if(SysreqManager.IsOldPlugin)
$("#download_block td").addClass("old_plugin_"+temp_lang);else
$("#download_block td").addClass("no_plugin_"+temp_lang);$("#download_block td").click(function(){});$("#download_block").show();}});;var alQuery="{api_url}?api=lcr&lic_type={license}&game_id={uuid}&userid={userid}";function UpdateCatalog(){$("#head_loader").remove();$("#body_loader").remove();var game_list=new GameList($('#local_games'));}
var last_game_id_ready=null;function ViewOnGameReady(game_id){if(last_game_id_ready==game_id)
return false;var $game_block=$("#my-games-grid .game-row[rel="+game_id+"]");var $first_game_block=(last_game_id_ready==null)?$("#my-games-grid .game-row:eq(0)"):$("#my-games-grid .game-row[rel="+last_game_id_ready+"]");$first_game_block.before($game_block.remove());last_game_id_ready=game_id;return true;}
$(document).ready(function(){$('#calcksize').click(function(){var catalog=drm.queryCatalog();var catalogDoc=XMLEnvironment.createDocument();catalogDoc.async=false;catalogDoc.loadXML(catalog);var size_local=0;var size_total=0;var games=Array();var games_buy=Array();var games_sub=Array();$('.game_size').each(function(){var size=0;var size2=0;var name_for_size=$(this).attr('name_for_size');var who=$(this).attr('who');$('Game',catalogDoc).each(function(i,_item){if($(_item).attr('image')==name_for_size){if($(_item).attr('size')&&$(_item).attr('size')!='undefined'){if(who=='local'){size=$(_item).attr('sizeOnDisk');size=Math.round(size/(1024*1024));if(games[name_for_size]==undefined)size_local+=parseInt(size);size2=$(_item).attr('size');size2=Math.round(size2/(1024*1024));if(games[name_for_size]==undefined)size_total+=parseInt(size2);games[name_for_size]=size+' / '+size2;}else if(who=='subscribe'){size=$(_item).attr('size');size=Math.round(size/(1024*1024));games_sub[name_for_size]=size;}else{size=$(_item).attr('size');size=Math.round(size/(1024*1024));games_buy[name_for_size]=size;}}}});if(size2>0)
$(this).html(size+' / '+size2+' MB');else
if(size>0)
$(this).html(size+' MB');});$('#size_local_games').html(size_local+' / '+size_total+' MB');});ProdownFrame=new ProgressiveDownloadFrame(ProdownFrameXslt);if(page_url=='cabinet/games'||page_url=='cabinet')
if(!anonim)UpdateCatalog();else $('#my_games_menu').click();if($('#sw_curent_game').length>0){var sysreqContainer=$('#sw_curent_game');SysreqManager.CurrentGameReq=sysreqContainer.val().split(',');if(SysreqManager.CurrentGameReq!='')SysreqManager.FillGameReq();else $('#retest_but').hide();}
$('#calcksize').click();});;$(document).ready(function(){$('#register').click(function(){me=this;userManager.Register($("#email_reg").val(),$("#password_reg").val(),$("#password_reg_conf").val(),$("#name").val(),(document.getElementById('newsletter').checked)?1:0,'Page',function(data){$('#authMainForm').html(data);ReloadWindow($(me).attr('href'),false);},function(data){$('#glob_errors').html(data);$('#email_reg').focus();});return false;});$('#auth_go').click(function(){if($('#enter_login').val().length>0&&$('#enter_password').val().length>0){userManager.Login($('#enter_login').val(),$('#enter_password').val(),'Page',function(data){$(document).trigger({type:Events.Login.PageSuccess});if($('#play_but').val()&&$('#buy_but').val()){ReloadWindow(null,true);return;}
players_refresh();$('#authMainForm').html(data);},function(){jAlert(authError,alert_header);$('#enter_login').focus();});}
return false;});$('#email_reg').blur(function(e){if($("#email_reg").val()!=''){$.ajax({type:"GET",url:cur_page+"/classes/check_email.php?email="+($("#email_reg").val()),success:function(data){if(data=='OK'){if(checkEmail(($("#email_reg").val()))=='OK')$('#check_email').attr('src',cur_page+'/skins/img/glob_img/accept.png');else $('#check_email').attr('src',cur_page+'/skins/img/glob_img/cancel.png');}
else $('#check_email').attr('src',cur_page+'/skins/img/glob_img/cancel.png');}});}
else $('#check_email').attr('src',cur_page+'/skins/img/glob_img/spacer.gif');});});;ratingURLTemplate='{cur_page}/classes/ratings.php?id={id}&value={score}&type={type}';$(document).ready(function(){$('.bd').datepicker({changeMonth:true,changeYear:true,yearRange:'-90:+0'});$("#accordion").accordion({autoHeight:false,navigation:true}).bind('accordionchange',function(event,ui){if($("#local_games .playing",ui.oldContent).length)
{$("#local_games tr",ui.oldContent).hide();$("#local_games .playing",ui.oldContent).parents("tr").show();ui.oldHeader.addClass("partially-shown");ui.oldContent.show();}}).bind('accordionchangestart',function(event,ui){ui.newContent.hide();if($("#local_games .playing",ui.newContent).length)
{ui.newHeader.removeClass("partially-shown");$("#local_games tr",ui.newContent).show();}});$("#tabs").tabs();$("button, input:submit.submit, .load_btn, .button",'body').button();$('div#rating').raty({path:cur_page+'/skins/img/glob_img/',hintList:['1','2','3','4','5'],showHalf:true,onClick:function(score){$.ajax({type:"GET",url:ratingURLTemplate.template({cur_page:cur_page,id:this.$this.attr('obj-id'),score:score,type:this.$this.attr('type')})});}});});;$(document).ready(function(){$('#register').click(function(){$(document).trigger({type:Events.Register.PageSubmit});});$('.reg_link').click(function(){$(document).trigger({type:Events.Register.PageOpen});});$('.plugin').live('click',function(){$(document).trigger({type:Events.Download.Plugin});});$('.old_plugin').live('click',function(){$(document).trigger({type:Events.Download.Plugin});});$('#consultant').click(function(){$(document).trigger({type:Events.Consultant.Click});});if($('#play_but').val()){$(document).trigger({type:Events.Game.Details});if(!$('#play_but').attr("disabled")){$(document).trigger({type:Events.Game.DetailsDemo});}}
$('#auth_go').click(function(){$(document).trigger({type:Events.Login.PageSubmit});});});;$(document).ready(function(){$('#search_but').click(function(){document.search_form.submit();});$('#launch_but').click(function(){GameManager.OnPlayClick();});$('#retest_but').click(function(){SysreqManager.FillGameReq();});$('#play_but').click(function(event){(new SysReqForm()).ShowForm(Function.emptyFunction,Function.emptyFunction,this);});$('#buy_but').click(function(){uuid=$(this).attr("uuid");buyWizard.Start(Function.emptyFunction,Function.emptyFunction,{uuid:uuid,pp_param:'game_id'});});$('#stop_but').click(function(){$("#block_stop").hide();ProdownFrame.Stop();});$('#online_game').click(function(){data={};data.UUID=$(this).attr("uuid");data.rate='play';RatingManager.Rate(data);$.ajax({type:"GET",url:'{cur_page}/classes/user_history.php?add={game_uuid}'.template({cur_page:cur_page,game_uuid:data.UUID})});});$("#my_games_menu").click(function(event){loginWizard.Start(function(){ReloadWindow($(event.currentTarget).attr('href'),false);},function(){ReloadWindow($(event.currentTarget).attr('href'),false);},null);return false;});$('.button.sub').click(function(event){uuid=$(event.currentTarget).attr('uuid');buyWizard.Start(Function.emptyFunction,Function.emptyFunction,{uuid:uuid,pp_param:'sub_id'});return false;});$('.button.rent').click(function(event){uuid=$(event.currentTarget).attr('uuid');game_id=$(event.currentTarget).attr('game_id');free=$(event.currentTarget).attr('free');buyWizard.Start(Function.emptyFunction,Function.emptyFunction,{uuid:uuid,pp_param:'rent_id',game_id:game_id,free_rent:free});return false;});$('#sub_but').click(function(){uuid=$(this).attr("uuid");buyWizard.Start(Function.emptyFunction,Function.emptyFunction,{uuid:uuid,pp_param:'sub_id'});return false;});$('#send_but').click(function(){var name=$("#name").val();var email=$("#email").val();var subject=$("#subject").val();var message=$("#message").val();if(name!=''&&email!=''&&subject!=''&&message!=''){if(email.isEmailAddress()){$.ajax({type:"GET",url:cur_page+"/classes/send_email.php?name="+name+"&email="+email+"&subject="+subject+"&message="+message,success:function(data){var text='';switch(data){case"send":$("#name").val('');$("#email").val('');$("#subject").val('');$("#message").val('');text=messageSent;break;case"error_send":text=messageNotSent;break;case"error_fill":text=messageNotFill;break;default:text=messageNotSent;break;}
var infoForm=new InfoForm();infoForm.ShowForm(Function.emptyFunction,Function.emptyFunction,{header:req_test_noplug,message:text});}});}
else{var infoForm=new InfoForm();infoForm.ShowForm(Function.emptyFunction,Function.emptyFunction,{header:req_test_noplug,message:messageEmailError});}}
else{var infoForm=new InfoForm();infoForm.ShowForm(Function.emptyFunction,Function.emptyFunction,{header:req_test_noplug,message:messageNotFill});}});});;function BaseWindow(){this.init();};BaseWindow.prototype={init:function(){$(document).bind('keydown','esc',function(evt){$.unblockUI();});}};;function LoginForm(){this.template='\
        <form name="authForm" id="authForm" method="post" action="">\
            <dl class="windowTab">\
              <dt class="windowTabHeader">\
                <a id="loginForm_close_but" class="fr"><ins class="com close_window"></ins></a>\
                {authHeader}\
              </dt>\
              <dd class="fill wide">\
                <p class="windowTabMsg">{authMsg}</p>\
                <fieldset>\
                        <table class="windowTabBody" cellpadding="0" cellspacing="7" border="0">\
                            <tr>\
                                <td align="left">{enterLogin}</td>\
                                <td align="right" class="windowTabBody_td"><input type="text" name="enterLogin" id="enterLogin" maxlength="128"></td>\
                                <td width="16"><img id="loginForm_checkEmail" src="{cur_page}/skins/img/glob_img/spacer.gif" width="16" height="16" alt="" border="0" /></td>\
                            </tr>\
                            <tr>\
                                <td align="left">{enterPassw}</td>\
                                <td align="right" class="windowTabBody_td"><input type="password" name="enterPassw" id="enterPassw" maxlength="32"></td>\
                                <td width="16"><img id="loginForm_checkPass" src="{cur_page}/skins/img/glob_img/spacer.gif" width="16" height="16" alt="" border="0" /></td>\
                            </tr>\
                            <tr>\
                                <td colspan="2">\
                                    <table cellpadding="0" cellspacing="0" border="0" width="100%">\
                                        <tr>\
                                            <td align="left"><a id="loginForm_remind_but">{remindForm}</a></td>\
                                            <td align="right"><a class="reg" id="loginForm_register_but">{regButReg}</a></td>\
                                        </tr>\
                                    </table>\
                                </td>\
                            </tr>\
                        </table>\
                </fieldset>\
                <fieldset class="windowTabButtons">\
                        <input type="button" class="windowTabButton" id="loginForm_login_but" value="{Login}" />\
                        <input type="button" class="windowTabButton" id="loginForm_cancel_but" value="{closeForm}" />\
                </fieldset>\
              </dd>\
            </dl>\
        </form>\
    ';this.imgUrlTemplate='{cur_page}/skins/img/glob_img/{status}.png';this.onSuccess=null;this.onFail=null;this.context=null;this.width=325;this.height='auto';this.init();};LoginForm.prototype=(new BaseWindow()).prototype;LoginForm.prototype={init:function(){this.onLoginClick=Function.createDelegate(this,this.OnLoginClick);this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onRemindClick=Function.createDelegate(this,this.OnRemindClick);this.onRegClick=Function.createDelegate(this,this.OnRegClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onLoginKeypress=Function.createDelegate(this,this.OnLoginKeypress);this.onLoginBlur=Function.createDelegate(this,this.OnLoginBlur);this.onPasswordKeypress=Function.createDelegate(this,this.OnPasswordKeypress);},ShowForm:function(onSuccess,onFail,obj){$(document).trigger({type:Events.Login.WizardOpen});this.onSuccess=onSuccess;this.onFail=onFail;this.context=obj;$.blockUI({message:this.template.template({authHeader:authHeader,authMsg:authMsg,enterLogin:enterLogin,enterPassw:enterPassw,Login:Login,closeForm:closeForm,remindForm:remindForm,regButReg:regButReg,cur_page:cur_page}),css:{cursor:null,width:(this.width!='auto')?this.width.Pixels():'auto',height:(this.height!='auto')?this.height.Pixels():'auto',top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'40%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null},focusInput:true});$('.blockOverlay').click(this.HideForm);$('#loginForm_login_but').click(this.onLoginClick);$('#loginForm_close_but').click(this.onCloseClick);$('#loginForm_remind_but').click(this.onRemindClick);$('#loginForm_register_but').click(this.onRegClick);$('#loginForm_cancel_but').click(this.onCancelClick);$('#enterLogin').keypress(this.onLoginKeypress).blur(this.onLoginBlur);$('#enterPassw').keypress(this.onPasswordKeypress);},HideForm:function(){$.unblockUI();},CloseForm:function(){$(document).trigger({type:Events.Login.WizardCancel});this.HideForm();ReloadIfBuy();},OnLoginKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#enterPassw').focus();}},OnLoginBlur:function(){if($('#enterLogin').val().length>0){$('#loginForm_checkEmail').attr('src',this.imgUrlTemplate.template({cur_page:cur_page,status:$('#enterLogin').val().isEmailAddress()?'accept':'cancel'}));}
else{$('#loginForm_checkPass').attr('src',GetGlobalImagePath('spacer.png'));$('#loginForm_checkEmail').attr('src',GetGlobalImagePath('spacer.png'));}},OnPasswordKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#loginForm_login_but').click();}},OnLoginClick:function(){$(document).trigger({type:Events.Login.WizardSubmit});var me=this;if(this.IsValidForm()){userManager.Login($('#enterLogin').val(),$('#enterPassw').val(),'Wizard',function(data){$(document).trigger({type:Events.Login.WizardSuccess});$('#authMainForm').html(data);me.HideForm();me.onSuccess();},function(){$(document).trigger({type:Events.Login.WizardFail});$('#enterLogin').focus();$('#loginForm_checkPass').attr('src',GetGlobalImagePath('cancel.png'));Effects.Shake($('.blockMsg'));});}
else{$(document).trigger({type:Events.Login.WizardFail});$('#enterLogin').focus();$('#loginForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));$('#loginForm_checkPass').attr('src',GetGlobalImagePath('cancel.png'));Effects.Shake($('.blockMsg'));}},OnCancelClick:function(){this.CloseForm();},OnCloseClick:function(){this.CloseForm();},OnRemindClick:function(){this.HideForm();var remindForm=new RemindForm();remindForm.ShowForm(this.onSuccess,this.onFail,this.context);},OnRegClick:function(){this.HideForm();var registerForm=new RegisterForm();registerForm.ShowForm(this.onSuccess,this.onFail,this.context);},IsValidForm:function(){return $('#enterLogin').val().isEmailAddress()&&$('#enterPassw').val().length>0;},CheckEmail:function(){$.ajax({type:"GET",url:'{cur_page}/classes/check_email.php?email={email}'.template({cur_page:cur_page,email:$("#enterLogin").val()}),success:function(data){if(data!='OK')$('#loginForm_checkEmail').attr('src',GetGlobalImagePath('accept.png'));else $('#loginForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));},error:WindowManager.ShowErrorWindow});}};;function RegisterForm(){this.template='\
            <dl class="windowTab">\
              <dt class="windowTabHeader mb0">\
                <a id="regForm_close_but" class="fr"><ins class="com close_window"></ins></a>\
                {regHeader}\
              </dt>\
              <dd>\
                <div class="windowTabMsg">{regMsg}</div>\
                <div id="regMsg"></div>\
                  <table class="windowTabBody fl" cellpadding="0" cellspacing="7" border="0">\
                            <tr>\
                                <td align="left">{regEmail}: </td>\
                                <td align="right" class="windowTabBody_td"><input type="text" name="regEmail" id="regEmail"></td>\
                                <td><img src="{cur_page}/skins/img/glob_img/spacer.gif" id="regForm_checkEmail" width="16" height="16" alt="" border="0" maxlength="128"></td>\
                            </tr>\
                            <tr id="error">\
                                <td align="left"></td>\
                                <td align="right" id="errors"></td>\
                                <td width="16"></td>\
                            </tr>\
                            <tr>\
                                <td align="left">{regPassword}: </td>\
                                <td align="right" class="windowTabBody_td"><input type="password" name="regPassword" id="regPassword"></td>\
                                <td><img src="{cur_page}/skins/img/glob_img/spacer.gif" id="regForm_checkPassw" width="16" height="16" alt="" border="0" maxlength="32"></td>\
                            </tr>\
                            <tr>\
                                <td align="left">{regPasswordConf}: </td>\
                                <td align="right" class="windowTabBody_td"><input type="password" name="regPasswordConf" id="regPasswordConf" maxlength="32"></td>\
                                <td></td>\
                            </tr>\
                            <tr>\
                                <td align="left">{regNickname}: </td>\
                                <td align="right" class="windowTabBody_td"><input type="text" name="regNickname" id="regNickname" maxlength="32"></td>\
                                <td><img src="{cur_page}/skins/img/glob_img/spacer.gif" id="regForm_checkNick" width="16" height="16" alt="" border="0"></td>\
                            </tr>\
                            <tr>\
                                <td align="left">{regReciveNews}: </td>\
                                <td align="left" class="windowTabBody_td"><input type="checkbox" name="regReciveNews" class="checkbox" id="regReciveNews" checked="checked"></td>\
                                <td width="16"></td>\
                            </tr>\
                        </table>\
                        <div class="delimcolon"></div>\
                  <div class="table100">\
                    <div class="textinfo">\
               <ol>\
                                        <li>{regMsg1}</li>\
                                        <li>{regMsg2}</li>\
                                        <li>{regMsg3}</li>\
                                    </ol>\
               <p>{regMsg4}&nbsp;<a id="regForm_login_but" href="javascript: void(0)">{regMsg5}</a></p>\
                    </div>\
                  </div>\
                  <div class="windowTabLine clr"></div>\
                  <div class="windowTabButtons center">\
                        <input type="button" class="windowTabButton" name="regForm_reg_but" id="regForm_reg_but" value="{regButReg}">&nbsp;\
                        <input type="button" class="windowTabButton" name="regForm_cancel_but" id="regForm_cancel_but" value="{regButCancel}">&nbsp;\
                </div>\
              </dd>\
            </dl>\
    ';this.imgUrlTemplate='{cur_page}/skins/img/glob_img/{status}.png';this.onSucces=null;this.onFail=null;this.context=null;this.width=640;this.height='auto';this.init();};RegisterForm.prototype=(new BaseWindow()).prototype;RegisterForm.prototype={init:function(){this.onRegClick=Function.createDelegate(this,this.OnRegClick);this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onLoginClick=Function.createDelegate(this,this.OnLoginClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onLoginKeypress=Function.createDelegate(this,this.OnLoginKeypress);this.onLoginBlur=Function.createDelegate(this,this.OnLoginBlur);this.onPasswKeypress=Function.createDelegate(this,this.OnPasswKeypress);this.onPasswBlur=Function.createDelegate(this,this.OnPasswBlur);this.onPasswCKeypress=Function.createDelegate(this,this.OnPasswCKeypress);this.onPasswCBlur=Function.createDelegate(this,this.OnPasswCBlur);this.onNickKeypress=Function.createDelegate(this,this.OnNickKeypress);this.onNickBlur=Function.createDelegate(this,this.OnNickBlur);},ShowForm:function(onSucces,onFail,obj){$(document).trigger({type:Events.Register.WizardOpen});this.onSucces=onSucces;this.onFail=onFail;this.context=obj;var me=this;$.blockUI({message:this.template.template({regHeader:regHeader,regMsg:regMsg,regMsg1:regMsg1,regMsg2:regMsg2,regMsg3:regMsg3,regMsg4:regMsg4,regMsg5:regMsg5,regEmail:regEmail,regPassword:regPassword,regPasswordConf:regPasswordConf,regNickname:regNickname,regReciveNews:regReciveNews,regButReg:regButReg,regButCancel:regButCancel,regButLogin:regButLogin,cur_page:cur_page}),css:{cursor:null,width:(this.width!='auto')?this.width.Pixels():'auto',height:(this.height!='auto')?this.height.Pixels():'auto',top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'40%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null}});$('.blockOverlay').click(this.HideForm);$('#regForm_reg_but').click(this.onRegClick);$('#regForm_cancel_but').click(this.onCancelClick);$('#regForm_login_but').click(this.onLoginClick);$('#regForm_close_but').click(this.onCloseClick);$('#regEmail').keypress(this.onLoginKeypress).blur(this.onLoginBlur);$('#regPassword').keypress(this.onPasswKeypress).blur(this.onPasswBlur);$('#regPasswordConf').keypress(this.onPasswCKeypress).blur(this.onPasswCBlur);$('#regNickname').keypress(this.onNickKeypress).blur(this.onNickBlur);},HideForm:function(){$.unblockUI();},OnLoginKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#regPassword').focus();}},OnLoginBlur:function(){if($('#regEmail').val().length>0){var isValid=$('#regEmail').val().isEmailAddress();$('#regForm_checkEmail').attr('src',this.imgUrlTemplate.template({cur_page:cur_page,status:isValid?'spacer':'cancel'}));if(isValid){$('#error').hide();$('#errors').html('');this.CheckEmail();}
else $('#errors').html(emailIncorrect);}},OnPasswKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#regPasswordConf').focus();}},OnPasswBlur:function(){if($('#regPassword').val().length>0){if($('#regPassword').val()!=String.Empty&&$('#regPasswordConf').val()!=String.Empty){if($('#regPassword').val()==$('#regPasswordConf').val())$('#regForm_checkPassw').attr('src',GetGlobalImagePath('accept.png'));else $('#regForm_checkPassw').attr('src',GetGlobalImagePath('cancel.png'));}}},OnPasswCKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#regNickname').focus();}},OnPasswCBlur:function(){if($('#regPassword').val().length>0||$('#regPasswordConf').val().length>0){if($('#regPassword').val()!=String.Empty&&$('#regPassword').val()==$('#regPasswordConf').val())$('#regForm_checkPassw').attr('src',GetGlobalImagePath('accept.png'));else $('#regForm_checkPassw').attr('src',GetGlobalImagePath('cancel.png'));}},OnNickKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#regForm_reg_but').click();}},OnNickBlur:function(){},OnRegClick:function(){$(document).trigger({type:Events.Register.WizardSubmit});var me=this;if(this.IsValidForm()){userManager.Register($("#regEmail").val(),$("#regPassword").val(),$("#regPasswordConf").val(),$("#regNickname").val(),(document.getElementById('regReciveNews').checked)?1:0,'Wizard',function(data){$('#authMainForm').html(data);me.HideForm();me.onSucces();},function(){$(document).trigger({type:Events.Register.WizardFail});$('#regEmail').focus();$('#error').show();$('#errors').html(emailExist);Effects.Shake($('.blockMsg'));});}
else{$(document).trigger({type:Events.Register.WizardFail});$('#error').show();$('#errors').html(emailIncorrect);$('#regEmail').focus();Effects.Shake($('.blockMsg'));}},OnCancelClick:function(){this.CloseForm();},OnCloseClick:function(){this.CloseForm();},CloseForm:function(){$(document).trigger({type:Events.Register.WizardCancel});this.HideForm();ReloadIfBuy();},OnLoginClick:function(){this.HideForm();buyWizard.ShowLogin(this.onSucces,this.onFail,this.context);},IsValidForm:function(){return $('#regEmail').val().isEmailAddress()&&$('#regPassword').val().length>0&&$('#regPassword').val()==$('#regPasswordConf').val();},CheckEmail:function(){$.ajax({type:"GET",url:'{cur_page}/classes/check_email.php?email={email}'.template({cur_page:cur_page,email:$("#regEmail").val()}),success:function(data){if(data=='OK'){$('#error').hide();$('#errors').html('');$('#regForm_checkEmail').attr('src',GetGlobalImagePath('accept.png'));}
else{$('#error').show();$('#errors').html(emailExist);$('#regForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));}},error:WindowManager.ShowErrorWindow});}};;function SimpleRegisterForm(){this.template='\
      <form name="authForm" id="authForm" method="post" class="m0 p0 rel">\
        <dl class="windowTab">\
          <dt class="windowTabHeader">\
              <a id="simpleRegForm_close_but" class="fr"><ins class="com close_window"></ins></a>\
              {stepsBuyHeader}\
          </dt>\
          <dd>\
            <fieldset id="img_block" class="mb0"></fieldset>\
            <fieldset class="windowTabRadio brd">\
                <label class="mr10"><input type="radio" name="choise_simpleRegister" id="choise_simpleRegister" checked="checked" value="0" class="radio" />{SimpleRegister}</label>\
                <label><input type="radio" name="choise_simpleRegister" id="choise_Login" value="1" class="radio" />{JustLogin}</label>\
            </fieldset>\
            <fieldset id="SRMsg1" class="windowTabMsg">\
            {simpleRegMsg} <span class="asterix">*</span>\
            </fieldset>\
            <fieldset class="windowTabBody" id="simpleRegisterTab">\
                <label><span class="b w_auto mr10">{enterEmail}</span> <input type="text" name="enterEmail" id="enterEmail" maxlength="128" /></label>\
                <div id="error">\
                    <span id="errors"></span>\
                </div>\
            </fieldset>\
            <fieldset class="windowTabBody loginTab" id="loginTab">\
                <label class="mb10">\
                    <span>{enterLogin}</span>\
                    <input type="text" name="enterLogin" id="enterLogin" maxlength="128">\
                </label>\
                <label class="mb10">\
                    <span>{enterPassw}</span>\
                    <input type="password" name="enterPassw" id="enterPassw" maxlength="32">\
                </label>\
                <a id="simpleRegForm_remind_but" class="fl">{remindForm}</a>\
                <a id="simpleRegForm_register_but" class="reg fr">{regButReg}</a>\
                <div class="clr"></div>\
            </fieldset>\
            <fieldset id="SRMsg2"><span class="asterix">*</span> {simpleRegMsg2}</fieldset>\
                <div class="txtcenter"><input type="button" class="windowTabButton" id="simpleRegForm_login_but" value="{Login}" />\
                <input type="button" class="windowTabButton" id="simpleRegForm_reg_but" value="{registerBut}" /></div>\
          </dd>\
        </dl>\
        </form>\
    ';this.imageTemplate='\
      <div class="intro">\
          <img src="{src}" alt="" height="61" width="165" class="pic" />\
          <div class="desc">\
              <div class="name">{stepsBuyGameAttr1} \'{name}\'</div>\
              <div class="price">{stepsBuyGameAttr2} <span id="to_pay">{price}</span> {stepsBuyGameAttr3}</div>\
              <div class="clr"></div>\
            </div>\
        </div>\
    ';this.imgUrlTemplate='{cur_page}/skins/img/glob_img/{status}.png';this.onSuccess=null;this.onFail=null;this.context=null;this.width=480;this.height='auto';this.init();};SimpleRegisterForm.prototype=(new BaseWindow()).prototype;SimpleRegisterForm.prototype={init:function(){this.onLoginClick=Function.createDelegate(this,this.OnLoginClick);this.onLoginPressClick=Function.createDelegate(this,this.OnLoginPressClick);this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onRemindClick=Function.createDelegate(this,this.OnRemindClick);this.onRegClick=Function.createDelegate(this,this.OnRegClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onLoginKeypress=Function.createDelegate(this,this.OnLoginKeypress);this.onEmailBlur=Function.createDelegate(this,this.OnEmailBlur);this.onLoginBlur=Function.createDelegate(this,this.OnLoginBlur);this.onPasswordKeypress=Function.createDelegate(this,this.OnPasswordKeypress);this.onEmailKeypress=Function.createDelegate(this,this.OnEmailKeypress);this.onSimpleRegClick=Function.createDelegate(this,this.OnSimpleRegClick);this.onLoginRegClick=Function.createDelegate(this,this.OnLoginRegClick);this.onRegisterClick=Function.createDelegate(this,this.OnRegisterClick);},ShowForm:function(onSuccess,onFail,obj){var me=this;$(document).trigger({type:Events.SimpleRegister.WizardOpen});if(obj.pp_param=='game_id')var BuyHeader=stepsBuyHeader;else if(obj.pp_param=='sub_id')var BuyHeader=stepsBuyHeader5;else var BuyHeader=stepsBuyHeader8;GameManager.GetGameAttributes($(obj).attr('uuid'),function(data){if(data){var img_block=me.imageTemplate.template({src:data.ImgSmall,name:data.FullName,price:data.Price,stepsBuyGameAttr1:stepsBuyGameAttr1,stepsBuyGameAttr2:stepsBuyGameAttr2,stepsBuyGameAttr3:stepsBuyGameAttr3});$('#img_block').html(img_block);}});this.onSuccess=onSuccess;this.onFail=onFail;this.context=obj;$.blockUI({message:this.template.template({stepsBuyHeader:BuyHeader,simpleRegMsg:simpleRegMsg,simpleRegMsg2:simpleRegMsg2,authMsg:authMsg,enterLogin:enterLogin,enterPassw:enterPassw,Login:Login,closeForm:closeForm,remindForm:remindForm,regButReg:regButReg,SimpleRegister:SimpleRegister,JustLogin:JustLogin,enterEmail:enterEmail,registerBut:registerBut,cur_page:cur_page}),css:{cursor:null,width:this.width.Pixels(),height:this.height.Pixels(),top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'30%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null},focusInput:false});$('#enterEmail').focus();$('#simpleRegForm_login_but').click(this.onLoginClick);$('#simpleRegForm_close_but').click(this.onCloseClick);$('#simpleRegForm_remind_but').click(this.onRemindClick);$('#simpleRegForm_register_but').click(this.onRegClick);$('#simpleRegForm_reg_but').click(this.onRegisterClick);$('#simpleRegForm_cancel_but').click(this.onCancelClick);$('#loginPress').live("click",this.onLoginPressClick);$('#choise_simpleRegister').click(this.onSimpleRegClick);$('#choise_Login').click(this.onLoginRegClick);$('#enterLogin').keypress(this.onLoginKeypress).blur(this.onLoginBlur);$('#enterPassw').keypress(this.onPasswordKeypress);$('#enterEmail').keypress(this.onEmailKeypress);},HideForm:function(){$.unblockUI();},CloseForm:function(){$(document).trigger({type:Events.SimpleRegister.WizardCancel});this.HideForm();ReloadIfBuy();},OnLoginPressClick:function(){var email=$('#enterEmail').val();$('#enterLogin').val(email);$('#choise_Login').click();$('#enterPassw').focus();},OnLoginKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#enterPassw').focus();}},OnPasswordKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#simpleRegForm_login_but').click();}},OnEmailKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#simpleRegForm_reg_but').click();}
else if(isTabKey(e)){this.onEmailBlur();}},OnLoginBlur:function(){if($('#enterLogin').val().length>0){$('#loginForm_checkEmail').attr('src',this.imgUrlTemplate.template({cur_page:cur_page,status:$('#enterLogin').val().isEmailAddress()?'accept':'cancel'}));}},OnLoginClick:function(){$(document).trigger({type:Events.Login.WizardSubmit});var me=this;if(this.IsValidForm('enterLogin')){userManager.Login($('#enterLogin').val(),$('#enterPassw').val(),'Wizard',function(data){$(document).trigger({type:Events.Login.WizardSuccess});$('#authMainForm').html(data);me.HideForm();me.onSuccess();},function(){$(document).trigger({type:Events.Login.WizardFail});$('#enterLogin').focus();$('#loginForm_checkPass').attr('src',GetGlobalImagePath('cancel.png'));Effects.Shake($('.blockMsg'));});}
else{$(document).trigger({type:Events.Login.WizardFail});$('#enterLogin').focus();$('#loginForm_checkPass').attr('src',GetGlobalImagePath('cancel.png'));Effects.Shake($('.blockMsg'));}},OnCancelClick:function(){this.CloseForm();},OnCloseClick:function(){this.CloseForm();},OnRemindClick:function(){$(document).trigger({type:Events.SimpleRegister.WizardCancel});this.HideForm();var remindForm=new RemindForm();remindForm.ShowForm(this.onSuccess,this.onFail,this.context);},OnRegClick:function(){this.HideForm();var registerForm=new RegisterForm();registerForm.ShowForm(this.onSuccess,this.onFail,this.context);},OnEmailBlur:function(){if($('#enterEmail').val().length>0){var isValid=$('#enterEmail').val().isEmailAddress();$('#simpleRegisterForm_checkEmail').attr('src',this.imgUrlTemplate.template({cur_page:cur_page,status:isValid?'spacer':'cancel'}));if(isValid){$('#error').hide();$('#errors').html('');this.CheckEmail('enterEmail');}
else{$('#error').show();$('#errors').html(emailIncorrect);}}},OnRegisterClick:function(){$(document).trigger({type:Events.SimpleRegister.WizardSubmit});var me=this;if(this.IsValidForm('enterEmail')){userManager.Register($('#enterEmail').val(),'generate password','generate password',String.Empty,1,'Wizard',function(data){$(document).trigger({type:Events.SimpleRegister.WizardSuccess});$('#authMainForm').html(data);me.HideForm();me.onSuccess();},function(){$(document).trigger({type:Events.SimpleRegister.WizardFail});$('#enterEmail').focus();$('#errors').html(emailExist2);$('#error').show();$('#simpleRegisterForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));Effects.Shake($('.blockMsg'));});}
else{$(document).trigger({type:Events.SimpleRegister.WizardFail});$('#enterEmail').focus();$('#errors').html(emailIncorrect);$('#error').show();$('#simpleRegisterForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));Effects.Shake($('.blockMsg'));}},OnSimpleRegClick:function(){$('#simpleRegisterTab').show();$('#simpleRegForm_reg_but').show();$('#loginTab').hide();$('#simpleRegForm_login_but').hide();$('#SRMsg1').show();$('#SRMsg2').show();},OnLoginRegClick:function(){$('#simpleRegisterTab').hide();$('#simpleRegForm_reg_but').hide();$('#loginTab').show();$('#simpleRegForm_login_but').show();$('#SRMsg1').hide();$('#SRMsg2').hide();},IsValidForm:function(id){var email=$('#'+id).val();return email.isEmailAddress()&&email.length>0;},CheckEmail:function(id){$.ajax({type:"GET",url:'{cur_page}/classes/check_email.php?email={email}'.template({cur_page:cur_page,email:$('#'+id).val()}),success:function(data){if(data=='OK'){$('#error').hide();$('#errors').html('');$('#simpleRegisterForm_checkEmail').attr('src',GetGlobalImagePath('accept.png'));}
else{$('#error').show();$('#errors').html(emailExist2);$('#simpleRegisterForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));}},error:WindowManager.ShowErrorWindow});}};;function RemindForm(){this.template='\
        <form name="remindForm" id="remindForm" method="post">\
          <dl class="windowTab">\
            <dt class="windowTabHeader">\
              <a id="remindForm_close_but" class="fr"><ins class="com close_window"></ins></a>\
              {remindHeader}\
            </dt>\
            <dd class="fill wide">\
              <p class="windowTabMsg txtcenter">{remindMsg}</p>\
              <fieldset>\
                        <table class="windowTabBody" cellpadding="0" cellspacing="7" border="0">\
                            <tr>\
                                <td align="left">{remindEmail}</td>\
                                <td align="left"><input type="text" name="remindEmail" id="remindEmail" maxlength="128"></td>\
                                <td width="16"><img id="remindForm_checkEmail" src="{cur_page}/skins/img/glob_img/spacer.gif" width="16" height="16" alt="" border="0" /></td>\
                            </tr>\
                        </table>\
              </fieldset>\
              <fieldset class="windowTabButtons">\
                        <input type="button" class="windowTabButton" id="remindForm_login_but" value="{Remind}" />\
                        <input type="button" class="windowTabButton" id="remindForm_cancel_but" value="{closeForm}" />\
              </fieldset>\
            </dd>\
          </dl>\
        </form>\
    ';this.onSucces=null;this.onFail=null;this.context=null;this.width=360;this.height='auto';this.init();};RemindForm.prototype=(new BaseWindow()).prototype;RemindForm.prototype={init:function(){this.onRemindSucces=Function.createDelegate(this,this.OnRemindSucces);this.onRemindClick=Function.createDelegate(this,this.OnRemindClick);this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onRemindKeypress=Function.createDelegate(this,this.OnRemindKeypress);},ShowForm:function(onSucces,onFail,obj){this.onSucces=onSucces;this.onFail=onFail;this.context=obj;var me=this;$.blockUI({message:this.template.template({remindHeader:remindHeader,remindMsg:remindMsg,remindEmail:remindEmail,Remind:Remind,cur_page:cur_page,closeForm:closeForm,cur_page:cur_page}),css:{cursor:null,width:(this.width!='auto')?this.width.Pixels():'auto',height:(this.height!='auto')?this.height.Pixels():'auto',top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'40%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null}});$('.blockOverlay').click($.unblockUI);$('#remindForm_login_but').click(this.onRemindClick);$('#remindForm_close_but').click(this.onCloseClick);$('#remindForm_cancel_but').click(this.onCancelClick);$('#remindEmail').keypress(this.onRemindKeypress).blur(this.onRemindBlur);},HideForm:function(){$.unblockUI();},OnRemindSucces:function(data){if(data=='OK'){this.HideForm();var infoForm=new InfoForm();infoForm.ShowForm(Function.emptyFunction,this.onFail,{message:RemindOkMessage,header:remindHeader});}
else{$('#remindEmail').focus();$('#remindForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));$('#remindForm_checkEmail').attr('alt',data);Effects.Shake($('.blockMsg'));}},OnRemindKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#remindForm_login_but').click();}},OnRemindClick:function(){if(this.IsValidForm()){$.ajax({type:"GET",url:'{cur_page}/classes/remind.php?email={email}&lang={lang}'.template({cur_page:cur_page,lang:language,email:$("#remindEmail").val()}),success:this.onRemindSucces,error:WindowManager.ShowErrorWindow});}
else{$('#regEmail').focus();$('#remindForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));Effects.Shake($('.blockMsg'));}
return false;},OnCancelClick:function(){this.HideForm();ReloadIfBuy();return false;},OnCloseClick:function(){this.HideForm();ReloadIfBuy();return false;},IsValidForm:function(){return $('#remindEmail').val().isEmailAddress();}};;function BuyWindow(){this.template='\
        <dl class="windowTab pb0 bgwhite">\
          <dt class="windowTabHeader mb0">\
            <a id="buyWindowButton" class="fr"><ins class="com close_window"></ins></a>\
            {stepsBuyHeader2}\
          </dt>\
          <dd class="ml0">\
                  <div class="ml5">\
                      <a href="javascript://" id="buyWindowBackButton">\
                                    <img src="{cur_page}/skins/img/glob_img/back_buybox.png">\
                                </a>\
                            </div>\
              <div class="txtcenter" style="margin-top:300px;width:100%;z-index:1" id="frameLoader">{pageLoadingMsg}</div>\
              <iframe frameborder="0" hspace="0" name="pp_frame" id="pp_frame" class="bgwhite" src="{link}" width="800" height="597" border="0" style="display:none;"></iframe>\
          </dd>\
        </dl>\
    ';this.alQuery='{api_url}?api=lcr&lic_type={license}&game_id={uuid}&userid={userid}';this.frameUrl='{api_url}?api=pp&{pp_param}={uuid}{pp_param2}&userid={userId}';this.onSucces=null;this.onFail=null;this.context=null;this.width=806;this.height=655;this.init();};BuyWindow.prototype=(new BaseWindow()).prototype;BuyWindow.prototype={init:function(){this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onBackClick=Function.createDelegate(this,this.OnBackClick);this.onLoadFrame=Function.createDelegate({context:this},this.OnLoadFrame);},ShowForm:function(onSucces,onFail,obj){if(parseInt(obj.free_rent)){var res={status:true,type:'rent',sub_type:'free_rent',game_id:obj.game_id,rent_id:obj.uuid};this.OnBuy(res);return;}
$(document).trigger({type:Events.Buy.Open});if(obj.pp_param=='game_id'){var BuyHeader=stepsBuyHeader3;var BuyHeader2=stepsBuyHeader2;var obj_buy={};obj_buy.rate='buy';obj_buy.UUID=obj.uuid;RatingManager.Rate(obj_buy);}
else if(obj.pp_param=='sub_id'){var BuyHeader=stepsBuyHeader4;var BuyHeader2=stepsBuyHeader6;}
else{var BuyHeader=stepsBuyHeader7;var BuyHeader2=stepsBuyHeader9;}
var me=this;this.onSucces=onSucces;this.onFail=onFail;this.context=obj;var pp_param2=String.Empty;if(this.context.game_id)
pp_param2='&game_id={game_id}'.template({game_id:this.context.game_id});if(obj.license_type=="preorder")
pp_param2='&license_type={license_type}&customer_email={user_email}'.template({license_type:obj.license_type,user_email:userManager.GetUserParameter("email")});$.blockUI({message:this.template.template({cur_page:cur_page,stepsBuyHeader2:(this.context.anonim)?BuyHeader2:BuyHeader,link:this.frameUrl.template({api_url:api_url,uuid:this.context.uuid,pp_param:this.context.pp_param,pp_param2:pp_param2,userId:user_id}),pageLoadingMsg:pageLoadingMsg}),css:{height:this.height.Pixels(),width:this.width.Pixels(),top:(($(window).height()-this.height)/2).Pixels(),left:(($(window).width()-this.width)/2).Pixels()},overlayCSS:{cursor:null}});$('#pp_frame').bind('load',this.onLoadFrame);$('#buyWindowButton').click(this.onCloseClick);$('#buyWindowBackButton').click(this.onBackClick);},HideForm:function(){$.unblockUI();},OnLoadFrame:function(){if($("#pp_frame:visible").length==0){$("#frameLoader").hide();var frame=$("#pp_frame");var frameDocument=frame[0].contentDocument;frame.show();$("#webmoney",frameDocument).click(function(){$(document).trigger({type:Events.Buy.WebMoney});});$("#yandex",frameDocument).click(function(){$(document).trigger({type:Events.Buy.YandexMoney});});$("#qiwi",frameDocument).click(function(){$(document).trigger({type:Events.Buy.Qiwi});});$("#moneymail",frameDocument).click(function(){$(document).trigger({type:Events.Buy.MoneyMail});});$("#wallet1",frameDocument).click(function(){$(document).trigger({type:Events.Buy.W1});});$("#rbkmoney",frameDocument).click(function(){$(document).trigger({type:Events.Buy.RbkMoney});});$("#send_promocode",frameDocument).click(function(){$(document).trigger({type:Events.Buy.PromoCode});});$("#send_code",frameDocument).click(function(){$(document).trigger({type:Events.Buy.Sms});});}
if($.browser.msie){$('#buyWindowBackButton').css('visibility','hidden');}
var result=Cookie.Get('x-json');if(result){this.context.OnBuy(result);Cookie.Delete('x-json',{path:'/'});}},OnCloseClick:function(){$(document).trigger({type:Events.Buy.Close});this.HideForm();ReloadIfBuy();return false;},OnBackClick:function(){frames.pp_frame.history.back();return false;},OnBuy:function(result){this.HideForm();var infoForm=new InfoForm();var parentLocation=$(window)[0].parent.location;var url='http://{host}{uri}'.template({host:parentLocation.hostname,uri:uri});if(result.status){$(document).trigger({type:Events.Buy.Success});var _header=onSuccesBuyHeader;switch(result.type){case"game":msg=onSuccesBuyMsg_game;var lic_type='buy';break;case"sub":msg=onSuccesBuyMsg_sub;break;case"rent":msg=onSuccesBuyMsg_rent;var lic_type='rent';break;}
if(result.serial)
msg+=serialWarn.template({serial:result.serial});if(result.type=='game'||result.type=='rent')
drm.acquireLicense(this.alQuery.template({api_url:api_url,license:lic_type,uuid:result.game_id,userid:user_id}));if(result.sub_type&&result.sub_type=="free_rent")
API.ActivateRent({game_id:result.game_id,rent_id:result.rent_id});}
else{$(document).trigger({type:Events.Buy.Fail});var _header=onErrorBuyHeader;msg=onErrorBuyMsg;}
infoForm.ShowForm(function(){$(window)[0].location.href=url;},Function.emptyFunction,{header:_header,message:msg});}};;function RemindForm(){this.template='\
        <form name="remindForm" id="remindForm" method="post">\
          <dl class="windowTab">\
            <dt class="windowTabHeader">\
              <a id="remindForm_close_but" class="fr"><ins class="com close_window"></ins></a>\
              {remindHeader}\
            </dt>\
            <dd class="fill wide">\
              <p class="windowTabMsg txtcenter">{remindMsg}</p>\
              <fieldset>\
                        <table class="windowTabBody" cellpadding="0" cellspacing="7" border="0">\
                            <tr>\
                                <td align="left">{remindEmail}</td>\
                                <td align="left"><input type="text" name="remindEmail" id="remindEmail" maxlength="128"></td>\
                                <td width="16"><img id="remindForm_checkEmail" src="{cur_page}/skins/img/glob_img/spacer.gif" width="16" height="16" alt="" border="0" /></td>\
                            </tr>\
                        </table>\
              </fieldset>\
              <fieldset class="windowTabButtons">\
                        <input type="button" class="windowTabButton" id="remindForm_login_but" value="{Remind}" />\
                        <input type="button" class="windowTabButton" id="remindForm_cancel_but" value="{closeForm}" />\
              </fieldset>\
            </dd>\
          </dl>\
        </form>\
    ';this.onSucces=null;this.onFail=null;this.context=null;this.width=360;this.height='auto';this.init();};RemindForm.prototype=(new BaseWindow()).prototype;RemindForm.prototype={init:function(){this.onRemindSucces=Function.createDelegate(this,this.OnRemindSucces);this.onRemindClick=Function.createDelegate(this,this.OnRemindClick);this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onRemindKeypress=Function.createDelegate(this,this.OnRemindKeypress);},ShowForm:function(onSucces,onFail,obj){this.onSucces=onSucces;this.onFail=onFail;this.context=obj;var me=this;$.blockUI({message:this.template.template({remindHeader:remindHeader,remindMsg:remindMsg,remindEmail:remindEmail,Remind:Remind,cur_page:cur_page,closeForm:closeForm,cur_page:cur_page}),css:{cursor:null,width:(this.width!='auto')?this.width.Pixels():'auto',height:(this.height!='auto')?this.height.Pixels():'auto',top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'40%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null}});$('.blockOverlay').click($.unblockUI);$('#remindForm_login_but').click(this.onRemindClick);$('#remindForm_close_but').click(this.onCloseClick);$('#remindForm_cancel_but').click(this.onCancelClick);$('#remindEmail').keypress(this.onRemindKeypress).blur(this.onRemindBlur);},HideForm:function(){$.unblockUI();},OnRemindSucces:function(data){if(data=='OK'){this.HideForm();var infoForm=new InfoForm();infoForm.ShowForm(Function.emptyFunction,this.onFail,{message:RemindOkMessage,header:remindHeader});}
else{$('#remindEmail').focus();$('#remindForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));$('#remindForm_checkEmail').attr('alt',data);Effects.Shake($('.blockMsg'));}},OnRemindKeypress:function(e){if(isEnterKey(e)){e.preventDefault();$('#remindForm_login_but').click();}},OnRemindClick:function(){if(this.IsValidForm()){$.ajax({type:"GET",url:'{cur_page}/classes/remind.php?email={email}&lang={lang}'.template({cur_page:cur_page,lang:language,email:$("#remindEmail").val()}),success:this.onRemindSucces,error:WindowManager.ShowErrorWindow});}
else{$('#regEmail').focus();$('#remindForm_checkEmail').attr('src',GetGlobalImagePath('cancel.png'));Effects.Shake($('.blockMsg'));}
return false;},OnCancelClick:function(){this.HideForm();ReloadIfBuy();return false;},OnCloseClick:function(){this.HideForm();ReloadIfBuy();return false;},IsValidForm:function(){return $('#remindEmail').val().isEmailAddress();}};;function InfoForm(){this.template='\
    <form name="infoForm" id="infoForm" method="post" action="">\
      <dl class="windowTab">\
        <dt class="windowTabHeader">\
          <a id="infoForm_close_but" class="fr"><ins class="com close_window"></ins></a>\
          {infoHeader}\
        </dt>\
        <dd>\
          <fieldset class="windowTabBody2">\
            <div class="infoForm txtcenter">\
                                 {message}\
                                </div>\
          </fieldset>\
          <fieldset class="windowTabButtons">\
                    <input type="button" class="windowTabButton" id="infoForm_ok_but" value="{okForm}" />\
          </fieldset>\
        </dd>\
      </dl>\
    </form>\
    ';this.onSucces=null;this.onFail=null;this.context=null;this.width=350;this.height='auto';this.init();};InfoForm.prototype=(new BaseWindow()).prototype;InfoForm.prototype={init:function(){this.onOkClick=Function.createDelegate(this,this.OnOkClick);this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);},ShowForm:function(onSucces,onFail,obj){this.onSucces=onSucces;this.onFail=onFail;this.context=obj;if(this.context.width!=undefined)this.width=this.context.width;if(this.context.height!=undefined)this.height=this.context.height;$.blockUI({message:this.template.template({cur_page:cur_page,message:this.context.message,infoHeader:this.context.header,okForm:okForm}),css:{cursor:null,width:(this.width!='auto')?this.width.Pixels():'auto',height:(this.height!='auto')?this.height.Pixels():'auto',top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'40%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null}});$('.blockOverlay').click(this.HideForm);$('#infoForm_ok_but').click(this.onOkClick);$('#infoForm_close_but').click(this.onCloseClick);},HideForm:function(){$.unblockUI();ReloadIfBuy();},OnOkClick:function(){this.HideForm();this.onSucces();return false;},OnCloseClick:function(){this.HideForm();}};;function SysReqForm(){this.template='\
      <form method="post" action="">\
        <dl class="windowTab window-sysreq" cellpadding="0" cellspacing="3" border="0">\
          <dt class="windowTabHeader">\
            <a id="sysreqWin_close_but" class="fr"><ins class="com close_window"></ins></a>\
            {SRHeader}\
          </dt>\
          <dd>\
            <fieldset id="img_block" class="game-info">\
              <img src="{game_img}" class="gameimg fl mr10">\
              <p class="info">{SRLoadGame}:<br /><span class="game-title">{game_title}</span></p>\
            </fieldset>\
            <div class="windowTabLine">&nbsp;</div>\
            <fieldset class="game-requirements">\
                <p>{SRReqs}\
                <ul id="sysReqCont">{SRMsg}</ul></p>\
            </fieldset>\
            <div class="windowTabLine">&nbsp;</div>\
            <fieldset class="windowTabButtons">\
                    <input type="button" class="windowTabButton{hideOK}" id="sysreqWin_ok_but" value="{SRokBut}" style="width: auto;" />\
                    <input type="button" class="windowTabButton{hidePlay}" id="sysreqWin_retest_but" value="{SRtestBut}" />\
                    <input type="button" class="windowTabButton{hideTest}" id="sysreqWin_play_but" value="{SRPlayBut}" />\
                    <input type="button" class="windowTabButton" id="sysreqWin_cancel_but" value="{SRcancelBut}" />\
            </fieldset>\
          </dd>\
        </dl>\
      </form>\
    ';this.templatePluginNotInstalled='\
        <div style="float: right; width: 15px; height: 15px;"><a style="margin-right:6px;margin-top:6px;" href="javascript://" id="sysreqWin_close_but"><img src="{cur_page}/skins/img/glob_img/close_buybox.gif"></a></div>\
        <div class="windowTabMsg">\
   <p class="no-pluginGameHeader">{SRHeader_pni}</p>\
            <div class="texts gametexts">\
                <ul style="line-height: 12px;margin:0;width:220px;text-align:justify;">\
                    <li style="padding: 4px;">{SRMsg_pni2}</li>\
                    <li style="padding: 4px;">{SRMsg_pni3}</li>\
                    <li style="padding: 4px;">{SRMsg_pni4}</li>\
                    <li style="padding: 4px;">{SRMsg_pni9}</li>\
                    <li style="padding: 4px;">{SRMsg_pni5}</li>\
                    <li style="padding: 4px;">{SRMsg_pni1}</li>\
                </ul>\
                <br />\
            </div>\
            <div class="texts gametexts">\
                <p style="width:215px;margin:0;">{SRMsg_pni6}</p>\
                <p style="text-align:justify;font-size:11px;line-height:14px;width:215px;">{SRMsg_pni8}</p>\
             <a href="http://st.playfast.ru/playfast-setup.exe"><img id="no-plugin-img" src="{cur_page}/skins/img/glob_img/no-plugin.png" width="218" height="51"></a><br />\
                <div class="no-pluginButtons">\
                    <input type="button" class="windowTabButton" id="sysreqWin_ok_but" value="{SRokBut}" />\
                </div>\
            </div>\
        </div>\
    ';this.templateGamePluginNotInstalled='\
        <div style="float: right; width: 15px; height: 15px;"><a style="margin-right:6px;margin-top:6px;" href="javascript://" id="sysreqWin_close_but"><img src="{cur_page}/skins/img/glob_img/close_buybox.gif"></a></div>\
        <div class="windowTabMsg">\
            <p class="no-pluginGameHeader no-pluginGameTitle">{game_title}</p>\
   <p class="no-pluginGameHeader">{SRHeader_pni}</p>\
            <div class="gameimg-div"><img src="{game_img}" class="gameimg"></div>\
            <div class="texts gametexts">\
                <ul style="line-height: 12px;margin:0;width:220px;text-align:justify;">\
                    <li style="padding: 4px;">{SRMsg_pni2}</li>\
                    <li style="padding: 4px;">{SRMsg_pni3}</li>\
                    <li style="padding: 4px;">{SRMsg_pni4}</li>\
                    <li style="padding: 4px;">{SRMsg_pni9}</li>\
                    <li style="padding: 4px;">{SRMsg_pni5}</li>\
                    <li style="padding: 4px;">{SRMsg_pni1}</li>\
                </ul>\
                <br />\
            </div>\
            <div class="texts gametexts">\
                <p style="width:215px;margin:0;">{SRMsg_pni6}</p>\
                <p style="text-align:justify;font-size:11px;line-height:14px;width:215px;">{SRMsg_pni8}</p>\
             <a href="http://st.playfast.ru/playfast-setup.exe"><img id="no-plugin-img" src="{cur_page}/skins/img/glob_img/no-plugin.png" width="218" height="51"></a><br />\
                <div class="no-pluginButtons">\
                    <input type="button" class="windowTabButton" id="sysreqWin_ok_but" value="{SRokBut}" />\
                </div>\
            </div>\
        </div>\
    ';this.reqTemplate='<li><a href="{url}" target="_blank">{install} {name}</a></li>';this.onSucces=null;this.onFail=null;this.context=null;this.width=608;this.height='auto';this.init();};SysReqForm.prototype=(new BaseWindow()).prototype;SysReqForm.prototype={init:function(){this.onOKClick=Function.createDelegate(this,this.OnOKClick);this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onPlayClick=Function.createDelegate(this,this.OnPlayClick);this.onRetestClick=Function.createDelegate(this,this.OnRetestClick);},ShowForm:function(onSucces,onFail,obj){var showMsg=true;this.onSucces=onSucces;if(SysreqManager.IsOldPlugin){$(document).trigger({type:Events.Game.PluginTrue});is_op=true;this.top='30%';this.width=360;this.height='auto';var bodyMsg=SRMsg2;var bodyHeader=SRHeader;msgBuild=this.template.template({SRHeader:bodyHeader,SRReqs:String.Empty,SRMsg:bodyMsg,SRokBut:SRokBut,SRtestBut:SRtestBut,SRPlayBut:SRPlayBut,SRcancelBut:SRcancelBut,cur_page:cur_page,hideOK:(SysreqManager.IsPluginInit)?' hidden':String.Empty,hidePlay:(SysreqManager.IsPluginInit)?String.Empty:' hidden',hideTest:(SysreqManager.IsPluginInit)?String.Empty:' hidden'});}
if(obj)
$(document).trigger({type:Events.Game.Play,license:obj.attributes[2].value});if(SysreqManager.IsPluginInit){showMsg=false;this.top='35%';this.width=400;this.height='auto';this.obj=obj;if(obj)
$(document).trigger({type:Events.Game.PluginTrue});bodyMsg=this.GetWindowContent();this.bodyMsg=bodyMsg;bodyHeader=SRHeader2_i;var context=this;GameManager.GetGameAttributes($(obj).attr('uuid'),function(data){showMsg=true;msgBuild=context.template.template({SRHeader:bodyHeader,SRLoadGame:SRLoadGame,SRReqs:SRReqs,SRMsg:bodyMsg,SRokBut:SRokBut,SRtestBut:SRtestBut,SRPlayBut:SRPlayBut,SRcancelBut:SRcancelBut,cur_page:cur_page,hideOK:(SysreqManager.IsPluginInit)?' hidden':String.Empty,hidePlay:(SysreqManager.IsPluginInit)?String.Empty:' hidden',hideTest:(SysreqManager.IsPluginInit)?String.Empty:' hidden',game_title:data.FullName,game_img:data.ImgSmall});if(!context.bodyMsg.IsEmpty()&&showMsg){context.ShowMsg(msgBuild);}
else{if(context.obj)
context.StartGame(context.obj);}});return false;}
else if(!SysreqManager.IsOldPlugin){var bodyMsg=String.Empty;if(obj){$.ajax({type:"GET",url:GameManager.RegisterAnonim.template({cur_page:cur_page}),success:function(response){user_id=response;installer_url="{cur_page}/installer.php?id={id}&lic={license}&uid={uid}";document.location.href=installer_url.template({cur_page:cur_page,id:$(obj).attr('uuid'),license:$(obj).attr('license'),uid:user_id});},error:WindowManager.ShowErrorWindow});}
else{this.width=550;this.top='15%';msgBuild=this.templatePluginNotInstalled.template({cur_page:cur_page,SRHeader_pni:SRHeader_pni,SRokBut:SRokBut,SRMsg_pni1:SRMsg_pni1,SRMsg_pni2:SRMsg_pni2,SRMsg_pni3:SRMsg_pni3,SRMsg_pni4:SRMsg_pni4,SRMsg_pni5:SRMsg_pni5,SRMsg_pni6:SRMsg_pni6,SRMsg_pni7:SRMsg_pni7,SRMsg_pni8:SRMsg_pni8,SRMsg_pni9:SRMsg_pni9});}
if(obj)
$(document).trigger({type:Events.Game.PluginFalse});$('#sysreqWin_play_but').hide();$('#sysreqWin_retest_but').hide();}
this.onSucces=onSucces;this.onFail=onFail;this.context=obj;if(!bodyMsg.IsEmpty()&&showMsg){this.ShowMsg(msgBuild);if(typeof is_op!=="undefined"&&is_op)$('#img_block').hide();else $('#img_block').show();}
else{if(obj&&SysreqManager.IsPluginInit)
this.StartGame(obj);}},ShowMsg:function(msgBuild){$.blockUI({message:msgBuild,css:{cursor:null,width:this.width.Pixels(),height:this.height.Pixels(),top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():this.top,left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},focusInput:false,overlayCSS:{cursor:null}});$('.blockOverlay').click(this.HideForm);$('#sysreqWin_ok_but').click(this.onOKClick);$('#sysreqWin_close_but').click(this.onCloseClick);$('#sysreqWin_cancel_but').click(this.onCancelClick);$('#sysreqWin_play_but').click(Function.createCallback(this.onPlayClick,this.obj));$('#sysreqWin_retest_but').click(this.onRetestClick);$(".texts a.plugin").focus();$("#no-plugin-img").hover(function(){$(this).attr('src',cur_page+'/skins/img/glob_img/no-plugin-hover.png');},function(){$(this).attr('src',cur_page+'/skins/img/glob_img/no-plugin.png');});},HideForm:function(){$.unblockUI();ReloadIfBuy();},OnOKClick:function(){ReloadWindow(null,true);},OnCancelClick:function(){this.HideForm();},OnCloseClick:function(){this.HideForm();},OnPlayClick:function(obj,context){this.HideForm();this.StartGame(context);},StartGame:function(context){var play_btn=$(context);obj={};obj.uuid=play_btn.attr('uuid');obj.license=play_btn.attr('license');obj.play_id=play_btn.attr('play_id');GameManager.OnLoadClick(obj);if((typeof this.onSucces)!=="undefined")
$(document).one(Events.Plugin.Loading,this.onSucces);},OnRetestClick:function(){this.UpdateWindow();},GetReqHTML:function(data){var result=String.Empty;var j=0;for(var i=0;i<data.length;i++){var item=data[i];if(!item.status){result+=this.reqTemplate.template({url:item.url,name:item.name,install:install_cap});}}
return result;},UpdateWindow:function(){$('#sysReqCont').html(this.GetWindowContent());},GetWindowContent:function(){return this.GetReqHTML(SysreqManager.Check());}};;function GlobalBuyForm(){this.template='\
  <form name="globalForm" id="globalForm" method="post" action="">\
    <dl class="windowTab">\
      <dt class="windowTabHeader">\
        <a id="buyWin_close_but" class="fr"><ins class="com close_window"></ins></a>\
        {globalBWinHeader}\
      </dt>\
      <dd>\
        <div class="txtcenter" valign="middle" id="img_block"></div>\
        <div class="windowTabLine">&nbsp;</div>\
        <fieldset class="windowTabBody">\
          {globalBWinMsg}\
        </fieldset>\
        <fieldset class="windowTabButtons">\
                    <input type="button" class="windowTabButton" id="buyWin_buy_but" value="{globalBWinBuyBut}" style="width:120px;" />&nbsp;\
        </fieldset>\
      </dd>\
    </dl>\
    </form>\
 ';this.imageTemplate='\
        <div style="margin: 5px auto; height: auto; overflow: hidden; font-size: 14px; font-weight:900; width: 450px;">\
            <div class="fl"><img height="61" width="165" src="{src}"></div>\
            <div class="fl" style="margin-top: -62px; margin-left: 170px; width: 270px;">\
                <p class="m0">{stepsBuyGameAttr1} \'{name}\'</p>\
                <p class="m0">{stepsBuyGameAttr2} <span id="to_pay">{price}</span> {stepsBuyGameAttr3}</p>\
            </div>\
        </div>\
    ';this.onSucces=null;this.onFail=null;this.context=null;this.width=458;this.height='auto';this.init();};GlobalBuyForm.prototype=(new BaseWindow()).prototype;GlobalBuyForm.prototype={init:function(){this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onBuyClick=Function.createDelegate(this,this.OnBuyClick);},ShowForm:function(onSucces,onFail,obj){$(document).trigger({type:Events.Game.LongPlay});this.onSucces=onSucces;this.onFail=onFail;this.context=obj;var me=this;GameManager.GetGameAttributes(Cookie.Get('runGame'),function(data){if(data){var img_block=me.imageTemplate.template({src:data.ImgSmall,name:data.FullName,price:data.Price,stepsBuyGameAttr1:stepsBuyGameAttr1,stepsBuyGameAttr2:stepsBuyGameAttr2,stepsBuyGameAttr3:stepsBuyGameAttr3});$('#img_block').html(img_block);}});$.blockUI({message:this.template.template({cur_page:cur_page,globalBWinMsg:globalBWinMsg,globalBWinHeader:globalBWinHeader,globalBWinBuyBut:globalBWinBuyBut,globalBWinCancelBut:globalBWinCancelBut}),css:{cursor:null,width:(this.width!='auto')?this.width.Pixels():'auto',height:(this.height!='auto')?this.height.Pixels():'auto',top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'40%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null}});$('.blockOverlay').click(this.HideForm);$('#buyWin_buy_but').click(this.onBuyClick);$('#buyWin_close_but').click(this.onCloseClick);$('#buyWin_cancel_but').click(this.onCancelClick);},HideForm:function(){$.unblockUI();},OnCloseClick:function(){this.HideForm();},OnCancelClick:function(){this.HideForm();},OnBuyClick:function(){var runGame=Cookie.Get('runGame');Cookie.Delete('runGame',{path:'/'});buyWizard.Start(Function.emptyFunction,Function.emptyFunction,{uuid:runGame,pp_param:'game_id'});}};;function GlobalProblemForm(){this.template='\
  <form name="globalForm" id="globalForm" method="post" action="">\
    <dl class="windowTab">\
      <dt class="windowTabHeader">\
        <a id="problemWin_close_but" class="fr"><ins class="com close_window"></ins></a>\
        {globalPWinHeader}\
      </dt>\
      <dd>\
        <fieldset>\
                    <table class="windowTabBody2" cellpadding="0" cellspacing="7" border="0">\
                        <tr>\
                         <td>{globalPWinMsg2}</td>\
                            <td width="15">&nbsp;</td>\
                            <td><input type="button" class="windowTabButton" id="problemWin_help_but" value="{globalPWinHelpBut}" /></td>\
                        </tr>\
                        <tr>\
                         <td>{globalPWinMsg3}</td>\
                            <td width="15">&nbsp;</td>\
                            <td><input type="button" class="windowTabButton" id="problemWin_buy_but" value="{globalPWinBuyBut}" /></td>\
                        </tr>\
                    </table>\
        </fieldset>\
        <fieldset class="windowTabButtons">\
                    <input type="button" class="windowTabButton" id="problemWin_cancel_but" value="{globalPWinCancelBut}" />\
        </fieldset>\
      </dd>\
    </dl>\
    </form>\
 ';this.onSucces=null;this.onFail=null;this.context=null;this.width=460;this.height='auto';this.init();};GlobalProblemForm.prototype=(new BaseWindow()).prototype;GlobalProblemForm.prototype={init:function(){this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onBuyClick=Function.createDelegate(this,this.OnBuyClick);this.onHelpClick=Function.createDelegate(this,this.OnHelpClick);},ShowForm:function(onSucces,onFail,obj){$(document).trigger({type:Events.Game.ShortPlay});this.onSucces=onSucces;this.onFail=onFail;this.context=obj;$.blockUI({message:this.template.template({cur_page:cur_page,globalPWinHeader:globalPWinHeader,globalPWinMsg1:globalPWinMsg1,globalPWinMsg2:globalPWinMsg2,globalPWinMsg3:globalPWinMsg3,globalPWinHelpBut:globalPWinHelpBut,globalPWinBuyBut:globalPWinBuyBut,globalPWinCancelBut:globalPWinCancelBut}),css:{cursor:null,width:(this.width!='auto')?this.width.Pixels():'auto',height:(this.height!='auto')?this.height.Pixels():'auto',top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'40%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null}});$('.blockOverlay').click(this.HideForm);$('#problemWin_buy_but').click(this.onBuyClick);$('#problemWin_close_but').click(this.onCloseClick);$('#problemWin_help_but').click(this.onHelpClick);$('#problemWin_cancel_but').click(this.onCancelClick);},HideForm:function(){$.unblockUI();},OnCloseClick:function(){this.HideForm();},OnCancelClick:function(){this.HideForm();},OnBuyClick:function(){var runGame=Cookie.Get('runGame');Cookie.Delete('runGame',{path:'/'});buyWizard.Start(Function.emptyFunction,Function.emptyFunction,{uuid:runGame,pp_param:'game_id'});},OnHelpClick:function(){document.location.href='{cur_page}{language}/help/'.template({cur_page:cur_page,language:language});}};;function StartGameForm(){this.template='\
      <form method="post" action="">\
        <dl class="windowTab">\
          <dt class="windowTabHeader">\
            <a id="sgWin_close_but" class="fr"><ins class="com close_window"></ins></a>\
            {sgWinHeader}\
          </dt>\
          <dd>\
            <fieldset id="img_block" class="txtcenter"></fieldset>\
            <div class="windowTabLine">&nbsp;</div>\
            <fieldset class="windowTabBody2">\
              {sgWinMsg}\
            </fieldset>\
            <fieldset class="windowTabButtons">\
                    <input type="button" class="windowTabButton" id="sgWin_play_but" value="{sgWinPlayBut}" />\
                    <input type="button" class="windowTabButton" id="sgWin_cancel_but" value="{sgWinCancelBut}" />\
            </fieldset>\
          </dd>\
        </dl>\
      </form>\
 ';this.imageTemplate='\
        <div style="font-size: 16px;">\
            <img height="61" align="left" width="165" src="{src}" hspace="10" align="left"><div class="displayName">{name}</div>\
        </div>\
    ';this.onSucces=null;this.onFail=null;this.context=null;this.width=360;this.height='auto';this.init();};StartGameForm.prototype=(new BaseWindow()).prototype;StartGameForm.prototype={init:function(){this.onCloseClick=Function.createDelegate(this,this.OnCloseClick);this.onCancelClick=Function.createDelegate(this,this.OnCancelClick);this.onPlayClick=Function.createDelegate(this,this.OnPlayClick);},ShowForm:function(onSucces,onFail,obj){this.onSucces=onSucces;this.onFail=onFail;this.context=obj;var me=this;GameManager.GetGameAttributes(Cookie.Get('runGame'),function(data){if(data){var img_block=me.imageTemplate.template({src:data.ImgSmall,name:data.FullName,price:data.Price,stepsBuyGameAttr1:stepsBuyGameAttr1,stepsBuyGameAttr2:stepsBuyGameAttr2,stepsBuyGameAttr3:stepsBuyGameAttr3});$('#img_block').html(img_block);}});$.blockUI({message:this.template.template({cur_page:cur_page,sgWinHeader:sgWinHeader,sgWinMsg:sgWinMsg,sgWinPlayBut:sgWinPlayBut,sgWinCancelBut:sgWinCancelBut}),css:{cursor:null,width:(this.width!='auto')?this.width.Pixels():'auto',height:(this.height!='auto')?this.height.Pixels():'auto',top:(this.height!='auto')?(($(window).height()-this.height)/2).Pixels():'40%',left:(this.width!='auto')?(($(window).width()-this.width)/2).Pixels():'35%'},overlayCSS:{cursor:null}});$('.blockOverlay').click(this.HideForm);$('#sgWin_play_but').click(this.onPlayClick);$('#sgWin_close_but').click(this.onCloseClick);$('#sgWin_cancel_but').click(this.onCancelClick);},HideForm:function(){$.unblockUI();},OnCloseClick:function(){this.HideForm();},OnCancelClick:function(){this.HideForm();},OnPlayClick:function(){this.HideForm();GameManager.OnPlayClick();}};;(function(){var s=true,t=false,aa=window,u=undefined,v=Math,ba="push",fa="slice",ga="cookie",y="charAt",z="indexOf",A="gaGlobal",ha="getTime",ja="toString",B="window",D="length",E="document",F="split",G="location",ka="href",H="substring",I="join",L="toLowerCase";var la="_gat",ma="_gaq",na="4.8.6",oa="_gaUserPrefs",pa="ioo",M="&",N="=",O="__utma=",qa="__utmb=",ra="__utmc=",sa="__utmk=",ta="__utmv=",ua="__utmz=",va="__utmx=",wa="GASO=";var xa=function(){var j=this,h=[],k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";j.uc=function(m){h[m]=s};j.Nb=function(){for(var m=[],i=0;i<h[D];i++)if(h[i])m[v.floor(i/6)]^=1<<i%6;for(i=0;i<m[D];i++)m[i]=k[y](m[i]||0);return m[I]("")}},ya=new xa;function Q(j){ya.uc(j)};var za=function(j,h){var k=this;k.window=j;k.document=h},R=new za(aa,document);var Aa=function(j){return function(h,k,m){j[h]=function(){Q(k);return m.apply(j,arguments)};return m}},S=function(j){return u==j||"-"==j||""==j},T=function(j,h,k){var m="-",i;if(!S(j)&&!S(h)&&!S(k)){i=j[z](h);if(i>-1){k=j[z](k,i);if(k<0)k=j[D];m=j[H](i+h[z](N)+1,k)}}return m},Ba=function(j){var h=t,k=0,m,i;if(!S(j)){h=s;for(m=0;m<j[D];m++){i=j[y](m);k+="."==i?1:0;h=h&&k<=1&&(0==m&&"-"==i||".0123456789"[z](i)>-1)}}return h},U=function(j,h){var k=encodeURIComponent;if(k instanceof Function)return h?encodeURI(j):k(j);else{Q(68);return escape(j)}},Ca=function(j,h){var k=decodeURIComponent,m;j=j[F]("+")[I](" ");if(k instanceof Function)try{m=h?decodeURI(j):k(j)}catch(i){Q(97);m=unescape(j)}else{Q(68);m=unescape(j)}return m},V=function(j,h){return j[z](h)>-1};function Da(j){if(!j||""==j)return"";for(;j[y](0)[D]>0&&" \n\r\t"[z](j[y](0))>-1;)j=j[H](1);for(;j[y](j[D]-1)[D]>0&&" \n\r\t"[z](j[y](j[D]-1))>-1;)j=j[H](0,j[D]-1);return j}
var X=function(j,h){j[ba]||Q(94);j[j[D]]=h},Ea=function(j){var h=1,k=0,m;if(!S(j)){h=0;for(m=j[D]-1;m>=0;m--){k=j.charCodeAt(m);h=(h<<6&268435455)+k+(k<<14);k=h&266338304;h=k!=0?h^k>>21:h}}return h},Fa=function(){return v.round(v.random()*2147483647)},Ga=function(){};var Ha=function(j,h){this.Na=j;this.$a=h},Ia=function(){function j(k){var m=[];k=k[F](",");for(var i,p=0;p<k[D];p++){i=k[p][F](":");m[ba](new Ha(i[0],i[1]))}return m}var h=this;h.ta="utm_campaign";h.ua="utm_content";h.va="utm_id";h.wa="utm_medium";h.xa="utm_nooverride";h.ya="utm_source";h.za="utm_term";h.Aa="gclid";h.U=0;h.v=0;h.Ea=15768E6;h.kb=18E5;h.u=63072E6;h.ia=[];h.ka=[];h.fc="cse";h.gc="q";h.bb=5;h.M=j("daum:q,eniro:search_word,naver:query,images.google:q,google:q,yahoo:p,msn:q,bing:q,aol:query,aol:encquery,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,about:terms,mamma:query,alltheweb:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,aol:q,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,pchome:q,kvasir:q,sesam:q,ozu:q,terra:query,mynet:q,ekolay:q,rambler:words");h.f="/";h.O=100;h.ga="/__utm.gif";h.Y=1;h.Z=1;h.t="|";h.W=1;h.Fa=1;h.Da=1;h.a="auto";h.B=1;h.Dc=10;h.Fb=10;h.Ec=0.2;h.l=u};var Ja=function(j){function h(a,c,f,d){var e="",q=0;e=T(a,"2"+c,";");if(!S(e)){a=e[z]("^"+f+".");if(a<0)return["",0];e=e[H](a+f[D]+2);if(e[z]("^")>0)e=e[F]("^")[0];f=e[F](":");e=f[1];q=parseInt(f[0],10);if(!d&&q<i.q)e=""}if(S(e))e="";return[e,q]}function k(a,c){return"^"+[[c,a[1]][I]("."),a[0]][I](":")}function m(a){var c=new Date;a=new Date(c[ha]()+a);return"expires="+a.toGMTString()+"; "}var i=this,p=j;i.q=(new Date)[ha]();var l=[O,qa,ra,ua,ta,va,wa];i.h=function(){var a=R[E][ga];return p.l?i.Ob(a,p.l):a};i.Ob=function(a,c){for(var f=[],d,e=0;e<l[D];e++){d=h(a,l[e],c)[0];S(d)||(f[f[D]]=l[e]+d+";")}return f[I]("")};i.k=function(a,c,f){var d=f>0?m(f):"";if(p.l){c=i.bc(R[E][ga],a,p.l,c,f);a="2"+a;d=f>0?m(p.u):""}a=a+c;d=d;if(a[D]>2E3){Q(69);a=a[H](0,2E3)}d=a+"; path="+p.f+"; "+d+i.Qa();R[E].cookie=d};i.bc=function(a,c,f,d,e){var q="";e=e||p.u;d=k([d,i.q+e*1],f);q=T(a,"2"+c,";");if(!S(q)){a=k(h(a,c,f,s),f);q=q[F](a)[I]("");return q=d+q}return d};i.Qa=function(){return S(p.a)?"":"domain="+p.a+";"}};var Ka=function(j){function h(b){b=b instanceof Array?b[I]("."):"";return S(b)?"-":b}function k(b,g){var o=[],n;if(!S(b)){o=b[F](".");if(g)for(n=0;n<o[D];n++)Ba(o[n])||(o[n]="-")}return o}function m(b,g,o){var n=e.F,r,w;for(r=0;r<n[D];r++){w=n[r][0];w+=S(g)?g:g+n[r][4];n[r][2](T(b,w,o))}}var i,p,l,a,c,f,d,e=this,q,x=j;e.g=new Ja(j);e.Xa=function(){return u==q||q==e.I()};e.h=function(){return e.g.h()};e.ea=function(){return c?c:"-"};e.nb=function(b){c=b};e.ma=function(b){q=Ba(b)?b*1:"-"};e.da=function(){return h(f)};e.na=function(b){f=k(b)};e.Mb=function(){e.g.k(ta,"",-1)};e.cc=function(){return q?q:"-"};e.Qa=function(){return S(x.a)?"":"domain="+x.a+";"};e.ba=function(){return h(i)};e.lb=function(b){i=k(b,1)};e.z=function(){return h(p)};e.la=function(b){p=k(b,1)};e.ca=function(){return h(l)};e.mb=function(b){l=k(b,1)};e.fa=function(){return h(a)};e.ob=function(b){a=k(b);for(b=0;b<a[D];b++)if(b<4&&!Ba(a[b]))a[b]="-"};e.Xb=function(){return d};e.xc=function(b){d=b};e.Ib=function(){i=[];p=[];l=[];a=[];c=u;f=[];q=u};e.I=function(){for(var b="",g=0;g<e.F[D];g++)b+=e.F[g][1]();return Ea(b)};e.ja=function(b){var g=e.h(),o=t;if(g){m(g,b,";");e.ma(e.I());o=s}return o};e.qc=function(b){m(b,"",M);e.ma(T(b,sa,M))};e.Bc=function(){var b=e.F,g=[],o;for(o=0;o<b[D];o++)X(g,b[o][0]+b[o][1]());X(g,sa+e.I());return g[I](M)};e.Hc=function(b,g){var o=e.F,n=x.f;e.ja(b);x.f=g;for(var r=0;r<o[D];r++)S(o[r][1]())||o[r][3]();x.f=n};e.xb=function(){e.g.k(O,e.ba(),x.u)};e.qa=function(){e.g.k(qa,e.z(),x.kb)};e.yb=function(){e.g.k(ra,e.ca(),0)};e.sa=function(){e.g.k(ua,e.fa(),x.Ea)};e.zb=function(){e.g.k(va,e.ea(),x.u)};e.ra=function(){e.g.k(ta,e.da(),x.u)};e.Kc=function(){e.g.k(wa,e.Xb(),0)};e.F=[[O,e.ba,e.lb,e.xb,"."],[qa,e.z,e.la,e.qa,""],[ra,e.ca,e.mb,e.yb,""],[va,e.ea,e.nb,e.zb,""],[ua,e.fa,e.ob,e.sa,"."],[ta,e.da,e.na,e.ra,"."]]};var La=function(){var j=this;j.jb=function(h,k,m,i,p){if(!p&&k[D]>2037)k=m+"&err=len&max=2037&len="+k[D];j.Kb(h+k,i)};j.Kb=function(h,k){var m=new Image(1,1);m.src=h;m.onload=function(){m.onload=null;(k||Ga)()}}};var Ma=function(j){var h=this,k=j,m=new Ka(k),i=new La,p=!Y.Ic(),l=function(){};h.$c=function(a){var c=a[F](".");if(!c||c[D]<5)return a;if((a=c[fa](4)[I]("."))&&a[z]("=")==-1)a=Ca(a);c=c[fa](0,4);X(c,a);return c[I](".")};h.$b=function(){return"https:"==R[E][G].protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif"};h.P=function(a,c,f,d,e,q){var x=k.B,b=R[E][G];m.ja(f);var g=m.z()[F](".");if(g[1]<500||d){if(e){g=g;var o=(new Date)[ha](),n;n=(o-g[3])*(k.Ec/1E3);if(n>=1){g[2]=v.min(v.floor(g[2]*1+n),k.Fb);g[3]=o}g=g}if(d||!e||g[2]>=1){if(!d&&e)g[2]=g[2]*1-1;g[1]=g[1]*1+1;e="?utmwv="+na;o="&utmn="+Fa();d=e+"e"+o;a=e+o+(S(b.hostname)?"":"&utmhn="+U(b.hostname))+(k.O==100?"":"&utmsp="+U(k.O))+a;if(0==x||2==x){b=2==x?l:q||l;p&&i.jb(k.ga,a,d,b,s)}if(1==x||2==x){c="&utmac="+c;d+=c;a+=c+"&utmcc="+h.Tb(f);if(Y.Ma){f="&aip=1";d+=f;a+=f}a+="&utmu="+ya.Nb();p&&i.jb(h.$b(),a,d,q)}}}m.la(g[I]("."));m.qa()};h.Tb=function(a){for(var c=[],f=[O,ua,ta,va],d=m.h(),e,q=0;q<f[D];q++){e=T(d,f[q]+a,";");if(!S(e)){if(f[q]==ta){e=e[F](a+".")[1][F]("|")[0];if(S(e))continue;e=a+"."+e}X(c,f[q]+e+";")}}return U(c[I]("+"))}};var Na=function(){var j=this;j.S=[];j.Va=function(h){for(var k,m=j.S,i=0;i<m[D];i++)k=h==m[i].n?m[i]:k;return k};j.Eb=function(h,k,m,i,p,l,a,c){var f=j.Va(h);if(u==f){f=new Na.Bb(h,k,m,i,p,l,a,c);X(j.S,f)}else{f.Ca=k;f.tb=m;f.sb=i;f.qb=p;f.Ha=l;f.rb=a;f.Ka=c}return f}};Na.Ab=function(j,h,k,m,i,p){var l=this;l.wb=j;l.oa=h;l.o=k;l.Ga=m;l.db=i;l.eb=p;l.pa=function(){return"&"+["utmt=item","tid="+U(l.wb),"ipc="+U(l.oa),"ipn="+U(l.o),"iva="+U(l.Ga),"ipr="+U(l.db),"iqt="+U(l.eb)][I]("&utm")}};Na.Bb=function(j,h,k,m,i,p,l,a){var c=this;c.n=j;c.Ca=h;c.tb=k;c.sb=m;c.qb=i;c.Ha=p;c.rb=l;c.Ka=a;c.K=[];c.Db=function(f,d,e,q,x){var b=c.Yb(f),g=c.n;if(u==b)X(c.K,new Na.Ab(g,f,d,e,q,x));else{b.wb=g;b.oa=f;b.o=d;b.Ga=e;b.db=q;b.eb=x}};c.Yb=function(f){for(var d,e=c.K,q=0;q<e[D];q++)d=f==e[q].oa?e[q]:d;return d};c.pa=function(){return"&"+["utmt=tran","id="+U(c.n),"st="+U(c.Ca),"to="+U(c.tb),"tx="+U(c.sb),"sp="+U(c.qb),"ci="+U(c.Ha),"rg="+U(c.rb),"co="+U(c.Ka)][I]("&utmt")}};var Oa=function(j){function h(){var c=i;try{var f=l.awt.Toolkit.getDefaultToolkit().getScreenSize();c=f.width+"x"+f.height}catch(d){}return c}function k(){var c,f,d;f="ShockwaveFlash";var e="$version",q=R[B].navigator;if((q=q?q.plugins:u)&&q[D]>0)for(c=0;c<q[D]&&!d;c++){f=q[c];if(V(f.name,"Shockwave Flash"))d=f.description[F]("Shockwave Flash ")[1]}else{f=f+"."+f;try{c=new ActiveXObject(f+".7");d=c.GetVariable(e)}catch(x){}if(!d)try{c=new ActiveXObject(f+".6");d="WIN 6,0,21,0";c.Lc="always";d=c.GetVariable(e)}catch(b){}if(!d)try{c=new ActiveXObject(f);d=c.GetVariable(e)}catch(g){}if(d){d=d[F](" ")[1][F](",");d=d[0]+"."+d[1]+" r"+d[2]}}return d?d:i}var m=this,i="-",p=R[B].screen,l=R[B].pd,a=R[B].navigator;m.ib=p?p.width+"x"+p.height:l?h():i;m.hb=p?p.colorDepth+"-bit":i;m.Hb=U(R[E].characterSet?R[E].characterSet:R[E].charset?R[E].charset:i);m.ab=(a&&a.language?a.language:a&&a.browserLanguage?a.browserLanguage:i)[L]();m.Za=a&&a.javaEnabled()?1:0;m.Qb=j?k():i;m.Cc=function(){return M+"utm"+["cs="+U(m.Hb),"sr="+m.ib,"sc="+m.hb,"ul="+m.ab,"je="+m.Za,"fl="+U(m.Qb)][I]("&utm")};m.Sb=function(){var c=R[B].navigator,f=R[B].history[D];c=c.appName+c.version+m.ab+c.platform+c.userAgent+m.Za+m.ib+m.hb+(R[E][ga]?R[E][ga]:"")+(R[E].referrer?R[E].referrer:"");for(var d=c[D];f>0;)c+=f--^d++;return Ea(c)}};var Z=function(j,h,k,m){function i(a){var c="";c=a[F]("://")[1][L]();if(V(c,"/"))c=c[F]("/")[0];return c}var p=m,l=this;l.b=j;l.fb=h;l.q=k;l.Ua=function(a){var c=l.aa();return new Z.r(T(a,p.va+N,M),T(a,p.ya+N,M),T(a,p.Aa+N,M),l.J(a,p.ta,"(not set)"),l.J(a,p.wa,"(not set)"),l.J(a,p.za,c&&!S(c.C)?Ca(c.C):u),l.J(a,p.ua,u))};l.Wa=function(a){var c=i(a),f;f=a;var d="";f=f[F]("://")[1][L]();if(V(f,"/")){f=f[F]("/")[1];if(V(f,"?"))d=f[F]("?")[0]}f=d;if(V(c,"google")){a=a[F]("?")[I](M);if(V(a,M+p.gc+N))if(f==p.fc)return s}return t};l.aa=function(){var a,c=l.fb,f,d=p.M;if(!(S(c)||"0"==c||!V(c,"://")||l.Wa(c))){a=i(c);for(var e=0;e<d[D];e++){f=d[e];if(V(a,f.Na[L]())){c=c[F]("?")[I](M);if(V(c,M+f.$a+N)){a=c[F](M+f.$a+N)[1];if(V(a,M))a=a[F](M)[0];return new Z.r(u,f.Na,u,"(organic)","organic",a,u)}}}}};l.J=function(a,c,f){a=T(a,c+N,M);return f=!S(a)?Ca(a):!S(f)?f:"-"};l.mc=function(a){var c=p.ia,f=t;if(a&&"organic"==a.L){a=Ca(a.C)[L]();for(var d=0;d<c[D];d++)f=f||c[d][L]()==a}return f};l.Sa=function(){var a="",c="";a=l.fb;if(!(S(a)||"0"==a||!V(a,"://")||l.Wa(a))){a=a[F]("://")[1];if(V(a,"/")){c=a[H](a[z]("/"));c=c[F]("?")[0];a=a[F]("/")[0][L]()}if(0==a[z]("www."))a=a[H](4);return new Z.r(u,a,u,"(referral)","referral",u,c)}};l.Pa=function(a){var c="";if(p.U){c=a&&a.hash?a[ka][H](a[ka][z]("#")):"";c=""!=c?c+M:c}c+=a.search;return c};l.Vb=function(){return new Z.r(u,"(direct)",u,"(direct)","(none)",u,u)};l.nc=function(a){var c=t,f=p.ka;if(a&&"referral"==a.L){a=U(a.Q)[L]();for(var d=0;d<f[D];d++)c=c||V(a,f[d][L]())}return c};l.i=function(a){return u!=a&&a.Ya()};l.od=function(a){a=T(a,ua+l.b+".",";");var c=a[F](".");a=new Z.r;a.cb(c[fa](4)[I]("."));if(!l.i(a))return s;c=R[E][G];c=l.Pa(c);c=l.Ua(c);if(!l.i(c)){c=l.aa();l.i(c)||(c=l.Sa())}return l.i(c)&&a.D()[L]()!=c.D()[L]()};l.Ub=function(a,c){if(p.Fa){var f="",d="-",e,q=0,x,b,g=l.b;if(a){b=a.h();f=l.Pa(R[E][G]);if(p.v&&a.Xa()){d=a.fa();if(!S(d)&&!V(d,";")){a.sa();return}}d=T(b,ua+g+".",";");e=l.Ua(f);if(l.i(e)){f=T(f,p.xa+N,M);if("1"==f&&!S(d))return}if(!l.i(e)){e=l.aa();if(!S(d)&&l.mc(e))return}if(!l.i(e)&&c){e=l.Sa();if(!S(d)&&l.nc(e))return}if(!l.i(e))if(S(d)&&c)e=l.Vb();if(l.i(e)){if(!S(d)){q=d[F](".");x=new Z.r;x.cb(q[fa](4)[I]("."));x=x.D()[L]()==e.D()[L]();q=q[3]*1}if(!x||c){b=T(b,O+g+".",";");x=b.lastIndexOf(".");b=x>9?b[H](x+1)*1:0;q++;b=0==b?1:b;a.ob([g,l.q,b,q,e.D()][I]("."));a.sa()}}}}}};Z.r=function(j,h,k,m,i,p,l){var a=this;a.n=j;a.Q=h;a.V=k;a.o=m;a.L=i;a.C=p;a.Ja=l;a.D=function(){var c=[],f=[["cid",a.n],["csr",a.Q],["gclid",a.V],["ccn",a.o],["cmd",a.L],["ctr",a.C],["cct",a.Ja]],d,e;if(a.Ya())for(d=0;d<f[D];d++)if(!S(f[d][1])){e=f[d][1][F]("+")[I]("%20");e=e[F](" ")[I]("%20");X(c,"utm"+f[d][0]+N+e)}return c[I]("|")};a.Ya=function(){return!(S(a.n)&&S(a.Q)&&S(a.V))};a.cb=function(c){var f=function(d){return Ca(T(c,"utm"+d+N,"|"))};a.n=f("cid");a.Q=f("csr");a.V=f("gclid");a.o=f("ccn");a.L=f("cmd");a.C=f("ctr");a.Ja=f("cct")}};var Pa=function(j,h,k,m){var i=this,p=h,l=N,a=j,c=m;i.H=k;i.ha="";i.m={};i.kc=function(){var f;f=T(i.H.h(),ta+p+".",";")[F](p+".")[1];if(!S(f)){f=f[F]("|");var d=i.m,e=f[1],q;if(!S(e)){e=e[F](",");for(var x=0;x<e[D];x++){q=e[x];if(!S(q)){q=q[F](l);if(q[D]==4)d[q[0]]=[q[1],q[2],1]}}}i.ha=f[0];i.T()}};i.T=function(){i.Gb();var f=i.ha,d,e,q="";for(d in i.m)if((e=i.m[d])&&1===e[2])q+=d+l+e[0]+l+e[1]+l+1+",";S(q)||(f+="|"+q);if(S(f))i.H.Mb();else{i.H.na(p+"."+f);i.H.ra()}};i.yc=function(f){i.ha=f;i.T()};i.wc=function(f,d,e,q){if(1!=q&&2!=q&&3!=q)q=3;var x=t;if(d&&e&&f>0&&f<=a.bb){d=U(d);e=U(e);if(d[D]+e[D]<=64){i.m[f]=[d,e,q];i.T();x=s}}return x};i.ec=function(f){if((f=i.m[f])&&1===f[2])return f[1]};i.Lb=function(f){var d=i.m;if(d[f]){delete d[f];i.T()}};i.Gb=function(){c.w(8);c.w(9);c.w(11);var f=i.m,d,e;for(e in f)if(d=f[e]){c.p(8,e,d[0]);c.p(9,e,d[1]);(d=d[2])&&3!=d&&c.p(11,e,""+d)}}};var Qa=function(){function j(n,r,w,J){if(u==l[n])l[n]={};if(u==l[n][r])l[n][r]=[];l[n][r][w]=J}function h(n,r,w){if(u!=l[n]&&u!=l[n][r])return l[n][r][w]}function k(n,r){if(u!=l[n]&&u!=l[n][r]){l[n][r]=u;var w=s,J;for(J=0;J<f[D];J++)if(u!=l[n][f[J]]){w=t;break}if(w)l[n]=u}}function m(n){var r="",w=t,J,P;for(J=0;J<f[D];J++){P=n[f[J]];if(u!=P){if(w)r+=f[J];r=r;P=P;w=[];var ia=void 0,C=void 0;for(C=0;C<P[D];C++)if(u!=P[C]){ia="";if(C!=o&&u==P[C-1])ia+=C[ja]()+x;var K;K=P[C];var W="",ca=void 0,da=void 0,ea=void 0;for(ca=0;ca<K[D];ca++){da=K[y](ca);ea=g[da];W+=u!=ea?ea:da}K=W;ia+=K;X(w,ia)}P=d+w[I](q)+e;r=r+P;w=t}else w=s}return r}var i=this,p=Aa(i),l={},a="k",c="v",f=[a,c],d="(",e=")",q="*",x="!",b="'",g={};g[b]="'0";g[e]="'1";g[q]="'2";g[x]="'3";var o=1;i.ic=function(n){return u!=l[n]};i.N=function(){var n="",r;for(r in l)if(u!=l[r])n+=r[ja]()+m(l[r]);return n};i.rc=function(n){if(n==u)return i.N();var r=n.N(),w;for(w in l)if(u!=l[w]&&!n.ic(w))r+=w[ja]()+m(l[w]);return r};i.p=p("_setKey",89,function(n,r,w){if(typeof w!="string")return t;j(n,a,r,w);return s});i.pb=p("_setValue",90,function(n,r,w){if(typeof w!="number"&&(u==Number||!(w instanceof Number))||v.round(w)!=w||w==NaN||w==Infinity)return t;j(n,c,r,w[ja]());return s});i.Zb=p("_getKey",87,function(n,r){return h(n,a,r)});i.dc=p("_getValue",88,function(n,r){return h(n,c,r)});i.w=p("_clearKey",85,function(n){k(n,a)});i.Ia=p("_clearValue",86,function(n){k(n,c)})};var Ra=function(j,h){var k=this,m=Aa(k);k.rd=h;k.pc=j;k.ub=m("_trackEvent",91,function(i,p,l){return h.ub(k.pc,i,p,l)})};var $=function(){};$.Pb=function(j){var h="gaso=",k=R[E][G].hash;if(k&&1==k[z](h))j=T(k,h,M);else j=(k=R[B].name)&&0<=k[z](h)?T(k,h,M):T(j.h(),wa,";");return j};$.oc=function(j,h){var k=(h||"www")+".google.com";k="https://"+k+"/analytics/reporting/overlay_js?gaso="+j+M+Fa();var m="_gasojs",i=R[E].createElement("script");i.type="text/javascript";i.src=k;if(m)i.id=m;(R[E].getElementsByTagName("head")[0]||R[E].getElementsByTagName("body")[0]).appendChild(i)};$.load=function(j,h){if(!$.lc){var k=$.Pb(h),m=k&&k.match(/^(?:\|([-0-9a-z.]{1,30})\|)?([-.\w]{10,1200})$/i);if(m){h.xc(k);h.Kc();Y._gasoDomain=j.a;Y._gasoCPath=j.f;$.oc(m[2],m[1])}$.lc=s}};var Sa=function(j,h,k){function m(){if("auto"==d.a){var b=R[E].domain;if("www."==b[H](0,4))b=b[H](4);d.a=b}d.a=d.a[L]()}function i(){m();var b=d.a,g=b[z]("www.google.")*b[z](".google.")*b[z]("google.");return g||"/"!=d.f||b[z]("google.org")>-1}function p(b,g,o){if(S(b)||S(g)||S(o))return"-";b=T(b,O+a.b+".",g);if(!S(b)){b=b[F](".");b[5]=""+(b[5]?b[5]*1+1:1);b[3]=b[4];b[4]=o;b=b[I](".")}return b}function l(){return"file:"!=R[E][G].protocol&&i()}var a=this,c=Aa(a),f=u,d=new Ia,e=d.a,q=t,x=u;a.o=j;a.q=v.round((new Date)[ha]()/1E3);a.s=h||"UA-XXXXX-X";a.La=R[E].referrer;a.$=u;a.d=u;a.A=t;a.G=u;a.e=u;a.Oa=u;a.b=u;a.j=u;d.l=k?U(k):u;a.ac=function(){return Fa()^a.G.Sb()&2147483647};a.Wb=function(){if(!d.a||""==d.a||"none"==d.a){d.a="";return 1}m();return d.Da?Ea(d.a):1};a.Rb=function(b,g){if(S(b))b="-";else{g+=d.f&&"/"!=d.f?d.f:"";var o=b[z](g);b=o>=0&&o<=8?"0":"["==b[y](0)&&"]"==b[y](b[D]-1)?"-":b}return b};a.gb=function(b){var g="";g+=d.W?a.G.Cc():"";g+=d.Y&&!S(R[E].title)?"&utmdt="+U(R[E].title):"";g=g;var o;o=u;if(R[B]&&R[B][A]&&R[B][A].hid)o=R[B][A].hid;else{o=Fa();R[B].gaGlobal=R[B][A]?R[B][A]:{};R[B][A].hid=o}o=o;return g=g+("&utmhid="+o+"&utmr="+U(a.$)+"&utmp="+U(a.sc(b)))};a.sc=function(b){var g=R[E][G];return b=u!=b&&""!=b?U(b,s):U(g.pathname+g.search,s)};a.Fc=function(b){if(a.R()){var g="";if(a.e!=u&&a.e.N()[D]>0)g+="&utme="+U(a.e.N());g+=a.gb(b);f.P(g,a.s,a.b)}};a.Jb=function(){var b=new Ka(d);return b.ja(a.b)?b.Bc():u};a.Ra=c("_getLinkerUrl",52,function(b,g){var o=b[F]("#"),n=b,r=a.Jb();if(r)if(g&&1>=o[D])n+="#"+r;else if(!g||1>=o[D])if(1>=o[D])n+=(V(b,"?")?M:"?")+r;else n=o[0]+(V(b,"?")?M:"?")+r+"#"+o[1];return n});a.hc=function(){var b=a.q,g=a.j,o=g.h(),n=a.b+"",r=R[B]?R[B][A]:u,w,J=V(o,O+n+"."),P=V(o,qa+n),ia=V(o,ra+n),C,K=[],W="",ca=t;o=S(o)?"":o;if(d.v){w=R[E][G]&&R[E][G].hash?R[E][G][ka][H](R[E][G][ka][z]("#")):"";if(d.U&&!S(w))W=w+M;W+=R[E][G].search;if(!S(W)&&V(W,O)){g.qc(W);g.Xa()||g.Ib();C=g.ba()}w=g.ea;var da=g.nb,ea=g.zb;if(!S(w())){da(Ca(w()));V(w(),";")||ea()}w=g.da;da=g.na;ea=g.ra;if(!S(w())){da(w());V(w(),";")||ea()}}if(S(C))if(J)if(!P||!ia||0){C=p(o,";",b);a.A=s}else{C=T(o,O+n+".",";");K=T(o,qa+n,";")[F](".")}else{C=[n,a.ac(),b,b,b,1][I](".");ca=a.A=s}else if(S(g.z())||S(g.ca())){C=p(W,M,b);a.A=s}else{K=g.z()[F](".");n=K[0]}C=C[F](".");if(R[B]&&r&&r.dh==n&&!d.l){C[4]=r.sid?r.sid:C[4];if(ca){C[3]=r.sid?r.sid:C[4];if(r.vid){b=r.vid[F](".");C[1]=b[0];C[2]=b[1]}}}g.lb(C[I]("."));K[0]=n;K[1]=K[1]?K[1]:0;K[2]=u!=K[2]?K[2]:d.Dc;K[3]=K[3]?K[3]:C[4];g.la(K[I]("."));g.mb(n);S(g.cc())||g.ma(g.I());g.xb();g.qa();g.yb()};a.jc=function(){f=new Ma(d)};a.getName=c("_getName",58,function(){return a.o});a.c=c("_initData",2,function(){var b;if(!q){if(!a.G)a.G=new Oa(d.Z);a.b=a.Wb();a.j=new Ka(d);a.e=new Qa;x=new Pa(d,a.b,a.j,a.e);a.jc()}if(l()){if(!q){a.$=a.Rb(a.La,R[E].domain);b=new Z(a.b,a.$,a.q,d)}a.hc(b);x.kc()}if(!q){l()&&b.Ub(a.j,a.A);a.Oa=new Qa;$.load(d,a.j);q=s}});a.Jc=c("_visitCode",54,function(){a.c();var b=T(a.j.h(),O+a.b+".",";");b=b[F](".");return b[D]<4?"":b[1]});a.Vc=c("_cookiePathCopy",30,function(b){a.c();a.j&&a.j.Hc(a.b,b)});a.R=function(){return a.Jc()%1E4<d.O*100};a.de=c("_trackPageview",1,function(b){if(l()){a.c();a.Fc(b);a.A=t}});a.ee=c("_trackTrans",18,function(){var b=a.b,g=[],o,n,r;a.c();if(a.d&&a.R()){for(o=0;o<a.d.S[D];o++){n=a.d.S[o];X(g,n.pa());for(r=0;r<n.K[D];r++)X(g,n.K[r].pa())}for(o=0;o<g[D];o++)f.P(g[o],a.s,b,s)}});a.Zd=c("_setTrans",20,function(){var b,g,o,n;b=R[E].getElementById?R[E].getElementById("utmtrans"):R[E].utmform&&R[E].utmform.utmtrans?R[E].utmform.utmtrans:u;a.c();if(b&&b.value){a.d=new Na;n=b.value[F]("UTM:");d.t=!d.t||""==d.t?"|":d.t;for(b=0;b<n[D];b++){n[b]=Da(n[b]);g=n[b][F](d.t);for(o=0;o<g[D];o++)g[o]=Da(g[o]);if("T"==g[0])a.Ba(g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8]);else"I"==g[0]&&a.Cb(g[1],g[2],g[3],g[4],g[5],g[6])}}});a.Ba=c("_addTrans",21,function(b,g,o,n,r,w,J,P){a.d=a.d?a.d:new Na;return a.d.Eb(b,g,o,n,r,w,J,P)});a.Cb=c("_addItem",19,function(b,g,o,n,r,w){var J;a.d=a.d?a.d:new Na;(J=a.d.Va(b))||(J=a.Ba(b,"","","","","","",""));J.Db(g,o,n,r,w)});a.ae=c("_setVar",22,function(b){if(b&&""!=b&&i()){a.c();x.yc(U(b));a.R()&&f.P("&utmt=var",a.s,a.b)}});a.Kd=c("_setCustomVar",10,function(b,g,o,n){a.c();return x.wc(b,g,o,n)});a.Zc=c("_deleteCustomVar",35,function(b){a.c();x.Lb(b)});a.ld=c("_getVisitorCustomVar",50,function(b){a.c();return x.ec(b)});a.Sd=c("_setMaxCustomVariables",71,function(b){d.bb=b});a.link=c("_link",12,function(b,g){if(d.v&&b){a.c();R[E][G].href=a.Ra(b,g)}});a.qd=c("_linkByPost",13,function(b,g){if(d.v&&b&&b.action){a.c();b.action=a.Ra(b.action,g)}});a.be=c("_setXKey",83,function(b,g,o){a.e.p(b,g,o)});a.ce=c("_setXValue",84,function(b,g,o){a.e.pb(b,g,o)});a.md=c("_getXKey",76,function(b,g){return a.e.Zb(b,g)});a.nd=c("_getXValue",77,function(b,g){return a.e.dc(b,g)});a.Tc=c("_clearXKey",72,function(b){a.e.w(b)});a.Uc=c("_clearXValue",73,function(b){a.e.Ia(b)});a.Yc=c("_createXObj",75,function(){a.c();return new Qa});a.tc=c("_sendXEvent",78,function(b){var g="";a.c();if(a.R()){g+="&utmt=event&utme="+U(a.e.rc(b))+a.gb();f.P(g,a.s,a.b,t,s)}});a.Xc=c("_createEventTracker",74,function(b){a.c();return new Ra(b,a)});a.ub=c("_trackEvent",4,function(b,g,o,n){a.c();var r=a.Oa;if(u!=b&&u!=g&&""!=b&&""!=g){r.w(5);r.Ia(5);(b=r.p(5,1,b)&&r.p(5,2,g)&&(u==o||r.p(5,3,o))&&(u==n||r.pb(5,1,n)))&&a.tc(r)}else b=t;return b});a.dd=function(){return d};a.Nd=c("_setDomainName",6,function(b){e=d.a=b});a.Oc=c("_addOrganic",14,function(b,g,o){d.M.splice(o?0:d.M[D],0,new Ha(b,g))});a.Sc=c("_clearOrganic",17,function(){d.M=[]});a.Mc=c("_addIgnoredOrganic",15,function(b){X(d.ia,b)});a.Qc=c("_clearIgnoredOrganic",16,function(){d.ia=[]});a.Nc=c("_addIgnoredRef",31,function(b){X(d.ka,b)});a.Rc=c("_clearIgnoredRef",32,function(){d.ka=[]});a.ud=c("_setAllowHash",8,function(b){d.Da=b?1:0});a.Fd=c("_setCampaignTrack",36,function(b){d.Fa=b?1:0});a.Gd=c("_setClientInfo",66,function(b){d.W=b?1:0});a.cd=c("_getClientInfo",53,function(){return d.W});a.Hd=c("_setCookiePath",9,function(b){d.f=b});a.$d=c("_setTransactionDelim",82,function(b){d.t=b});a.Jd=c("_setCookieTimeout",25,function(b){a.vc(b*1E3)});a.vc=c("_setCampaignCookieTimeout",29,function(b){d.Ea=b});a.Ld=c("_setDetectFlash",61,function(b){d.Z=b?1:0});a.ed=c("_getDetectFlash",65,function(){return d.Z});a.Md=c("_setDetectTitle",62,function(b){d.Y=b?1:0});a.fd=c("_getDetectTitle",56,function(){return d.Y});a.Pd=c("_setLocalGifPath",46,function(b){d.ga=b});a.gd=c("_getLocalGifPath",57,function(){return d.ga});a.Rd=c("_setLocalServerMode",92,function(){d.B=0});a.Vd=c("_setRemoteServerMode",63,function(){d.B=1});a.Qd=c("_setLocalRemoteServerMode",47,function(){d.B=2});a.hd=c("_getServiceMode",59,function(){return d.B});a.Wd=c("_setSampleRate",45,function(b){d.O=b});a.Xd=c("_setSessionTimeout",27,function(b){a.zc(b*1E3)});a.zc=c("_setSessionCookieTimeout",26,function(b){d.kb=b});a.vd=c("_setAllowLinker",11,function(b){d.v=b?1:0});a.td=c("_setAllowAnchor",7,function(b){d.U=b?1:0});a.Cd=c("_setCampNameKey",41,function(b){d.ta=b});a.yd=c("_setCampContentKey",38,function(b){d.ua=b});a.zd=c("_setCampIdKey",39,function(b){d.va=b});a.Ad=c("_setCampMediumKey",40,function(b){d.wa=b});a.Bd=c("_setCampNOKey",42,function(b){d.xa=b});a.Dd=c("_setCampSourceKey",43,function(b){d.ya=b});a.Ed=c("_setCampTermKey",44,function(b){d.za=b});a.xd=c("_setCampCIdKey",37,function(b){d.Aa=b});a.ad=c("_getAccount",64,function(){return a.s});a.sd=c("_setAccount",3,function(b){a.s=b});a.Td=c("_setNamespace",48,function(b){d.l=b?U(b):u});a.kd=c("_getVersion",60,function(){return na});a.wd=c("_setAutoTrackOutbound",79,Ga);a.Yd=c("_setTrackOutboundSubdomains",81,Ga);a.Od=c("_setHrefExamineLimit",80,Ga);a.Ud=c("_setReferrerOverride",49,function(b){a.La=b});a.Id=c("_setCookiePersistence",24,function(b){a.Ac(b)});a.Ac=c("_setVisitorCookieTimeout",28,function(b){d.u=b})};var Ta=function(){var j=this,h=Aa(j);j.Ma=t;j.vb={};j.Gc=0;j._gasoDomain=u;j._gasoCPath=u;j.jd=h("_getTracker",0,function(k,m){return j.X(k,u,m)});j.X=h("_createTracker",55,function(k,m,i){m&&Q(23);i&&Q(67);if(m==u)m="~"+Y.Gc++;return Y.vb[m]=new Sa(m,k,i)});j.Ta=h("_getTrackerByName",51,function(k){k=k||"";return Y.vb[k]||Y.X(u,k)});j.Ic=function(){var k=aa[oa];return k&&k[pa]&&k[pa]()};j.Pc=h("_anonymizeIp",70,function(){j.Ma=s})};var Ua=t,Wa=function(){var j=this,h=Aa(j);j.Wc=h("_createAsyncTracker",33,function(k,m){return Y.X(k,m||"")});j.bd=h("_getAsyncTracker",34,function(k){return Y.Ta(k)});j.push=function(){Q(5);var k=arguments,m=0;Ua=s;for(var i=0;i<k[D];i++)try{if(typeof k[i]==="function")k[i]();else{var p="",l=k[i][0],a=l.lastIndexOf(".");if(a>0){p=l[H](0,a);l=l[H](a+1)}var c=p==la?Y:p==ma?Va:Y.Ta(p);c[l].apply(c,k[i][fa](1))}}catch(f){m++}return m}};var Y=new Ta;var Xa=aa[la];if(Xa&&typeof Xa._getTracker=="function")Y=Xa;else aa[la]=Y;var Va=new Wa;a:{var Ya=aa[ma],Za=t;if(Ya&&typeof Ya[ba]=="function"){Za=Ya.constructor==Array;if(!Za)break a}aa[ma]=Va;Za&&Va[ba].apply(Va,Ya)};})();
