geom/doc/salome/gui/GEOM/whtopic.js

725 lines
15 KiB
JavaScript
Raw Normal View History

2004-12-17 16:18:33 +05:00
// WebHelp 5.10.005
var gsPPath="";
var gaPaths=new Array();
var gaAvenues=new Array();
var goFrame=null;
var gsStartPage="";
var gsRelCurPagePath="";
var gsSearchFormHref="";
var gnTopicOnly=-1;
var gnOutmostTopic=-1;
2004-06-16 21:45:26 +06:00
var BTN_TEXT=1;
var BTN_IMG=2;
2004-12-17 16:18:33 +05:00
var goSync=null;
2004-06-16 21:45:26 +06:00
2004-12-17 16:18:33 +05:00
var goShow=null;
var goHide=null;
2004-06-16 21:45:26 +06:00
2004-12-17 16:18:33 +05:00
var goPrev=null;
var goNext=null;
var gnForm=0;
var goShowNav=null;
var goHideNav=null;
2004-06-16 21:45:26 +06:00
2004-12-17 16:18:33 +05:00
var goWebSearch=null;
2004-06-16 21:45:26 +06:00
2004-12-17 16:18:33 +05:00
var gsBtnStyle="";
var gaButtons=new Array();
var gaTypes=new Array();
var whtopic_foldUnload=null;
2004-06-16 21:45:26 +06:00
var gbWhTopic=false;
var gbCheckSync=false;
var gbSyncEnabled=false;
2004-12-17 16:18:33 +05:00
function setButtonFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration)
2004-06-16 21:45:26 +06:00
{
var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration);
2004-12-17 16:18:33 +05:00
gsBtnStyle+=".whtbtn"+sType+"{"+getFontStyle(vFont)+"}";
2004-06-16 21:45:26 +06:00
}
function writeBtnStyle()
{
2004-12-17 16:18:33 +05:00
if(gaButtons.length>0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(gsBtnStyle.length>0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sStyle="<style type='text/css'>";
sStyle+=gsBtnStyle+"</style>";
2004-06-16 21:45:26 +06:00
document.write(sStyle);
}
}
}
2004-12-17 16:18:33 +05:00
function button(sText,nWidth,nHeight)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
this.sText=sText;
this.nWidth=nWidth;
this.nHeight=nHeight;
2004-06-16 21:45:26 +06:00
2004-12-17 16:18:33 +05:00
this.aImgs=new Array();
var i=0;
while(button.arguments.length>i+3)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
this.aImgs[i]=button.arguments[3+i];
i++;
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
//project info
2004-06-16 21:45:26 +06:00
function setRelStartPage(sPath)
{
2004-12-17 16:18:33 +05:00
if(gsPPath.length==0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
gsPPath=_getFullPath(_getPath(document.location.href),_getPath(sPath));
gsStartPage=_getFullPath(_getPath(document.location.href),sPath);
gsRelCurPagePath=_getRelativeFileName(gsStartPage,document.location.href);
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
function getImage(oImage,sType)
2004-06-16 21:45:26 +06:00
{
var sImg="";
2004-12-17 16:18:33 +05:00
if(oImage&&oImage.aImgs&&(oImage.aImgs.length>0))
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
sImg+="<img alt=\""+sType+"\" src=\""+oImage.aImgs[0]+"\"";
if(oImage.nWidth>0)
sImg+=" width="+oImage.nWidth;
if(oImage.nHeight>0)
sImg+=" height="+oImage.nHeight;
sImg+=" border=0>";
2004-06-16 21:45:26 +06:00
}
return sImg;
}
function addTocInfo(sTocPath)
{
2004-12-17 16:18:33 +05:00
gaPaths[gaPaths.length]=sTocPath;
2004-06-16 21:45:26 +06:00
}
2004-12-17 16:18:33 +05:00
function addAvenueInfo(sName,sPrev,sNext)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
gaAvenues[gaAvenues.length]=new avenueInfo(sName,sPrev,sNext);
2004-06-16 21:45:26 +06:00
}
2004-12-17 16:18:33 +05:00
function addButton(sType,nStyle,sText,sHref,sOnClick,sOnMouseOver,sOnLoad,nWidth,nHeight,sImg1,sImg2,sImg3)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sButton="";
2004-06-16 21:45:26 +06:00
var nBtn=gaButtons.length;
2004-12-17 16:18:33 +05:00
if(sType=="prev")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(canGo(false))
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sTitle="Previous Topic";
goPrev=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
sButton="<a title=\""+sTitle+"\" class=\"whtbtnprev\" href=\"javascript:void(0);\" onclick=\"goAvenue(false);return false;\">";
if(nStyle==BTN_TEXT)
sButton+=goPrev.sText;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sButton+=getImage(goPrev,sTitle);
sButton+="</a>";
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
else if(sType=="next")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(canGo(true))
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sTitle="Next Topic";
goNext=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
sButton="<a title=\""+sTitle+"\" class=\"whtbtnnext\" href=\"javascript:void(0);\" onclick=\"goAvenue(true);return false;\">";
if(nStyle==BTN_TEXT)
sButton+=goNext.sText;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sButton+=getImage(goNext,sTitle);
sButton+="</a>";
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
else if(sType=="show")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(isTopicOnly()&&(!gbOpera6||gbOpera7))
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sTitle="Show Navigation Component";
goShow=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
sButton="<a title=\""+sTitle+"\" class=\"whtbtnshow\" href=\"javascript:void(0);\" onclick=\"show();return false;\">";
if(nStyle==BTN_TEXT)
sButton+=goShow.sText;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sButton+=getImage(goShow,sTitle);
sButton+="</a>";
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
else if(sType=="hide")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(!isTopicOnly()&&!gbOpera6)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sTitle="Hide Navigation Component";
goHide=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
sButton="<a title=\""+sTitle+"\" class=\"whtbtnhide\" href=\"javascript:void(0);\" onclick=\"hide();return false;\">";
if(nStyle==BTN_TEXT)
sButton+=goHide.sText;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sButton+=getImage(goHide,sTitle);
sButton+="</a>";
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
else if(sType=="shownav")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(isShowHideEnable())
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sTitle="Show Navigation Component";
goShowNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
sButton="<a title=\""+sTitle+"\" class=\"whtbtnshownav\" href=\"javascript:void(0);\" onclick=\"showHidePane(true);return false;\">";
if(nStyle==BTN_TEXT)
sButton+=goShowNav.sText;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sButton+=getImage(goShowNav,sTitle);
sButton+="</a>";
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
else if(sType=="hidenav")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(isShowHideEnable())
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sTitle="Hide Navigation Component";
goHideNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
sButton="<a title=\""+sTitle+"\" class=\"whtbtnhidenav\" href=\"javascript:void(0);\" onclick=\"showHidePane(false);return false;\">";
if(nStyle==BTN_TEXT)
sButton+=goHideNav.sText;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sButton+=getImage(goHideNav,sTitle);
sButton+="</a>";
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
else if(sType=="synctoc")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(gaPaths.length>0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sTitle="Sync TOC";
goSync=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
sButton="<a title=\""+sTitle+"\" class=\"whtbtnsynctoc\" href=\"javascript:void(0);\" onclick=\"syncWithShow();return false;\">";
if(nStyle==BTN_TEXT)
sButton+=goSync.sText;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sButton+=getImage(goSync,sTitle);
sButton+="</a>";
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
else if(sType=="websearch")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(gsSearchFormHref.length>0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sTitle="WebSearch";
goWebSearch=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
sButton="<a title=\""+sTitle+"\" class=\"whtbtnwebsearch\" href=\""+gsSearchFormHref+"\">";
if(nStyle==BTN_TEXT)
sButton+=goWebSearch.sText;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sButton+=getImage(goWebSearch,sTitle);
sButton+="</a>";
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
else if(sType=="searchform")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
gaButtons[nBtn]="NeedSearchForm";
gaTypes[nBtn]=sType;
2004-06-16 21:45:26 +06:00
}
2004-12-17 16:18:33 +05:00
if(sButton.length!=0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(nStyle==BTN_TEXT)
sButton+="&nbsp;";
gaButtons[nBtn]="<td>"+sButton+"</td>";
gaTypes[nBtn]=sType;
2004-06-16 21:45:26 +06:00
}
}
function isSyncEnabled()
{
2004-12-17 16:18:33 +05:00
if(!gbCheckSync)
2004-06-16 21:45:26 +06:00
{
var oMsg=new whMessage(WH_MSG_ISSYNCSSUPPORT,this,1,null);
if(SendMessage(oMsg))
{
gbSyncEnabled=oMsg.oParam;
}
gbCheckSync=true;
}
return gbSyncEnabled;
}
function isInPopup()
{
2004-12-17 16:18:33 +05:00
return (window.name.indexOf("BSSCPopup")!=-1);
2004-06-16 21:45:26 +06:00
}
function getIntopicBar(sAlign)
{
2004-12-17 16:18:33 +05:00
var sHTML="";
if(gaButtons.length>0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
sHTML+="<div align="+sAlign+">";
2004-06-16 21:45:26 +06:00
2004-12-17 16:18:33 +05:00
sHTML+="<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\"><tr>";
for(var i=0;i<gaButtons.length;i++)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(gaTypes[i]!="synctoc"||isSyncEnabled())
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(gaButtons[i]=="NeedSearchForm")
sHTML+=getSearchFormHTML();
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sHTML+=gaButtons[i];
2004-06-16 21:45:26 +06:00
}
}
2004-12-17 16:18:33 +05:00
sHTML+="</tr></table>";
2004-06-16 21:45:26 +06:00
2004-12-17 16:18:33 +05:00
sHTML+="</div>";
2004-06-16 21:45:26 +06:00
}
return sHTML;
}
function writeIntopicBar(nAligns)
{
2004-12-17 16:18:33 +05:00
if(isInPopup()) return;
if(gaButtons.length>0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var sHTML="";
if(nAligns!=0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
sHTML+="<table width=100%><tr>"
if(nAligns&1)
sHTML+="<td width=33%>"+getIntopicBar("left")+"</td>";
if(nAligns&2)
sHTML+="<td width=34%>"+getIntopicBar("center")+"</td>";
if(nAligns&4)
sHTML+="<td width=33%>"+getIntopicBar("right")+"</td>";
sHTML+="</tr></table>";
2004-06-16 21:45:26 +06:00
document.write(sHTML);
}
}
}
function sendAveInfoOut()
{
2004-12-17 16:18:33 +05:00
if(!isInPopup())
setTimeout("sendAveInfo();",100);
2004-06-16 21:45:26 +06:00
}
function sendAveInfo()
{
2004-12-17 16:18:33 +05:00
var oMsg=new whMessage(WH_MSG_AVENUEINFO,this,1,gaAvenues);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
function onNext()
{
2004-12-17 16:18:33 +05:00
var oMsg=new whMessage(WH_MSG_NEXT,this,1,null);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
function onPrev()
{
2004-12-17 16:18:33 +05:00
var oMsg=new whMessage(WH_MSG_PREV,this,1,null);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
function createSyncInfo()
{
2004-12-17 16:18:33 +05:00
var oParam=new Object();
if(gsPPath.length==0)
gsPPath=_getPath(document.location.href);
oParam.sPPath=gsPPath;
oParam.sTPath=document.location.href;
oParam.aPaths=gaPaths;
2004-06-16 21:45:26 +06:00
return oParam;
}
function syncWithShow()
{
2004-12-17 16:18:33 +05:00
if(isTopicOnly())
2004-06-16 21:45:26 +06:00
show();
2004-12-17 16:18:33 +05:00
else
2004-06-16 21:45:26 +06:00
{
sync();
showTocPane();
}
}
function showTocPane()
{
2004-12-17 16:18:33 +05:00
var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
function sendSyncInfo()
{
2004-12-17 16:18:33 +05:00
if(!isInPopup())
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var oParam=null;
if(gaPaths.length>0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
oParam=createSyncInfo();
2004-06-16 21:45:26 +06:00
}
2004-12-17 16:18:33 +05:00
var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,oParam);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
}
function sendInvalidSyncInfo()
{
2004-12-17 16:18:33 +05:00
if(!isInPopup())
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,null);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
}
function enableWebSearch(bEnable)
{
2004-12-17 16:18:33 +05:00
if(!isInPopup())
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var oMsg=new whMessage(WH_MSG_ENABLEWEBSEARCH,this,1,bEnable);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
}
function autoSync(nSync)
{
2004-12-17 16:18:33 +05:00
if(nSync==0) return;
if(isInPopup()) return;
if(isOutMostTopic())
2004-06-16 21:45:26 +06:00
sync();
}
function isOutMostTopic()
{
2004-12-17 16:18:33 +05:00
if(gnOutmostTopic==-1)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var oMessage=new whMessage(WH_MSG_ISINFRAMESET,this,1,null);
if(SendMessage(oMessage))
gnOutmostTopic=0;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
gnOutmostTopic=1;
2004-06-16 21:45:26 +06:00
}
2004-12-17 16:18:33 +05:00
return (gnOutmostTopic==1);
2004-06-16 21:45:26 +06:00
}
function sync()
{
2004-12-17 16:18:33 +05:00
if(gaPaths.length>0)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var oParam=createSyncInfo();
var oMessage=new whMessage(WH_MSG_SYNCTOC,this,1,oParam);
2004-06-16 21:45:26 +06:00
SendMessage(oMessage);
}
}
2004-12-17 16:18:33 +05:00
function avenueInfo(sName,sPrev,sNext)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
this.sName=sName;
this.sPrev=sPrev;
this.sNext=sNext;
2004-06-16 21:45:26 +06:00
}
function getCurrentAvenue()
{
2004-12-17 16:18:33 +05:00
var oParam=new Object();
oParam.sAvenue=null;
var oMessage=new whMessage(WH_MSG_GETCURRENTAVENUE,this,1,oParam);
2004-06-16 21:45:26 +06:00
SendMessage(oMessage);
return oParam.sAvenue;
}
function unRegisterListener()
{
sendInvalidSyncInfo();
enableWebSearch(false);
2004-12-17 16:18:33 +05:00
if(whtopic_foldUnload)
2004-06-16 21:45:26 +06:00
whtopic_foldUnload();
}
function onSendMessage(oMsg)
{
2004-12-17 16:18:33 +05:00
var nMsgId=oMsg.nMessageId;
if(nMsgId==WH_MSG_GETAVIAVENUES)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
oMsg.oParam.aAvenues=gaAvenues;
2004-06-16 21:45:26 +06:00
return false;
}
2004-12-17 16:18:33 +05:00
else if(nMsgId==WH_MSG_GETTOCPATHS)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(isOutMostTopic())
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
oMsg.oParam.oTocInfo=createSyncInfo();
2004-06-16 21:45:26 +06:00
return false;
}
else
return true;
}
2004-12-17 16:18:33 +05:00
else if(nMsgId==WH_MSG_NEXT)
2004-06-16 21:45:26 +06:00
{
goAvenue(true);
}
2004-12-17 16:18:33 +05:00
else if(nMsgId==WH_MSG_PREV)
2004-06-16 21:45:26 +06:00
{
goAvenue(false);
}
2004-12-17 16:18:33 +05:00
else if(nMsgId==WH_MSG_WEBSEARCH)
2004-06-16 21:45:26 +06:00
{
websearch();
}
return true;
}
function goAvenue(bNext)
{
2004-12-17 16:18:33 +05:00
var sTopic=null;
var sAvenue=getCurrentAvenue();
var nAvenue=-1;
if(sAvenue!=null&&sAvenue!="")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
for(var i=0;i<gaAvenues.length;i++)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(gaAvenues[i].sName==sAvenue)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
nAvenue=i;
2004-06-16 21:45:26 +06:00
break;
}
}
2004-12-17 16:18:33 +05:00
if(nAvenue!=-1)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(bNext)
sTopic=gaAvenues[nAvenue].sNext;
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
sTopic=gaAvenues[nAvenue].sPrev;
2004-06-16 21:45:26 +06:00
}
}
else
2004-12-17 16:18:33 +05:00
{
for(var i=0;i<gaAvenues.length;i++)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(gaAvenues[i].sNext!=null&&gaAvenues[i].sNext.length>0&&bNext)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
sTopic=gaAvenues[i].sNext;
2004-06-16 21:45:26 +06:00
break;
}
2004-12-17 16:18:33 +05:00
else if(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
sTopic=gaAvenues[i].sPrev;
2004-06-16 21:45:26 +06:00
break;
}
}
}
2004-12-17 16:18:33 +05:00
if(sTopic!=null&&sTopic!="")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(gsPPath!=null&&gsPPath!="")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
sFullTopicPath=_getFullPath(gsPPath,sTopic);
document.location=sFullTopicPath;
2004-06-16 21:45:26 +06:00
}
}
}
function canGo(bNext)
{
2004-12-17 16:18:33 +05:00
for(var i=0;i<gaAvenues.length;i++)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if((gaAvenues[i].sNext!=null&&gaAvenues[i].sNext.length>0&&bNext)||
(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext))
2004-06-16 21:45:26 +06:00
return true;
}
return false;
}
function show()
{
2004-12-17 16:18:33 +05:00
if(gsStartPage!="")
window.location=gsStartPage+"#"+gsRelCurPagePath;
2004-06-16 21:45:26 +06:00
}
function hide()
{
2004-12-17 16:18:33 +05:00
if(goFrame!=null)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
goFrame.location=window.location;
2004-06-16 21:45:26 +06:00
}
}
function isTopicOnly()
{
2004-12-17 16:18:33 +05:00
if(gnTopicOnly==-1)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
var oParam=new Object();
oParam.oFrame=null;
var oMsg=new whMessage(WH_MSG_GETSTARTFRAME,this,1,oParam);
if(SendMessage(oMsg))
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
goFrame=oParam.oFrame;
gnTopicOnly=0;
2004-06-16 21:45:26 +06:00
}
else
2004-12-17 16:18:33 +05:00
gnTopicOnly=1;
2004-06-16 21:45:26 +06:00
}
2004-12-17 16:18:33 +05:00
if(gnTopicOnly==1)
2004-06-16 21:45:26 +06:00
return true;
else
return false;
}
function websearch()
{
2004-12-17 16:18:33 +05:00
if(gbNav4)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(document.ehelpform)
2004-06-16 21:45:26 +06:00
document.ehelpform.submit();
}
else
{
2004-12-17 16:18:33 +05:00
if(window.ehelpform)
2004-06-16 21:45:26 +06:00
window.ehelpform.submit();
}
}
function addSearchFormHref(sHref)
{
2004-12-17 16:18:33 +05:00
gsSearchFormHref=sHref;
2004-06-16 21:45:26 +06:00
enableWebSearch(true);
}
function searchB(nForm)
{
2004-12-17 16:18:33 +05:00
var sValue=eval("document.searchForm"+nForm+".searchString.value");
var oMsg=new whMessage(WH_MSG_SEARCHTHIS,this,1,sValue);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
function getSearchFormHTML()
{
2004-12-17 16:18:33 +05:00
var sHTML="";
gnForm++;
var sFormName="searchForm"+gnForm;
var sButton="<form name=\""+sFormName+"\" method=\"POST\" action=\"javascript:searchB("+gnForm+")\">"
sButton+="<input type=\"text\" name=\"searchString\" value=\"- Full Text search -\" size=\"20\"/>";
if(""=="text")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
sButton+="<a class=\"searchbtn\" href=\"javascript:void(0);\" onclick=\""+sFormName+".submit();return false;\"></a>";
2004-06-16 21:45:26 +06:00
}
2004-12-17 16:18:33 +05:00
else if(""=="image")
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
sButton+="<a class=\"searchbtn\" href=\"javascript:void(0);\" onclick=\""+sFormName+".submit();return false;\">"
2004-06-16 21:45:26 +06:00
sButton+="<img src=\"\" border=0></a>";
}
2004-12-17 16:18:33 +05:00
sButton+="</form>";
sHTML="<td align=\"center\">"+sButton+"</td>";
2004-06-16 21:45:26 +06:00
return sHTML;
}
function showHidePane(bShow)
{
var oMsg=null;
2004-12-17 16:18:33 +05:00
if(bShow)
oMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
2004-06-16 21:45:26 +06:00
else
2004-12-17 16:18:33 +05:00
oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null);
2004-06-16 21:45:26 +06:00
SendMessage(oMsg);
}
function isShowHideEnable()
{
2004-12-17 16:18:33 +05:00
if(gbIE4)
2004-06-16 21:45:26 +06:00
return true;
else
return false;
}
2004-12-17 16:18:33 +05:00
function PickupDialog_Invoke()
{
if(!gbIE4||gbMac)
{
if(typeof(_PopupMenu_Invoke)=="function")
return _PopupMenu_Invoke(PickupDialog_Invoke.arguments);
}
else
{
if(PickupDialog_Invoke.arguments.length>2)
{
var sPickup="whskin_pickup.htm";
var sPickupPath=gsPPath+sPickup;
if(gbIE4)
{
var sFrame=PickupDialog_Invoke.arguments[1];
var aTopics=new Array();
for(var i=2;i<PickupDialog_Invoke.arguments.length;i+=2)
{
var j=aTopics.length;
aTopics[j]=new Object();
aTopics[j].m_sName=PickupDialog_Invoke.arguments[i];
aTopics[j].m_sURL=PickupDialog_Invoke.arguments[i+1];
}
if(aTopics.length>1)
{
var nWidth=300;
var nHeight=180;
var nScreenWidth=screen.width;
var nScreenHeight=screen.height;
var nLeft=(nScreenWidth-nWidth)/2;
var nTop=(nScreenHeight-nHeight)/2;
if(gbIE4)
{
var vRet=window.showModalDialog(sPickupPath,aTopics,"dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:yes;status:no;scroll:no;help:no;center:yes;");
if(vRet)
{
var sURL=vRet.m_url;
if(sFrame)
window.open(sURL,sFrame);
else
window.open(sURL,"_self");
}
}
}
else if(aTopics.length==1)
{
var sURL=aTopics[0].m_sURL
if(sFrame)
window.open(sURL,sFrame);
else
window.open(sURL,"_self");
}
}
}
}
}
2004-06-16 21:45:26 +06:00
if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy)
{
2004-12-17 16:18:33 +05:00
RegisterListener("bsscright",WH_MSG_GETAVIAVENUES);
RegisterListener("bsscright",WH_MSG_GETTOCPATHS);
RegisterListener("bsscright",WH_MSG_NEXT);
RegisterListener("bsscright",WH_MSG_PREV);
RegisterListener("bsscright",WH_MSG_WEBSEARCH);
if(gbMac&&gbIE4)
2004-06-16 21:45:26 +06:00
{
2004-12-17 16:18:33 +05:00
if(typeof(window.onunload)!="unknown")
if(window.onunload.toString!=unRegisterListener.toString)
whtopic_foldUnload=window.onunload;
2004-06-16 21:45:26 +06:00
}
else
{
2004-12-17 16:18:33 +05:00
if(window.onunload)
if(window.onunload.toString!=unRegisterListener.toString)
whtopic_foldUnload=window.onunload;
2004-06-16 21:45:26 +06:00
}
2004-12-17 16:18:33 +05:00
window.onunload=unRegisterListener;
setButtonFont("show","","","","","","");
setButtonFont("hide","","","","","","");
2004-06-16 21:45:26 +06:00
gbWhTopic=true;
}
else
document.location.reload();