var _jq=$.noConflict(!0);try{window.$=_jq,window.jQuery=_jq}catch(Excp){} _jq.imCookie=function(a,b,d){if(null!=b){d=d||{};if(null==d.expires)d.expires=60;if(null===b)b="",d.expires=-1;var c="";if(d.expires&&("number"==typeof d.expires||d.expires.toUTCString))"number"==typeof d.expires?(c=new Date,c.setTime(c.getTime()+864E5*d.expires)):c=d.expires,c="; expires="+c.toUTCString();var e=d.path?"; path="+d.path:"",h=d.domain?"; domain="+d.domain:";",d=d.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),c,e,h,d].join("")}else{b=null;if(document.cookie&&""!== document.cookie){d=document.cookie.split(";");for(c=0;c<d.length;c++)if(e=_jq.trim(d[c]),e.substring(0,a.length+1)==a+"="){b=decodeURIComponent(e.substring(a.length+1));break}}return b}};_jq.extend(_jq.easing,{imBounce:function(a,b,d,c,e){return(b/=e)<1/2.75?c*7.5625*b*b+d:b<2/2.75?c*(7.5625*(b-=1.5/2.75)*b+0.75)+d:b<2.5/2.75?c*(7.5625*(b-=2.25/2.75)*b+0.9375)+d:c*(7.5625*(b-=2.625/2.75)*b+0.984375)+d}}); var x5engine={settings:{imGrid:{enabled:!1},imSound:{idName:"imJSSound"},imCaptcha:{offlineCodes:[]},zIndex:{menu:1E4,datePicker:10201,tip:10221,showBox:10301,splashBox:10401,popup:10501},general:{preview:!0},imShowBox:{background:"black",opacity:0.6,border:10,closeImg:"res/imClose.png",loadingImg:"res/imLoad.gif",textColor:"black",boxColor:"white",effect:"fade",shadow:!1,innerBorder:12},imPopUp:{background:"black",opacity:0.6,borderRadius:10,textColor:"black",boxColor:"white",effect:"fade",shadow:!1}, imTip:{borderRadius:10,classes:"",shadow:!0,arrow:!0,position:"right",effect:"fade",showTail:!0,persistant:!1,unique:!0},imAdv:{},imAlertBox:{position:"top",sound:"",cookie:!1,image:"",link:""},imSplashBox:{position:"center",sound:"",effect:"none",shadow:!0,margin:0,width:100,height:100,cookie:!1,image:"",link:""},imBlog:{posts:[],posts_month:[],posts_cat:[],posts_ids:[],comments:!1,captcha:!1}},l10n:{_l10n:[],addLocalization:function(a,b){x5engine.l10n._l10n[a]=b},getLocalization:function(a){return null== a||""==a||null==x5engine.l10n._l10n[a]||"undefined"==x5engine.l10n._l10n[a]||""==x5engine.l10n._l10n[a]?"":x5engine.l10n._l10n[a]}},utils:{hex2rgb:function(a,b,d,c){for(var a=a.replace("#","").match(/(.{2})/g),e=3;e--;)a[e]=parseInt(a[e],16);null!=b&&(a[0]+=b);null!=d&&(a[1]+=d);null!=c&&(a[2]+=c);for(e=0;3>e;e++)255<a[e]&&(a[e]=255),0>a[e]&&(a[e]=0);return"rgb("+a.join(", ")+")"},imFormatInt:function(a){10>a&&(a="0"+a);return a},popup:function(a){(new x5engine.utils.Gui).showPopUp(a)},Gui:function(){var a= function(a){_jq("#imGuiPopUp").fadeOut(a);_jq("#imGuiPopUpBg").fadeOut(a,function(){_jq("#imGuiPopUp").remove();_jq("#imGuiPopUpBg").remove()})};this.showPopUp=function(b){b.width=b.width||x5engine.settings.imPopUp.width;b.borderRadius=b.borderRadius||x5engine.settings.imPopUp.borderRadius;b.backGround=b.background||x5engine.settings.imPopUp.background;b.effect=b.effect||x5engine.settings.imPopUp.effect;b.textColor=b.textColor||x5engine.settings.imPopUp.textColor;b.boxColor=b.boxColor||x5engine.settings.imPopUp.boxColor; b.opacity=b.opacity||x5engine.settings.imPopUp.opacity;if(null==b.graphics)b.graphics=!0;if(b.graphics){b.text=b.text.replace(/&amp;/g,"&").replace(/\&gt;/g,">").replace(/\&lt;/g,"<");var d;d="none"!=b.effect?200:0;if(null==b.shadow)b.shadow=x5engine.settings.imPopUp.shadow;_jq("#imGuiPopUpBG").remove();_jq("#imGuiPopUp").remove();var c='<div id="imGuiPopUpBg"></div><div id="imGuiPopUp">'+b.text+'<div id="imCloseButton" class="imGuiButton">OK</div></div>';_jq("body").append(c);_jq("#imGuiPopUpBg").css({zIndex:x5engine.settings.zIndex.popup}); _jq("#imGuiPopUp").css({zIndex:x5engine.settings.zIndex.popup+1});_jq("#imGuiPopUp").fadeOut(0);b.shadow&&(_jq("#imGuiPopUp").css("box-shadow","0px 5px 30px #000"),_jq("#imGuiPopUp").css("-webkit-box-shadow","0px 5px 30px #000"),_jq("#imGuiPopUp").css("-moz-box-shadow","0px 5px 30px #000"));_jq("#imGuiPopUp").css("-moz-border-radius",b.borderRadius+"px");_jq("#imGuiPopUp").css("-webkit-border-radius",b.borderRadius+"px");_jq("#imGuiPopUp").css("border-radius",b.borderRadius+"px");_jq(".imGuiButton").css("-moz-border-radius", b.borderRadius+"px");_jq(".imGuiButton").css("-webkit-border-radius",b.borderRadius+"px");_jq(".imGuiButton").css("border-radius",b.borderRadius+"px");_jq("#imGuiPopUpBg").css({width:_jq(window).width(),height:_jq(window).height()});_jq("#imGuiPopUp").width(b.width);_jq("#imGuiPopUp").css({position:"fixed",top:(_jq(window).height()-_jq("#imGuiPopUp").outerHeight())/2,left:(_jq(window).width()-_jq("#imGuiPopUp").outerWidth())/2});_jq("#imGuiPopUpBg").click(function(){a(d)});_jq("#imCloseButton").click(function(){a(d)}); _jq("#imGuiPopUp").fadeIn(d);_jq("#imGuiPopUpBg").fadeOut(1,function(){_jq("#imGuiPopUpBg").fadeTo(d,b.opacity)})}else alert(b.text.replace(/&amp;/g,"&").replace(/\&gt;/g,">").replace(/\&lt;/g,"<").replace(/<br[\s]*\/>/g,"\n").replace(/<([A-Z][A-Z0-9]*)\b[^>]*\/?>/g,""))};this.removeLabels=function(){_jq(".imGuiLabel").remove()};this.showLabel=function(a){for(var d=0;0<_jq("#imGuiLabel"+d).length;)d++;var d="imGuiLabel"+d,c="<div class='imGuiLabel' id='"+d+"'>"+a.text+"</div>";_jq("body").append(c); var e=_jq("#"+d);e.css("box-shadow","0px 0px 7px #aaa");e.css("-webkit-box-shadow","0px 0px 7px #aaa");e.css("-moz-box-shadow","0px 0px 7px #aaa");e.css("-moz-border-radius","3px");e.css("-webkit-border-radius","3px");e.css("border-radius","3px");null!==a.object?(a=_jq(a.object),d=a.offset(),c=d.top+Math.floor((a.outerHeight()-e.outerHeight())/2),0>c&&(c=0),e.css({position:"absolute",top:c,left:d.left+a.outerWidth()+10})):(e.css({width:200,height:50,padding:10}),a=e.outerHeight(),e.css({position:"fixed", bottom:-a,right:30,overflow:"hidden",cursor:"pointer"}),e.animate({bottom:10}));e.fadeTo(300,0.8);e.click(function(){e.fadeOut(100,function(){e.remove()})})}},createId:function(a){for(var a=a||"imObj",b=0;0<_jq("#"+a+b).length;)b++;return a+b},imGetParameter:function(a){var b="",d=0,c=0;0!==window.top.location.search&&(b=unescape(window.top.location.search));a+="=";if(0<b.length&&(d=b.indexOf(a),-1!=d)){d+=a.length;c=b.indexOf("&",d);if(-1==c)c=b.length;return b.substring(d,c)}return null},imPreloadImages:function(a){for(var b= 0;b<a.length;b++)(new Image).src=a[b]},imOpenLocation:function(a){document.location=a},imGetLayer:function(a){return _jq(a)},imCodeProtection:function(a){document.oncontextmenu=function(){alert("Copyrights "+a+". All rights reserved.");return!1}},imFocus:function(a,b){_jq(a).css("background-color",b)},imSoundLink:{getMimeType:function(){var a="application/x-mplayer2",b=navigator.userAgent.toLowerCase();navigator.mimeTypes&&-1==b.indexOf("windows")&&navigator.mimeTypes["audio/mpeg"].enabledPlugin&& (a="audio/mpeg");return a},Play:function(a,b){null==b&&(b=!1);x5engine.utils.imSoundLink.Stop();_jq("body").append('<embed type="'+x5engine.utils.imSoundLink.getMimeType()+'" style="height:0" id="'+x5engine.settings.imSound.idName+'" src="'+a+'" loop="'+b+'" autostart="true" hidden="true" />')},Stop:function(){_jq("#"+x5engine.settings.imSound.idName).remove()}},imPopUpWin:function(a,b,d,c,e,h){void 0==e&&(e=!1);void 0==h&&(h=1);void 0==d&&(d=-1);void 0==c&&(c=-1);window.open(a,"",!0==e?"":-1==d|| -1==c?"width="+screen.width+",height="+screen.height+",top=0,left=0,scrollbars="+h+",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no":"width="+d+",height="+c+",top="+(screen.height?(screen.height-c)/2:100)+",left="+(screen.width?(screen.width-d)/2:100)+",scrollbars="+h+",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no").focus();return!1},switchFocus:function(a){_jq(a).find(":input").each(function(){var a=_jq(this).attr("type");"button"!=a&&"submit"!= a&&"reset"!=a&&(_jq(this).focus(function(){_jq(this).addClass("imFormFocus")}),_jq(this).blur(function(){_jq(this).removeClass("imFormFocus")}))})},isOnline:function(){return"http"==window.top.location.href.substring(0,4)?!0:!1},emailTo:function(a,b){for(var d="",c=0;c<a.length;c++)var e=parseInt(a.charAt(c),10),h=b.substring(0,e),b=b.substring(e),d=h+d;location.href="mailto:"+d},bookmark:function(a,b){try{if(window.sidebar)window.sidebar.addPanel(b,a,"");else if(window.opera){var d=document.createElement("A"); d.rel="sidebar";d.target="_search";d.title=b;d.href=a;d.click()}else document.all?window.external.AddFavorite(a,b):window.open(a)}catch(c){window.open(a)}},setHomepage:function(a,b){if(document.all)try{a.style.behavior="url(#default#homepage)",a.setHomePage(b)}catch(d){window.open(b)}else if(window.sidebar)try{window.netscape&&netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch).setCharPref("browser.startup.homepage", b)}catch(c){}},location:function(a){window.top.location.href=a},getParam:function(a){var b="",d=0,c=0;0!=window.top.location.search&&(b=unescape(window.top.location.search));a+="=";if(0<b.length&&(d=b.indexOf(a),-1!=d)){d+=a.length;c=b.indexOf("&",d);if(-1==c)c=b.length;return b.substring(d,c)}return null},offlineMessageTimeout:null,showOfflineMessage:function(a,b,d){var c=function(){_jq("#imMsgBoxF").height(_jq("#imMsgBox").outerHeight())};if(!x5engine.utils.isOnline()){if(0<_jq("#imMsgBox").length&& -1!==_jq("#imMsgBox").html().indexOf(a))return!1;_jq("#imMsgBox, #imMsgBoxF").remove();b=b||"";d="z-index: 10200; position: fixed; top: 0; left: 0; right: 0; padding: 8px; background-color: "+(d||"#FFFFE1")+"; font-family: Tahoma; font-size: 8pt; border-bottom: 1px solid gray;";0==_jq("#imMsgBox").length&&(_jq("body").prepend('<div id="imMsgBoxF">&nbsp;</div>'),_jq("body").prepend('<div id="imMsgBox" style="'+d+'">'+(""!=b?'<img style="float: left;" src="'+b+'" />':"")+'<span style="float: left;">'+ a+'</span><span id="imMsgBoxClose" style="float: right; cursor: pointer;"><b>X</b></span></div>'));c();_jq("#imMsgBox, #imMsgBoxF").fadeOut(0);_jq("#imMsgBox, #imMsgBoxF").slideDown("slow");_jq(window).unbind("resize",c).resize(c);_jq("#imMsgBoxClose").unbind("click").click(function(){_jq("#imMsgBox, #imMsgBoxF").slideUp("slow",function(){_jq("#imMsgBox, #imMsgBoxF").remove()})})}return!1},alignWelcomePage:function(){var a=function(){var a=_jq(window).height()-_jq("#imCell_1").outerHeight();0<_jq("#imCell_2").length&& (a-=_jq("#imCell_2").outerHeight());a/=2;0>a&&(a=0);_jq("#imContent").css({marginTop:a})};a();_jq(window).unbind("resize",a).resize(a)},autoHeight:function(){_jq(".autoHeight").each(function(){_jq(this).height("auto")})},imHash:function(a){for(var b="",d=0,c=a.length-1;0<=c;c--)d+=a.charCodeAt(c)*Math.pow(2,a.length-c);d=834*d+"";for(a=0;0<d.length;)a+=2*(parseInt(d.charAt(0))+5),d=d.substr(1),61<a&&(a-=61),b+="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890".charAt(a);return b}},imBlog:{separator:'<div class="imBlogSeparator"></div>\n', showPost:function(a,b,d){var c,b=b||0,d=d||0,e=x5engine.settings.imBlog.posts[a];if(null!=e){c=""+('<h2 id="imPgTitle" style="display: block;">'+e.title+"</h2>");c+='<div class="imBreadcrumb" style="display: block;">'+x5engine.l10n.getLocalization("blog_published_by")+"<strong> "+e.author+" </strong>";c+=x5engine.l10n.getLocalization("blog_in")+' <a href="?category='+e.category.replace(/[\s]{1}/g,"_")+'">'+e.category+"</a> &#149; "+e.timestamp;null!=e.media&&(c+=' &#149; <a href="'+e.media+'">Download '+ e.media.substring(e.media.lastIndexOf("/"))+"</a>");if(0<e.tag.length){c+="<br />Tags: ";for(var h=0;h<e.tag.length;h++)c+='<a href="?tag='+e.tag[h]+'">'+e.tag[h]+"</a>,&nbsp;"}c+="</div>";if(0!=b||0!=d){c+='<div class="imBlogPostBody">';null!=e.mediahtml&&(c+=e.mediahtml);c+=e.body;if(0<e.sources.length){c=c+'<div class="imBlogSources">'+("<b>"+x5engine.l10n.getLocalization("blog_sources")+":</b><br />");c+="<ul>";for(d=0;d<e.sources.length;d++)c+="<li>"+e.sources[d]+"</li>";c+="</ul></div>"}c+= (null!=x5engine.settings.imBlog.addThis?"<br />"+x5engine.settings.imBlog.addThis:"")+"<br /><br /></div>"}else c+='<div class="imBlogPostSummary">'+e.summary+"</div>";0==b&&(c+='<div class="imBlogPostRead"><a class="imCssLink" href="?id='+a+'">'+x5engine.l10n.getLocalization("blog_read_all")+" &#187;</a></div>");0!=b&&x5engine.settings.imBlog.comments&&(c=c+'<div class="imBlogPostComments">'+('<div class="imBlogCommentsCount">'+x5engine.l10n.getLocalization("blog_no_comment")+"</div>"),c=c+'<div class="imBlogCommentsForm" style="width: 300px;"><form id="blogComment" action="#"><div class="imBlogCommentRow">'+ ('<label for="form_name" style="float: left;">'+x5engine.l10n.getLocalization("blog_name")+'*</label> <input type="text" id="form_name" name="name" class="imfield mandatory" style="float: right;" />'),c=c+'</div><div class="imBlogCommentRow">'+('<label for="form_email" style="float: left;">'+x5engine.l10n.getLocalization("blog_email")+'*</label> <input type="text" id="form_email" name="email" class="imfield mandatory valEmail" style="float: right;" />'),c=c+'</div><div class="imBlogCommentRow">'+ ('<label for="form_url" style="float: left;">'+x5engine.l10n.getLocalization("blog_website")+'</label> <input type="text" id="form_url" name="url" style="float: right;" class="imfield" />'),c=c+'</div><div class="imBlogCommentRow">'+('<label for="form_body" style="clear: both;">'+x5engine.l10n.getLocalization("blog_message")+'*</label><textarea id="form_body" name="body" class="imfield mandatory" style="width: 100%; height: 100px;"></textarea>'),c+="</div>",x5engine.settings.imBlog.captcha&&(c=c+ '<div class="imBlogCommentRow" style="text-align: center">'+('<label for="imCpt" style="float: left;">'+x5engine.l10n.getLocalization("form_captcha_title")+'</label>&nbsp;<input type="text" id="imCpt" name="imCpt" class="imfield imCpt[5,../]" size="5" style="width: 120px; margin: 0 auto;" />'),c+="</div>"),c+='<div class="imBlogCommentRow" style="text-align: center; margin-bottom: 15px;"><input type="button" value="'+x5engine.l10n.getLocalization("blog_send")+'" class="imBlogCommentSubmitBtn" onclick="x5engine.imBlog.offlineCheck()"/></div>', c+="</form></div></div>");return c}},offlineCheck:function(){x5engine.imForm.validate("#blogComment",{type:"tip",showAll:!0})&&x5engine.utils.showOfflineMessage(x5engine.l10n.getLocalization("blog_offline_message"))},showCategory:function(a){var b="";bps=x5engine.settings.imBlog.posts_cat[a];if(null!=bps){if(0<bps.length)for(a=0;a<bps.length;a++)b+=x5engine.imBlog.showPost(bps[a],0,a==bps.length-1?1:0),0<a&&(b+=x5engine.imBlog.separator);else b+='<div class="imBlogEmpty">Empty category</div>';return b}}, showMonth:function(a){var b="";bps=x5engine.settings.imBlog.posts_month[a];if(null!=bps){if(0<bps.length)for(a=0;a<bps.length;a++)b+=x5engine.imBlog.showPost(bps[a],0,a==bps.length-1?1:0),0<a&&(b+=x5engine.imBlog.separator);else b+='<div class="imBlogEmpty">Empty month</div>';return b}},showSearch:function(a){var b="",d=x5engine.settings.imBlog.posts_ids,c=0;if(null!=d){if(0<d.length){for(var e=0;e<d.length;e++)if(-1!=x5engine.settings.imBlog.posts[d[e]].title.indexOf(a)||-1!=x5engine.settings.imBlog.posts[d[e]].summary.indexOf(a)|| -1!=x5engine.settings.imBlog.posts[d[e]].body.indexOf(a))b+=x5engine.imBlog.showPost(d[e],0,c==d.length-1?1:0),c++,0<e&&(b+=x5engine.imBlog.separator);0==c&&(b+='<div class="imBlogEmpty">Empty search</div>')}else b+='<div class="imBlogEmpty">Empty blog</div>';return b}},showLast:function(a){var b=x5engine.settings.imBlog.posts_ids,d="";if(null!=b){if(0<b.length)for(var a=b.length<a?b.length:a,c=0;c<a;c++)d+=x5engine.imBlog.showPost(b[c],0,0==c?1:0),0<c&&(d+=x5engine.imBlog.separator);else d+='<div class="imBlogEmpty">Empty blog</div>'; return d}},showTag:fun
