/*********************** API JavaScript Library CONET CONSULTING, 11/2001 ************************/ var sLocalDirectory = ""; function yw_loadprintversion(sAction){ var kwdwin = 'kwdp'; var url = window.location.href; var urlnew = url.replace('vwContentByKey','Print'); urlnew = urlnew.replace('vwcontentbykey','Print'); urlnew = urlnew.replace('DocName','Print'); urlnew = urlnew.replace('docname','Print'); urlnew = urlnew.replace('Docs','Print'); urlnew = urlnew.replace('docs','Print'); urlnew = urlnew.replace('CurrentBaseLink','Print'); urlnew = urlnew.replace('currentbaselink','Print'); if (typeof sAction =='undefined'){ window.open(urlnew,kwdwin);} else { window.location.href=urlnew; } } function yw_RightBack(sT, sK) { var sRet = ''; if (sT.indexOf(sK) > -1) { sRet = sT.substring(sT.lastIndexOf(sK)+ sK.length,sT.length); if (sRet == sT) sRet = ''; } return sRet; } function yw_LeftString(sT, sK) { return sT.substring(0,sT.indexOf(sK)); } function yw_ReplaceSubstring(AllStr, SearchStr, ReplaceStr) { var position; var laenge; var vorne =""; var hinten = ""; var pos; var rest = ""; position = AllStr.indexOf(SearchStr); if (position == -1) return AllStr; laenge = SearchStr.length; vorne= AllStr.slice(0, position); hinten= AllStr.slice(position+laenge); pos = hinten.indexOf(SearchStr); if (pos > -1) { rest = yw_ReplaceSubstring(hinten, SearchStr, ReplaceStr); hinten = rest; } return vorne + ReplaceStr + hinten; } function yw_loadfile(sType, sKey, sFile) { var sURL; if ((sType=='')||(sType=='CurrentBaseLink')){ sTarget = yw_LeftString(yw_RightBack(sKey,"target:")+" "," "); sAttr = yw_LeftString(yw_RightBack(sKey,"attributes:")+" "," "); sAttr = yw_ReplaceSubstring(sAttr,"+",", "); sURL = "../CurrentBaseLink/" + sUnid + "/$File/"; if (sTarget=='') window.location.href=sURL + sFile; else window.open(sURL + sFile,sTarget,sAttr); } else if(sType=='RepositoryFile') { sURL = sLocalDirectory + "/" + JSCRReplicaIDx + "/" + sType + "/" + sKey + "/$File/"; document.write(''); } return } function loadfile(sType, sKey, sFile) { yw_loadfile(sType, sKey, sFile) } /**************** TypeSwitch API */ function yw_setParameter(sParamName, sParamValue, sURL) { //adds [?open]&sParamName=sParamValue to URL or resets the parameter to the given Value if //it is already set var iPosIndex = sURL.indexOf('&'+sParamName+'='); var iLength = sURL.length; if (iPosIndex != -1) { var sBehind = sURL.substring(iPosIndex+1, iLength-1); var iNextIndex = sBehind.indexOf('&'); sURL = sURL.substring(0, iPosIndex) + '&'+sParamName+'=' + sParamValue + (iNextIndex ==-1?'':sURL.substring(iPosIndex + iNextIndex+1, iLength)); } else { sURL = sURL + (sURL.indexOf('?open') == -1?'?open':'') + '&'+sParamName+'=' + sParamValue; } return sURL; } function yw_getParameter (sParamName, sURL) { // reads Parameter Value from sURL var iPosIndex = sURL.indexOf('&'+sParamName+'='); if (iPosIndex != -1) { var sBehind = sURL.substring(iPosIndex+1,sURL.length); var iNextIndex = sBehind.indexOf('&'); var iValueIndex = sParamName.length+1; if (iNextIndex != -1) { return sBehind.substring(iValueIndex, iNextIndex); } return sBehind.substring(iValueIndex, sBehind.length); } else { return ""; } } function yw_removeParameter (sParamName, sURL) { //removes the parameter from the URL var iPosIndex = sURL.indexOf('&'+sParamName+'='); var iLength = sURL.length; if (iPosIndex != -1) { var sBehind = sURL.substring(iPosIndex+1, iLength); var iNextIndex = sBehind.indexOf('&'); sURL = sURL.substring(0, iPosIndex) + (iNextIndex ==-1?'':sURL.substring(iPosIndex + iNextIndex+1, iLength)); } return sURL; } function yw_switchView (sURL) { // switches from a content to a frameset view sURL=yw_ReplaceSubstring(sURL, 'vwContentByKey', 'vwContentFrame'); sURL=yw_ReplaceSubstring(sURL, 'vwcontentbykey', 'vwContentFrame'); sURL=yw_ReplaceSubstring(sURL, 'currentbaselink','vwContentFrame'); sURL=yw_ReplaceSubstring(sURL, 'CurrentBaseLink','vwContentFrame'); sURL=yw_ReplaceSubstring(sURL, 'docname', 'FrameDocName'); sURL=yw_ReplaceSubstring(sURL, 'DocName', 'FrameDocName'); sURL=yw_ReplaceSubstring(sURL,'docs', 'frames'); sURL=yw_ReplaceSubstring(sURL,'Docs', 'frames'); return sURL; } /******* for web admin users:*/ function yw_switchBackFS() { var sURL = window.location.href; sURL = yw_removeParameter('at', sURL); sURL = yw_switchView(sURL); parent.location.href=sURL; } function yw_switchToFS (sTypeSuffix) { var sURL=window.location.href; sURL=yw_setParameter('at', sTypeSuffix,sURL); sURL=yw_switchView(sURL); parent.location.href=sURL; } function yw_switchFS(sTypeSuffix) { var sURL = window.location.href; var iPos = sURL.indexOf('&at=' + sTypeSuffix); if (iPos != -1) { sURL = yw_removeParameter('at', sURL); } else { sURL=yw_setParameter('at', sTypeSuffix,sURL); } sURL=yw_switchView(sURL); parent.location.href=sURL; } function yw_switchBack() { var sURL = window.location.href; window.location.href=yw_removeParameter('at', sURL); } function yw_switchTo (sTypeSuffix) { var sURL=window.location.href; window.location.href=yw_setParameter('at', sTypeSuffix, sURL); } function yw_switch(sTypeSuffix) { var sURL = window.location.href; var iPos = sURL.indexOf('&at=' + sTypeSuffix); if (iPos != -1) { window.location.href = yw_removeParameter('at', sURL); } else { window.location.href = yw_setParameter('at', sTypeSuffix, sURL); } } function yw_pasteParameters (sSourceURL, sTargetURL) { var sAT = yw_getParameter ('at', sSourceURL); var sLA = yw_getParameter ('la', sSourceURL); var sWF = yw_getParameter ('wf', sSourceURL); var sResult = (sAT ==''? sTargetURL:yw_setParameter('at', sAT, sTargetURL)); sResult = (sWF ==''? sResult: yw_setParameter('wf', sWF, sResult)); sResult = (sLA ==''? sResult: yw_setParameter('la', sLA, sResult)); return sResult; } function yw_loadURL (sTargetURL) { window.location.href = yw_pasteParameters (window.location.href, sTargetURL); } function BrowserTest() { var b = navigator.appName; if (b=="Netscape") this.b = "ns"; this.version = navigator.appVersion; this.v = parseInt(this.version); this.ns5 = (this.b=="ns" && this.v==5); } function yw_loadSearchResult (parSKD, parSQU, parSUI, parSSUQ, parSSQ){ var sURL; sURL=yw_setParameter('ssq', parSSQ, yw_setParameter('ssuq', parSSUQ, yw_setParameter('sui', parSUI, yw_setParameter('squ', parSQU, yw_setParameter('skd', parSKD, window.location.href))))); sURL=yw_removeParameter('in', sURL); sURL=yw_removeParameter('next', sURL); window.location.href=sURL; }