var shareOverlay;var shareWindow;var shareTween;var isDisplayed;function initShare(){shareOverlay=$("shareOverlay");shareWindow=$("shareWindow");isDisplayed=false;shareTween=new Fx.Tween("shareOverlay",{property:"opacity",duration:500,transition:Fx.Transitions.Quart.easeOut});window.addEvent("resize",function(a){shareResizeOverlay()});shareResizeOverlay();if(window.location.hash.substr(0,7)=="#share_"){showShare(window.location.hash.substr(7))}else{if(window.location.hash.substr(0,6)=="#share"){if($("sharekey")){showShare($("sharekey").value)}}}}function displayShareWindow(){shareWindow.setStyle("display","block");new Fx.Scroll(window,{wait:false,duration:1000,offset:{x:-200,y:-50},transition:Fx.Transitions.Quad.easeInOut}).toElement(shareWindow)}function shareGetScrollBarWidth(){var c=document.createElement("p");c.style.width="100%";c.style.height="200px";var d=document.createElement("div");d.style.position="absolute";d.style.top="0px";d.style.left="0px";d.style.visibility="hidden";d.style.width="200px";d.style.height="150px";d.style.overflow="hidden";d.appendChild(c);document.body.appendChild(d);var b=c.offsetWidth;d.style.overflow="scroll";var a=c.offsetWidth;if(b==a){a=d.clientWidth}document.body.removeChild(d);return(b-a)}function shareGetPageSize(){var e,a;if(window.innerHeight&&window.scrollMaxY){e=window.innerWidth+window.scrollMaxX;a=window.innerHeight+window.scrollMaxY}else{e=Math.max(document.body.scrollWidth,document.body.offsetWidth);a=Math.max(document.body.scrollHeight,document.body.offsetHeight)}var b,f;if(self.innerHeight){b=self.innerWidth;f=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;f=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;f=document.body.clientHeight}}}pageHeight=Math.max(f,a);pageWidth=Math.max(b,e);if(!window.ActiveXObject&&((document.getBoxObjectFor!=undefined)||(!navigator.taintEnabled))){var c=shareGetScrollBarWidth();var d=new Array(b<pageWidth,f<pageHeight);if(d[1]){pageWidth-=c}if(d[0]){pageHeight-=c}}return new Array(pageWidth,pageHeight,b,f)}function shareResizeOverlay(){shareOverlay.setStyle("display","none");var b=shareGetPageSize();if(isDisplayed){shareOverlay.setStyle("display","block")}var c;var a;c=parseInt(b[0])+"px";a=parseInt(b[1])+"px";shareOverlay.setStyle("width",c);shareOverlay.setStyle("height",a)}function showShare(a){if(a){shareOverlay.setStyle("display","block");shareTween.start(0,0.8);displayShareWindow.delay(500);new Request({url:"ajax_com.php?action=share",method:"post",onSuccess:function(b){updateField("shareWindow",this.xhr);initAccordion()},onFailure:function(b){showError(this.xhr)},data:"key="+encodeURIComponent(a)}).send();isDisplayed=true}}function hideShare(){shareWindow.setStyle("display","none");shareOverlay.setStyle("display","none");shareOverlay.setStyle("opacity","0");isDisplayed=false}function initAccordion(){if(window.ie6){var c="100%"}else{var c=""}var b="dt.accordion_toggler_";var f="dd.accordion_content_";var a=1;var e=$$(b+a);var d=$$(f+a);while(e.length>1){new Accordion(e,d,{opacity:false,display:0,alwaysHide:true,onComplete:function(){var g=$(this.elements[this.previous]);if(g&&g.offsetHeight>0){g.setStyle("height",c)}},onActive:function(h,g){h.addClass("open")},onBackground:function(h,g){h.removeClass("open")}});a++;e=$$(b+a);d=$$(f+a)}};