/***************************************************************************/
function replaceChars(entry, SearchChar, ReplChar) {
//out = " "; // replace this
//add = "+"; // with this
out = SearchChar;
add = ReplChar;
strReplace = "" + entry;
while (strReplace.indexOf(out)>-1) {
pos=strReplace.indexOf(out);
strReplace = "" + (strReplace.substring(0, pos) + add +
strReplace.substring((pos + out.length), strReplace.length));
}
}
/***************************************************************************/
var menuclass= "flatmenu";
var pageURL = window.document.location.href;
var StartReqdURL = pageURL.indexOf("__");
var ReqdURL = "/" + pageURL.substring(StartReqdURL , pageURL.length);
//var menuclass="flatmenu";
function generatemenu(level, currentsequence, label, ref_url, target,startnode)
{
var tag="";
var label_tag="";
var targetframe="";
var classtouse="";
var classoffset=0;
var menuclassNames = new Array();
menuclassNames[0] = "";
menuclassNames[1] = menuclass+"heading";
menuclassNames[2] = menuclass+"item";
menuclassNames[3] = menuclass+"subitem";
// 0 is void, 1-3 is for normal items, 4-6 is for the selected items
menuclassNames[4] = menuclass+"currentheading";
menuclassNames[5] = menuclass+"currentitem";
menuclassNames[6] = menuclass+"currentsubitem";
if (startnode==currentsequence)
{
classoffset = 3;
}
// Get the class to use
classtouse = menuclassNames[classoffset+parseInt(level)];
document.write("
");
if (target != "")
{
targetframe="Target='"+target+"'";
}
if (ref_url == "no_link")
{
label_tag=label;
}
else
{
label_tag=""+label+"";
}
tag="| ";
document.write(tag);
document.write(label_tag);
document.write(" | ");
document.write("
");
}
function GenerateEStylemenu(level, currentsequence, label, ref_url, target,startnode, dbPath)
{
var classtouse;
var linkurl;
var temp;
temp = currentsequence.substring(0,3);
var classoffset=0;
var urlid = Number(pageURL.indexOf("menuid=")+7);
var menuid = pageURL.substring(urlid,pageURL.length);
// Get the class to use
if (menuid==currentsequence)
{
classtouse = "estylemenuitem"
} else
{
classtouse = "estylesubmenuitem"
}
if ( ReqdURL == ref_url) {linktext = label}
if (target =="_blank")
{
linktext = "" + label + ""
}else
if (target =="_parent")
{
linktext = "" + label + ""
}else
{ linktext = "" + label + ""}
document.write("");
if ( level == 1)
{
if ( MenuwithSubmenu.indexOf(temp) != -1 )
{
//document.write(" " + linktext + " | ");
document.write(" | " + linktext + " | ");
}
else
{
document.write(" | " + linktext + " | ");
}
}
else
if (level==2 )
{
//document.write(" " + linktext + " | ");
document.write(" | " + linktext + " | ");
}
document.write("
");
}
function writecatsel(docURL, catToWrite, menuClass, selectedClass, orgTitle, SelectedCat) {
if (catToWrite == SelectedCat)
{
document.write('| '+ orgTitle+' |
');
}
else {
document.write('
');
}
}
var dbURL = "";
var pathname = (window.location.pathname);
var ns = (document.layers)? true:false;
var ie4 = (document.all)? true:false;
var x;
var addressField;
function addressBook(paramDivName, paramFormName, paramFieldName, Count, TextType )
{
texttype = TextType
divname = paramDivName;
formname = paramFormName;
addressField = paramFieldName;
statement = Count ;
var pathname= dbURL +"/";
if (navigator.appVersion.indexOf('X11') != -1)
{
childwindow = window.open(dbURL+'/AddressBook?OpenForm','Address','status=no,menubar=no,scrollbars=no,screenX=100,screenY=100,width=550,height=500');
}
else
{
if (navigator.appName =='Netscape')
{
if (navigator.appVersion.indexOf("Win") != -1)
{
childwindow = window.open(dbURL+'/AddressBook?OpenForm','Address','status=no,menubar=no, scrollbars=no,screenX=120,screenY=100,width=550,height=500');
}
else
{
childwindow = window.open(dbURL+'/AddressBook?OpenForm','Address','status=no,menubar=no, scrollbars=no,screenX=100,screenY=100,width=550,height=500');
}
}
else
{
childwindow = window.open(dbURL+'/AddressBook?OpenForm','Address','status=no,menubar=no, scrollbars=no,top=120,left=100,width=550,height=500');
}
}
}
function dbSearch(searchtype, layername, formname, defaulturl, serverpool, target)
{
var ns = (document.layers) ? 1 : 0;
var ie = (document.all) ? 1 : 0;
if (ns)
{
if (layername == "")
{
var query=eval("document.forms['"+formname+"'].Query.value");
}
else
{
var query=eval("document.layers['"+layername+"'].document.forms['"+formname+"'].Query.value");
}
}
else if(ie)
{
var query=eval("document.forms['"+formname+"'].Query.value");
}
if (searchtype=="Internet" || searchtype=="Database")
{
if (query !="")
{
var searchstring=query.replace(' ', '+');
var newstring=defaulturl.replace('', searchstring);
window.open(newstring,target);
}
}
else
{
var htmltag=writehtmltag(searchtype, query, serverpool, target);
if (ns)
{
if (layername == "")
{
document.open();
document.write(htmltag);
document.close();
document.SearchForm.submit();
}
else
{
document.SearchLayer.document.open();
document.SearchLayer.document.write(htmltag);
document.SearchLayer.document.close();
document.SearchLayer.document.SearchForm.submit();
}
}
else if(ie)
{
document.all['SearchLayer'].innerHTML=htmltag;
document.all['SearchForm'].submit();
}
}
}
function writehtmltag(paramsearchtype,paramqueryvalue,paramserverpool, paramtarget)
{
var remotehost=window.location.host;
var htmltowrite='';
switch (paramsearchtype)
{
case "PB" :
var htmltowrite="";
break;
case "DB" :
var htmltowrite="";
break;
case "AP":
var htmltowrite="";
break;
}
return htmltowrite;
}
function ReadCookie (CookieName)
{
var CookieString = document.cookie;
var CookieSet = CookieString.split (';');
var SetSize = CookieSet.length;
var CookiePieces;
var ReturnValue = "";
var x = 0;
for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++)
{
CookiePieces = CookieSet[x].split ('=');
if (CookiePieces[0].substring (0,1) == ' ')
{
CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
}
if (CookiePieces[0] == CookieName)
{
ReturnValue = CookiePieces[1];
}
}
return (ReturnValue);
}
function SetCookie(cookiename, cookievalue, expiryhour)
{
expiry=1000 * 60 * (60 * expiryhour);
var the_cookie = cookiename + "=" + escape(cookievalue);
if (expiryhour =='')
{
var the_date = new Date("December 31, 2010");
var the_cookie_date = the_date.toGMTString();
}
else
{
var the_date = new Date();
the_date.setTime (the_date.getTime() + expiry);
var the_cookie_date = the_date.toGMTString();
}
the_cookie = the_cookie + ";expires=" + the_cookie_date
document.cookie = the_cookie;
}
function PollSubmit(cookiename, cookievalue, expiryhour, formname, targeturl, target)
{
result=ReadCookie(cookiename);
if (result=="")
{
SetCookie(cookiename, cookievalue, expiryhour);
var the_form=eval("document.forms['"+formname+"']");
the_form.submit();
}
else
{
window.open(targeturl,target);
}
}
function CheckRadioSelection(fieldname)
{
var tmpselected=0;
for (var i = 0; i < fieldname.length; i++)
{
if (fieldname[i].checked==1)
{
tmpselected=1;
}
}
if (tmpselected)
{
return 1;
}
else
{
return 0;
}
}
function SetHomePage(sTarget, sPath)
{
var ms = navigator.appVersion.indexOf("MSIE");
if (ms != -1) // IE
{
var ver = parseInt(navigator.appVersion.substring(ms+5, ms+6))
if (ver >= 3) // Version
{
var mac = navigator.appVersion.indexOf("MAC");
if (mac != -1) // Mac
{
window.open(AddPaths(sPath, 'mmyhpIEFail.htm' + sTarget + "&" + sPath),'mmyhpie','alwaysRaised=yes,scrollbars=yes,resizable=yes,width=450,height=325');
}
else // PC/Unix
{
// ******** Change www.mmyhp.com here
window.open(AddPaths(sPath, 'mmyhpIE.htm?' + sTarget + "&" + sPath),'mmyhpie','alwaysRaised=yes,scrollbars=yes,resizable=yes,width=450,height=325');
}
}
}
else // Not IE
{
var nn = navigator.appName.indexOf("Netscape")
if (nn != -1) // Netscape
{
var ver = parseInt(navigator.appVersion.substring(0, 1))
if (ver >= 4) // Version
{
var mac = navigator.appVersion.indexOf("MAC");
if (mac != -1) // Mac
{
window.open(AddPaths(sPath, 'mmyhpNNFail.htm?' + sTarget + "&" + sPath),'mmyhpnn','alwaysRaised=yes,resizable=yes,scrollbars=yes,width=450,height=390');
}
else // PC
{
// ******** Change www.mmyhp.com here
window.open(AddPaths(sPath, 'mmyhpNN.htm?' + sTarget + "&" + sPath),'mmyhpnn','alwaysRaised=yes,resizable=yes,scrollbars=yes,width=450,height=390');
}
}
}
}
}
function GetTarget()
{
var nStart = location.search.indexOf("?")+1;
var nEnd = location.search.indexOf("&", nStart);
return location.search.substring(nStart, nEnd);
}
function GetPath()
{
var nStart = location.search.indexOf("&")+1;
var nEnd = location.search.length;
return location.search.substring(nStart, nEnd);
}
function GetArgs()
{
var nStart = location.search.indexOf("?")+1;
var nEnd = location.search.length;
return location.search.substring(nStart, nEnd);
}
function ModifyCurrPath(sCurrPage, sNewPage)
{
var sNewPath;
var nStart = location.href.lastIndexOf(sCurrPage);
if (nStart > 0)
{
sNewPath = location.href.substring(0, nStart) + sNewPage + location.href.substring(nStart+sCurrPage.length, location.href.length)
}
return sNewPath;
}
function AddPaths(sLHS, sRHS)
{
var nPos;
var sRet = "";
nPos = sLHS.length;
if (sLHS.substring(nPos, nPos) == "/" || sLHS.substring(nPos, nPos) == "\\")
nPos = nPos-1;
sRet = sLHS.substring(0, nPos);
sRet = sRet + "/";
nPos = 0;
if (sRHS.substring(1, 1) == "/" || sRHS.substring(1, 1) == "\\")
nPos = 1;
sRet = sRet + sRHS.substring(nPos, sRHS.length);
return sRet;
}
function OpenerGoToMMYHP()
{
opener.location = "http://www.MakeMeYourHomePage.com"
self.close();
}
/***********************************************************************************************************/
function goDirSearch( qry, mode )
{
replaceChars(qry, " ", "+");
strSearch = strReplace;
var dbPath = window.location.pathname.substring(0,(window.location.pathname.indexOf('.nsf')+5));
if (mode == "GPD")
{
qryStr="http://gd.db.com/perl/searchx.perl?uid="+strSearch+"&type=2&lines=300&limit=300&showheader=yes";
}
else if (mode == "IS")
{
qryStr="http://ht-search1-1.groga.eur.deuba.com/search/search?lang=en&iconflag=no&origquery=&logoflag=yes&sourcequerytext=&bannerflag=no&rmthost=hbifwxp1.btco.com&start+searching.x=8&searchaction=Default&start+searching.y=11&searchtitle=Search+the+Deutsche+Bank+Intranet&querytext="+strSearch+"&template=11&action=search";
}
else if (mode == "SPD")
{
qryStr="http://ht-search1-1.groga.eur.deuba.com/search/search?bannerflag=no&rmthost=sdbo14&lang=en&iconflag=no&searchaction=Default&origquery=&searchtitle=&querytext="+strSearch+"&logoflag=yes&template=11&sourcequerytext=&action=search";
}
if ( strSearch == "")
{
alert ("Please enter the string to Search");
}
else
{
window.open(qryStr);
}
}