var imgExpand = new Image(); imgExpand.src = "../includes/images/admin_expand.gif"; var imgCollapse = new Image(); imgCollapse.src = "../includes/images/admin_collapse.gif"; function IsBlank(p_strFormName, p_strFieldName, p_strErrorMessage) { var objFormField = eval("document." + p_strFormName + "." + p_strFieldName); if (objFormField != null) { if (Trim(objFormField.value) == "") { return "\n - " + p_strErrorMessage; } else { return ""; } } } function IsAlphabetic(p_strFormName, p_strFieldName, p_strErrorMessage) { var objFormField = eval("document." + p_strFormName + "." + p_strFieldName); if (objFormField != null) { var strValue = new String(Trim(objFormField.value)); if (strValue.search(/[^A-Z\.\s]/gi) != -1) { return "\n - " + p_strErrorMessage; } else { return ""; } } } function IsAlphaNumeric(p_strFormName, p_strFieldName, p_strErrorMessage) { var objFormField = eval("document." + p_strFormName + "." + p_strFieldName); if (objFormField != null) { var strValue = new String(Trim(objFormField.value)); if (strValue.search(/[^A-Z0-9\.\s]/gi) != -1) { return "\n - " + p_strErrorMessage; } else { return ""; } } } function IsNumeric(p_strFormName, p_strFieldName, p_strErrorMessage) { var objFormField = eval("document." + p_strFormName + "." + p_strFieldName); if (objFormField != null) { var strValue = new String(Trim(objFormField.value)); if (strValue.search(/[^0-9\.\s]/gi) != -1) { return "\n - " + p_strErrorMessage; } else { return ""; } } } function IsEmail(p_strFormName, p_strFieldName, p_strErrorMessage) { var objFormField = eval("document." + p_strFormName + "." + p_strFieldName); if (objFormField != null) { var strValue = new String(Trim(objFormField.value)); if (strValue.search(/^(['_a-zA-Z0-9-]+)(\.['_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,5})$/gi) == -1) { return "\n - " + p_strErrorMessage; } else { return ""; } } } function IsURL(p_strFormName, p_strFieldName, p_strErrorMessage) { var objFormField = eval("document." + p_strFormName + "." + p_strFieldName); if (objFormField != null) { var strValue = new String(Trim(objFormField.value)); if (strValue.search(/^(ftp|http|https)\:\/\/\w+([\.\-]\w+)*\.\w{2,4}(\:\d+)*([\/\.\-\?\&\%\#]\w+)*\/?$/gi) == -1) { return "\n - " + p_strErrorMessage; } else { return ""; } } } function IsValidFile(p_strFormName, p_strFieldName, p_strFileList, p_strErrorMessage) { var objFormField = eval("document." + p_strFormName + "." + p_strFieldName); if (objFormField != null) { var strValue = new String(Trim(objFormField.value)); if (strValue.search(eval("/\.(" + p_strFileList + ")$/gi")) == -1) { return "\n - " + p_strErrorMessage; } else { return ""; } } } function IsDate(p_strFormName, p_strYearFieldName, p_strMonthFieldName, p_strDayFieldName, p_strErrorMessage) { var objFormYearField = eval("document." + p_strFormName + "." + p_strYearFieldName); var objFormMonthField = eval("document." + p_strFormName + "." + p_strMonthFieldName); var objFormDayField = eval("document." + p_strFormName + "." + p_strDayFieldName); if (objFormYearField != null && objFormMonthField != null && objFormDayField != null) { var dtNewDate = new Date(); dtNewDate.setFullYear(objFormYearField.value); dtNewDate.setMonth(objFormMonthField.value - 1); dtNewDate.setDate(objFormDayField.value); if (dtNewDate.getYear() != objFormYearField.value || dtNewDate.getMonth() != objFormMonthField.value - 1 || dtNewDate.getDate() != objFormDayField.value) { return "\n - " + p_strErrorMessage; } else { return ""; } } } function IsInRange(p_strFormName, p_strFieldName, p_varMinimum, p_varMaximum, p_strErrorMessage) { var objFormField = eval("document." + p_strFormName + "." + p_strFieldName); if (objFormField != null) { var fltMinimum = parseFloat(p_varMinimum); if (isNaN(fltMinimum) == true) { fltMinimum = 0; } var fltMaximum = parseFloat(p_varMaximum); if (isNaN(fltMaximum) == true) { fltMaximum = 0; } var fltInputValue = parseFloat(objFormField.value); if (isNaN(fltInputValue) == true) { return "\n - " + p_strErrorMessage; } else { if (fltInputValue >= Math.min(fltMinimum, fltMaximum) && fltInputValue <= Math.max(fltMinimum, fltMaximum)) { return ""; } else { return "\n - " + p_strErrorMessage; } } } } function InputDouble(p_objEvent) { if (p_objEvent.keyCode == 46 || (p_objEvent.keyCode >= 48 && p_objEvent.keyCode <= 57)) { return(true); } else { return(false); } } function InputInteger(p_objEvent) { if (p_objEvent.keyCode >= 48 && p_objEvent.keyCode <= 57) { return(true); } else { return(false); } } function Trim(p_strValue) { var strValue = new String(p_strValue); strValue = strValue.replace(/^\s+/gi, ""); strValue = strValue.replace(/\s+$/gi, ""); return strValue; } function OpenWindow(p_strURL, p_strWindowName, p_WindowOptions) { var wndNewWindow = window.open(p_strURL, p_strWindowName, p_WindowOptions); if (wndNewWindow == null) { window.alert("Window has been blocked..."); } } var myWin=0; function MM_openBrWindow(theURL,winName,features) { //v2.0 newwindow=window.open(theURL,winName,features); if (window.focus) {newwindow.focus()} return false; }