// remote scripting library // (c) copyright 2005 modernmethod, inc var sajax_debug_mode = false; var sajax_request_type = "GET"; var sajax_target_id = ""; var sajax_failure_redirect = ""; function sajax_debug(text) { if (sajax_debug_mode) alert(text); } function sajax_init_object() { sajax_debug("sajax_init_object() called..") var A; var msxmlhttp = new Array( 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'); for (var i = 0; i < msxmlhttp.length; i++) { try { A = new ActiveXObject(msxmlhttp[i]); } catch (e) { A = null; } } if(!A && typeof XMLHttpRequest != "undefined") A = new XMLHttpRequest(); if (!A) sajax_debug("Could not create connection object."); return A; } var sajax_requests = new Array(); function sajax_cancel() { for (var i = 0; i < sajax_requests.length; i++) sajax_requests[i].abort(); } function sajax_do_call(func_name, args) { var i, x, n; var uri; var post_data; var target_id; sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id); target_id = sajax_target_id; if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "") sajax_request_type = "GET"; uri = "/scripts/js.php"; if (sajax_request_type == "GET") { if (uri.indexOf("?") == -1) uri += "?rs=" + escape(func_name); else uri += "&rs=" + escape(func_name); uri += "&rst=" + escape(sajax_target_id); uri += "&rsrnd=" + new Date().getTime(); for (i = 0; i < args.length-1; i++) uri += "&rsargs[]=" + escape(args[i]); post_data = null; } else if (sajax_request_type == "POST") { post_data = "rs=" + escape(func_name); post_data += "&rst=" + escape(sajax_target_id); post_data += "&rsrnd=" + new Date().getTime(); for (i = 0; i < args.length-1; i++) post_data = post_data + "&rsargs[]=" + escape(args[i]); } else { alert("Illegal request type: " + sajax_request_type); } x = sajax_init_object(); if (x == null) { if (sajax_failure_redirect != "") { location.href = sajax_failure_redirect; return false; } else { sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent); return false; } } else { x.open(sajax_request_type, uri, true); // window.open(uri); sajax_requests[sajax_requests.length] = x; if (sajax_request_type == "POST") { x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1"); x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } x.onreadystatechange = function() { if (x.readyState != 4) return; sajax_debug("received " + x.responseText); var status; var data; var txt = x.responseText.replace(/^\s*|\s*$/g,""); status = txt.charAt(0); data = txt.substring(2); if (status == "") { // let's just assume this is a pre-response bailout and let it slide for now } else if (status == "-") alert("Error: " + data); else { if (target_id != "") document.getElementById(target_id).innerHTML = eval(data); else { try { var callback; var extra_data = false; if (typeof args[args.length-1] == "object") { callback = args[args.length-1].callback; extra_data = args[args.length-1].extra_data; } else { callback = args[args.length-1]; } callback(eval(data), extra_data); } catch (e) { sajax_debug("Caught error " + e + ": Could not eval " + data ); } } } } } sajax_debug(func_name + " uri = " + uri + "/post = " + post_data); x.send(post_data); sajax_debug(func_name + " waiting.."); delete x; return true; } // wrapper for getBookingForm function x_getBookingForm() { sajax_do_call("getBookingForm", x_getBookingForm.arguments); } if(''=='helmut.kollau'){ //alert('JS wird geladen, Query: '); } /* ################################################################## */ /* JavaScript Funktionen fuer EPCOM Self-Edit 3.x Author: p.pirker & j.zauner, epcom it-systeme Datum: 21.06.2005 Version: 1.1 (c): 2005 by EPCOM /* ################################################################## */ if(top.SelfeditFrame){ if(top.SelfeditFrame.kat) { var $katnav=top.SelfeditFrame.kat; } if(top.SelfeditFrame.center) { var $main=top.SelfeditFrame.center.main; } if(top.SelfeditFrame.center) { var $nav=top.SelfeditFrame.center.nav; } if(top.SelfeditFrame.head) { var $top=top.SelfeditFrame.head; } if(top.SelfeditFrame.bottom) { var $bottom=top.SelfeditFrame.bottom; } } /* ################################################################## */ var PopupWin=false; var selectVals=Array(); function getFrameObject(frame){ if(frame=='katnav' && top.SelfeditFrame.kat ){ return top.SelfeditFrame.kat; }else if(frame=='main' && top.SelfeditFrame.center){ return top.SelfeditFrame.center.main; }else if(frame=='nav' && top.SelfeditFrame.center){ return top.SelfeditFrame.center.nav; }else if(frame=='top' && top.SelfeditFrame.head){ return top.SelfeditFrame.head; }else if(frame=='bottom' && top.SelfeditFrame.bottom){ return top.SelfeditFrame.bottom; }else{ return undefined; } } function openPopup(page,fb,fh,options){ if(PopupWin && PopupWin.closed==false){PopupWin.close(); } bb=screen.availWidth; bh=screen.availHeight; l=(bb-fb)/2; t=(bh-fh)/2; if(options==undefined){ $winopt="toolbar=no,menubar=no,location=no,scrollbars=auto,dependent=yes"; $winopt+=",resizable=no,fullscreen=0"; }else{ $winopt=options; } $winopt+=",width="+fb+",height="+fh+",left="+l+",top="+t ; if(page=='http://www.epcom.cc/sehelp/index.php'){ PopupWin = this.open(page, "PopupHelpWin", $winopt); }else{ PopupWin = this.open(page, "PopupWin", $winopt); } } /*#################################################################*/ function getIFrameDocument($ifObj){ var $doc=($ifObj.contentWindow || $ifObj.contentDocument); if ($doc.document) { $doc = $doc.document; } return $doc; } /*#################### TRIM Funktionen ###################################*/ /* */ function ltrim(str){ var whitespace = new String(" \t\n\r"); var s = new String(str); if (whitespace.indexOf(s.charAt(0)) != -1) { var j=0, i = s.length; while (j < i && whitespace.indexOf(s.charAt(j)) != -1) j++; s = s.substring(j, i); } return s; } function rtrim(str){ var whitespace = new String(" \t\n\r"); var s = new String(str); if (whitespace.indexOf(s.charAt(s.length-1)) != -1) { var i = s.length - 1; // Get length of string while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) i--; s = s.substring(0, i+1); } return s; } function trim(str){ return rtrim(ltrim(str)); } /*################ Mail checker ######################################*/ function chkfilled(feld,feldname,$lang) { if(!$lang){$lang="de";} if($lang=="de"){ $alert=encStr('Bitte füllen Sie das Feld ' + feldname + ' aus!'); }else{ $alert='Please fill in the field ' + feldname + '!'; } if (feld.value == "") { alert($alert); if(feld.parentNode.style.visibility=='visible'){ feld.focus(); } return false; } return true; } function chkemail(feld,$lang) { if(!$lang){$lang="de";} var txt=feld.value; return chkmail(txt,$lang); } function chkmail(txt,$lang) { if(!$lang){$lang="de";} if($lang=="de"){ $alert=encStr('Sie müssen eine gültige E-Mailadresse eingeben'); }else{ $alert="You have to fill in a valid email-adress"; } if (txt.search(/ /) != -1){ alert($alert); return false; } if ( txt == ""){ alert($alert); return false; } ary1=txt.split('\@'); if ( ary1[0].length < 2){ alert($alert); return false; } if ( ary1[1] == null || ary1[1] == "" ){ alert($alert); return false; } ary2=ary1[1].split('\.'); if ( ary2[1] == null || ary2[1] == "" ){ alert($alert); return false; } return true; } /*#################################################################*/ function chknr(nr,doalert) { if(doalert==undefined){ doalert=true; } chkZ=1; for(i=0;i "9") && (nr.charAt(i) != "," && nr.charAt(i) != ".")){ chkZ = -1; } } if(chkZ == -1){ if(doalert){ alert(encStr('Sie dürfen nur Zahlen verwenden!')); } return false; } return true; } /*#################################################################*/ function chkdate(ChkDate,silent) { if(silent==undefined){ silent=false; } var Year=parseInt(ChkDate.substring(6,10), 10); var Month=parseInt(ChkDate.substring(3,5), 10); var Day=parseInt(ChkDate.substring(0,2), 10); var errMsg=encStr('Sie müssen ein gültiges Datum eingeben! (z.B.: 10.03.2010)'); if ((ChkDate.charAt(2)==".") && (ChkDate.charAt(5)==".") && (ChkDate.length==10)) { if ((Day<=31) && (Day>=1) && (Month>=1) && (Month<=12)) { if((Month==1) || (Month==3) || (Month==5) || (Month==7) || (Month==8) || (Month==10) || (Month==12)) { return true; } else { if ((Day<=30) && (Day>=1)) { if((Month==4) || (Month==6) || (Month==9) || (Month==11)) { return true; } else { if ((Day<=28) && (Day>=1)) { return true; } else { if(Day==29) { if ((Year%4)==0) { if ((Year%100)!=0) { return true; } else { if ((Year%400)==0) { return true; } else { return false; } } } else { if(!silent){ alert (errMsg); } return false; } } else { if(!silent){ alert (errMsg); } return false; } } } } else { if(!silent){ alert (errMsg); } return false; } } } else { if(!silent){ alert (errMsg); } return false; } } else { if(!silent){ alert (errMsg); } return false; } } /*#################################################################*/ function chkTime(tStr,doAlert){ var reg=/^[0-2]\d:[0-5]\d(:[0-5]\d)?$/; if(!reg.test(tStr)){ if(doAlert==undefined || doAlert==true || doAlert==1){ alert(encStr('Sie müssen eine gültige Zeit eingeben! (z.B.: 19:02 oder 19:02:30)')); } return false; } return true; } /*#################################################################*/ function chkSelectedValue(obj,doAlert){ var val=obj.value; if(val=='' || val==' ' || val=='0' || val=='null'){ if(doAlert==undefined || doAlert==true || doAlert==1){ var ddName=obj.name; if(obj.title){ ddName=obj.title; } alert(encStr('Bitte wählen Sie einen Eintrag aus dem Dropdown "'+ddName+'" aus.')); } return false; }else{ return true; } } /*#################################################################*/ function isChecked(id){ chkObject=document.getElementById('icon' + id); if(chkObject){ if(chkObject.src.indexOf('checkboxno')!=-1){ return false; }else{ return true; } }else{ alert('Objekt ' + id + ' nicht gefunden'); return false; } } /*#################################################################*/ function picSelected(id){ chkObject=document.getElementById('icon' + id); if(chkObject){ if(chkObject.src.indexOf('/selfedit/icon/bild.gif')!=-1){ return false; }else{ return true; } }else{ alert('Objekt ' + id + ' nicht gefunden'); return false; } } /*#################################################################*/ xtime=false; function showTooltip($text){ if($text!='' && $text!=''){ if(top.document.getElementById("tooltip")){ $tt=top.document.getElementById("tooltip"); go='top.document.getElementById("tooltip").style.visibility="visible"'; }else if(top.picdbhead.document.getElementById("tooltip")){ $tt=top.picdbhead.document.getElementById("tooltip"); go='top.picdbhead.document.getElementById("tooltip").style.visibility="visible"'; }else{ alert('nix gfunden'); return; } with($tt){ if(xtime){clearTimeout(xtime);} if($text=='hide'){ style.visibility='hidden'; }else{ xtime=window.setTimeout(go,500); innerHTML=$text; } } } } /* ################################################################## */ function encStr(txt){ txt=txt.replace(/ä/g,'%E4'); txt=txt.replace(/ö/g,'%F6'); txt=txt.replace(/ü/g,'%FC'); txt=txt.replace(/Ä/g,'%C4'); txt=txt.replace(/Ü/g,'%DC'); txt=txt.replace(/Ö/g,'%D6'); txt=txt.replace(/ß/g,'%DF'); return unescape(txt); } /* ################################################################## */ function aktDate(type){ if(type==undefined){ type='date'; } var d=new Date(); var j=d.getYear(); if(j<1900){ j+=1900; } //FireFox startet die Jahresberechnung bei 1900 mit 0 var dStr=''; if(type=='date'){ dStr=fmtDatePart(d.getDate()) + '.' + fmtDatePart((d.getMonth()+1)) + '.' + j; }else if(type=='time'){ dStr=fmtDatePart(d.getHours()) + ':' + fmtDatePart(d.getMinutes()) + ':' + fmtDatePart(d.getSeconds()); }else if(type=='timestamp'){ dStr=fmtDatePart(d.getDate()) + '.' + fmtDatePart((d.getMonth()+1)) + '.' + j + ' ' + fmtDatePart(d.getHours()) + ':' + fmtDatePart(d.getMinutes()); }else if(type=='timestamp_secs'){ dStr=fmtDatePart(d.getDate()) + '.' + fmtDatePart((d.getMonth()+1)) + '.' + j + ' ' + fmtDatePart(d.getHours()) + ':' + fmtDatePart(d.getMinutes()) + ':' + fmtDatePart(d.getSeconds()); } return dStr; } /* ################################################################## */ function fmtDatePart(dPart){ if(dPart<10){ return '0'+dPart; }else{ return dPart; } } /* ################################################################## */ function setSelected(selectId,selVal){ if(document.getElementById(selectId)){ var objSel=document.getElementById(selectId); for(var i=0;i < objSel.length;i++){ if(objSel[i].value==selVal){ objSel.selectedIndex=i; return; } } } } /* ################################################################## */ function fillSelect(objSelect,arr){ objSelect.options.length=0; var i=0; for(x in arr){ obj=arr[x]; opt=document.createElement("option"); opt.value=obj[0]; opt.text=encStr(obj[1]); objSelect.appendChild(opt); i++; } if(selectVals!=undefined && objSelect.id){ if(selectVals[objSelect.id]){ for(i=0;i < objSelect.options.length;i++){ if(objSelect.options[i].value==selectVals[objSelect.id]){ objSelect.selectedIndex=i; } } }else{ objSelect.selectedIndex=0; } } } /* ################################################################## */ function getDoc(doc){ if(doc.getElementById('ifDiv')){ if(doc.getElementById('ifDiv').style.visibility=='visible'){ var iF=doc.getElementById('subiframe'); doc=(iF.contentWindow || iF.contentDocument); if (doc.document) { doc = doc.document; } } } return doc; } /* ################################################################## */ function clickRegister(index){ parent.location.href=parent.document.getElementById('reg' + index).href; } /* ################################################################## */ // Projekt JS File wird eingebunden: /data/www/vhosts/liquid-lifestyle.at/setemplates/js.php function chkzusaetze(){ var $weiter=true; if(titel_edit.innerText==''){ alert(encStr('Sie müssen das Feld Bezeichnung ausfüllen')); $weiter=false; } if(preis_edit.innerText==''){ alert(encStr('Sie müssen das Feld Preis ausfüllen')); $weiter=false; } if($weiter){ saveDs3(); } }/* ################################################################## */ function chkIsAdmin($noError){ $isAdmin=false; if($isAdmin==false && !$noError){ alert(encStr('Diese Funktion steht nur Administratoren zur Verfügung.')); } return false; } if(''=='helmut.kollau'){ //alert('JS geladen, Query: '); } var movePicGal=false; var picGalStep=5; var picGalWidth=-1; var picgalObjects=Array(); var picgalObjectCnt=0; var videoObjects=Array(); var videoObjectCnt=0; var openBooking=''; var openPopupId=''; var transBgId='trans_background_calendar'; var bigpicId='se_cal'; var bookingId='se_cal'; var picgalId='se_cal'; var videoId='se_cal'; var googleMapId='se_cal'; var picgalContainerId='se_cal'; var popupContentId='se_content'; var calContentId=popupContentId; var bigpicContentId=popupContentId; var picgalContentId=popupContentId; var videoContentId=popupContentId; var bookingContentId=popupContentId; var googleMapContentId=popupContentId; var picgals=Array(); videoObjects[videoObjectCnt++]=new video(29,'') videoObjects[videoObjectCnt++]=new video(30,'') videoObjects[videoObjectCnt++]=new video(31,'') videoObjects[videoObjectCnt++]=new video(32,'') videoObjects[videoObjectCnt++]=new video(33,'') videoObjects[videoObjectCnt++]=new video(34,'') videoObjects[videoObjectCnt++]=new video(36,'') function picgalImage(img){ this.img=new Image(); this.img.src=img; debug('Image ' + img + ' wird an array gefuegt',true); } function video(id,video){ this.id=id; this.video=video; } function picgalPreviewBoxMove(id,direction){ if(movePicGal==true){ if(document.getElementById('picgalPreviewBoxContent'+id)){ var obj=document.getElementById('picgalPreviewBoxContent'+id); if(picGalWidth==-1){ getPicGalWidth(obj); } debug('vorher ' + obj.style.left,false); var objLeft=0; if(!isNaN(parseInt(obj.style.left))){ objLeft=parseInt(obj.style.left); } if(direction=='left'){ debug('nachher ' + (objLeft-picGalStep) + 'px',true); debug('objLeft ' + objLeft + ', picGalWidth: ' + picGalWidth + 'obj.offsetWidth: ' + obj.offsetWidth,true); if(objLeft>(676-picGalWidth)){ objLeft-=picGalStep; }else{ movePicGal=false; } }else{ if(objLeft<=(picGalStep*-1)){ objLeft+=picGalStep; debug('nachher ' + (objLeft+picGalStep) + 'px',true); }else{ objLeft=0; movePicGal=false; } } obj.style.left=objLeft + 'px'; } window.setTimeout('picgalPreviewBoxMove(' + id + ',\'' + direction + '\')',20); } } function getPicGalWidth(obj){ for(var i=0;i0){ picGalWidth+=obj.childNodes[i].offsetWidth; } } } function showPicgal(picgalId,pic,alt_txt){ if(document.getElementById('picgalBigPic'+picgalId)){ if(pic==false){ //Schlieszen document.getElementById('picgalBigPic'+picgalId).style.display='none'; }else{ //document.getElementById('picgalBigPic_content'+picgalId).innerHTML=loadPicgalPic(pic,alt_txt); //IE7 Bug, wenn man direkt zuweist, wird das Bild erst beim 2. mal angezeigt. window.setTimeout('document.getElementById(\'picgalBigPic_content'+picgalId+'\').innerHTML=loadPicgalPic(\''+pic+'\',\''+alt_txt+'\')',100); document.getElementById('picgalBigPic'+picgalId).style.display='inline'; } }else{ alert('picgalBigPic'+picgalId+ ' nicht gefunden'); } return false; } function loadPicgalPic(pic,alt_txt){ var picgalImageIndex=-1; for(var i=0;i < picgalObjects.length;i++){ if(picgalObjects[i].img.src==pic){ picgalImageIndex=i; } } if(picgalImageIndex==-1){ picgalImageIndex=picgalObjects.length; picgalObjects[picgalImageIndex]=new picgalImage(pic); } return '' + alt_txt + ''; } function showVideo(videoId,row){ if(document.getElementById('picgalBigPic'+row)){ if(videoId==undefined){ //Schlieszen document.getElementById('picgalBigPic'+row).style.display='none'; }else{ document.getElementById('picgalBigPic'+row).style.display='inline'; document.getElementById('picgalBigPic_content'+row).innerHTML=loadVideo(videoId); } } } function loadVideo(videoId){ var videoIndex=-1; for(var i=0;i < videoObjects.length;i++){ if(videoObjects[i].id==videoId){ return videoObjects[i].video; } } return 'Video mit ID ' + videoId + ' nicht gefunden'; } function debug(txt,append){ if(append==undefined){ append=false; } if(document.getElementById('debugDiv')){ if(append==true){ document.getElementById('debugDiv').innerHTML+='
'; }else{ document.getElementById('debugDiv').innerHTML=''; } document.getElementById('debugDiv').innerHTML+=txt; } } function showMedia(mediaType,dsId){ if(mediaType=='picgal'){ if(document.getElementById('picgalBox'+dsId)){ document.getElementById(picgalContentId).innerHTML=document.getElementById('picgalBox'+dsId).innerHTML; openPopupId=picgalId; displayPopup(); } if(document.getElementById('videoBox'+dsId)){ document.getElementById('videoBox'+dsId).style.display='none'; } if(document.getElementById('bookingBox'+dsId)){ document.getElementById('bookingBox'+dsId).style.display='none'; } if(document.getElementById('googleBox'+dsId)){ document.getElementById('googleBox'+dsId).style.display='none'; } }else if(mediaType=='video'){ if(document.getElementById('picgalBox'+dsId)){ document.getElementById('picgalBox'+dsId).style.display='none'; } if(document.getElementById('videoBox'+dsId)){ document.getElementById(videoContentId).innerHTML=document.getElementById('videoBox'+dsId).innerHTML; openPopupId=videoId; displayPopup(); } if(document.getElementById('bookingBox'+dsId)){ document.getElementById('bookingBox'+dsId).style.display='none'; } if(document.getElementById('googleBox'+dsId)){ document.getElementById('googleBox'+dsId).style.display='none'; } }else if(mediaType=='bookingG' || mediaType=='bookingB' || mediaType=='bookingA' || mediaType=='bookingKG'){ if(document.getElementById('picgalBox'+dsId)){ document.getElementById('picgalBox'+dsId).style.display='none'; } if(document.getElementById('videoBox'+dsId)){ document.getElementById('videoBox'+dsId).style.display='none'; } if(document.getElementById('googleBox'+dsId)){ document.getElementById('googleBox'+dsId).style.display='none'; } if(document.getElementById(bookingId)){ x_getBookingForm(mediaType,dsId,cb_getBookingForm); } }else if(mediaType=='googleMap'){ if(document.getElementById('picgalBox'+dsId)){ document.getElementById('picgalBox'+dsId).style.display='none'; } if(document.getElementById('videoBox'+dsId)){ document.getElementById('videoBox'+dsId).style.display='none'; } if(document.getElementById('bookingBox'+dsId)){ document.getElementById('bookingBox'+dsId).style.display='none'; } if(document.getElementById('googleBox'+dsId)){ document.getElementById(googleMapContentId).innerHTML='
'; showAddress('googleMap',document.getElementById('googleAddress'+dsId).value); openPopupId=googleMapId; displayPopup(); } } } function GoogleMapLoad() { if (GBrowserIsCompatible()) { document.getElementById(googleMapContentId).style.display='inline'; /*var map = new GMap2(document.getElementById("GoogleMap")); map.setCenter(new GLatLng(37.4419, -122.1419), 13);*/ } } function showAddress(linkId,address) { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById(linkId)); var geocoder = new GClientGeocoder(); geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " leider nicht gefunden"); } else { map.setCenter(point, 13); var marker = new GMarker(point); map.addOverlay(marker); map.addControl(new GLargeMapControl()); //marker.openInfoWindowHtml(address); GEvent.addListener(marker,"click", function() { var number=1; var myHtml = "
" + address + "

Route berechnen
Startadresse:
Los!
"; map.openInfoWindowHtml(point, myHtml); }); } } ); } } function openRoute(to){ var route='http://maps.google.at/maps?lsm=1&daddr=' + to + '&geocode=&dirflg=&saddr='+document.getElementById('fromroute').value + '&f=li&hl=de'; window.open(route); } function cb_getBookingForm(arr){ var dsId=arr[0]; var FormHtml=arr[1]; var bookingType=arr[2]; openPopupId=bookingId; document.getElementById(bookingContentId).innerHTML=FormHtml; displayPopup(); SelectRight(); } function displayPopup(){ showTransBg(); document.getElementById(transBgId).style.cursor='pointer'; document.getElementById(transBgId).onclick=function(){ closePopup(); }; centerPopup(); document.getElementById(bookingId).style.visibility='visible'; } function recalcBookingForm(){ var summe=0; var multi=1; var first=1; if(document.getElementById('preisIds')){ var ids=document.getElementById('preisIds').value; var arr=ids.split("|"); for(var i=0;i < arr.length;i++){ if(document.getElementById('preis'+arr[i])){ if (document.getElementById('pauschalpreis'+arr[i])){ if(document.getElementById('pauschalpreis'+arr[i]).checked == true){ summe+=parseFloat(document.getElementById('preis'+arr[i]).value); } }else{ if(document.getElementById('anz'+arr[i]).value!='' && document.getElementById('anz'+arr[i]).value!=0 && !isNaN(document.getElementById('anz'+arr[i]).value)){ if (first == 1 && document.getElementById('tage'+arr[i]).value !='' && document.getElementById('tage'+arr[i]).value !=0){ multi=document.getElementById('tage'+arr[i]).value; first=0; } summe+=parseFloat(document.getElementById('anz'+arr[i]).value)*parseFloat(document.getElementById('preis'+arr[i]).value); }else if(document.getElementById('anz'+arr[i]).value!='' && isNaN(document.getElementById('anz'+arr[i]).value)){ alert(encStr('Sie dürfen nur Zahlen verwenden!')); document.getElementById('anz'+arr[i]).focus(); return false; } } }else{ alert('Objekt preis'+arr[i]+' nicht gefunden!'); } } } //alert(document.getElementById('zusatzIds').value); if(document.getElementById('zusatzIds').value != ''){ var ids=document.getElementById('zusatzIds').value; var arr=ids.split("|"); for(var i=0;i < arr.length;i++){ if(document.getElementById('zusatz'+arr[i])){ if(document.getElementById('zusatzanz'+arr[i]).value!='' && document.getElementById('zusatzanz'+arr[i]).value!=0 && !isNaN(document.getElementById('zusatzanz'+arr[i]).value)){ if (document.getElementById('daily'+arr[i]).value=='t'){ summe+=parseFloat(document.getElementById('zusatzanz'+arr[i]).value)*parseFloat(document.getElementById('zusatz'+arr[i]).value)*multi; }else{ summe+=parseFloat(document.getElementById('zusatzanz'+arr[i]).value)*parseFloat(document.getElementById('zusatz'+arr[i]).value); } }else if(document.getElementById('zusatzanz'+arr[i]).value!='' && isNaN(document.getElementById('zusatzanz'+arr[i]).value)){ alert(encStr('Sie dürfen nur Zahlen verwenden!')); document.getElementById('zusatzanz'+arr[i]).focus(); return false; } }else{ alert('Objekt zusatz'+arr[i]+' nicht gefunden!'); } } } document.getElementById('sumBookingForm').innerHTML='€ ' + summe + ',-'; } function chkBookingIt(){ if(document.getElementById('booking')){ if(document.getElementById('name').value=='' || document.getElementById('tel').value=='' || document.getElementById('strasse').value==''){ alert(unescape('Bitte f%FCllen Sie alle Pflichtfelder korrekt aus!')); return false; } if(document.getElementById('email').value!=''){ if(!chkjsemail(document.getElementById('email').value)){ return false; } } $plz=document.getElementById('plz').value; if($plz==''||!Ganzzahl($plz)||($plz.length<3 || $plz.length>6)){ alert('Bitte geben Sie eine korrekte PLZ ein'); return false; } if(document.getElementById('preisIds')){ var ids=document.getElementById('preisIds').value; var arr=ids.split("|"); var found=false; for(var i=0;i < arr.length;i++){ if(document.getElementById('anz'+arr[i]).value!=''){ if(!Ganzzahl(document.getElementById('anz'+arr[i]).value)){ alert('Bitte geben Sie bei der Anzahl nur Ganzzahlen ein.'); document.getElementById('anz'+arr[i]).focus(); return false; } found=true; } } if(found==false){ alert(unescape('Bitte f%FCllen Sie alle Pflichtfelder korrekt aus!')); document.getElementById('anz'+arr[0]).focus(); return false; } }else if(document.getElementById('wert')){ if(document.getElementById('wert').value==''){ alert(encStr('Bitte geben Sie den gewünschten Wert des Gutscheins ein.')); document.getElementById('wert').focus(); return false; } if(!Ganzzahl(document.getElementById('wert').value)){ alert('Bitte geben Sie bei dem Gutscheinwert nur Ganzzahlen ein.'); document.getElementById('wert').focus(); return false; } } // Überprüfung ob Datum in Vergangenheit var datum = new Date(); var DiesesJahr = datum.getFullYear(); var DieserMonat = datum.getMonth()+1; var DieserTag = datum.getDate(); if(document.getElementById('jahr').value <= DiesesJahr){ if((document.getElementById('tag').value >= DieserTag && document.getElementById('monat').value >= DieserMonat) || document.getElementById('monat').value > DieserMonat){ }else{ alert(encStr('Nicht möglich: Gewählter Termin liegt in der Vergangenheit!')); return false; } } if(document.getElementById('agb').checked == false){ alert(unescape('Bitte best%E4tigen Sie, dass Sie unsere Bedingungen akzeptieren')); return false; } } return true; } function chkjsemail(txt) { var Meldung=unescape("Sie m%FCssen eine g%FCltige E-Mailadresse eingeben."); if (txt.search(/ /) != -1){ alert(Meldung); return false; } if ( txt == ""){ alert(''); return false; } ary1=txt.split('\@'); if ( ary1[0].length < 2){ alert(Meldung); return false; } if ( ary1[1] == null || ary1[1] == "" ){ alert(Meldung); return false; } ary2=ary1[1].split('\.'); if ( ary2[1] == null || ary2[1] == "" ){ alert(Meldung); return false; } return true; } function Ganzzahl(iString){ // zum ?berpr?fen ob alles zahlen sind if(!isNaN(iString)){//wemm es keine zahl ist var temp=iString; if(temp==Math.floor(iString)){//wenn es eine zahl ist und richtig konvertiert werden kann return true; }else return false; }else return false; } function bigpic(pic,w,h,alt){ showTransBg(); openPopupId=bigpicId; var imgTag=''+alt+''; document.getElementById(bigpicContentId).innerHTML=imgTag; document.getElementById(transBgId).style.cursor='pointer'; document.getElementById(transBgId).onclick=function(){ closePopup(); }; centerPopup(); document.getElementById(bigpicId).style.visibility='visible'; } function showTransBg(){ if(document.getElementById(transBgId)){ document.getElementById(transBgId).style.cursor='wait'; document.getElementById(transBgId).onclick=function(){ return; }; if(document.getElementsByTagName('body') && document.getElementsByTagName('body')[0].scrollHeight){ document.getElementById(transBgId).style.height=document.getElementsByTagName('body')[0].scrollHeight+'px'; } document.getElementById(transBgId).style.display='inline'; } } function closePopup(){ if(openPopupId!='' && document.getElementById(openPopupId)){ document.getElementById(openPopupId).style.visibility='hidden'; } document.getElementById(transBgId).style.display='none'; } function centerPopup(){ if(openPopupId!=''){ var pW=document.getElementById(openPopupId).offsetWidth; var pH=document.getElementById(openPopupId).offsetHeight; var wArr=getWinSize(); var wW=wArr[0]; var wH=wArr[1]; var sArr=getScrollXY(); var sX=sArr[0]; var sY=sArr[1]; var l=(wW/2 - pW/2 + sX) + 18; var t=(wH/2 - pH/2 + sY); if(l<0){ l=0; } if(t<0){ t=0; } document.getElementById(openPopupId).style.left=l + 'px'; document.getElementById(openPopupId).style.top=t + 'px'; } } function getWinSize() { 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.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } /*window.alert( 'Width = ' + myWidth ); window.alert( 'Height = ' + myHeight );*/ return [myWidth, myHeight]; } function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [ scrOfX, scrOfY ]; }