function openPopUp(sUrl, iWidth, iHeight, sTarget) { if (typeof(sTarget)=="undefined") sTarget = "content"; windowOpen(sUrl, sTarget, "top=50,left=50,toolbar=0,height="+ iHeight +",width="+iWidth+",resizable=1,scrollbars=1",false); } function windowOpenPrintPreview(sUrl) { return(windowOpen(sUrl, 'PrintPreview','left=100,top=100,height=550,width=700,resizable=1,scrollbars=1')); } function windowOpenExportPreview(sUrl) { return(windowOpen(sUrl, 'ExportPreview','top=20,left=20,height=200,width=300,resizable=1,menubar=1')); } function windowClose() { parentFocus(); window.close(); } function windowRefresh(_bDontCloseChildren) { bDontCloseChildren = _bDontCloseChildren; try { window.document.location.reload(true); } catch(e) { window.document.location.replace(window.document.location.href); } } function windowReplace(sUrl) { window.document.location.replace(sUrl); } function parentFocus() { try { window.opener.focus(); } catch(e) {} } function parentRefresh() { try { window.opener.windowRefresh(); } catch(e) { try { window.opener.location.reload(true); } catch(e) {} } } function parentCall(sCmd) { try { eval('window.opener.' + sCmd +';'); } catch(e) {} } var _aSpRowStyle = new Array(); function SetClassName(item, name, classname) { _aSpRowStyle[name] = item.className; item.className = classname; } function ResetClassName(item, name) { item.className = _aSpRowStyle[name]; } function Round(fVal, iDecimals) { iShift = Math.pow(10, iDecimals); return (Math.round(fVal*iShift) / iShift); } function search_nextPage(pname, sURL, iLastIndex) { eval('var iPageNr=parseInt('+pname+'_iPageNr);'); eval('var sIndices='+pname+'_sIndices;'); sPageIndex = (iPageNr+1) + '@' + iLastIndex; sRegEx = '/' + iPageNr + '@/'; iPos = sIndices.search(sRegEx); if (iPos != -1) sIndices = sIndices.substr(0, iPos) + ':'; else sIndices += ':'; sIndices += sPageIndex; sURL += ((sURL.search(/\?/) == -1) ? "?" : "&"); var sPagePar = pname+'_PageNr='+(iPageNr+1); var sIndPar = '&'+pname+'_Indices='+sIndices; var sSearchPar = '&'+pname+'_Search=2'; document.location = sURL+sPagePar+sIndPar+sSearchPar; } function search_prevPage(pname, sURL) { eval('var iPageNr=parseInt('+pname+'_iPageNr);'); eval('var sIndices='+pname+'_sIndices;'); sURL += ((sURL.search(/\?/) == -1) ? "?" : "&"); var sPagePar = pname+'_PageNr='+(iPageNr-1); var sIndPar = '&'+pname+'_Indices='+sIndices; var sSearchPar = '&'+pname+'_Search=2'; document.location = sURL+sPagePar+sIndPar+sSearchPar; } function trim(s) { return ltrim(rtrim(s)); } function ltrim(s) { while (s.length > 0 && s.charAt(0) == ' ') s = s.substr(1, s.length); return s; } function rtrim(s) { while (s.length > 0 && s.charAt(s.length - 1) == ' ') s = s.substr(0, s.length - 1); return s; } function nl2br(s) { re = /\n/g; return s.replace(re, '
'); } function noPopUp(e) { var message="Copyright '2012 - Webfauna'"; if(e.button == 2) { alert(message); return false; } } function OpenWizard(pname, sParams, sWndName, bUpdateParent) { iUpdate = ((typeof(bUpdateParent)=="undefined" || !bUpdateParent) ? 0 : 1); if (sParams!="" && sParams.substr(0, 1) != "&") { sParams = "&" + sParams; } windowOpen("/documentviewer.html?sDocName=" + pname + "&bUpdateParent="+iUpdate+"&variant=1&new=1" + sParams , sWndName,"left=300,top=300,height=530,width=660,resizable=1,scrollbars=0" ); } function confirmDelete(title) { if (typeof(title)=="string" && title!="") title = " ("+ title +") "; return confirm("Weet u zeker dat u dit item"+title+" wilt wissen?"); } function showPropInfo(prop, val, showval) { var param = (prop==0) ? "val="+val : "prop="+prop; if (typeof(showval) != "undefined" && showval) param += "&showval=1"; openPopUp("/pages/propinfo.html?variant=popup&"+param, 400, 400, "info"); } var _aReq = new Array(); function getReqObj() { var req = false; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { } } } return req; } function fillListItemsXml(id, val) { if (_aReq[id].readyState!=4) return; if (_aReq[id].status == 200) { var oList = document.getElementById(id); var oNodeList = _aReq[id].responseXML.getElementsByTagName("items").item(0); if (oNodeList == null) return; var checkVal = (typeof(val) != 'undefined' && val!=null); oNodeList = oNodeList.childNodes; for (var i=0; i < oNodeList.length; i++) { var node = oNodeList.item(i); var oOpt = document.createElement("OPTION"); oOpt.value = node.getAttribute("id"); oOpt.text = unescape(node.getAttribute("caption")); if (checkVal && val==oOpt.value) { oOpt.selected = true; } oList.options.add(oOpt, i+1); } _aReq[id] = "ok"; } } function asyncGetXmlItems(id, cbf, type, val, page) { if (typeof(_aReq[id])=="string" && _aReq[id]=="ok") return; if (!val) val = "1"; if (!page) page = "/pages/getxml.html"; _aReq[id] = getReqObj(); _aReq[id].onreadystatechange = cbf; _aReq[id].open("GET", page+"?"+type+"="+val, true); _aReq[id].send(null); } function FloatUS2NL(sString, iDecimals) { return FormatFloat(sString, iDecimals, ','); } function FormatFloat(fValue, iDecimals, sSep) { if (typeof(sSep) == "undefined") sSep = "."; var fValue = parseFloat(fValue); if ( isNaN(fValue) ) return ""; var iValue = Math.floor(fValue); var fLower = Math.round((fValue-iValue) * Math.pow(10, iDecimals)); var sLower = fLower.toString(10); if (sLower.length > iDecimals) { sLower = sLower.substr(2, iDecimals); } else { while (sLower.length < iDecimals) { sLower += "0"; } } return iValue + sSep + sLower; }