function getDbPath() { return (location.pathname.substr(0, location.pathname.toLowerCase().indexOf(".nsf") + 4)); } function closeDocument() { var form = document.forms[0]; window.location.replace(form.elements['$$$.nav.NextUrl'].value? form.elements['$$$.nav.NextUrl'].value : getDbPath()); return false; } // Generic popupXXX functions function popupWindow(url, h, w, id) { sw = screen.width/2; sh = screen.height/2; popwin = window.open(url,id,'height=' + h + ',width=' + w + ',left='+(sw-w/2)+',top='+(sh-h/2)+',scrollbars=yes,dependent=yes,resizable=no'); return false; } function popupHelp(topic) { var url = getDbPath() + '/help?ReadForm&topic=' + escape(topic); return popupWindow(url, 300, 400, 'help'); } function popupProduct(url) { return popupWindow(url, 300, 640, 'product'); } function popupStore(url) { return popupWindow(url, 500, 500, 'store'); } function popupRecipe(url) { return popupWindow(url, 500, 500, 'recipe'); } // End of generic popupXXX functions function imgOver(name) { return name.replace(/(-over)?\.gif/i, "-over.gif"); } function imgOut(name) { return name.replace(/(-over)?\.gif/i, ".gif"); } function calcGraphic(name) { return getDbPath() + name; } function openCalendar(form, fieldName, multiSelect) { var cUrl = getDbPath() + "/webcalendar?OpenForm&form=" + escape(form.name) + "&field=" + escape(fieldName) + "&multi=" + (multiSelect? "1" : "0"); window.open(cUrl,'datePicker','height=290,width=300, top=200,left=300'); } function openSelector(form, fieldName, keyword, multiSelect, windowCaption) { var cUrl = getDbPath() + "/kselector?OpenForm&form=" + escape(form.name) + "&field=" + escape(fieldName) + "&multi=" + (multiSelect? "1" : "0") + "&what=" + escape(keyword) + "&caption=" + escape(windowCaption); window.open(cUrl,'keywordSelector','height=180,width=400, top=200,left=300'); } function beginGraphicalTable(title, color, xwidth) { if (color == "grey"){ colorCode="#C0C0C0"; } else if (color == "green"){ colorCode="#AFAA5A"; } else { colorCode= "#7A8400"; } document.write('

' + title + '
'); } function endGraphicalTable() { document.write('
'); } function resizeImage(fotoObj,fixedHeight) { if (fixedHeight < fotoObj.height) { ratio = fotoObj.width / fotoObj.height; calcWidth = ratio * fixedHeight; fotoObj.width= calcWidth; fotoObj.height = fixedHeight; } } // end of section