var frm; var form; var sFUCVal = ""; function openhelp( ohForm ) { window.open( ohForm.thisDatabaseWithPath.value + "/formHelp?openform", 'show_details_window', 'top=100, left=150, width=600, height=590,scrollbars'); } function delcat(docid) { document.location = "./deletecat?openAgent&u=" + docid + ""; } function newWin1( urlToOpen, windowName ) { window.open( urlToOpen, windowName, 'location=no,resizable=yes,scrollbars=yes,status=yes,width=600, height=600, top=50, left=50' ) } function newWin(wURL, wWidth, wHeight, wTop, wLeft, wResize, wStatus) { // usage: newWin( document.forms(0).thisDatabaseWithPath.value + '/luCategories?open', 700, 420, 25, 200, true, true); features = 'dependent,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=1,resizable=' + ((wResize) ? 1 : 0) + ((wResize) ? 1 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ? ',height=' + wHeight : '') + ((wTop) ? ',top=' + wTop : '') + ((wLeft) ? ',left=' + wLeft : ''); popWin = window.open(wURL,'ChildWin',features); if (popWin.focus) popWin.focus(); return popWin; } function show_props(obj, obj_name) { // usage : alert( show_props( document.forms(0), "forms.0" ) ) var result = ""; for (var i in obj) { var sTmp = new String( obj[i] ); result += obj_name + "." + i + " = " + sTmp.substr( 0, 30 ) + "\t"; } return result; } function setMsg( msg ){ window.status = msg return true } function assignParentOld( sParent, sParentID ) { //, vCatReaders ){ //eParent + @If( eParent!=""; "\\"; "" ) + eTitle; currParent = document.forms(0).eParent.value; currTitle = document.forms(0).eTitle.value; currCategory = ''; if ( currParent == '' ) currCategory = currTitle else currCategory = currParent + "\\" + currTitle if ( currCategory == sParent ) alert( "Can't select the current category as parent" ); else { document.forms(0).eParent.value = sParent; document.forms(0).eParentID.value = sParentID; // document.forms(0).dplyeCatReaders.value = vCatReaders // alert( "Assigned Category " + sParent + " with ID " + sParentID ); } } function assignParent( sParent, sParentID ) { if ( document.forms(0).dplyForm.value == "formCategory" ){ // alert( document.forms(0).dplyForm.value ); currParent = document.forms(0).eParent.value; currTitle = document.forms(0).eTitle.value; currCategory = ''; if ( currParent == '' ) currCategory = currTitle else currCategory = currParent + "\\" + currTitle if ( currCategory == sParent ) { alert( "Can't select the current category as parent" ); return false; } } // alert( document.forms(0).dplyForm.value ); document.forms(0).eParent.value = sParent; document.forms(0).eParentID.value = sParentID; // alert( "Assigned Category " + sParent + " with ID " + sParentID ); // } } function pullCategory( ) { catWin = newWin( document.forms(0).thisDatabaseWithPath.value + '/luCategories?open', 700, 420, 25, 200, true, true); if (catWin.opener == null) catWin.opener = self; } function doExpandCollapse( ) { // since 'window.location.href = form.NewURL.value;' opens a separate page in the history, replace is used. // alert( document.forms(0).NewURL.value ) window.location.replace( document.forms(0).NewURL.value ) } function doRefresh( ) { window.location.reload( true ) } function addressBox( fieldName ) { abURL = '/segbcentral.nsf/AddressBox?OpenForm'; addressField = fieldName; opts = 'resizable=1, status=1, width=560,height=220'; popupWin=window.open( abURL,'abWindow', opts); } function linkWindow( linkURL ) { linkURL = document.forms(0).thisDatabaseWithPath.value + linkURL catWin = newWin( linkURL, 700, 420, 25, 200, true, true); if (catWin.opener == null) catWin.opener = self; } function refreshCalc( rcForm ) { // recalculates the computed fields in the form and also assigns back the FileUploadControl's value, which will disappear while recalculating for ( var i=0; i0) { tempArray[Count]=tempString.substr(0,tempString.indexOf(delimiter)); tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1); Count=Count+1 } tempArray[Count]=tempString; return tempArray; } function linkExtWindow( linkURL ) { catWin = newWin( linkURL, 700, 420, 25, 200, true, true); if (catWin.opener == null) catWin.opener = self; } function assignExternalLink( aelForm, aelDB, aelView, aelUNID, aelText ) { // given the document Unique ID (UNID), this function constructs the link to that document sURL = aelDB + "/" + aelView + "/" + aelUNID; sLinkURL = "Javascript:linkExtWindow( '" + sURL + "' )"; aelForm.eExtLink.value = sLinkURL + "|" + aelText; } function refreshDoc( rdForm ) { // check the alternate function refreshCalc - as above rdForm.__Click.value = '$Refresh' rdForm.submit() } //
Next
function Navigate(linkto, link) { var sLink; var found; sLink =new Array(); j=document.links.length-1; alert ( "links length = " + j ); found = j for (i=0 ; i Previous" + document.links[j].href ); alert ( document.links[j].href + document.links[j].id); j=j-1; } alert ( "Name = Previous" + document.links[found].href ); alert( show_props( document.links[found], "links." + found ) ) alert( document.links[found].onclick ); // link.attachEvent( "onclick", document.links[found].onclick ) document.links[found].target = '_self' document.links[found].onclick // return document.links[found].handleEvent( Event.CLICK ) // window.location=sLink[linkto]; } //************************************************************************************** // trim the leading and trailing blank spaces in the field value - given its field name; //************************************************************************************** function trim( f ) { while( '' + f.charAt( f.length-1 ) == ' ' ) f = f.substring( 0, f.length-1 ); while( '' + f.charAt(0) == ' ' ) f = f.substring( 1, f.length ); return f } /*********************************************************** doSubmit( dsForm ) This function is passed an form object. On validating the form based on the arguments, the form object will be submitted. ************************************************************/ function doSubmit( dsForm ) { // alert( "Validating" ) if ( validateForm( dsForm ) ) { dsForm.submit(); } } /*********************************************************** doClose( dcForm ) { This function is passed an form object. Resets the href to URLOnCancel value. Arguments: obj = form object. ************************************************************/ function doClose( dcForm ) { // alert( dcForm.URLOnCancel.value ); // if( dcForm.URLOnCancel.value == "" ) // history.go(-1) // else sCloseURL = dcForm.thisDatabaseWithPath.value + "/formHome?open" location.href = sCloseURL } /*********************************************************** doBack( ) { history.go(-1) ************************************************************/ function doBack( ) { history.go(-1) } /*********************************************************** doDelete( ddForm, ddDelFlag, ddSaveOnlyFlag ) This function is passed an form object, delflag-a boolean, SaveOnlyFlag-a boolean. On validating the form based on the arguments, the form object will be submitted. Arguments: obj = form object. delflag = true / false to say whether current document is marked for deletion saveonlyflag = true / false to say whether the current document is actioned for just save only ************************************************************/ function doDelete( ddForm, ddDelFlag, ddSaveOnlyFlag ) { // alert( "Entering doDelete-" + ddForm.eTitle.value ); if ( validateForm( ddForm, ddDelFlag, ddSaveOnlyFlag ) ) { ddForm.submit(); } } function doEdit( deUNID, deFocusField ) { location.href = form.thisDatabaseWithPath.value + "/0/" + deUNID + "?edit"; for( var i=0; i<200000; i++ ); if ( deFocusField != "" ) { var deField = form[ deFocusField ]; ( typeof deField != "undefined" ) ? deField.focus(): ""; } } /* This Script can be used to validate your form for numeric values. The Numeric TextBox allows only numbers and accepts one decimal Point. Compatible with both Netscape and Internet Explorer. Usage : onKeyPress="return keyCheck(event, this)" */ function keyCheck(eventObj, obj) { var keyCode // Check For Browser Type if (document.all){ keyCode=eventObj.keyCode } else{ keyCode=eventObj.which } var str=obj.value if(keyCode==46){ if (str.indexOf(".")>0){ return false } } if((keyCode<48 || keyCode >58) && (keyCode != 46)){ // Allow only integers and decimal points return false } return true } /* This script allows only delete key in a field. Compatible with both Netscape and IE. Usage : onKeyPress="return allowOnlyFieldValueDelete(event)" */ function allowOnlyFieldValueDelete(eventObj) { var keyCode // Check For Browser Type if (document.all){ keyCode=eventObj.keyCode } else{ keyCode=eventObj.which } if(keyCode!=127) { // Allow only Del key return false } return true } /* This Script can be used to validate your form for numeric values. The Numeric TextBox allows only numbers and accepts one decimal Point. Compatible with both Netscape and Internet Explorer. Usage : onKeyPress="return numberCheck(event, this, 6, form["nextField"] )" */ function numberCheck(eventObj, obj, iMaxLen, objNext ) { var keyCode // Check For Browser Type if (document.all){ keyCode=eventObj.keyCode } else{ keyCode=eventObj.which } var str=obj.value // alert( str + iMaxLen ) if ( iMaxLen > 0 ) { if ( str.length == iMaxLen ) { alert( str + "(current len=" + str.length + " allowed len=" + iMaxLen ); if( typeof objNext == "undefined") objNext.focus(); return false; } } if(keyCode==46){ if (str.indexOf(".")>0){ return false } } if((keyCode<48 || keyCode >58) && (keyCode != 46)){ // Allow only integers and decimal points return false } return true } /********************* helpCS_Old( formHCS ) *********************/ function helpCS_Old( formHCS ) { if ( formHCS.helpKey.value == "" ) { alert( "No Help Key found." ) } else { if ( formHCS.helpKey.value == "Annual Appraisal" ) { s= new String(currtab); val = s.substring(3); val2 =parseInt(val); newWin( formHCS.thisDatabaseWithPath.value + '/contextsensitive/' + formHCS.helpKey.value + val2 + '?open', 700, 420, 25, 200, true, true) } else { newWin( formHCS.thisDatabaseWithPath.value + '/contextsensitive/' + formHCS.helpKey.value + '?open', 700, 420, 25, 200, true, true) } } } /********************* helpCS( ) *********************/ function helpCS( ) { newWin( '/intranetgb/segbcentralfaq.nsf/formFolderCentralWin?open&ID=GEMY-62TLT6', 700, 420, 25, 200, true, true) } function showAuditHistoryValue( sUNID ) { newWin( form.thisDatabaseWithPath.value + '/formAudithistoryDisplay?open&parentUNID=' + sUNID, 725, 300, 10, 10, false, false); } /* pinched from French Competitor database http://planet.schneider-electric.com/intranet/DE/concurrence/concurrenceV2.nsf/FrameSetHP?ReadForm&L=Us&=Us& */ function saveAsMe (filename) { if (document.all) { var OLECMDID_SAVEAS = 4; var OLECMDEXECOPT_DONTPROMPTUSER = 2; var OLECMDEXECOPT_PROMPTUSER = 1; var WebBrowser = ""; document.body.insertAdjacentHTML("beforeEnd", WebBrowser); WebBrowser1.ExecWB(OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER); WebBrowser1.outerHTML = ""; } else { alert("Sorry, Don't work for Netscape users !"); } } function replacesubstring(fullS,oldS,newS) { for (var i=0; i