/*
$ /js/pb/pb.js | 2008/06/25 12:00 | 2009/01/07 13:41 $
*/

var overlayOpacity="0.50";var fadeInDuration=20;var fadeOutDuration=20;function AJAX(){if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest()}else{if(window.ActiveXObject){xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}else{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}}return xmlhttp}function pb_load(){var A=document.getElementsByTagName("body")[0];var B=document.createElement("div");B.id="pb_overlay";B.xOpacity=overlayOpacity;setOpacity(B);B.onclick=function(){pb_close()};A.appendChild(B);var F=getPageSize();B.style.height=F[1]+"px";var G=document.createElement("div");G.id="pb_loading";A.appendChild(G);var C=document.createElement("div");C.id="pb";A.appendChild(C);var D=document.createElement("div");D.id="pb_content";C.appendChild(D);var E=document.createElement("div");E.id="pb_close";E.innerHTML='<a href="#" onclick="pb_close()">&nbsp;</a>';C.appendChild(E)}function pb_show(){var A=document.getElementsByTagName("body")[0];var D=document.getElementById("pb_loading");if(!D){return }A.removeChild(D);var B=document.getElementById("pb");if(!B){return }var C=getPageSize();diffWidth=C[2]-B.offsetWidth;diffHeight=C[3]-B.offsetHeight;B.style.left=parseInt(diffWidth/2)+"px";B.xOpacity=0;setOpacity(B);B.style.visibility="visible";setTimeout("fadein('pb');",20)}function pb_open(A,C){pb_load();var B=AJAX();if(!B){return }else{B.open("GET",A,true);B.onreadystatechange=function(){if((B.readyState==4)&&(B.status==200)){document.getElementById("pb_content").innerHTML=B.responseText;pb_show();if(document.getElementById("printer_flash")){swfobject.embedSWF("/images/printer_"+C+".swf","printer_flash","400","294","9.0.0","")}}};B.send(null)}}function pb_close(){setTimeout("fadeout('pb');",20)}function getPageSize(){var C,A;if(window.innerHeight&&window.scrollMaxY){C=window.innerWidth+window.scrollMaxX;A=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){C=document.body.scrollWidth;A=document.body.scrollHeight}else{C=document.body.offsetWidth;A=document.body.offsetHeight}}var B,D;if(self.innerHeight){if(document.documentElement.clientWidth){B=document.documentElement.clientWidth}else{B=self.innerWidth}D=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){B=document.documentElement.clientWidth;D=document.documentElement.clientHeight}else{if(document.body){B=document.body.clientWidth;D=document.body.clientHeight}}}if(A<D){pageHeight=D}else{pageHeight=A}if(C<B){pageWidth=C}else{pageWidth=B}arrayPageSize=new Array(pageWidth,pageHeight,B,D);return arrayPageSize}function fadein(B){var A=document.getElementById(B);if(!A){return }o=A.xOpacity;o+=0.1;A.xOpacity=o;setOpacity(A);if(o<1){setTimeout("fadein('"+B+"');",fadeInDuration)}}function fadeout(F){var D=document.getElementById(F);if(!D){return }o=D.xOpacity;o-=0.1;D.xOpacity=o;setOpacity(D);if(o>0){setTimeout("fadeout('"+F+"');",fadeOutDuration)}else{var A=document.getElementsByTagName("body")[0];var E=document.getElementById("pb_content");if(!E){return }var C=document.getElementById("pb");if(!C){return }C.removeChild(E);A.removeChild(C);var B=document.getElementById("pb_overlay");if(!B){return }A.removeChild(B)}}function setOpacity(A){if(A.xOpacity>1){A.xOpacity=1;return }A.style.opacity=A.xOpacity;A.style.MozOpacity=A.xOpacity;A.style.KhtmlOpacity=A.xOpacity;A.style.filter="alpha(opacity="+(A.xOpacity*100)+")"};