var currentWindow = ""; var CONST_CHEKOUT = "checkoutCountry"; var CONST_CHEKIN = "checkinCountry"; //var initialise au document rady de la first step var JS_PATH = ""; function setJsPath(path){ JS_PATH=path; } Waiting = function(){ this.id = "waiting"; this.container = getObj(this.id); this.timer = new Array(); this.text = ""+this.container.innerHTML; } Waiting.prototype.start = function() { this.timer[this.timer.length] = setInterval("getWaiting().load()", 200); this.container.innerHTML = this.text; this.container.style.display = "block"; getObj("checkoutLocation").disabled = true; getObj("checkinLocation").disabled = true; getObj("checkoutLocationRange").disabled = true; getObj("checkinLocationRange").disabled = true; getObj("checkoutLocationDetail").style.display = "none"; getObj("checkinLocationDetail").style.display = "none"; } Waiting.prototype.load = function() { if(this.container.innerHTML.length<35) this.container.innerHTML += "."; else this.container.innerHTML = this.text; } Waiting.prototype.startSubmit = function() { this.container.style.display = "block"; this.timer = setInterval("getWaiting().load()", 200); } Waiting.prototype.stop = function(){ for(var count=0;count")!=-1) return; this.getListener().parentNode.innerHTML = result; if(supportedNavigator()) setStationSelect(this.getListener(), null); getWaiting().stop(); if(this.stationCode!=null){ setStation(this.stationCode,this.getListener().id); //setValue(this.getListener().id, this.stationCode); //seeStationDetail(getObj(this.id.replace("Country","Location"))); } getObj(this.getListener().name).options[getObj(this.getListener().name).selectedIndex].value=""; if(currentWindow!="") { currentWindow.close(); currentWindow = ""; } } Stations.prototype.getValues = function(stationCode){ getObj("errorMessages").style.display = "none"; this.stationCode = stationCode; getObj(this.getListener().id+"Range").value = CONST_CHOOSE; if(getSelectValue(this.id)=="") return; var parameter = "pkid="+getSelectValue(this.id)+"&component="+this.getListener().id; getWaiting().start(); sendData(this,HTTP_GET,this.url,parameter); if(this.id==CONST_CHEKOUT) { getObj(CONST_CHEKIN).selectedIndex = getObj(this.id).selectedIndex; myCheckInStations.getValues(stationCode); } } Stations.prototype.setStation = function(obj){ getObj("errorMessages").style.display = "none"; if(obj.id.indexOf("checkin")!=-1) return; if(getObj(this.id).selectedIndex==getObj(CONST_CHEKIN).selectedIndex){ myCheckInStations.getListener().selectedIndex = this.getListener().selectedIndex; getObj(myCheckInStations.getListener().id+"Range").value = getSelectHtml(this.getListener().id); } } var myCheckOutStations = new Stations(CONST_CHEKOUT); var myCheckInStations = new Stations(CONST_CHEKIN); /*** selet replace managemenr **/ function setStation(code, id) { setValue(id,code); getObj(id+"Range").value = getSelectHtml(id); getObj(id+"Range").title = getSelectHtml(id); getObj(id+"Detail").style.display = "none"; if(id.indexOf("checkout")!=-1) myCheckOutStations.setStation(getObj(id)); else myCheckInStations.setStation(getObj(id)); seeStationDetail(getObj(id)); } var objTextRange = null; var isPassedByTextRange = false; function setTextRange(obj,e) { var code; if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; var frameSet = (obj.id.indexOf("checkout")!=-1)?window.frames.checkoutLocationDetail:window.frames.checkinLocationDetail; var id = obj.id.replace("Range", ""); if(code==27) //arrow down { getObj(id+"Detail").style.display = "none"; return; } if(code==40) //arrow down { frameSet.setNextSibling(); return; } if(code==38) //arrow down { frameSet.setPreviousSibling(); return; } if(code==13) //enter { frameSet.selectCurrentNode(); return; } isPassedByTextRange = true; getObj(id+"Detail").style.display = "block"; setStationSelect(getObj(id), obj.value); } function setStationSelect(component, text) { var objIframe = null; var options = component.options; var iFrame = getObj(component.id+"Detail"); var textLength = (text==null)?0:text.length; iFrame = getObj(component.id + "Detail"); if(iFrame == undefined || iFrame == null) objIframe = document; else if (iFrame.contentDocument) objIframe = iFrame.contentDocument; else if (iFrame.contentWindow) objIframe = iFrame.contentWindow.document; else if (iFrame.document) objIframe = iFrame.document; var optionsDisplayed = 0; var firstOptionDisplayed = null; if(objIframe.getElementById("container") == undefined || objIframe.getElementById("container") == null){ return; } var tbody = objIframe.getElementById("container").getElementsByTagName("tbody")[0]; while(tbody.firstChild) { tbody.removeChild(tbody.firstChild); } for(var count=0;count1) { getObj("checkoutLocationRange").value = getSelectHtml("checkoutLocation"); seeStationDetail(getObj("checkoutLocation")); } } function initWithWaitingTimeIn(){ if(getObj("stationCodeCheckin").value!="") myCheckInStations.getValues(getObj("stationCodeCheckin").value); if(supportedNavigator()) setStationSelect(getObj("checkinLocation"),null); else { getObj("checkoutLocationRange").style.display = "none"; getObj("checkinLocationRange").style.display = "none"; } if(getObj("checkinLocation").options.length>1) { getObj("checkinLocationRange").value = getSelectHtml("checkinLocation"); seeStationDetail(getObj("checkinLocation")); } } function clearInput(obj){ obj.value=""; } function setPassword(id,pwd) { getObj("driverId").value = id; getObj("password").value = pwd; } //get the browser cookie support var cookieEnabled = true; if (getCookie("TestCookie") == null) { setCookie("TestCookie",1); cookieEnabled = (getCookie("TestCookie") != null )? true : false; deleteCookie("TestCookie"); } if (!cookieEnabled) { alert("To use our website, you must accept First Party/internal cookies in your browser Privacy/Security options"); } function setCookie(name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) { return null; } } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } }