//-----------------------ValidSession---------------------------// function IsValidSession() { if (top.frames.length==0 ) return false if (top.frames(0).document.forms(0).txtPFNo.value == "error") return false return true } //--------------------End ValidSession------------------------// //-----------------------logout---------------------------// function DivertToHomePage() { //alert($F('txtIpAddLoggedIN')) //alert($('Remote_Addr').innerHTML) if ((document.getElementById("txtUserName").innerHTML.toLowerCase() == "anonymous") || $F('txtIpAddLoggedIN') !=$('Remote_Addr').innerHTML) { var f = document.forms[0]; //location.href ="/frmHome?OpenForm" ; location.href = "/" +f.txtCurrDB.value+ "/frmHome?OpenForm"; } $("loading").hide(); $("hideBody").show(); } function logout() { sid = top.frames(0).document.forms(0).txtSessionID.value if (CurrentMode.innerText =="OPENDOCUMENT" | CurrentMode.innerText =="EDITDOCUMENT") top.location.href='../agLogout?OpenAgent&sid=' + sid else top.location.href='agLogout?OpenAgent&sid=' + sid } //--------------------End logout------------------------// //--------------------- Start txtCheckEmpty -----------------------------/// //Function txtCheckEmpty //Description : Checks if the Text field is empty or Null //Returns True or False accordingly function txtCheckEmpty(textCheck) { if (textCheck.value=="") { return true } } //--------------------- End txtCheckEmpty -----------------------------/// //--------------------- Start removeEntry -----------------------------/// function removeEntry( objList , strEntry ) { for( i=objList.length-1; i >= 0 ; i--) { if( objList.options(i).text == strEntry ) { objList.options.remove(i) } } } //--------------------- End removeEntry -----------------------------/// //--------------------- Start checkIsNumber -----------------------------/// //Function CheckIsNumber //Description : Checks if the field data is Number or not //Returns True or False accordingly function CheckIsNumber(textCheck ) { if(isNaN(textCheck.value)) { return false; } else if (eval(isNaN(textCheck.value))) { return false; } return true; } //--------------------- End checkIsNumber -----------------------------/// //--------------------- Start checkDuplicate -----------------------------/// //Function to checkDuplicate value //textCheck=Object of which value to be checked //textCheckIn=Object In which value to be checked // Comment : Please remove Save.click from the function function checkDuplicate(textCheck , textCheckIn) { var cnt for(cnt=0;cnt 0") } } //--------------------- End numbersOnly -----------------------------/// //--------------------- Start removeAttachment -----------------------------/// //att=attachment Name //attfield=Field //docid=docid.innerText function removeAttachment(att,attfield,docid) { window.open("../agRemoveAttachment?OpenAgent&docid=" +docid+ "&attname="+att+"&attfield="+attfield,"new", "toolbar=0,menubar=0,top=200,left=300,height=70,width=200") } //--------------------- End removeAttachment -----------------------------/// //--------------------- Start Sort a List Box -----------------------------/// function Sort(dlgFieldToSort) { var ln = dlgFieldToSort.length; var myArray = new Array(ln); for (i=0;i" + innerText + "

"); } } function addText( divId, innerText, divDesc, docId ) { if ( document.all( divId ) ) { var innerHTML = ""; if ( divDesc.length >0 ) { innerHTML = "

" + innerText + "

" + divDesc + ""; } else { innerHTML = "

" + innerText + ""; } document.all( divId ).innerHTML = document.all( divId ).innerHTML + innerHTML; } } function OpenDocument( docID) { if ( subString(loc,"?","&") =="OpenDocument") { // window.open("../0/" + docID + "?OpenDocument&did=" + docID + "&hk=S",'_new','menubar=no,toolbar=no,top=50,left=175,width=500,height=450' ) window.open("../0/" + docID + "?OpenDocument&mode=openat" , '_new' ,'menubar=no,toolbar=no,top=50,left=175,width=500,height=450' ) } else if ( subString(loc,"?","&") =="OpenForm") { // window.open("../0/" + docID + "?OpenDocument&did=" + docID + "&hk=S",'_new','menubar=no,toolbar=no,top=50,left=175,width=500,height=450' ) window.open("0/" + docID + "?OpenDocument&mode=openat" , '_new' ,'menubar=no,toolbar=no,top=50,left=175,width=500,height=450' ) } } //-----------------------------------------Start delete document(s) appearing in List View----------------------------// // This function is used to check if atleast one document is checked for deletion. If atleast one is selected then it will confirm the user action for deletion before // actually deleting the document function delDoc() { if(document.forms[0].txtDeleteDoc && document.forms[0].SaveOptions) { j=0; for(i=0;i<=document.forms[0].txtDeleteDoc.length;i++) { if(document.forms[0].txtDeleteDoc[i] && document.forms[0].txtDeleteDoc[i].checked) { j=j+1; break; } } if(j!=0) { if(confirm("This action will delete the selected record(s)")) { for(i=0;i<=document.forms[0].txtDeleteDoc.length;i++) { if(document.forms[0].txtDeleteDoc[i] && document.forms[0].txtDeleteDoc[i].checked) { document.forms[0].SaveOptions.value="0" document.forms[0].Save.click(); return true; break; } } } } else { alert("Please Select Document(s) To Delete "); } } } //-----------------------------------------End delete document(s) appearing in List View----------------------------// function Trim(strTrim) { return RTrim(LTrim(strTrim)); } function LTrim(strTrim){ while( strTrim.indexOf(' ') == 0 ){ strTrim = strTrim.substring(1) } return strTrim; } function RTrim(strTrim){ while( strTrim.lastIndexOf(' ') == strTrim.length-1 && strTrim.length > 0 ){ strTrim = strTrim.substring(0,strTrim.length-1) } return strTrim; } /////////////////////////////////////////////////////////////////