Element.addMethods({removeAllChildren:function(A){while(A.lastChild){A.removeChild(A.lastChild)}},update2:function(A,B){if(B.nodeType){A.removeAllChildren();A.appendChild(B)}else{A.innerHTML=B}},$$:function(A,B){var C=A.select("."+B);return C.length!=0?C[0]:null},$$$:function(A,C){var B=A.select(C);return B.length!=0?B[0]:null},getBounds:function(B){var C=B.cumulativeOffset();var A=B.getDimensions();return new Rectangle(C.left,C.top,A.width,A.height)}});function getWindowWidth(){return Prototype.Browser.IE?document.documentElement.clientWidth:window.innerWidth}function getWindowHeight(){return Prototype.Browser.IE?document.documentElement.clientHeight:window.innerHeight}function getScrollHeight(){return Prototype.Browser.WebKit?document.body.scrollHeight:document.documentElement.scrollHeight}function observeInitialization(A){if(Prototype.Browser.WebKit){Event.observe(window,"load",A)}else{Event.observe(document,"dom:loaded",A)}}var MIN_CONTENT_WIDTH=340;var MIN_CONTENT_HEIGHT=253;var Board=Class.create();Object.extend(Board.prototype,{initialize:function(B){this.elem=B;this.board=B.$$("board");Event.observe(window,"load",this.layoutBackground.bindAsEventListener(this));Event.observe(window,"resize",this.layoutBackground.bindAsEventListener(this));if(this.elem.$$("languages")){["ja","en"].each(function(D){var C=$("lang"+D.capitalize());C.observe("mouseover",function(){C.src="/image/lang_"+D+".png"});C.observe("mouseout",function(){C.src="/image/langgray_"+D+".png"})})}var A=this.board.$$("boardSizedContent");if(A){this.board.$$("boardContent").setStyle({"width":"auto"})}},show:function(){this.elem.show()},layout:function(){this.layoutBoard();this.layoutBackground()},layoutBackground:function(){var C=getWindowWidth();var I=getWindowHeight();var A=0;var B=$("sideBar");if(B){A=B.getWidth()}var H=this.board.$$("boardBg").getDimensions().width;this.elem.$$("board").setStyle({"left":Math.max(A,Math.floor((C-H)/2))+"px"});var F=this.elem.$$("background");var D=this.elem.$$("backgroundTexture");F.hide();D.hide();var G=$(document.documentElement).getWidth();var E=Math.max(getScrollHeight(),I);F.setStyle({"width":G+"px","height":E+"px"});D.setStyle({"top":(E-311)+"px","width":G+"px"});this.elem.$$("footerContainer").setStyle({"top":(E-100)+"px","width":G+"px"});F.show();D.show()},layoutBoard:function(){var G=this.board.$$("boardContent");var F=this.board.$$("boardSizedContent");if(F){var B=F.getWidth();if(B<MIN_CONTENT_WIDTH){F.setStyle({"width":MIN_CONTENT_WIDTH+"px"})}G.setStyle({"width":F.getWidth()+"px"})}var D=this.board.$$("boardBg");var C=G.getDimensions();var E=C.width+65;var A=Math.max(C.height+(D.hasClassName("largeLogo")?93:55),MIN_CONTENT_HEIGHT);D.setStyle({"width":E+"px","height":A+"px"});this.board.$$("boardBgCenter").setStyle({"width":(E-18)+"px","height":(A-26)+"px"});this.board.$$("boardBgLeft").setStyle({"height":(A-26)+"px"});this.board.$$("boardBgRight").setStyle({"height":(A-26)+"px"});this.board.$$("boardBgBottom").setStyle({"width":(E-18)+"px"});this.board.$$("boardBgRLeft").setStyle({"top":(A-10)+"px"});this.board.$$("boardBgRCenter").setStyle({"top":(A-10)+"px","width":(E-18)+"px"});this.board.$$("boardBgRRight").setStyle({"top":(A-10)+"px"});this.board.setStyle({"width":E+"px","height":A+"px"})}});observeInitialization(function(){var A=new Board($("board"));A.show();A.layout()})