/******************************************************** Set of Global JavaScript functions to be used throughout DpiweLib ********************************************************/ function openWin(page,width,height,resize,scrollbars) { if (resize=='') resize='no'; if (scrollbars=='') scrollbars='auto'; var temp = window.open(page,"NewCatWin","toolbar=no,scrollbars="+scrollbars+",resizable="+resize+",width="+width+",height="+height + "left=200, top=200, screenX=200, screenY=200"); } function getElement(elemID) { var elem; if (document.getElementById) { elem = document.getElementById(elemID); } else { elem = document.all[elemID]; } return elem; } function adjustIFrameSize(iframeWindow, iframeId) { // resizes the height of iframe to display its full content // otherwise vertical scrollbars could appear down the right-hand side of the iframe // if the content is too large for the set height of the iframe var minHeight = 995; if ( typeof(iframeId) == "undefined") iframeId = "listFrame"; if (iframeId == "") iframeId = "listFrame"; if (document.getElementById) { iframeElement = document.getElementById(iframeId); } else { // iframeElement = document.all[iframeWindow.name]; iframeElement = document.all[iframeId]; } //for netscape if (iframeWindow.document.height && iframeWindow.document.height != '0') { docHeight = iframeWindow.document.height; // alert('netscape: document.hHeight: ' + iframeWindow.document.height); // alert('netscape: document.offsetHeight: ' + iframeWindow.document.offsetHeight); if (docHeight < minHeight) docHeight = minHeight; iframeElement.style.height = docHeight + 5 + 'px'; // alert('netscape: document.height: ' + iframeElement.style.height); return; } //for ie if (iframeWindow.document.body.scrollHeight && iframeWindow.document.body.scrollHeight != '0' ) { docHeight = iframeWindow.document.body.scrollHeight ; if (docHeight < minHeight) docHeight = minHeight; iframeElement.style.height = docHeight + 5 + 'px'; // alert('ie: document.all - compat mode ' + iframeElement.style.height); return; } //for mozilla if (iframeWindow.document.documentElement.scrollHeight) { docHeight = iframeWindow.document.documentElement.scrollHeight ; if (docHeight < minHeight) docHeight = minHeight; iframeElement.style.height = docHeight + 5 + 'px'; // alert('moz document.all - compatMode != BackCompat ' + iframeElement.style.height); return; } } function loadCardTab(recordID) { var refURL = "&ref=" + document.forms[0].searchURL.value; newLoc = "FullRecord?OpenForm&rec=" + recordID + refURL; window.location.href = getDBPath() + newLoc; } function closeCardTab() { // var searchURL = getDBPath() + document.forms[0].refURL.value; // window.location.href = searchURL; history.back(1); } function printList() { window.print(); } function logout() { // delete cookies deleteCookie("listid", "/"); deleteCookie("listdm", "/"); // redirect to home page window.location.href = getDBPath(); } /*********************************************************** trim is a simple function to remove leading/trailing spaces ************************************************************/ function trim(aStr) { return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "") }