var INVALID_CHARS = new String("\\ / : * ? \" ' < > | & # "); function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i= sLength) || (s.charAt(i) != "@")) {return false;} else {i += 2;} while ((i < sLength) && (s.charAt(i) != ".")) {i++;}//find . if ((i >= sLength - 1) || (s.charAt(i) != ".")) {return false;} else {return true;} } function IsNumeric(strString, allowBlank){ if (strString.length == 0){return (allowBlank) ? true : false;} var strValidChars = "0123456789.,-$"; var strChar; var blnResult = true; // test strString consists of valid characters listed above for (i = 0; i < strString.length && blnResult == true; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1){blnResult = false;} } return blnResult; } function IsDate(obj, allowBlank){ var s = new String(GetValue(obj)); if (s.length==0) {return (allowBlank) ? true : false;} //check length if(document.all){ var d = new Date(s); return !isNaN(d); }else{ return true; //FF has a bug that prevents the above workaround. } } function GetValue(obj){ var val = null; if(obj){ switch(obj.tagName){ case "SELECT": val = (obj.selectedIndex!=-1) ? obj.options[obj.selectedIndex].value : ""; break; case "RADIO": if(obj.length){ for(i=0;i0){ for(o=(ubound-1);o>=lbound;o--){ if(obj.options[o].selected==true && obj.options[o].value!=""){oArr[oArr.length] = obj.options[o];} } } } return oArr } function getOptions(obj, lbound, ubound){ var oArr = new Array(); if(obj){ lbound = (lbound!=null) ? lbound : 0; ubound = (ubound!=null) ? ubound : obj.options.length; for(o=lbound;o= [" + selIdx + "] < " + ubound + " = " + (selIdx>=lbound && selIdx= [" + repIdx + "] < " + ubound + " = " + (repIdx>=lbound && repIdx=lbound && selIdx=lbound && repIdx= [" + selIdx + "] < " + ubound + " = " + (selIdx>=lbound && selIdx=lbound && selIdx=0;s--){ selIdx = oSelected[s].index; //alert(lbound + " >= [" + selIdx + "] < " + ubound + " = " + (selIdx>=lbound && selIdx=lbound && selIdx1){ oOptArr = sortArr(oOptArr, dir); obj.options.length = lbound; for(a=0;a (i2)) { return -1; } if ((i1) < (i2)) { return 1; } return 0; } ) } var oVersionWin; function OpenVersionWindow(qs){ if(oVersionWin){if(!oVersionWin.closed){oVersionWin.close();}} oVersionWin = window.open("/BASE10/includes/window_version_items.aspx" + qs, "oOrderWin", "height=365,width=400"); if(oVersionWin){if(!oVersionWin.closed){oVersionWin.focus();}} return false; } var oOrderWin; function OpenOrderWindow(ItemKey, ItemType, ItemSubType){ if(oOrderWin){if(!oOrderWin.closed){oOrderWin.close();}} ItemKey = (ItemKey) ? ItemKey : ""; ItemType = (ItemType) ? ItemType : ""; ItemSubType = (ItemSubType) ? ItemSubType : ""; oOrderWin = window.open("/BASE10/includes/window_order_items.aspx?ItemKey=" + ItemKey + "&ItemType=" + ItemType + "&ItemSubType=" + ItemSubType, "oOrderWin", "height=205,width=450"); if(oOrderWin){if(!oOrderWin.closed){oOrderWin.focus();}} return false; } var oCalWin; var oCalObj; function OpenCalendarWindow(srcObj){ if(!srcObj){alert("An error has occured. Please try again.");return;} if(oCalWin){if(!oCalWin.closed){oCalWin.close();}} var dte = new Date(); if(srcObj){dte=srcObj.value;} oCalObj = srcObj; oCalWin = window.open("/BASE10/includes/date_picker.aspx?SelectedDate=" + dte, "oCalWin", "height=215,width=605"); if(oCalWin){if(!oCalWin.closed){oCalWin.focus();}} return false; } function SetCalDate(dte){ if(!oCalObj){alert("An error has occured. Please try again.");return;} oCalObj.value = dte; } function Right(val, len){ return Mid(val, val.length - len, val.length); } function Left(val, len){ return Mid(val, 0, len); } function Mid(val, start, end){ var OutPut=""; for(i=start;i"; } } else{ switch (node.nodeName){ case "TEXTAREA": for(a=0;a"; break; } } break; case node.COMMENT_NODE: html += ""; break; case node.TEXT_NODE: html += node.nodeValue; break; } return html; } } function getInnerText(node) { if (!node || !node.firstChild) return ''; node = node.firstChild; var depth = 1, ret = []; traceTree: while (node && depth > 0) { if (node.hasChildNodes()) { node = node.firstChild; depth++; } else { if (node.tagName){ switch(String(node.tagName).toUpperCase()){ case "BR" : ret.push("\n");break; case "P" : ret.push("\n\n");break; case "HR" : ret.push("\n");break; } } if (node.nodeType == Node.TEXT_NODE){ ret.push(node.nodeValue.replace(/\n/gi, " ")); } else if (node.alt){ ret.push(node.alt); } while (!node.nextSibling) { node = node.parentNode; depth--; if (!node) break traceTree; } node = node.nextSibling; } } return ret.join(''); } function ConfirmPurge(){ return confirm("This action will permanently remove the item(s) from the system.\n\nAre you sure you wish to continue?") } function ConfirmPublish(){ return confirm("This action will move the item(s) to the next publish stage.\n\nAre you sure you wish to continue?") } var lastAssetObj; var oWinAssetObjBrowser; function BrowseAssetFile(objID){ var obj = document.getElementById(objID); var url = "/BASE10/includes/asset_object_browser/index.aspx"; if(!obj || url==""){return false;} if(oWinAssetObjBrowser){ if(oWinAssetObjBrowser.closed){ oWinAssetObjBrowser = window.open(url, "oWinAssetObjBrowser", "width=800,height=600,resizable=1"); } } else{ oWinAssetObjBrowser = window.open(url, 'oWinAssetObjBrowser', "width=800,height=600,resizable=1"); } oWinAssetObjBrowser.focus(); SetAssetObj(obj) return false; } function SetAssetObj(obj){ if(obj){ lastAssetObj=obj; if(oWinAssetObjBrowser){if(!oWinAssetObjBrowser.closed){oWinAssetObjBrowser.B10Element=obj;}} } } function ShowAssetFile(objID){ var obj = document.getElementById(objID); if(!obj){return false;} if(obj.value!=""){window.open(obj.value, '', 'width=800,height=600,resizable=1');} return false; } function InArr(arr, val){ if(arr){ if(arr.length > 0){ for(ia=0;ia CurrDaysInMonth){ for(i=0;i<(CurrSelectDays - CurrDaysInMonth);i++){oDay.options[oDay.options.length - 1] = null;} } if(CurrSelectDays < CurrDaysInMonth){ for(i=0;i<(CurrDaysInMonth - CurrSelectDays);i++){oDay.add(new Option(oDay.options.length + 1));} } if(oCurrDay > CurrDaysInMonth){oCurrDay = CurrDaysInMonth;} oDay.selectedIndex = oCurrDay - 1; } } function SetDate(nme, dte){ var oMonth = document.getElementById(nme + "_mm"); var oDay = document.getElementById(nme + "_dd"); var oYear = document.getElementById(nme + "_yy"); if(oMonth && oDay && oYear){ var SetDate = new Date(dte) var oCurrMonth = SetDate.getMonth() + 1; var oCurrDay = SetDate.getDate() ; var oCurrYear = SetDate.getYear(); var CurrDaysInMonth = DaysInMonth(oCurrMonth, oCurrYear); var CurrSelectDays = oDay.length; if(CurrSelectDays > CurrDaysInMonth){ for(i=0;i<(CurrSelectDays - CurrDaysInMonth);i++){oDay.options[oDay.options.length - 1] = null;} } if(CurrSelectDays < CurrDaysInMonth){ for(i=0;i<(CurrDaysInMonth - CurrSelectDays);i++){oDay.add(new Option(oDay.options.length + 1));} } if(oCurrDay > CurrDaysInMonth){oCurrDay = CurrDaysInMonth;} oDay.selectedIndex = oCurrDay - 1; } } //================================================================================ // DistributionList Rules Functions //================================================================================ var oWinRules; function RulesManager(){ var url = "/BASE10/includes/window_distributionlist_rules.aspx"; var props = "width=425,height=285,status=0"; if(oWinRules){ if(oWinRules.closed){ oWinRules = window.open(url, "oWinRules", props, true); } }else{ oWinRules = window.open(url, "oWinRules", props, true); } if(oWinRules){if(!oWinRules.closed){oWinRules.focus();}} return false; } var oRecipFields = new Array(); oRecipFields[0] = "RecipientTitle|Title" oRecipFields[1] = "RecipientFirstName|First Name" oRecipFields[2] = "RecipientLastName|Last Name" oRecipFields[3] = "RecipientEmail|Email Address" oRecipFields[4] = "RecipientCompany|Company" oRecipFields[5] = "RecipientJobTitle|Job Title" oRecipFields[6] = "RecipientStreet|Street" oRecipFields[7] = "RecipientCity|City" oRecipFields[8] = "RecipientState|State" oRecipFields[9] = "RecipientZipcode|Zip Code" oRecipFields[10] = "RecipientCountry|Country" oRecipFields[11] = "RecipientPhone|Phone" oRecipFields[12] = "RecipientAltPhone|Alt Phone" function FieldName(fld, oArr){ for(f=0;f0){ for(i=0;i0){ for(i=0;i=": strTextVal += "is greater than or equal to " break; case ">": strTextVal += "is greater than " break; default: //"=" strTextVal += "is equal to " break; } strTextVal += oArrFieldVals.join(" or ") oPTRuleArr[oPTRuleArr.length] = new Array(strFieldGroup, strTextVal); } } return oPTRuleArr; } //========================================================================================== function MM_Ovr(obj){if(obj){if(obj.className!='tbButton-selected'){obj.lastClass=obj.className;obj.className="tbButton-over";}}} function MM_Out(obj){if(obj){if(obj.className!='tbButton-selected'){obj.className=(obj.lastClass) ? obj.lastClass : "tbButton";}}} function MM_Dn(obj){if(obj){if(obj.className!='tbButton-selected'){obj.className="tbButton-down";}}} function MM_Up(obj){if(obj){if(obj.className!='tbButton-selected'){obj.className="tbButton-over";}}} //========================================================================================== function CheckAll(id, val){ var oChks = document.getElementsByTagName("INPUT"); for(i=0;i=lbound;i--){obj.options[i]=null;} //obj.options.length = 0; for(o=0;o