var onLoadFunctions=""; function initCB(){ eval(onLoadFunctions); } window.onload =initCB; var curLevel=0; var maxLevel=3; function searchDistrict(level){ var country_id = document.getElementById("DistrictSelect"+level).options[document.getElementById("DistrictSelect"+level).options.selectedIndex].value; getSelectDistrict(country_id,level); } function processReqYacht(){ if(req.readyState == 4&&req.status == 200){//onchange='setYacht()' var html = ""; document.getElementById("YachtDiv").innerHTML=html; showDiv("NewYachtBlock"); }else if(req.readyState == 4){ alert("Request Fail:"+req.statustext+" "+req.status); } } function processReqProvider(){ if(req.readyState == 4&&req.status == 200){ var elements = req.responseXML.getElementsByTagName("CharterProvider"); if(elements.length==0){ document.getElementById("CharterProviderNameInput").value="keine Ergebnisse!"; hideDiv("CharterProviderSelectDiv"); showDiv("NewProviderBlock"); return; } var html = ""; document.getElementById("CharterProviderSelectDiv").innerHTML=html; showDiv("NewProviderBlock"); }else if(req.readyState == 4){ alert("Request Fail:"+req.statustext+" "+req.status); } } function processReqAgency(){ if(req.readyState == 4&&req.status == 200){ var elements = req.responseXML.getElementsByTagName("Agency"); if(elements.length==0){ document.getElementById("AgencyNameInput").value="keine Ergebnisse!"; showDiv("NewAgencyBlock"); return; } var html = ""; document.getElementById("AgencySelectDiv").innerHTML=html; showDiv("NewAgencyBlock"); }else if(req.readyState == 4){ alert("Request Fail:"+req.statustext+" "+req.status); } } function processInsurancePersons(){ if(req.readyState == 4&&req.status == 200){ var html = req.responseText; document.getElementById("InsurancePersons").innerHTML=html; }else if(req.readyState == 4){ alert("Request Fail:"+req.statustext+" "+req.status); } } function submitForm(formname){ document.getElementById(formname).submit(); } function createXMLHttpRequest() { try{ req = new XMLHttpRequest(); }catch (e){ try{ req = new ActiveXObject("Msxml2.XMLHTTP"); }catch (e){ try{ req = new ActiveXObject("Microsoft.XMLHTTP"); }catch (failed){ req = null; alert("kein Ajax Request"); } } } return req; } var req = createXMLHttpRequest(); function getNodeValue(tree, el){ return tree.getElementsByTagName(el)[0].firstChild.nodeValue; } function sendAjaxRequest(url,processReq){ req = createXMLHttpRequest(); req.onreadystatechange=processReq; req.open("GET",url,true); req.send(null); } function submitCharterProviderForm(){ var url = AJAXgetForm("CharterProviderForm"); var offerDiv = document.getElementById("LightWindow"); AJAXloadHTMLinTarget(url,"LightWindow",null,null); } function openNewCharterProvider(event){ showLightWindow(80,200,560,670); var url = "http://order.eis-insurance.com/NewCharterProvider.jsp;jsessionid=abchircpynWVh9qr2oPwt?action=new"; AJAXloadHTMLinTarget(url,"LightWindow",null,event); } function submitYachtForm(){ var url = AJAXgetForm("YachtForm"); var offerDiv = document.getElementById("LightWindow"); AJAXloadHTMLinTarget(url,"LightWindow",null,null); } function openNewYacht(event){ showLightWindow(80,200,560,670); var url = "http://order.eis-insurance.com/NewYacht.jsp;jsessionid=abchircpynWVh9qr2oPwt?action=new"; AJAXloadHTMLinTarget(url,"LightWindow",null,event); } function submitRegattaForm(){ var url = AJAXgetForm("RegattaForm"); var offerDiv = document.getElementById("LightWindow"); AJAXloadHTMLinTarget(url,"LightWindow",null,null); } function openNewRegatta(event){ showLightWindow(80,200,560,670); var url = "http://order.eis-insurance.com/NewRegatta.jsp;jsessionid=abchircpynWVh9qr2oPwt?action=new&district="+document.getElementById("district_oid_fk").value; AJAXloadHTMLinTarget(url,"LightWindow",null,event); } function submitAgencyForm(){ var url = AJAXgetForm("AgencyForm"); var offerDiv = document.getElementById("LightWindow"); AJAXloadHTMLinTarget(url,"LightWindow",null,null); } function openNewAgency(event){ showLightWindow(80,200,560,670); var url = "http://order.eis-insurance.com/NewAgency.jsp;jsessionid=abchircpynWVh9qr2oPwt?action=new"; AJAXloadHTMLinTarget(url,"LightWindow",null,event); } function submitPersonForm(){ var url = AJAXgetForm("PersonForm"); var offerDiv = document.getElementById("LightWindow"); AJAXloadHTMLinTarget(url,"LightWindow",null,null); } function deletePerson(id,event){ var url = "http://order.eis-insurance.com/NewPerson.jsp;jsessionid=abchircpynWVh9qr2oPwt?action=delete&id="+id; AJAXloadHTMLinTarget(url,"LightWindow",null,event); } function openNewPerson(event){ showLightWindow(80,200,560,670); var url = "http://order.eis-insurance.com/NewPerson.jsp;jsessionid=abchircpynWVh9qr2oPwt?action=new"; AJAXloadHTMLinTarget(url,"LightWindow",null,event); } function editPerson(id,event){ showLightWindow(80,200,560,670); var url = "http://order.eis-insurance.com/NewPerson.jsp;jsessionid=abchircpynWVh9qr2oPwt?action=edit&ip="+id; AJAXloadHTMLinTarget(url,"LightWindow",null,event); } var onLoadFunctions=""; function initOnLoadEvent(){ eval(onLoadFunctions); } function addOnLoadEvent(functionString){ if(functionString.lastIndexOf(';')!=functionString.length-1)functionString += ';'; onLoadFunctions += functionString; } window.onload =initOnLoadEvent;var ajaxReqURLs = new Array(); var runningAjaxReqs = new Array(); var ajaxReqFunctions = new Array(); var nextFunctionAJAX = new Array(); var lastMouseX = 0; var lastMouseY = 0; var MouseXAJAX = new Array(); var MouseYAJAX = new Array(); var ajaxLoader =""; function AJAXgetForm(formName){ var elements = document.getElementById(formName).elements; if(!elements)elements = document.forms[formName].elements; var url=elements['AJAXURL']?elements['AJAXURL'].value:''; if(url.indexOf('?')==-1){url+='?';} return url+AJAXgetParameter(formName); } function AJAXgetTextParameter(element){ var temp = element.value; temp = escape(temp);//(/\&/,"%26"); temp = temp.replace(/\+/g , "%2B"); return element.name+"="+temp; } function AJAXgetParameter(formName){ var and=true;var url=''; var elements = document.getElementById(formName).elements; if(!elements)elements = document.forms[formName].elements; for(var i=0;i-1){ var errorText =text.substr(text.indexOf("-1){ window.location.reload(); return; }else{ req = runningAjaxReqs[url]; eval(ajaxReqFunctions[url]); hideDiv("ajaxLoaderDiv"); if(nextFunctionAJAX[url]!=null)eval(nextFunctionAJAX[url]); } runningAjaxReqs[url]=null; ajaxReqFunctions[url]=null; }else if(curReq.status == 503){//server down window.location.reload(); }else if(curReq.status == 0){//auch server down??? window.location.reload(); }else{ alert("Request Fail: Statustext:"+curReq.statustext+" Status:"+curReq.status+" readyState"+curReq.readyState+"\nText:"+curReq.responseText); } }else{ runningCount++; } } if(runningCount==0){ ajaxReqURLs = new Array(); ajaxReqFunctions = new Array(); runningAjaxReqs[url]=new Array(); } } function AJAXsendRequest(url,processReq,nextFunction,target_id,e){ if(!e)e = window.event; var curReq = AJAXcreateXMLHttpRequest(); if(url.indexOf("?")<0){ url+="?"; }else{url+="&";} url+="rand="+(new Date()).getTime(); ajaxReqURLs.push(url); runningAjaxReqs[url]=curReq; ajaxReqFunctions[url]=processReq; if(e!=null){ MouseXAJAX[url]=e.clientX; MouseYAJAX[url]=e.clientY; lastMouseX=e.clientX; lastMouseY=e.clientY; } if(nextFunction!=null)nextFunctionAJAX[url]=nextFunction; var ajaxLoaderDiv = document.getElementById("ajaxLoaderDiv"); if(ajaxLoaderDiv==null && document.getElementsByTagName("body").length>0){ ajaxLoaderDiv = document.createElement("div"); ajaxLoaderDiv.id="ajaxLoaderDiv"; document.getElementsByTagName("body")[0].appendChild(ajaxLoaderDiv); } if(ajaxLoaderDiv!=null){ var top=0; var left=0; if(window.innerHeight !=null){ top= (window.innerHeight/2) ; left= (window.innerWidth/2) -150; }else{ top= (screen.availHeight/3+ document.body.scrollTop) ; left= (document.body.clientWidth/2) ; } for(var i=0;i200)targetHeight=200; if(targetWidth>0){ tempAjaxLoader +="width:"+targetWidth+"px;"; } if(targetHeight>0){ tempAjaxLoader +="height:"+targetHeight+"px;"; } tempAjaxLoader +="' >"+""; document.getElementById(target_id).innerHTML=tempAjaxLoader; }else{ ajaxLoaderDiv.innerHTML+="
RQ"+url; ajaxLoaderDiv.innerHTML=ajaxLoader; ajaxLoaderDiv.style.position="absolute"; ajaxLoaderDiv.style.top=top+"px"; ajaxLoaderDiv.style.left=left+"px"; showDiv("ajaxLoaderDiv"); } } curReq.onreadystatechange=AJAXsetRequestRunning; curReq.open("GET",url,true); curReq.send(null); } var edit=0; var a_links = new Array(document.getElementsByTagName("a").length); function AJAXsetFormReadOnly(form){ if(form.elements["oid_form"].value=="-1"){ if(document.getElementById("ChangeButton")!=null)hideDiv("ChangeButton"); if(document.getElementById("SaveButton")!=null)showDiv("SaveButton"); return; } for(var i=0;i0){ scrollPos +=top; }else{ scrollPos+=100; } offerDiv.style.top=scrollPos+"px"; if(left<=0){ if(window.innerWidth)left = ((window.innerWidth-width)/2); else left = ((document.body.clientWidth -width)/2); } offerDiv.style.left=left+"px"; offerDiv.style.width=width+"px"; if(height>0)offerDiv.style.height=height+"px"; showDiv(windowName); } function setBgBlack(divName){ var bodyheight=document.getElementsByTagName('body')[0].scrollHeight; var bodywidth=document.getElementsByTagName('body')[0].scrollWidth; bodyheight += window.innerHeight; if(window.innerWidth)document.getElementById(divName).style.width=window.innerWidth+'px'; if(bodyheight)document.getElementById(divName).style.height=bodyheight+'px'; showDiv(divName); } function closeLightWindow(top,left,width,height){ closeAJAXWindow('LightWindow'); } function closeAJAXWindow(windowName){ if(document.getElementById("BlackBackground"))hideDiv("BlackBackground"); hideDiv(windowName); } function stopEvent(event){ if(!event)event=window.event; if (!event.stopPropagation) { event.cancelBubble = true; event.returnValue = false; }else{ event.stopPropagation(); event.preventDefault(); } } function loadAJAXWindow(url,curWindow){ curWindow.setAjaxContent(url, { evalJS:'force',method: 'get',evalJSON:false, onCreate: function() {this.setContent('
Please wait...
');}, onComplete: function(){evalAJAXScripts(this.content);} }); }function submitAJAXForm(formName,curWindow){ var url = AJAXgetForm(formName); loadAJAXWindow(url,curWindow); } function evalAJAXScripts(html){ var scripts = html.getElementsByTagName("pre"); for(var i=0;i20 ) curWindow.setPosition(30,left); else if(top<30 && left <20 ) curWindow.setPosition(30,20); else if(top>30 && left <20 ) curWindow.setPosition(top,20); else curWindow.setPosition(top,left); if(!curWindow){ }else{ /*var temp = new UI.Window({}); temp.setSize(curWindow.getSize()); temp.setPosition(curWindow.getPosition()); curWindow.initialize(); alert(curWindow.id+" "+ curWindow.style);*/ } curWindow.activate(); curWindow.show(); return curWindow; } function setAllForm(formName){ for(var i=0;i< document.forms[formName].elements.length;i++){ if(document.forms[formName].elements[i].type=="checkbox"){ document.forms[formName].elements[i].checked=true; } } } function unsetAllForm(formName){ for(var i=0;i< document.forms[formName].elements.length;i++){ if(document.forms[formName].elements[i].type=="checkbox"){ document.forms[formName].elements[i].checked=false; } } } function imposeMaxLength(Object, MaxLen){ if(Object.value.length >= MaxLen){ Object.value = Object.value.substring(0,MaxLen-1); } return (Object.value.length <= MaxLen); } function genLightBox(lightBoxName){ var aTags = document.getElementsByTagName("a"); for(var i=0;i