/* FILE ARCHIVED ON 5:52:10 May 7, 2016 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 15:58:18 Jan 27, 2017. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ var extIconWindow = null; var imgWindow = null; var imageSelectWin = null; var fileSelectWin = null; var colorWindow = null; var colorSelectInput = null; function openImageAdmin() { var iWidth = 1024; var iHeight = 768; var strWinName = "imageSelectWin"; var openWin = true; var strURL = '/js/webimageselect_iShowThumbs_1_iSelectImg_0_strInitialPath_..-images.html'; var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=1,scrollbars=1,status=1,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; if (imageSelectWin == null) openWin = true; else if (imageSelectWin.closed) openWin = true; else openWin = false; if (openWin) { imageSelectWin = window.open(strURL, strWinName, strParameters); imageSelectWin.focus(); } else { if (!imageSelectWin.closed) { imageSelectWin.focus(); if (imageSelectWin.setInitialPath) imageSelectWin.setInitialPath(); } } } function openFileAdmin() { var iWidth = 1024; var iHeight = 768; var strWinName = "fileSelectWin"; var openWin = true; var strURL = '/js/fileselect_iSelectFile_0_strInitialPath_..-download.html'; var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=1,scrollbars=1,status=1,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; if (fileSelectWin == null) openWin = true; else if (fileSelectWin.closed) openWin = true; else openWin = false; if (openWin) { fileSelectWin = window.open(strURL, strWinName, strParameters); fileSelectWin.focus(); } else { if (!fileSelectWin.closed) { fileSelectWin.focus(); if (fileSelectWin.setInitialPath) fileSelectWin.setInitialPath(); } } } function openOffscopeFileAdmin() { var iWidth = 1024; var iHeight = 768; var strWinName = "fileSelectWin"; var openWin = true; var strURL = '/js/fileselect_iSelectFile_0_strInitialPath_..-..-documents.html'; var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=1,scrollbars=1,status=1,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; if (fileSelectWin == null) openWin = true; else if (fileSelectWin.closed) openWin = true; else openWin = false; if (openWin) { fileSelectWin = window.open(strURL, strWinName, strParameters); fileSelectWin.focus(); } else { if (!fileSelectWin.closed) { fileSelectWin.focus(); if (fileSelectWin.setInitialPath) fileSelectWin.setInitialPath(); } } } function updateFormStrings() { var editField; var index = (arrLangs.length > 1 && arrLangFields.length) ? document.forms[strFormName].thisLang.selectedIndex : null; iNewLang = (arrLangs.length > 1 && arrLangFields.length) ? document.forms[strFormName].thisLang[index].value : iCurrLang; for (var i = 0; i < arrLangFields.length; i++) { editField = eval("document.forms[0]." + arrLangFields[i].toUpperCase()); document.forms[strFormName].elements[arrLangFields[i] + "[" + iCurrLang + "]"].value = editField.value; editField.value = document.forms[strFormName].elements[arrLangFields[i] + "[" + iNewLang + "]"].value; } if (iHasArticleElements) { for (var i = 0; i < arrArticleFields.length; i++) { if (iUseTinymce == 1) { eval('getArticleContent' + arrArticleFields[i] + '();'); } else { if (typeof window.frames[arrArticleFields[i]] != 'undefined' && window.frames[arrArticleFields[i]] != null) { window.frames[arrArticleFields[i]].getEditWinContent(); } } } } iCurrLang = iNewLang; } function evalEnabledFields() { for (var strFieldName in arrEnabledFields) { document.forms[strFormName].elements[strFieldName].disabled = (!eval(arrEnabledFields[strFieldName])); } } function evalEditPresenterLock() { var iValuesChanged = false; if (!document.forms.length || typeof strFormName == 'undefined' || typeof strConfirmEditLock == 'undefined') { top.getLockedURL(); return; } //alert(strFormName); updateFormStrings(); if (document.forms[strFormName] != null && arrValues.length) { for (var i = 0; i < arrValues.length; i++) { if (document.forms[strFormName].elements[arrValues[i][0]].value != arrValues[i][1]) { iValuesChanged = true; } } } if (iValuesChanged) { if (confirm(strConfirmEditLock)) { top.getLockedURL(); } } else { top.getLockedURL(); } } function toggleEditLang() { if (!document.forms.length) return; if (typeof strFormName == 'undefined') return; if (typeof document.forms[strFormName] == 'undefined') return; if (typeof document.forms[strFormName].thisLang == 'undefined') return; var index = document.forms[strFormName].thisLang.selectedIndex; if (index == document.forms[strFormName].thisLang.options.length - 1) document.forms[strFormName].thisLang.selectedIndex = 0; else document.forms[strFormName].thisLang.selectedIndex = index+1; updateFormStrings(); } function evalFormData(arrPostFunctions) { var iResult = 1; var thisField; var editField; var iIsMandatory; var iIsMultiLang; var thisForm = document.forms[strFormName]; var arrLangsFilled = new Array(); var arrLangIDsFilled = new Array(); for (var i = 0; i < arrLangFields.length; i++) { // First update the hidden lang fields editField = eval("thisForm." + arrLangFields[i].toUpperCase()); if (!editField) continue; if (arrEditLangs.length > 1) { if (thisForm.iTheSame.checked) { iIsMandatory = false; for (var j = 0; j < arrMandatoryFields.length; j++) { if (arrLangFields[i] == arrMandatoryFields[j][1]) { iIsMandatory = true; break; } } if (!iIsMandatory || (iIsMandatory && editField.value != "")) setLangsTheSame(arrLangFields[i]); } else { if (iHasArticleElements) { for (a = 0; a < arrArticleFields.length; a++) { if (arrArticleFields[a] != arrLangFields[i]) { thisForm.elements[arrLangFields[i] + "[" + iCurrLang + "]"].value = editField.value; } } } else { thisForm.elements[arrLangFields[i] + "[" + iCurrLang + "]"].value = editField.value; } } } else { if (iHasArticleElements) { for (a = 0; a < arrArticleFields.length; a++) { if (arrArticleFields[a] != arrLangFields[i]) { thisForm.elements[arrLangFields[i] + "[" + iCurrLang + "]"].value = editField.value; } } } else { thisForm.elements[arrLangFields[i] + "[" + iCurrLang + "]"].value = editField.value; } } } if (iAllLangsMandatory) { for (var i = 0; i < arrEditLangs.length; i++) arrLangIDsFilled[arrLangIDsFilled.length] = arrEditLangs[i][0]; } else { for (var i = 0; i < arrEditLangs.length; i++) { // Now check which lang IDs have been filled for (var j = 0; j < arrLangFields.length; j++) { editField = thisForm.elements[arrLangFields[j] + "[" + arrEditLangs[i][0] + "]"]; if (editField != null) { if (editField.value != "") { arrLangIDsFilled[arrLangIDsFilled.length] = arrEditLangs[i][0]; arrLangsFilled[arrLangsFilled.length] = arrEditLangs[i]; break; } } } } if (!arrLangsFilled.length) { arrLangIDsFilled[arrLangIDsFilled.length] = iDefaultLang; arrLangsFilled[arrLangsFilled.length] = new Array(iDefaultLang, strDefaultLang); } } var arrLangsToEval = (iAllLangsMandatory) ? arrEditLangs : arrLangsFilled; if (arrLangFields.length) thisForm.langsFilled.value = arrLangIDsFilled.toString(); for (var j = 0; j < arrMandatoryFields.length; j++) { iIsMultiLang = false; for (var n = 0; n < arrLangFields.length; n++) { if (arrLangFields[n] == arrMandatoryFields[j][1]) { iIsMultiLang = true; break; } } if (iIsMultiLang) { editField = eval("thisForm." + arrMandatoryFields[j][1].toUpperCase()); thisForm.elements[arrMandatoryFields[j][1] + "[" + iCurrLang + "]"].value = editField.value; for (var i = 0; i < arrLangsToEval.length; i++) { thisField = thisForm.elements[arrMandatoryFields[j][1] + "[" + arrLangsToEval[i][0] + "]"]; var strLang = (arrLangsToEval.length > 1) ? ", " + arrLangsToEval[i][1] : ""; if (thisField.value == "") { alert(arrMandatoryFields[j][0] + strLang + ": " + strNoValue); if (arrLangsToEval.length > 1) { thisForm.thisLang.selectedIndex = i; } updateFormStrings(); editField.focus(); iResult = 0; break; } } } else { /* for (var m = 0; m < thisForm.elements.length; m++) { alert(thisForm.elements[m].value); } */ editField = eval("thisForm." + arrMandatoryFields[j][1]); if (editField != null) { var strNonValue = ""; if (typeof arrNonValues[editField.name] != 'undefined') strNonValue = arrNonValues[editField.name]; if (arrMandatoryFields[j][1].substring(0,1) == "i" && strNonValue == "") { if (!parseInt(editField.value) && editField.value != "0") { alert(arrMandatoryFields[j][0] + ": " + strNoNumber); editField.focus(); iResult = 0; break; } } else { var strNonValue = ""; if (typeof arrNonValues[editField.name] != 'undefined') strNonValue = arrNonValues[editField.name]; if (editField.value == strNonValue) { alert(arrMandatoryFields[j][0] + ": " + strNoValue); editField.focus(); iResult = 0; break; } } } } if (!iResult) break; } if (iHasArticleElements) { for (var i = 0; i < arrArticleFields.length; i++) { if (iUseTinymce == 1) { eval('getArticleContent' + arrArticleFields[i] + '();'); } else { if (typeof window.frames[arrArticleFields[i]] != 'undefined' && window.frames[arrArticleFields[i]] != null) { window.frames[arrArticleFields[i]].getEditWinContent(); } } } } /* check for validation method, if any */ if (typeof arrValidate != 'undefined' && arrValidate.length) { for (i = 0; i < arrValidate.length; i++) { validateReg = eval(arrValidate[i][2]); iIsMultiLang = false; for (var n = 0; n < arrLangFields.length; n++) { if (arrLangFields[n] == arrValidate[i][1]) { iIsMultiLang = true; break; } } if (iIsMultiLang) { validateField = eval("thisForm." + arrValidate[i][1].toUpperCase()); for (var j = 0; j < arrLangsToEval.length; j++) { thisField = thisForm.elements[arrValidate[i][1] + "[" + arrLangsToEval[j][0] + "]"]; var strLang = (arrLangsToEval.length > 1) ? ", " + arrLangsToEval[j][1] : ""; if (!validateReg.test(thisField.value) && thisField.value != '' && iResult) { alert(arrValidate[i][0] + strLang + ': ' + strInvalidCharsUsed); if (arrLangsToEval.length > 1) { thisForm.thisLang.selectedIndex = i; } updateFormStrings(); validateField.focus(); iResult = 0; break; } } } else { validateField = eval("thisForm." + arrValidate[i][1]); if (!validateReg.test(validateField.value) && validateField.value != '' && iResult) { alert(arrValidate[i][0] + ': ' + strInvalidCharsUsed); validateField.focus(); iResult = 0; break; } } } } if (typeof arrPasswordFields != 'undefined' && arrPasswordFields.length) { for (var i = 0; i < arrPasswordFields.length; i++) { var strField = arrPasswordFields[i][1]; var editField = eval("thisForm." + arrPasswordFields[i][1]); var editFieldConfirm = eval("thisForm." + arrPasswordFields[i][1] + "_confirmPass"); if (editFieldConfirm != null && editField.value != editFieldConfirm.value) { alert(arrPasswordFields[i][0] + ": " + strPasswordNoMatch); iResult = 0; editField.focus(); break; } } } if (iResult) { if (arrPostFunctions != null) { for (var i = 0; i < arrPostFunctions.length; i++) { if (!(iResult = (eval(arrPostFunctions[i])))) break; } } } if (iResult) { thisForm.submit(); } } function onBeforeSubmitSetLangsTheSame() { document.forms[strFormName].iTheSame.checked = true; } function setLangsTheSame(strFieldName) { editField = eval("document.forms[0]." + strFieldName.toUpperCase()); for (var j = 0; j < arrLangs.length; j++) { document.forms[0].elements[strFieldName + "[" + arrLangs[j][0] + "]"].value = editField.value; } } function evalPrivilegeData() { var thisForm = document.forms['privilegeForm']; var iFlagID; for (var i = 0; i < thisForm.elements.length; i++) { if (thisForm.elements[i].type != "checkbox") continue; if (thisForm.elements[i].checked) { iFlagID = thisForm.elements[i].name.substring(4, thisForm.elements[i].name.indexOf("_")); thisForm.elements['bitvalue[' + iFlagID + ']'].value |= thisForm.elements[i].value; } } thisForm.submit(); } function checkAll(whichForm) { for (var i = 0; i < whichForm.elements.length; i++) { if (whichForm.elements[i].type == "checkbox" && whichForm.elements[i].name != "iTheSame") { whichForm.elements[i].checked = true; } } } function uncheckAll(whichForm) { for (var i = 0; i < whichForm.elements.length; i++) { if (whichForm.elements[i].type == "checkbox" && whichForm.elements[i].name != "iTheSame") { whichForm.elements[i].checked = false; } } } function extIconSelect(strWhichForm) { var iWidth = 360; var iHeight = 300; var strURL = "/js/index_Mode_extIconSelect_strForm_.html" + strWhichForm; var strWinName = "extIconWindow"; var openWin = true; var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=0,scrollbars=1,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; if (extIconWindow == null) openWin = true; else if (extIconWindow.closed) openWin = true; else openWin = false; if (openWin) { extIconWindow = window.open(strURL, strWinName, strParameters); extIconWindow.focus(); } else { if (!extIconWindow.closed) extIconWindow.focus(); } } function imageSelect(strInput, strRelPath) { var iWidth = 540; var iHeight = 380; var strURL = "/js/index_Mode_imgSelect_strInput_.html" + strInput + "&strRelPath=" + strRelPath; var strWinName = "imgWindow"; var openWin = true; var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=0,scrollbars=1,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; if (imgWindow == null) openWin = true; else if (imgWindow.closed) openWin = true; else openWin = false; if (openWin) { imgWindow = window.open(strURL, strWinName, strParameters); imgWindow.focus(); } else { if (!imgWindow.closed) imgWindow.focus(); } } function selectImage(strFileName, strInput) { if (opener != null && !opener.closed) { var saveInput = opener.imgInput; saveInput.value = strFileName; window.close(); } } function evalPagetypeInfo() { var iResult = 1; if (document.forms[0].vcTemplateName.selectedIndex == 0) { alert(strNoFile); document.forms[0].vcTemplateName.focus(); iResult = 0; } return iResult; } /************************************************************************************** * strReplace() - replaces the string strPattern with strReplacement * in strHaystack ***************************************************************************************/ function strReplace(strHaystack, strPattern, strReplacement) { var strTemp = ""; if (strHaystack.indexOf(strPattern) != -1) { for (var i = 0; i < strHaystack.length; i++) { if (strHaystack.substring(i, i + strPattern.length) == strPattern) { strTemp += strReplacement; i += (strPattern.length - 1); } else { strTemp += strHaystack.charAt(i); } } } else { strTemp = strHaystack; } return strTemp; } function evalHasPageInterface() { var thisForm = document.forms['infoform']; if (thisForm.iHasPageInterface.checked) { arrMandatoryFields[arrMandatoryFields.length] = new Array(strPageInterfaceName, "vcPageInterfaceName"); arrMandatoryFields[arrMandatoryFields.length] = new Array(strFileName, "vcFileName"); } else { arrNewMandatoryFields = new Array(); for(var i=0; i < arrMandatoryFields.length -2; i++) { arrNewMandatoryFields[i] = arrMandatoryFields[i]; } arrMandatoryFields = arrNewMandatoryFields; } } function updateColorSelectBg(inputField) { var strColor = "" + inputField.value; var colorShow = document.getElementById("color" + inputField.name); if (colorShow != null) { if ((strColor.length == 4 || strColor.length == 7) && strColor.charAt(0) == '#') colorShow.style.backgroundColor = strColor; } } function colorSelect(iSelectStdColors) { var iSelectStdColors = (iSelectStdColors) ? 1 : 0; var iWidth = 270; var iHeight = (iSelectStdColors) ? 250 : 220; var strURL = "/js/index_Mode_colorSelect_iSelectStdColors_.html" + iSelectStdColors; if (typeof ODEUMSESSID != 'undefined') strURL += '&ODEUMSESSID=' + ODEUMSESSID; var strWinName = "colorWindow"; var openWin = true; var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=0,scrollbars=1,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; if (colorWindow == null) openWin = true; else if (colorWindow.closed) openWin = true; else openWin = false; if (openWin) { colorWindow = window.open(strURL, strWinName, strParameters); colorWindow.focus(); } else { if (!colorWindow.closed) { colorWindow.close(); colorWindow = window.open(strURL, strWinName, strParameters); } } } function setSelectedColorInput(inputField) { colorSelectInput = inputField; } function getSelectedColor() { if (colorSelectInput != null) { return colorSelectInput.value; } else { return "#FFFFFF"; } } function saveColor(strColor) { if (colorSelectInput != null) { colorSelectInput.value = strColor; updateColorSelectBg(colorSelectInput); } } var BUTTONSTATE_DEFAULT = 1; var BUTTONSTATE_FOCUSED = 2; var BUTTONSTATE_CLICKED = 3; var BUTTONSTATE_SELECTED = 4; var BUTTONSTATE_DISABLED = 5; var BUTTONTYPE_PLAIN = -1; var BUTTONTYPE_FORWARD = 2; var BUTTONTYPE_BACK = 1; var iButtonCount = 0; function OdeumSysButton(strLabel, strCommand, iType) { var button = document.createElement("div"); button.strLabel = strLabel; button.strCommand = strCommand; button.iType = (iType == null) ? BUTTONTYPE_PLAIN : iType; button.iState = BUTTONSTATE_DEFAULT; button.id = "sysbutton" + iButtonCount++; var strButtonText = strLabel; switch(button.iType) { case BUTTONTYPE_BACK: strButtonText = "< " + strButtonText; break; case BUTTONTYPE_FORWARD: strButtonText = strButtonText + " >"; break; } var strHTML = ""; button.innerHTML = strHTML; //alert(button.innerHTML); button.onmouseover = function() { this.iState = BUTTONSTATE_FOCUSED; this.reDraw(); } button.onmouseout = function() { this.iState = BUTTONSTATE_DEFAULT; this.reDraw(); } button.onmousedown = function() { this.iState = BUTTONSTATE_CLICKED; this.reDraw(); } button.onclick = function() { this.iState = BUTTONSTATE_FOCUSED; this.reDraw(); eval(this.strCommand); //this.getElementsByTagName("a")[0].focus(); } button.onfocus = function() { if (this.iState != BUTTONSTATE_FOCUSED) { this.iState = BUTTONSTATE_FOCUSED; this.reDraw(); } } button.onblur = function() { if (this.iState != BUTTONSTATE_DEFAULT) { this.iState = BUTTONSTATE_DEFAULT; this.reDraw(); } } button.reDraw = function() { switch(this.iState) { case BUTTONSTATE_DEFAULT: with(this.firstChild.style) { fontFamily = 'verdana, sans-serif'; fontSize = '11px'; color = '#fff'; backgroundColor = '#265f88'; padding = '6px 5px 6px 5px'; margin = '0px 3px 0px 0px'; border = 'none'; } break; case BUTTONSTATE_FOCUSED: with(this.firstChild.style) { fontFamily = 'verdana, sans-serif'; fontSize = '11px'; color = '#fff'; backgroundColor = '#3b97d3'; padding = '6px 5px 6px 5px'; margin = '0px 3px 0px 0px'; border = 'none'; } break; case BUTTONSTATE_CLICKED: with(this.firstChild.style) { fontFamily = 'verdana, sans-serif'; fontSize = '11px'; color = '#fff'; backgroundColor = '#3b97d3'; padding = '6px 5px 6px 5px'; margin = '0px 3px 0px 0px'; border = 'none'; } break; case BUTTONSTATE_CLICKED: alert(this.firstChild); break; } } button.reDraw(); return button; } //--------------------------------- function OdeumSysButtonPanel(parent) { var elm = document.createElement("div"); //elm.className = 'placeholder'; if (parent != null) parent.appendChild(elm); elm.mainTable = document.createElement("table"); elm.mainTable.border = 0; elm.mainTable.cellSpacing = 0; elm.mainTable.cellPadding = 0; elm.mainTBody = document.createElement("tbody"); elm.mainTRow = document.createElement("tr"); elm.appendChild(elm.mainTable); elm.mainTable.appendChild(elm.mainTBody); elm.mainTBody.appendChild(elm.mainTRow); elm.addButton = function(strLabelButton, strCommand, iType) { if (strCommand == null) { var button = strLabelButton; this.mainTRow.appendChild(document.createElement("td")); this.mainTRow.lastChild.appendChild(button); } else { var button = OdeumSysButton(strLabelButton, strCommand, iType); this.mainTRow.appendChild(document.createElement("td")); this.mainTRow.lastChild.appendChild(button); } } elm.removeButtons = function() { var iCount = 100; while (this.mainTRow.firstChild != null && --iCount) { this.mainTRow.removeChild(this.mainTRow.firstChild); } } return elm; } function unquote(str) { if (str.charAt(0) == "\"" || str.charAt(0) == "\'") str = str.substring(1); if (str.charAt(str.length - 1) == "\"" || str.charAt(str.length - 1) == "\'") str = str.substring(0, str.length - 1); return str; } function ltrim(str) { strTmp = ""; var iStart = true; for (var i = 0; i < str.length; i++) { if (iStart && (str.charAt(i) == " " || str.charAt(i) == "\t" || str.charAt(i) == "\n" || str.charAt(i) == "\r") ) continue; else { strTmp += str.charAt(i); iStart = false; } } return strTmp; } function rtrim(str) { strTmp = ""; var iEnd = true; for (var i = str.length - 1; i >= 0; i--) { if (iEnd && (str.charAt(i) == " " || str.charAt(i) == "\t" || str.charAt(i) == "\n" || str.charAt(i) == "\r") ) continue; else { strTmp = str.charAt(i) + strTmp; iEnd = false; } } return strTmp; } function trim(str) { return ltrim(rtrim(str)); } /****************************************************************************** function getTagVals(strHTML, iOffset); Description: Parses a string of html in to an array, with the attributes as keys. It parses the html string one char at a time with a state pointer. This is the same logic as in the php class DocumentHandler's method ******************************************************************************/ function getTagVals(strHTML, iOffset) { if (iOffset == null) iOffset = 0; var iStart = strHTML.toLowerCase().indexOf("<", iOffset); var iEnd = strHTML.toLowerCase().indexOf(">", iStart) + 1; if (iStart == -1 || iEnd == -1) return null; var strInnerHTML = strHTML.substring(iStart + 1, iEnd - 1); var strTagBody = strInnerHTML; var strAttribName, strAttribValue; var strQuoteChar = ""; var iState = 0; var arrAttribs = new Array(); var strAttrib = ""; for (var i = 0; i < strTagBody.length; i++) { //echo "$iState:" . $strTagBody[$i] . "
"; switch(strTagBody.charAt(i)) { case ">": if (iState != 2) { iState = 3; arrAttribs[arrAttribs.length] = strAttrib; } break; case "\n": case "\r": case "\t": case " ": switch (iState) { case 0: //continue; strAttrib = ""; break; case 1: arrAttribs[arrAttribs.length] = strAttrib; strAttrib = ""; break; case 2: strAttrib += strTagBody.charAt(i); break; } break; case "\"": case "'": switch (iState) { case 1: strQuoteChar = strTagBody.charAt(i); strAttrib += strTagBody.charAt(i); iState = 2; break; case 2: strAttrib += strTagBody.charAt(i); if (strQuoteChar == strTagBody.charAt(i)) { arrAttribs[arrAttribs.length] = strAttrib; strAttrib = ""; iState = 0; } break; } break; default: if (iState == 0) iState = 1; strAttrib += strTagBody.charAt(i); break; } if (iState == 3) { break; } } var arrValues = new Array(); for (var i = 0; i < arrAttribs.length; i++) { strAttrib = arrAttribs[i]; if (!i) arrValues[0] = strAttrib.toLowerCase(); else { if (trim(strAttrib) == '') continue; if (arrAttribs[i].indexOf("=") != -1) { var arrValueParts = arrAttribs[i].split("="); strAttribName = arrAttribs[i].substr(0, arrAttribs[i].indexOf("=")); strAttribValue = arrAttribs[i].substr(arrAttribs[i].indexOf("=")+1); } else { strAttribName = arrAttribs[i]; strAttribValue = arrAttribs[i]; } arrValues[strAttribName.toLowerCase()] = unquote(unescape(strAttribValue)); } } //showObj(arrValues); return arrValues; } function removeTag(strTag, strHTML, iOffset) { if (iOffset == null) iOffset = 0; strTag = strTag.toLowerCase(); var iStart = strHTML.toLowerCase().indexOf("<" + strTag, iOffset); var iEnd = strHTML.toLowerCase().indexOf(">", iStart) + 1; if (iStart != -1) { strHTML = strHTML.substring(0, iStart) + strHTML.substring(iEnd); iStart = strHTML.toLowerCase().indexOf("", iStart) + 1; if (iStart != -1) { strHTML = strHTML.substring(0, iStart) + strHTML.substring(iEnd); } } return "" + strHTML; } function removeTags(strHTML) { var iOffset = 0; var iStart = strHTML.indexOf("<", iOffset); var iEnd = strHTML.indexOf(">", iStart) + 1; while (iStart != -1) { strHTML = strHTML.substring(0, iStart) + strHTML.substring(iEnd); var iStart = strHTML.indexOf("<", iOffset); var iEnd = strHTML.indexOf(">", iStart) + 1; } return strHTML; } function showObj(obj, iNumElements, strMatch) { var iCount = 0; var str = ""; var value = ""; if (iNumElements == null) iNumElements = 20; for (var a in obj) { if (strMatch != null && a.toLowerCase().indexOf(strMatch.toLowerCase()) == -1) continue; if (obj[a] != null && obj[a].toString) value = trim(obj[a].toString()); else value = ""; if (value.substring(0, 8) == "function") value = value.substring(0, value.indexOf(")")+1); str += a + " => " + value + "\n"; if (iCount == iNumElements) { alert(str); str = ""; iCount = 0; } iCount++; } if (str.length) { top.alert(str); } } function ImageServerFileSelect_SaveFileName(strFileName) { if (this.form != null && this.form[this.strInputName] != null) { if (this.iImagePreview && !this.iDPSystemUse && !this.iUseDb) { strFileName = "/images/" + strFileName; } this.form[this.strInputName].value = strFileName; if (this.form[this.strInputName + '_isthesame'] != null && !this.form[this.strInputName + '_isthesame'].checked) { for (j = 0; j < arrEditLangs.length; j++) { this.form[this.strRealInputName + '[' + arrEditLangs[j][0] + ']'].value = this.form[this.strInputName].value; } } } } function ImageServerFileSelect_GetFileName() { if (this.form != null && this.form[this.strInputName] != null) { var strValue = this.form[this.strInputName].value; return strValue; } return ""; } function setServerFileSelectTheSame(strInputName) { var form = document.getElementById('infoform'); if (form == null) { form = opener.document.getElementById('infoform'); } var formLangs = null; if (typeof arrEditLangs != 'undefined') { formLangs = arrEditLangs; } else { formLangs = opener.arrEditLangs; } if (strInputName != '' && form[strInputName.toUpperCase() + '_isthesame'] != null && !form[strInputName.toUpperCase() + '_isthesame'].checked) { for (j = 0; j < formLangs.length; j++) { form[strInputName + '[' + formLangs[j][0] + ']'].value = form[strInputName.toUpperCase()].value; } } } function collDepr(which) { if (which == null) return; var thisTD = which; thisTD.className = "listCaption_depr"; } function collRelease(which) { if (which == null) return; var thisTD = which; thisTD.className = "listCaption"; } function collSort(strBaseID, iCol) { var strTableID = "list_" + strBaseID; var table = document.getElementById(strTableID); if (table == null) return; var tbody = table.getElementsByTagName("tbody")[0]; var arrTRs = tbody.getElementsByTagName("tr"); var iCount = 10000; if (typeof iSortMode == 'undefined') iSortMode = false; var strSortImg = (iSortMode) ? "asc" : "desc"; var tHeaders = table.getElementsByTagName("th"); for (var i = 0; i < tHeaders.length; i++) { var sortImg = document.getElementById("sortimg_" + strBaseID + "_" + i); if (sortImg != null) { if (i == iCol) { sortImg.src = "/gifs/elements/" + strSortImg + "/js/.gif"; } else { sortImg.src = "/gifs/layout/dot.gif"; } } } var iNothingChanged = false; var iMaxLength = null; while (!iNothingChanged && --iCount) { iNothingChanged = true; if (iMaxLength == null && (tHeaders[iCol].id.toLowerCase().substring(0, 2) == "da" || tHeaders[iCol].id.toLowerCase().charAt(0) == "i")) { for (var i = 1; i < arrTRs.length; i++) { var td = arrTRs[i].getElementsByTagName("td")[iCol]; if (typeof td.sortText != 'undefined') { strValue = td.sortText; } else { var strValue = trim(removeTags(td.innerHTML)); } if (iMaxLength == null) iMaxLength = strValue.length; else if (strValue.length > iMaxLength) iMaxLength = strValue.length; } } for (var i = 1; i < arrTRs.length; i++) { if (i == arrTRs.length - 1) continue; var td1 = arrTRs[i].getElementsByTagName("td")[iCol]; var td2 = arrTRs[i+1].getElementsByTagName("td")[iCol]; for (var j = 1; j <= 2; j++) { var td = eval("td" + j); if (typeof td.sortText == 'undefined') { td.sortText = trim(removeTags(td.innerHTML)); } if (iMaxLength != null) { var iZeroFill = iMaxLength - td.sortText.length; while (iZeroFill--) td.sortText = "0" + td.sortText; } } //if (i==2) showObj(td1); var strOperator = (iSortMode) ? ">" : "<"; if (eval("td1.sortText " + strOperator + " td2.sortText")) { iNothingChanged = false; var row1 = arrTRs[i]; var row2 = arrTRs[i+1]; //alert(row2.tagName); //tbody.removeChild(row2); tbody.insertBefore(row2, row1); } } } for (var i = 1; i < arrTRs.length; i++) { var arrTDs = arrTRs[i].getElementsByTagName("td"); for (var j = 0; j < arrTDs.length; j++) { if (j == iCol) { arrTDs[j].className = (arrTDs[j].className == "list1") ? "listSort1" : "listSort2"; } else { arrTDs[j].className = (arrTDs[j].className == "listSort1") ? "list1" : "list2"; } } } iSortMode = !iSortMode; } function initListSortVals(strBaseID) { var strTableID = "list_" + strBaseID; var table = document.getElementById(strTableID); if (table == null) return; var tbody = table.getElementsByTagName("tbody")[0]; var arrTRs = tbody.getElementsByTagName("tr"); var iCount = 10000; if (typeof iSortMode == 'undefined') iSortMode = false; var strSortImg = (iSortMode) ? "asc" : "desc"; var tHeaders = table.getElementsByTagName("th"); for (var strFieldName in arrSortValues) { for (var i = 0; i < tHeaders.length; i++) { if (tHeaders[i].id == strFieldName) { for (var j = 1; j < arrTRs.length; j++) { var td = arrTRs[j].getElementsByTagName("td")[i]; td.sortText = arrSortValues[strFieldName][j-1]; } } } } } function RemoveSpecialChars(str) { var newstr = ''; for (i = 0; i < str.length; i++) { switch (str.charCodeAt(i)) { case 33: case 37: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 63: case 92: case 124: break; case 32: newstr += ' '; break; case 197: newstr += 'AA'; break; case 198: newstr += 'AE'; break; case 216: newstr += 'OE'; break; case 229: newstr += 'aa'; break; case 230: newstr += 'ae'; break; case 248: newstr += 'oe'; break; default: newstr += str.charAt(i); break; } } newstr = newstr.toLocaleLowerCase(); return newstr; } /* * Function to remove newlines from a string */ function removeNewlines(str) { var result = ''; for (i = 0; i < str.length; i++) { if (str.charCodeAt(i) != 13 && str.charCodeAt(i) != 10) { result += str.charAt(i); } } return result; } /*********************************************************************** function quickSort() Original author: DreamCode (allan@pichler.dk) This version is slight modified by Frank Sorensen, fs@webhouse.dk The modification is that it swaps the arrays in stead of just letting the values change place. ***********************************************************************/ function quickSort(data, column, loBound, hiBound){ var pivot, loSwap, hiSwap, temp; // Two items to sort if (hiBound - loBound == 1){ if (data[loBound][column] > data[hiBound][column]){ temp = data[loBound]; data[loBound] = data[hiBound]; data[hiBound] = temp; } return; } // Three or more items to sort pivot = data[parseInt((loBound + hiBound) / 2)]; data[parseInt((loBound + hiBound) / 2)] = data[loBound]; data[loBound] = pivot; loSwap = loBound + 1; hiSwap = hiBound; while (loSwap < hiSwap) { // Find the right loSwap while (loSwap <= hiSwap && data[loSwap][column] <= pivot[column]) loSwap++; // Find the right hiSwap while (data[hiSwap][column] > pivot[column]) hiSwap--; // Swap values if loSwap is less than hiSwap if (loSwap < hiSwap){ temp = data[loSwap]; data[loSwap] = data[hiSwap]; data[hiSwap] = temp; } } data[loBound] = data[hiSwap]; data[hiSwap] = pivot; // Recursively call function // 2 or more items in first section if (loBound < hiSwap - 1) quickSort(data, column, loBound, hiSwap - 1); // 2 or more items in second section if (hiSwap + 1 < hiBound) quickSort(data, column, hiSwap + 1, hiBound); } var mainWorkspacePopup = null; function workspacePopupElm(iWidth, iHeight, iXPos, iYPos) { this.iWidth = iWidth; this.iHeight = iHeight; this.iXPos = iXPos; this.iYPos = iYPos; this.mainElm = null; this.arrShadowLayers = new Array(); this.init = function() { var holder = document.getElementById("popupHolder"); if (holder == null) return; var iNumShadows = 10; var iAlpha = 1; for (var i = 0; top.isIE && i < iNumShadows; i++) { var shadowLayer = document.createElement("div"); holder.appendChild(shadowLayer); shadowLayer.style.visibility = "hidden"; shadowLayer.style.position = "absolute"; shadowLayer.style.left = "-1000px"; shadowLayer.style.top = "-1000px"; if (top.isIE) { shadowLayer.style.filter = "alpha(opacity=" + ((i*2)+iAlpha++) + ")"; } else { shadowLayer.style.MozOpacity=0.01*iAlpha; } shadowLayer.style.backgroundColor = "black"; this.arrShadowLayers[i] = shadowLayer; } this.mainElm = document.createElement("div"); this.mainElm.popupElm = this; holder.appendChild(this.mainElm); this.mainElm.style.visibility = "hidden"; this.mainElm.style.position = "absolute"; this.mainElm.style.border = "outset 2px white"; this.mainElm.style.padding = "10px"; this.mainElm.style.backgroundColor = "white"; if (this.iWidth != null) this.mainElm.style.width = this.iWidth + "px"; if (this.iHeight != null) this.mainElm.style.height = this.iHeight + "px"; this.mainElm.style.left = "-1000px"; this.mainElm.style.top = "-1000px"; } this.setInnerHTML = function(strTitle, strHTML) { this.mainElm.innerHTML = "\n" + "" + "\t\n" + "" + "\n" + "
" + strTitle + "" + "" + "" + "
" + "
" + strHTML + "
"; } this.show = function() { if (this.iXPos != null) this.mainElm.style.left = (this.iXPos+2) + "px"; if (this.iYPos != null) this.mainElm.style.top = (this.iYPos+2) + "px"; this.mainElm.style.visibility = "visible"; //showObj(this.mainElm); var textHolder = document.getElementById("mainPopupTextHolder"); for (var i = 0; top.isIE && i < this.arrShadowLayers.length; i++) { //alert((this.mainElm.offsetWidth-(i*2)+10)); this.arrShadowLayers[i].style.width = (this.mainElm.offsetWidth-(i*2)+10) + "px"; this.arrShadowLayers[i].style.height = (this.mainElm.offsetHeight-(i*2)+10) + "px"; if (this.iXPos != null) this.arrShadowLayers[i].style.left = ((i+this.iXPos)-1) + "px"; if (this.iYPos != null) this.arrShadowLayers[i].style.top = ((i+this.iYPos)-1) + "px"; this.arrShadowLayers[i].style.visibility = "visible"; } } this.hide = function() { this.mainElm.style.left = "-1000px"; this.mainElm.style.top = "-1000px"; this.mainElm.style.visibility = "hidden"; for (var i = 0; i < this.arrShadowLayers.length; i++) { this.arrShadowLayers[i].style.left = "-1000px"; this.arrShadowLayers[i].style.top = "-1000px"; this.arrShadowLayers[i].style.visibility = "hidden"; } } } function workspacePopup(strTitle, strInnerHTML, iWidth, iHeight, iXPos, iYPos) { //alert(strInnerHTML); if (mainWorkspacePopup == null) { mainWorkspacePopup = new workspacePopupElm(iWidth, iHeight, iXPos, iYPos); mainWorkspacePopup.init(); } mainWorkspacePopup.setInnerHTML(strTitle, strInnerHTML); mainWorkspacePopup.show(); } function getOffsetLeft(elm) { var mOffsetLeft = elm.offsetLeft; var mOffsetParent = elm.offsetParent; while(mOffsetParent){ mOffsetLeft += mOffsetParent.offsetLeft; mOffsetParent = mOffsetParent.offsetParent; } return mOffsetLeft; } function getOffsetTop(elm) { var mOffsetTop = elm.offsetTop; var mOffsetParent = elm.offsetParent; while(mOffsetParent){ mOffsetTop += mOffsetParent.offsetTop; mOffsetParent = mOffsetParent.offsetParent; } return mOffsetTop; } function sprintf() { if (!arguments || arguments.length < 1 || !RegExp) { return; } var str = arguments[0]; var re = /([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)/; var a = b = [], numSubstitutions = 0, numMatches = 0; while (a = re.exec(str)) { var leftpart = a[1], pPad = a[2], pJustify = a[3], pMinLength = a[4]; var pPrecision = a[5], pType = a[6], rightPart = a[7]; numMatches++; if (pType == '%') { subst = '%'; } else { numSubstitutions++; if (numSubstitutions >= arguments.length) { alert('Error! Not enough function arguments (' + (arguments.length - 1) + ', excluding the string)\nfor the number of substitution parameters in string (' + numSubstitutions + ' so far).'); } var param = arguments[numSubstitutions]; var pad = ''; if (pPad && pPad.substr(0,1) == "'") pad = leftpart.substr(1,1); else if (pPad) pad = pPad; var justifyRight = true; if (pJustify && pJustify === "-") justifyRight = false; var minLength = -1; if (pMinLength) minLength = parseInt(pMinLength); var precision = -1; if (pPrecision && pType == 'f') precision = parseInt(pPrecision.substring(1)); var subst = param; if (pType == 'b') subst = parseInt(param).toString(2); else if (pType == 'c') subst = String.fromCharCode(parseInt(param)); else if (pType == 'd') subst = parseInt(param) ? parseInt(param) : 0; else if (pType == 'u') subst = Math.abs(param); else if (pType == 'f') subst = (precision > -1) ? Math.round(parseFloat(param) * Math.pow(10, precision)) / Math.pow(10, precision): parseFloat(param); else if (pType == 'o') subst = parseInt(param).toString(8); else if (pType == 's') subst = param; else if (pType == 'x') subst = ('' + parseInt(param).toString(16)).toLowerCase(); else if (pType == 'X') subst = ('' + parseInt(param).toString(16)).toUpperCase(); } str = leftpart + subst + rightPart; } return str; } function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) { curleft += obj.x; } return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) { curtop += obj.y; } return curtop; } //converts input to a unix timestamp. input is in the form dd-mm-yyyy function date2unix(dateinput) { var dateinput = dateinput; arrDate = dateinput.split('-'); var objDate = new Date(Date.UTC(arrDate[2],(stripLeadingZeroes(arrDate[1])-1),stripLeadingZeroes(arrDate[0]),0,0,0)); return (objDate.getTime() / 1000.0); } //strips leading 0 from a number function stripLeadingZeroes(input) { if ((input.length > 1) && (input.substr(0,1) == "0")) { return input.substr(1); } else { return input; } } function evalFieldLength(thisObj, length, strMaxLength) { if (thisObj.value.length > length) { alert(strReplace(strMaxLength, '%d', length)); thisObj.value = thisObj.value.substring(0, length); } } var helpWindow = null; var helpTextWin = null; function showHelpText(strText) { var iWidth = 400; var iHeight = 300; var strWinName = "helpWin"; var openWin = true; var strURL = "/js/index_Mode_ShowHelpText_text_.html" + escape(strText); var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=1,scrollbars=1,status=1,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; if (helpTextWin == null) openWin = true; else if (helpTextWin.closed) openWin = true; else openWin = false; if (openWin) { helpTextWin = window.open(strURL, strWinName, strParameters); helpTextWin.focus(); } else { if (!helpTextWin.closed) { helpTextWin.focus(); if (helpTextWin.setInitialPath) helpTextWin.setInitialPath(); } } } function sendMailTo(user,domain,tld) { locationstring = 'mai' + 'lto:' + user + '@' + domain + '.' + tld; window.location.replace(locationstring); } //pause function function pausecomp(millis) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millis); } function get_html_translation_table (table, quote_style) { // /web/20160507055210/http://kevin.vanzonneveld.net // + original by: Philip Peterson // + revised by: Kevin van Zonneveld (/web/20160507055210/http://kevin.vanzonneveld.net) // + bugfixed by: noname // + bugfixed by: Alex // + bugfixed by: Marco // + bugfixed by: madipta // + improved by: KELAN // + improved by: Brett Zamir (/web/20160507055210/http://brett-zamir.me) // + bugfixed by: Brett Zamir (/web/20160507055210/http://brett-zamir.me) // + input by: Frank Forte // + bugfixed by: T.Wild // + input by: Ratheous // % note: It has been decided that we're not going to add global // % note: dependencies to php.js, meaning the constants are not // % note: real constants, but strings instead. Integers are also supported if someone // % note: chooses to create the constants themselves. // * example 1: get_html_translation_table('HTML_SPECIALCHARS'); // * returns 1: {'"': '"', '&': '&', '<': '<', '>': '>'} var entities = {}, hash_map = {}, decimal; var constMappingTable = {}, constMappingQuoteStyle = {}; var useTable = {}, useQuoteStyle = {}; // Translate arguments constMappingTable[0] = 'HTML_SPECIALCHARS'; constMappingTable[1] = 'HTML_ENTITIES'; constMappingQuoteStyle[0] = 'ENT_NOQUOTES'; constMappingQuoteStyle[2] = 'ENT_COMPAT'; constMappingQuoteStyle[3] = 'ENT_QUOTES'; useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS'; useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT'; if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') { throw new Error("Table: " + useTable + ' not supported'); // return false; } entities['38'] = '&'; if (useTable === 'HTML_ENTITIES') { entities['160'] = ' '; entities['161'] = '¡'; entities['162'] = '¢'; entities['163'] = '£'; entities['164'] = '¤'; entities['165'] = '¥'; entities['166'] = '¦'; entities['167'] = '§'; entities['168'] = '¨'; entities['169'] = '©'; entities['170'] = 'ª'; entities['171'] = '«'; entities['172'] = '¬'; entities['173'] = '­'; entities['174'] = '®'; entities['175'] = '¯'; entities['176'] = '°'; entities['177'] = '±'; entities['178'] = '²'; entities['179'] = '³'; entities['180'] = '´'; entities['181'] = 'µ'; entities['182'] = '¶'; entities['183'] = '·'; entities['184'] = '¸'; entities['185'] = '¹'; entities['186'] = 'º'; entities['187'] = '»'; entities['188'] = '¼'; entities['189'] = '½'; entities['190'] = '¾'; entities['191'] = '¿'; entities['192'] = 'À'; entities['193'] = 'Á'; entities['194'] = 'Â'; entities['195'] = 'Ã'; entities['196'] = 'Ä'; entities['197'] = 'Å'; entities['198'] = 'Æ'; entities['199'] = 'Ç'; entities['200'] = 'È'; entities['201'] = 'É'; entities['202'] = 'Ê'; entities['203'] = 'Ë'; entities['204'] = 'Ì'; entities['205'] = 'Í'; entities['206'] = 'Î'; entities['207'] = 'Ï'; entities['208'] = 'Ð'; entities['209'] = 'Ñ'; entities['210'] = 'Ò'; entities['211'] = 'Ó'; entities['212'] = 'Ô'; entities['213'] = 'Õ'; entities['214'] = 'Ö'; entities['215'] = '×'; entities['216'] = 'Ø'; entities['217'] = 'Ù'; entities['218'] = 'Ú'; entities['219'] = 'Û'; entities['220'] = 'Ü'; entities['221'] = 'Ý'; entities['222'] = 'Þ'; entities['223'] = 'ß'; entities['224'] = 'à'; entities['225'] = 'á'; entities['226'] = 'â'; entities['227'] = 'ã'; entities['228'] = 'ä'; entities['229'] = 'å'; entities['230'] = 'æ'; entities['231'] = 'ç'; entities['232'] = 'è'; entities['233'] = 'é'; entities['234'] = 'ê'; entities['235'] = 'ë'; entities['236'] = 'ì'; entities['237'] = 'í'; entities['238'] = 'î'; entities['239'] = 'ï'; entities['240'] = 'ð'; entities['241'] = 'ñ'; entities['242'] = 'ò'; entities['243'] = 'ó'; entities['244'] = 'ô'; entities['245'] = 'õ'; entities['246'] = 'ö'; entities['247'] = '÷'; entities['248'] = 'ø'; entities['249'] = 'ù'; entities['250'] = 'ú'; entities['251'] = 'û'; entities['252'] = 'ü'; entities['253'] = 'ý'; entities['254'] = 'þ'; entities['255'] = 'ÿ'; } if (useQuoteStyle !== 'ENT_NOQUOTES') { entities['34'] = '"'; } if (useQuoteStyle === 'ENT_QUOTES') { entities['39'] = '''; } entities['60'] = '<'; entities['62'] = '>'; // ascii decimals to real symbols for (decimal in entities) { if (entities.hasOwnProperty(decimal)) { hash_map[String.fromCharCode(decimal)] = entities[decimal]; } } return hash_map; } function html_entity_decode (string, quote_style) { // /web/20160507055210/http://kevin.vanzonneveld.net // + original by: john (/web/20160507055210/http://www.jd-tech.net) // + input by: ger // + improved by: Kevin van Zonneveld (/web/20160507055210/http://kevin.vanzonneveld.net) // + revised by: Kevin van Zonneveld (/web/20160507055210/http://kevin.vanzonneveld.net) // + bugfixed by: Onno Marsman // + improved by: marc andreu // + revised by: Kevin van Zonneveld (/web/20160507055210/http://kevin.vanzonneveld.net) // + input by: Ratheous // + bugfixed by: Brett Zamir (/web/20160507055210/http://brett-zamir.me) // + input by: Nick Kolosov (/web/20160507055210/http://sammy.ru) // + bugfixed by: Fox // - depends on: get_html_translation_table // * example 1: html_entity_decode('Kevin & van Zonneveld'); // * returns 1: 'Kevin & van Zonneveld' // * example 2: html_entity_decode('&lt;'); // * returns 2: '<' var hash_map = {}, symbol = '', tmp_str = '', entity = ''; tmp_str = string.toString(); if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) { return false; } // fix & problem // /web/20160507055210/http://phpjs.org/functions/get_html_translation_table:416#comment_97660 delete(hash_map['&']); hash_map['&'] = '&'; for (symbol in hash_map) { entity = hash_map[symbol]; tmp_str = tmp_str.split(entity).join(symbol); } tmp_str = tmp_str.split(''').join("'"); return tmp_str; } function getQuerystring(key, default_) { if (default_==null) default_=""; key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); var qs = regex.exec(window.location.href); if(qs == null) return default_; else return qs[1]; } var macroWindow = null; var macroTextWin = null; function showMacroText(strText, strField, strFieldType) { //load tinymce article if (typeof tinyMCE.get(strField + 'Editor') == 'undefined' && strFieldType == 'ARTICLENEW') { eval('loadTinymce' + strField + '()'); } var iWidth = 400; var iHeight = 300; var strWinName = "macroWin"; var openWin = true; var strURL = "/js/index_Mode_ShowMacroText_text_.html" + escape(strText) + "&strField=" + strField + '&strFieldType=' + strFieldType; var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=1,scrollbars=1,status=1,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; if (macroTextWin == null) openWin = true; else if (macroTextWin.closed) openWin = true; else openWin = false; if (openWin) { macroTextWin = window.open(strURL, strWinName, strParameters); macroTextWin.focus(); } else { if (!macroTextWin.closed) { macroTextWin.focus(); } } } function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=c_name + "=" + c_value + '/js/-path-/'; } function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i = 0 ; i < ARRcookies.length ; i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } } function eraseCookie(name) { setCookie(name, "", -1); } function areCookiesEnabled() { var r = false; setCookie('iscookiesenabled', 'Hello', 1); if (getCookie('iscookiesenabled') != null) { r = true; eraseCookie('iscookiesenabled'); } return r; } function s4() { return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); } function guid() { return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); }