var mclick="click",mtouchstart="mousedown",mtouchend="mouseup",mtouchmove="mousemove";if(window.ontouchstart!==undefined){mclick="click";mtouchstart="touchstart";mtouchend="touchend";mtouchmove="touchmove"}function getSessionExpiredUrl(){$(window).unbind("beforeunload");alert(translate("page.sessionTimeout"));window.close();return null}function initCanvasHeight(){var maxheight=0;var helperfunc=function(dom){var degree=dom.data("deg");var pos=[parseInt(dom.css("left")),parseInt(dom.css("top"))];var w=dom.width();var h=dom.height();if(dom.hasClass("cstlayer")){var buttompos=$.divrotate.getDegreeModMaxPointOrigin(dom,degree,pos,[w,h],"buttom")}else{var buttompos=dom.ab_pos_cnter("top")+parseInt(dom.css("height"))}return buttompos};var filterfunc=function(){return $(this).is(":not(div[deleted='deleted'])")&&$(this).attr("childdel")!="del"};$("#canvas .cstlayer,#canvas .full_column").filter(filterfunc).each(function(){var canvheight=helperfunc($(this));if(canvheight>maxheight){maxheight=canvheight}});$("#canvas").data("layermaxheight",maxheight)}$(document).bind("lastexec",function(){if(window.MobileModel){var $scontainer=$("#scroll_container"),canvaswidth=$("#canvas").width();$scontainer.unbind(".mbprevredhat.tmpredhat");if($("#wp-mobile-device-header").length>0){var screenWidth=window.innerWidth||self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,deviceOtherHeight=$("#wp-mobile-device-header").closest(".wp-new-manage-toolbar-position").height()+$("#wp-mobile-device-footer").height();var onlyOnce_resize_width=false;$(window).bind("resize.mbeditor",function(e,status){var screenHeight=window.innerHeight||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;$("#wp-mobile-device-sides").height(screenHeight-deviceOtherHeight).children(".mwrapper").height(screenHeight-deviceOtherHeight-2);var sidewidth=14;var mbtimer=setTimeout(function(){var newleft=($._parseFloat($("#wp-mobile-device-header").css("left"))||0)+sidewidth;$scontainer.css({"left":(newleft-10)+"px","width":function(){if(onlyOnce_resize_width==false){onlyOnce_resize_width=true;return($(this).width()+(status?(sidewidth+15+10):0))+"px"}else{return}},"margin":"0","padding-left":"11px","top":"-6px","overflow-y":"scroll"});$("#site_footer").css("left","11px");if(status==undefined){$scontainer.mscroll("destroy")}$scontainer.mscroll({difleft:10,maskbg:"#ccc"});clearTimeout(mbtimer)},100)}).triggerHandler("resize.mbeditor",["init"]);$("#wp-mobile-device-header,#wp-mobile-device-sides,#wp-mobile-device-footer").css({"left":function(){return((screenWidth-$(this).width())/2)+"px"},"visibility":"visible"});$("#wp-mobile-device-footer > span").click(function(){wp_floatpanel(parseToURL("wp_widgets","save_page"),{title:translate("page.saveLayout"),width:418,overlay:true,isCenter:true,contentClass:"wp-site-set_panel_c",id:"wp-page_save",zIndex:9999})})}else{$scontainer.css("visibility","visible");$(window).load(function(){var $win=$(this),frmwidth=$win.width(),frmheight=window.getdeviceheight||565;$scontainer.height(frmheight);var mprevtimer=setTimeout(function(){$scontainer.mscroll({"maskcname":"wp-mobile-device-premask","difleft":-6,"height":frmheight,"barcname":"wp-mobile-prescrollbar","maskleft":frmwidth,"barleft":frmwidth});$win.triggerHandler("pageloaded");clearTimeout(mprevtimer);var maxtop=frmheight-$(".wp-mobile-prescrollbar > span.pane").height();$scontainer.bind("mousedown.mbprevredhat",function(e){e.preventDefault();var $prebar=$(".wp-mobile-prescrollbar"),pagey=e.pageY;$scontainer.bind("mousemove.tmpredhat",function(e){e.preventDefault();var scrltop=$scontainer.scrollTop(),movey=e.pageY-pagey;if(scrltop<0){scrltop=0}$scontainer.scrollTop(scrltop-movey)}).bind("mouseup.tmpredhat",function(e){e.preventDefault();$scontainer.unbind(".tmpredhat");$(parent.document).unbind(".rmredhat")});$(parent.document).bind("mouseup.rmredhat",function(){$scontainer.unbind(".tmpredhat")})})},150)})}$("#site_footer,#footer_content").width(canvaswidth)}function resizeCanvasHeight(){window.canv=$("#canvas");var container=$("#scroll_container");var cvhgt=window.innerHeight||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;if(window.isHandheld){cvhgt=Math.min(cvhgt,MobileUtils.getScreenHeight())}cvhgt-=container.offset().top,mfooterheight=$("#wp-mobile-device-footer").height()||0;container.height(cvhgt-mfooterheight);if($("#site_footer").length>0){var canvheight=Math.max($("#canvas").data("layermaxheight"),cvhgt-$("#site_footer").height()-mfooterheight);if($("#site_footer:not(.only_copyright)").length>0){canvheight=Math.max(canvheight,$("#canvas").height())}}else{var canvheight=Math.max($("#canvas").data("layermaxheight"),cvhgt)}$('.cstlayer[type="bslider"]:not(.isplate)').each(function(i,dom){$(dom).triggerHandler("resetbsliderheight",[canvheight])});canv.css("height",canvheight+"px");$("#scroll_container_bg").css("height",(canvheight+$("#site_footer").height())+"px");if($(window).width()-canv.width()<0){$("#scroll_container_bg").width(canv.width())}else{$("#scroll_container_bg").css("width","100%")}var canvleft=canv.offset().left;if(typeof $.fn.ruler_locate!="undefined"){$.fn.ruler_locate({x:{left:canvleft+"px"},y:{height:canvheight+"px",left:(canvleft>17?canvleft-17:0)+"px"}});$(".line_y").height(canvheight)}if(window.isHandheld){var $container=$("#scroll_container"),$footer=$("#site_footer"),maxheight=$("#scroll_container_bg").height()+$(">.mblank_placeholder",$container).height();$container.css({"height":maxheight+"px","overflow-x":"hidden","overflow-y":"hidden"});if($footer.length){$footer.find("#footer_content").andSelf().width($("#canvas").width())}$(".mloading-mask").remove();$container.css("visibility","visible");$(window).triggerHandler("pageloaded")}}function correctFooterPos(){var canvheight=canv.height();var canvwidth=canv.width();var containerOffsetLeft=$("#scroll_container").offset().left;$("#site_footer").css({left:canv.offset().left-containerOffsetLeft+$("#scroll_container").scrollLeft()+$.parseInteger($("#canvas").css("borderLeftWidth")),top:canvheight});$("#site_footer >.full_width").css({left:0-canv.offset().left+containerOffsetLeft-$("#scroll_container").scrollLeft()-$.parseInteger($("#canvas").css("borderLeftWidth")),width:$(window.MobileModel?"#canvas":"#scroll_container_bg").width()});if($("#wp-mobile-device-header").length){$("#site_footer >.full_width").css("left","0px")}}window.correctFooterPos=correctFooterPos;window.scroll_container_adjust=function(){initCanvasHeight();resizeCanvasHeight();correctFooterPos()};window.scroll_container_adjust();$(".full_column>.full_width").css({left:0-canv.offset().left+$("#scroll_container").offset().left-$("#scroll_container").scrollLeft()-$.parseInteger($("#canvas").css("borderLeftWidth")),width:$("#scroll_container_bg").width()});var me="orientation" in window&&"onorientationchange" in window?"orientationchange":"resize";$(window).bind(me,function(e){if(e.target==window||e.target==document){resizeCanvasHeight();correctFooterPos();$(".full_column>.full_width").css({left:0-canv.offset().left+$("#scroll_container").offset().left-$("#scroll_container").scrollLeft()-$.parseInteger($("#canvas").css("borderLeftWidth")),width:$("#scroll_container_bg").width()})}});if(!window.isHandheld){rotateDom($(".cstlayer"))}if(window.opener){var winH=screen.availHeight||768,winW=screen.availWidth||1024;window.resizeTo(winW,winH)}$.extend({openNewWin:function(URI){var win=window.open(URI,"_blank");win.focus}})});