var popupWindow; var imageWindow; var down; var handle; var initial; var ebydosAuth = "ebydosAuth"; var focusErrorInput; var auth; var ssid; var changed = false; var xMousePos = 0; // Horizontal position of the mouse on the screen var yMousePos = 0; // Vertical position of the mouse on the screen function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&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') if (thetitle.length>1){ thetitles='' for (i=0;i'+text+'') document.tooltip.document.close() document.tooltip.left=e.pageX+5 document.tooltip.top=e.pageY+5 document.tooltip.visibility="show" } } function hidetip(){ if (document.layers) document.tooltip.visibility="hidden" } /** * Validates email **/ function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false } if (str.indexOf(at,(lat+1))!=-1){ return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false } if (str.indexOf(dot,(lat+2))==-1){ return false } if (str.indexOf(" ")!=-1){ return false } return true } function statusPending() { if (document.getElementById) { var prepage = document.getElementById('prepage'); if (prepage != null) { prepage.style.visibility='visible'; } } else { if (document.layers && document.prepage != null) { //NS4 document.prepage.visibility = 'visible'; } else if (document.all.prepage != null) { //IE4 document.all.prepage.style.visibility = 'visible'; } } } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } function IsPopupBlocker() { var oWin = window.open("","testpopupblocker","width=100,height=50,top=5000,left=5000"); if (oWin==null || typeof(oWin)=="undefined") { return true; } else { oWin.close(); return false; } } function setAuthSession(value) { return getSessionInfos(ebydosAuth, "set", value); } function eraseAuthSession() { getSessionInfos(ebydosAuth, "erase"); } function readAuthSession() { return getSessionInfos(ebydosAuth, "read"); } function setAuthCookie(value) { auth = setAuthSession(value); if (!auth) { eraseAuthCookie(); createCookie(ebydosAuth, value, "100"); } } function eraseAuthCookie() { eraseCookie(ebydosAuth); } function readAuthCookie() { return readCookie(ebydosAuth); } /** * returns win height if param is true else win width */ function getWinSize(b) { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.offsetWidth || document.body.offsetHeight ) ) { myWidth = document.body.offsetWidth; myHeight = document.body.offsetHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return b ? myHeight : myWidth; } function getWinH() { return getWinSize(true); } function getWinW() { return getWinSize(false); } /** * calls getSessionInfos.do with action name and two optional params **/ function getSessionInfos(actionName, param1, param2) { var result = ""; try { var infos = "getSessionInfos.do?actionName=" + actionName; if (param1 != null) { infos += "¶m1="+param1; } if (param2 != null) { infos += "¶m2="+param2; } var _result = loadDocument(infos); if (_result != null) result = _result; } catch (e) { } return result; } function URLDecode(psEncodeString) { // Create a regular expression to search all +s in the string var lsRegExp = /\+/g; // Return the decoded string return unescape(String(psEncodeString).replace(lsRegExp, " ")); } var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i 0 && focusErrorInput == null) { var focusElements = document.getElementsByName(focusInput); if (focusElements != null && focusElements.length == 1) { focusElements[0].focus(); focusErrorInput = focusElements[0]; } } } function addSecret(url) { var res = url; if (ssid != null && url.indexOf('ssid') == -1) { var i = url.indexOf('?'); if (i == -1) res = url + "?ssid=" + ssid; else if (i == url.length-1) res = url + "ssid=" + ssid; else res = url + "&ssid=" + ssid; } return res; } /** Gets document form */ function getForm() { var form; if (document.forms.length == 1) { form = document.forms[0]; } else if (document.forms.length > 1) { form = document.forms['theForm']; } return form; } function doSubmit(url, form, checkPopup) { if (checkPopup == null || checkPopup) if (focusPopup()) return; setAuthCookie(url); url = addSecret(url); if (form == null) { form = getForm(); } if (form != null) { form.action = url; form.submit(); } else { alert('Can not submit, form not found'); } statusPending(); } function doSend(url) { if (focusPopup()) return; setAuthCookie(url); url = addSecret(url); window.document.location.href=url; statusPending(); } /** set value for field in form */ function setValue(fieldName, value) { var form = getForm(); var element = null; if (form != null) { element = form.elements[fieldName]; } if (element == null) { element = document.getElementById(fieldName); } if (element != null) { element.value = value; } } function setChanged() { changed = true; var _changed = document.getElementById('changed'); if (_changed != null) { _changed.innerHTML = '*'; } } function isChanged() { return changed; } function getMousePos() { // Set Netscape up to run the "captureMousePosition" function whenever // the mouse is moved. For Internet Explorer and Netscape 6, you can capture // the movement a little easier. if (document.layers) { // Netscape document.captureEvents(Event.MOUSEMOVE); document.onmousemove = captureMousePosition; } else if (document.all) // Internet Explorer document.onmousemove = captureMousePosition; else if (document.getElementById) // Netcsape 6 document.onmousemove = captureMousePosition; } function openRelativeWin() { getMousePos(); setAuthCookie(""); relWin = window.open("","OpenWin","width=100, height=100, screenX=0, screenY=0"); relWin.moveTo(xMousePos, yMousePos); } function captureMousePosition(e) { if (document.layers) { // When the page scrolls in Netscape, the event's mouse position // reflects the absolute position on the screen. innerHight/Width // is the position from the top/left of the screen that the user is // looking at. pageX/YOffset is the amount that the user has // scrolled into the page. So the values will be in relation to // each other as the total offsets into the page, no matter if // the user has scrolled or not. //xMousePos = e.pageX; //yMousePos = e.pageY; xMousePos = e.screenX; yMousePos = e.screenY; } else if (document.all) { // When the page scrolls in IE, the event's mouse position // reflects the position from the top/left of the screen the // user is looking at. scrollLeft/Top is the amount the user // has scrolled into the page. clientWidth/Height is the height/ // width of the current page the user is looking at. So, to be // consistent with Netscape (above), add the scroll offsets to // both so we end up with an absolute value on the page, no // matter if the user has scrolled or not. xMousePos = windowPosLeft() + window.event.x; //+document.body.scrollLeft; yMousePos = windowPosTop() + window.event.y; //+document.body.scrollTop; } else if (document.getElementById) { // Netscape 6 behaves the same as Netscape 4 in this regard //xMousePos = e.pageX; //yMousePos = e.pageY; xMousePos = e.screenX; yMousePos = e.screenY; } } // checkSession taken from wbcycle.js // and doSend from page where mousepos.jsp is included function openHelpWin(url) { var isLogged = checkSession(); if ("true" != isLogged) { return doSend("detail.do"); } getMousePos(); setAuthCookie(url); url = addSecret(url); popupWindow = window.open(url, "helpwin", "width=300,height=180,resizable=yes,scrollbars=yes,top="+yMousePos+",left="+xMousePos); popupWindow.onunload = function() { if (window.opener && typeof(window.opener.onPopupClosed) == 'function') { closePopup(); } }; } function centerWindow(myWindow) { var winW,winH; if (BrowserDetect != null && BrowserDetect.browser == "Explorer") { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } else { winW = myWindow.innerWidth; winH = myWindow.innerHeight; } var left = parseInt((screen.availWidth/2) - (winW/2)); var top = parseInt((screen.availHeight/2) - (winH/2)); myWindow.moveTo(left,top); } function isConfigInit() { var isConfigInit = "true"; try { var infos = "getSessionInfos.do?actionName=isConfigInit"; var _isConfigInit = loadDocument(infos); if (_isConfigInit != null) isConfigInit = _isConfigInit; } catch (e) { } return isConfigInit; } function windowPosLeft() { return document.all ? window.screenLeft : window.screenX; } function windowPosTop() { return document.all ? window.screenTop:window.screenY; } getMousePos(); // call once to init