// Convert "255px" to "255" var pxReg = /^\d+/gi; function pxToInt(px) { var m = px.match(pxReg); if (m != null) return (m[0] * 1); return null; } function valid(obj) { return ((typeof(obj) != "undefined") && (obj != null)); } function popModal(url, args, width, height) { return window.open(url,"InformationWindow","height="+ height +"px,width="+ width +"px,status=no,resizable=yes,scrollbars=no"); } function selectObject(o) { var oRange = window.document.selection.createRange(); oRange.moveToElementText(o); oRange.select(); } function getFrameByName(strFrameName) { var bottomWindow = window; while (bottomWindow.parent != bottomWindow) { bottomWindow = bottomWindow.parent; } return _getFrameByName(bottomWindow, strFrameName); } //************************************************************ // SHELL MODAL CONFIGURATION //*************************************************************/ /* AVAILABLES ICONS */ MODAL_ICONS = [ ICON_NONE = 0x1, ICON_ERROR = 0x2, ICON_QUESTION = 0x4, ICON_WARNING = 0x8, ICON_INFO = 0x10 ]; /* AVAILABLES BUTTONS (Also return values) */ MODAL_BUTTONS = [ BTN_OK = 0x1, BTN_CANCEL = 0x2, BTN_YES = 0x4, BTN_NO = 0x8, BTN_PRINT = 0x10 ]; /* BODY TEXT ALIGN (center default) */ MODAL_TEXT_ALIGN = [ ALIGN_LEFT = "left", ALIGN_CENTER = "center", ALIGN_RIGHT = "right" ]; MODAL_DEFAULT_TXT_WHITESPACE = "normal"; MODAL_DEFAULT_ICON = ICON_WARNING; MODAL_DEFAULT_BUTTON = BTN_YES | BTN_NO; MODAL_DEFAULT_ALIGN = ALIGN_CENTER; function NotifyUser(sText, Icon, Width, Height, txtAlign, Button, txtWhiteSpace) { if (Icon == undefined) Icon=ICON_INFO; if (Button == undefined) Button=BTN_OK; var args = new ModalShellArguments(sText, Icon, Button, txtAlign, txtWhiteSpace) if (navigator.appName == "Microsoft Internet Explorer") var ret = popShellModal(args, Width, Height); else popShellWindow(args, Width, Height); } function ModalShellArguments(sText, Icon, Buttons, txtAlign, txtWhiteSpace) { if (sText == undefined) sText="PLEASE ENTER TEXT IN THE MODAL DIALOG"; if (Icon == undefined) Icon=MODAL_DEFAULT_ICON; if (Buttons == undefined) Buttons=MODAL_DEFAULT_BUTTON; if (txtAlign == undefined) txtAlign=MODAL_DEFAULT_ALIGN; if (txtWhiteSpace == undefined) txtWhiteSpace=MODAL_DEFAULT_TXT_WHITESPACE; this.text = sText; this.selectedIcon = Icon; this.selectedButtons = Buttons; this.selectedAlign = txtAlign; this.selectedTxtWhiteSpace = txtWhiteSpace; } function popShellModal(args, width, height) { if (width == undefined) width=400; //Default value if (height == undefined) height=300; //Default value return window.showModalDialog("/ed/Manager/ModalShell.html", args, "dialogWidth:" + width + "px; dialogHeight:" + height + "px;center:yes;help:no;resizable:yes;status:no;scroll:no;"); } function popShellWindow(args, width, height){ if (width == undefined) width=400; //Default value if (height == undefined) height=300; //Default value var winModal = window.open("/ed/Manager/ModalShell.html","InformationWindow","height="+ height +"px,width="+ width +"px,status=no,resizable=yes,scrollbars=no"); winModal.dialogArguments = args; } function AskUser(sText, Icon, Buttons, txtAlign, width, height) { var args = new ModalShellArguments(sText, Icon, Buttons, txtAlign) var ret = popShellModal(args, width, height) return (ret == BTN_YES) } function loadTrad(sType, intId, blnShowAllLanguages) { if (blnShowAllLanguages == undefined) blnShowAllLanguages = false; var win = window.open("/ed/includes/traduction/objecttrans.asp?type="+ sType +"&Id="+ intId + "&AllLang=" + (blnShowAllLanguages ? "true" : "false"), "mac", "height=600,width=800,resizable=yes,scrollbars=no,titlebar=no"); win.focus(); } function GoToDotNetPageFromPortal(page, keyRepresentation) { var parameters = ""; for(i = 0 ; i < keyRepresentation.length ; i++) { parameters += "&" + keyRepresentation[i].name + "=" + encodeURIComponent(keyRepresentation[i].value); } var portalWindow = window; while(portalWindow.location.pathname.toLowerCase() != '/ed/portal/default.asp') { portalWindow = portalWindow.parent; } portalWindow.location = "/ed/portal/default.asp?location=" + page + parameters } function GoToDotNetPage(page, keyRepresentation, rootPath) { var parameters = ""; for(i = 0 ; i < keyRepresentation.length ; i++) { if (parameters == "") { parameters += "?"; } else { parameters += "&"; } parameters += keyRepresentation[i].name + "=" + encodeURIComponent(keyRepresentation[i].value); } var url = parent.window.location.href; if(rootPath != undefined) { getFrameByName("ManagerContent").location = page + parameters; } else { parent.window.location = url.substr(url,url.lastIndexOf("/") + 1) + page + parameters; } }