var o_jsp=null,o_sfnc,o_rfnc,o_cfnc,o_param,i_pw,i_ph,i_int,i_a,s_html,b_scrl;
function PanelWrapper(sPnl,dPnl){
this.sPnl=sPnl;this.dPnl=dPnl;
}
function showJSPanels(intWidth,intHeight,strHtml,bolScroll,intZIndex,objCallback,objParams){
if(o_jsp==null){
var objBody;
if(window.onscroll!=null&&window.onscroll!=scrollJSPanels)o_sfnc=window.onscroll;
if(window.onscroll!=scrollJSPanels)window.onscroll=scrollJSPanels;
if(window.onresize!=null&&window.onresize!=resizeJSPanels)o_rfnc=window.onresize;
if(window.onresize!=resizeJSPanels)window.onresize=resizeJSPanels;
i_pw=intWidth;i_ph=intHeight;s_html=strHtml;i_a=0;
if(bolScroll==null)b_scrl=false;
else b_scrl=bolScroll;
o_cfnc=objCallback;o_param=objParams;objBody=document.getElementsByTagName("body")[0];o_jsp=new PanelWrapper(document.createElement("div"),document.createElement("div"));
with(o_jsp){
sPnl.style.position="absolute";sPnl.style.backgroundColor="black";sPnl.style.opacity=0.0;sPnl.style.filter="alpha(opacity=0)";
if(intZIndex!=null)sPnl.style.zIndex=intZIndex;
dPnl.style.position="absolute";dPnl.style.overflow="hidden";dPnl.style.height=50;dPnl.style.width=50;dPnl.style.backgroundColor="white";
if(intZIndex!=null)dPnl.style.zIndex=(intZIndex+1);
i_int=0;resizeJSPanels();objBody.appendChild(sPnl);objBody.appendChild(dPnl);i_int=window.setInterval("incPanelSize()",10);
}}}
function closeJSPanels(){
if(o_jsp!=null){
var objBody=document.getElementsByTagName("body")[0];
try{window.clearInterval(i_int);}catch(ex){}
objBody.removeChild(o_jsp.sPnl);objBody.removeChild(o_jsp.dPnl);o_jsp=null;
}}
function scrollJSPanels(){
if(o_jsp!=null)priv_resizeJSPanels();
if(o_sfnc!=null)o_sfnc();
}
function resizeJSPanels(){
if(o_jsp!=null)priv_resizeJSPanels();
if(o_rfnc!=null)o_rfnc();
}
function getCssLength(strLength){
var strEnd="";
if(strLength.length>=3)strEnd=strLength.substr(strLength.length-2,2);
if(strEnd=="px")return new Number(strLength.substr(0,strLength.length-2));
else return new Number(strLength);
}
function priv_resizeJSPanels(){
var objBody=document.getElementsByTagName("body")[0];
with(o_jsp){
sPnl.style.top=objBody.scrollTop;sPnl.style.left=objBody.scrollLeft;sPnl.style.width=objBody.clientWidth;sPnl.style.height = document.body.clientHeight;
if(i_int==-1){
intSize=i_pw;
if(i_pw>document.body.clientWidth) intSize = document.body.clientWidth;
dPnl.style.width=intSize;intSize=i_ph;
if(i_ph>document.body.clientHeight) intSize=document.body.clientHeight;
dPnl.style.height=intSize;
}
dPnl.style.top=((document.body.clientHeight-getCssLength(dPnl.style.height))/2)+objBody.scrollTop;dPnl.style.left=((document.body.clientWidth-getCssLength(dPnl.style.width))/2)+objBody.scrollLeft;
}}
function incPanelSize(){
with(o_jsp){
if(i_a<70){i_a+=5;sPnl.style.opacity=(i_a/100);sPnl.style.filter="alpha(opacity="+new String(i_a)+");";}
var objBody=document.getElementsByTagName("body")[0],intW=getCssLength(dPnl.style.width),intH=getCssLength(dPnl.style.height);
if(intW!=i_pw){intW=incSizeVar(intW,i_pw);dPnl.style.width=intW;dPnl.style.left=((document.body.clientWidth-intW)/2)+objBody.scrollLeft;}
else if(intH!=i_ph){intH=incSizeVar(intH,i_ph);dPnl.style.height=intH;dPnl.style.top=((document.body.clientHeight-intH)/2)+objBody.scrollTop;}
else{
window.clearInterval(i_int);i_int=-1;
if(b_scrl) dPnl.style.overflow="scroll";
dPnl.innerHTML=s_html;resizeJSPanels();
if(o_cfnc!=null) o_cfnc(o_param);
}}}
function incSizeVar(intSize,intFinal){
if(intSize<intFinal&&intSize+10<=intFinal)intSize+=10;
else if(intSize>intFinal&&intSize-10>=intFinal)intSize-=10;
else intSize=intFinal;
return intSize;
}
function changePanel(intWidth,intHeight,strHtml,bolScroll,intZIndex,objCallback,objParams){
if(intWidth!=null)i_pw=intWidth;
if(intHeight!=null)i_ph=intHeight;
if(strHtml==null)s_html="";
else s_html=strHtml;
if(bolScroll==null)b_scrl=false;
else b_scrl=bolScroll;
o_cfnc=objCallback;o_param=objParams;o_jsp.dPnl.innerHTML="";o_jsp.dPnl.style.overflow="hidden";i_int=window.setInterval("incPanelSize()",10);
}
