// // STAR Javascript Library v2.1 ã 2001 // // n identifies Netscape // ie identifies Internet Explorer var n = (document.layers)? true:false; var ie = (document.all)? true:false; var win; // The minimum browser generation we need var BrowserGeneration = 4; // Warn user if broeser version is not supported if (parseInt(navigator.appVersion) < BrowserGeneration) { window.location.href = "OldBrowserHint.htm"; } //Layer handling // Show layer function show(showobj) { showobj.visibility = "visible"; return true; } // hide layer function hide(hideobj) { hideobj.visibility = "hidden"; return true; } //Open Link in same or new Window function openURL(url, newWindow, x, y) { if (newWindow == 1) { location="javascript:NewWindow('"+url+"','popup','"+ x+"','"+ y+"','yes')" } else { location=url } } //Formatting //??? function padout(number) { return (number < 10) ? '0' + number : number; } //??? function y2k(number){ return (number < 1000) ? number + 1900 : number; } //Format date to dd/mm/yyyy function formatDate(day, month, year){ return (padout(day) + '/' + padout(month - 0 + 1) + '/' + year); } //String Handling //Remove leading and triling spaces function trim(strText) { while (strText.substring(0,1) == ' ') strText = strText.substring(1, strText.length); while (strText.substring(strText.length-1,strText.length) == ' ') strText = strText.substring(0, strText.length-1); return strText; } //Replace in strSource all occurences of strPattern with strReplace function ReplaceSubstring(strSource, strPattern, strReplace) { if (strPattern==" ") { re= /\ /gi } else { re = "/\\"+strPattern+"/gi" } return strSource.replace(re, strReplace); } //Form Handling // Reloads document without loosing field values and without saving. Form property "Generate HTML" must be enabled function refreshDocFields(){ document.forms[0].__Click.value = '$Refresh'; document.forms[0].submit() } //Mark all checkboxes as checked function selectAll() { var form = document.forms[0]; for (i=0; i <= form.elements.length -1;i++) { if ((form.elements[i].type == 'checkbox') && (form.elements[i].checked == false)) { form.elements[i].checked = true; } } } //Mark all checkboxes as unchecked function DeSelectAll() { var form = document.forms[0]; for (i=0; i <= form.elements.length -1;i++) { if ((form.elements[i].type == 'checkbox') && (form.elements[i].checked == true)) { form.elements[i].checked = false; } } } //Window handling // Write Text to Browser's status bar function printStatus(message) { window.status = message; return true; } //Clear Text in Browser's status bar function clearStatus() { if (window.opener==null) { window.status=""; } else { window.opener.status="" } } //Reload calling window if available function reloadParent() { if (window.opener!=null) { window.opener.location.reload(); } } // Open url (mypage) in own centered window. function NewWindow(mypage, myname, w, h, scroll) { var delta = 30; //approx. height of windows Start bar var winl = (screen.width - w) / 2; var wint = ((screen.height - h) / 2) - delta; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'; win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } // Open url (mypage) in own centered window. function NewWindowWithValue(mypage, myname, w, h, x, y, scroll) { //var hostname = window.location.host var delta = 30; //approx. height of windows Start bar var winl = (screen.width - w) / 2; var wint = ((screen.height - h) / 2) - delta; winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', screenX='+x+', screenY='+y+', scrollbars='+scroll+', resizable'; win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } // Open url (mypage) in own centered window. function NewWindowXY(mypage, myname) { //var hostname = window.location.host var h = '800'; var w = '650'; var wint = '1'; var winl = '1'; var x = '1'; var y = '1'; var scroll = 'yes'; var delta = 30; //approx. height of windows Start bar var winl = (screen.width - w) / 2; var wint = ((screen.height - h) / 2) - delta; winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', screenX='+x+', screenY='+y+', scrollbars='+scroll+', '; win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } // Open url (mypage) in own centered window. function NewWindowXYZ(mypage, myname) { //var hostname = window.location.host var h = '800'; var w = '1200'; var wint = '1'; var winl = '1'; var x = '1'; var y = '1'; var scroll = 'yes'; var delta = 30; //approx. height of windows Start bar var winl = (screen.width - w) / 4; var wint = ((screen.height - h) / 2) - delta; winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl+', screenX='+x+', screenY='+y+', scrollbars='+scroll+', resizable=no'; win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } //Close child window if there is a parent window function closeWindow() { if (window.opener!=null) { window.close(); } } //STAR WF Specific function openDetailOrder (strOrderNo, strODType ) { url=jsDBPath +"ito_OpenDetailOrder?OpenAgent&ONr=" + strOrderNo + "&ODType=" + strODType; NewWindow(url, "DetailOrder", 1000, 550, "yes") } function openTargetINKAWindow (url) { f=document.forms[0]; //f.submit(); NewWindow(url, "TargetINKA", 300, 150, "yes"); }