var OldWidth=0;
var OldHeight=0;
var AllWidth=0;
var AutoWidth=0;
var AllHeight=0;
var OtherHeight=0;
function ResizeTable(){
if (OldWidth!=Main.offsetWidth){
   FrameTb.width="100%";
   var zlWidth=PT1.offsetWidth;
   PT2.style.width=100;
   PT4.style.width=100;
   PT0.style.width=zlWidth+100;
   PT5.style.width=zlWidth+100;
   AutoWidth=PTbody.offsetWidth;
   if (AutoWidth>AllWidth) {
    blWidth=AllWidth;
   } else {
    blWidth=AutoWidth;
   if (blWidth<=0) blWidth=1;
}
   PT2.style.width=blWidth;
   PT4.style.width=blWidth;
   PT0.style.width=zlWidth+blWidth;
   PT5.style.width=zlWidth+blWidth;
   Nr2.style.width=PT2.style.width;
   Nr5.style.width=PT5.style.width;
   AddPt2.width=AllWidth+20;
   if (PT1.style.pixelWidth+PT2.style.pixelWidth<FrameTb.offsetWidth-1) FrameTb.width=PT1.style.pixelWidth+PT2.style.pixelWidth;
   if (zlWidth+AllWidth<FrameTb.offsetWidth) PT0.style.width=zlWidth+AllWidth;
   Nr0.style.width=PT0.style.width;
   Nr2.scrollLeft=0;
   PT4.scrollLeft=0;
}
if (OldHeight!=Main.offsetHeight){
   var byHeight=Main.offsetHeight-OtherHeight-10;
   FrameTb.height=OtherHeight;
   if (byHeight<=0) byHeight=100;
   if (byHeight>AllHeight) byHeight=AllHeight;
   PT3.style.height=byHeight;
   PT4.style.height=byHeight;
   Nr3.style.height=PT3.style.height;
}
Nr3.scrollTop=PT4.scrollTop;
OldWidth=Main.offsetWidth;
OldHeight=Main.offsetHeight;
}
function AutoScroll(){
Nr2.scrollLeft=PT4.scrollLeft;
Nr0.scrollLeft=PT4.scrollLeft;
Nr5.scrollLeft=PT4.scrollLeft;
Nr3.scrollTop=PT4.scrollTop;
}
function Init(){
AutoWidth=0;
OtherHeight=PT0.offsetHeight+PT1.offsetHeight+PT5.offsetHeight;
AllWidth=PT4.getElementsByTagName("table")[0].offsetWidth;
AllHeight=PT4.getElementsByTagName("table")[0].offsetHeight;
PT3.style.width=PT1.offsetWidth;
PT2.style.height=PT1.offsetHeight;
PT0.style.height=PT0.offsetHeight;
PT5.style.height=PT5.offsetHeight;
ResizeTable();
Nr0.style.pixelHeight=PT0.style.pixelHeight+20;
Nr2.style.pixelHeight=PT2.style.pixelHeight+20;
Nr3.style.height=PT3.style.height;
Nr3.style.pixelWidth=PT3.style.pixelWidth+16;
Nr5.style.pixelHeight=PT5.style.pixelHeight+20;
}
function SetBgColor(){
PT1.getElementsByTagName("table")[0].bgColor="#EFEFEF"
Nr2.getElementsByTagName("table")[0].bgColor="#EFEFEF"
Nr3.getElementsByTagName("table")[0].bgColor="#EFEFEF"
AddPt3.bgColor="#EFEFEF"
}
function LeftCol(){
if (PT1.style.overflow=="hidden"){
PT1.style.overflow="visible";
PT1.style.borderColor = "#000000";
PT3.style.borderColor = "#000000";
OldWidth=0;
Init();
} else {
var leftWidth=460;
var MaxLeft=Main.offsetWidth-AllWidth-24;
if (leftWidth<PT1.offsetWidth && MaxLeft<PT1.offsetWidth){
 if (MaxLeft>leftWidth) leftWidth=MaxLeft;
 PT1.style.overflow="hidden";
 PT1.style.width=leftWidth;
 PT1.style.borderColor = "#C0C0C0";
 PT3.style.borderColor = "#C0C0C0"
 OldWidth=0;
 Init();
}
}
Nr3.scrollTop=PT4.scrollTop;
}
