");
}
var goNewWnd = null;
var gsURL = "";
var gsNewName = "";
var gstrOpt = "";
var gsSvrPath = "";
var gsProject = "";
var gsTopicURL = "";
var gbUpdate = false;
var FHWO_LOCATION = 0x01; // location bar
var FHWO_MENUBAR = 0x02; // menubar
var FHWO_RESIZABLE = 0x04; // resizable
var FHWO_TOOLBAR = 0x08; // toolbar
var FHWO_STATUS = 0x10; // statusbar
var FHWO_SCROLLBARS=0x20; // scrollbars
function CshWindow()
{
this.sName = "";
// Browse Options
this.bUseDefault = true;
this.nBOptions = 0;
this.sBLeft = "0";
this.sBTop = "0";
this.sBWidth = "0";
this.sBHeight = "0";
this.sCaption = "";
// FH Window Options
this.nPanes = 2;
this.nPOptions = 0;
this.sPButtons = "";
this.sPDefBtn = "";
}
var gaWindow = new CshWindow();
function decodeURL(in_str)
{
var out_str = in_str;
var temp_str = "";
var val_str = "";
var nIndex = out_str.indexOf("%");
while (nIndex >= 0)
{
temp_str = out_str.substring(0,nIndex);
val_str = out_str.substr(nIndex+1, 2);
temp_str += String.fromCharCode(parseInt(val_str,16));
temp_str +=out_str.substring(nIndex+3);
out_str = temp_str;
nIndex = out_str.indexOf("%",nIndex+1);
}
return out_str;
}
function showCSH(sParam)
{
sParam = decodeURL(sParam);
parseParam(sParam);
if (gbStatus)
{
DisplayStatus();
}
else
{
SwitchURL();
}
}
function DisplayStatus()
{
var oWnd=gaWindow;
var sURL=_getPath(document.location.href)+"wf_filestatus.htm";;
var strOpt=getBrowserOptionString(oWnd);
var sNewName=convertWindowName(oWnd.sName);
if(gbIE5)
{
window.open("about:blank",sNewName,strOpt);
goNewWnd=window.open(sURL,sNewName,strOpt);
}
else
{
gsURL = sURL; // IE4 had hard time to handle bookmark.
goNewWnd=window.open("about:blank",sNewName,strOpt);
}
setTimeout("postWindowOpen();",100);
}
function SwitchURL()
{
var sURL="";
var oWnd=gaWindow;
sURL=_getPath(document.location.href)+"wf_startfs.htm#"+gsTopicURL;
if(sURL&&oWnd)
{
strURLOpt="";
if(oWnd.sCaption)
strURLOpt+=">>cap="+oWnd.sCaption;
if(oWnd.nPanes==1)
strURLOpt+=">>pan="+oWnd.nPanes;
else if(oWnd.nPanes==2)
{
strURLOpt+=">>pan="+oWnd.nPanes;
if(oWnd.nPOptions)
strURLOpt+=">>pot="+oWnd.nPOptions;
if(oWnd.sPButtons)
strURLOpt+=">>pbs="+oWnd.sPButtons;
if(oWnd.sPDefBtn)
strURLOpt+=">>pdb="+oWnd.sPDefBtn;
}
if(strURLOpt)
{
if(sURL.indexOf("#")==-1)
sURL+="#";
sURL+=strURLOpt;
if (gsSvrPath !="")
sURL+=">>svr="+gsSvrPath;
if (gsProject !="")
sURL+=">>prj="+gsProject;
}
if(gsJava=="false")
{
var strOpt=getBrowserOptionString(oWnd);
var sNewName=convertWindowName(oWnd.sName);
if(gbNav4)
{
if (gbNav6)
{
gsURL = sURL;
goNewWnd=window.open("about:blank",sNewName,strOpt);
setTimeout("postWindowNSOpen();",100);
}
else
{
window.open("about:blank",sNewName,strOpt);
var oNewWnd=window.open(sURL,sNewName);
window.close();
oNewWnd.focus();
}
}
else
{
gsURL = sURL;
gsNewName = sNewName;
gstrOpt = strOpt;
if (!gbUpdate)
{
if(gbIE5)
{
window.open("about:blank",sNewName,strOpt);
goNewWnd=window.open(sURL,sNewName,strOpt);
}
else
{
goNewWnd=window.open("about:blank",sNewName,strOpt);
}
setTimeout("postWindowOpen();",100);
}
else
{
setTimeout("updDelayOpen();",500);
}
}
}
else
document.location=sURL;
}
}
function updDelayOpen()
{
if(gbIE5)
{
window.open("about:blank",gsNewName,gstrOpt);
goNewWnd=window.open(gsURL,gsNewName,gstrOpt);
}
else
{
goNewWnd=window.open("about:blank",gsNewName,gstrOpt);
}
setTimeout("postWindowOpen();",100);
}
function getBrowserOptionString(oWnd)
{
var strOpts="";
if(oWnd.bUseDefault)
return strOpts;
if(oWnd.nBOptions&FHWO_LOCATION)
strOpts+="location=yes";
else
strOpts+="location=no";
if(oWnd.nBOptions&FHWO_TOOLBAR)
strOpts+=",toolbar=yes";
else
strOpts+=",toolbar=no";
if(oWnd.nBOptions&FHWO_MENUBAR)
strOpts+=",menubar=yes";
else
strOpts+=",menubar=no";
if(oWnd.nBOptions&FHWO_STATUS)
strOpts+=",status=yes";
else
strOpts+=",status=no";
if(oWnd.nBOptions&FHWO_SCROLLBARS)
strOpts+=",scrollbars=yes";
else
strOpts+=",scrollbars=no";
if(oWnd.nBOptions&FHWO_RESIZABLE)
strOpts+=",resizable=yes";
else
strOpts+=",resizable=no";
if(oWnd.sBTop)
{
var nTop=getSValue(oWnd.sBTop,screen.height);
strOpts+=",top="+nTop;
strOpts+=",screenY="+nTop;
}
if(oWnd.sBLeft)
{
var nLeft=getSValue(oWnd.sBLeft,screen.width);
strOpts+=",left="+nLeft;
strOpts+=",screenX="+nLeft;
}
if(oWnd.sBWidth)
{
var nWidth=getSValue(oWnd.sBWidth,screen.width);
strOpts+=",width="+nWidth;
strOpts+=",outerWidth="+nWidth;
}
if(oWnd.sBHeight)
{
var nHeight=getSValue(oWnd.sBHeight,screen.height);
strOpts+=",height="+nHeight;
strOpts+=",outerHeight="+nHeight;
}
return strOpts;
}
function getSValue(sValue,nLength)
{
var nValue=0;
var nPos=sValue.indexOf("%");
if(nPos!=-1)
{
if(nPos>0)
{
var nPart=parseInt(sValue.substring(0,nPos));
nValue=nLength*nPart/100;
}
}
else
nValue=parseInt(sValue);
return nValue;
}
function convertWindowName(strName)
{
var strNewName = strName;
var strResultName = "";
var re=new RegExp("_","g");
strNewName = strName.replace(re,"__");
for (var i=0;i