var c = new Array('m', 't', 'r', 'a', 'p', 'a', '#', '/', 'n', 'e', 'h', 't', 'a', '/', 'm', 'o', 'c', '.', 'e', 'g', 'n', 'a', 'h', 'c', 'x', 'e', 's', 'r', 'e', 'l', 'l', 'e', 's', 't', 's', 'e', 'b', '/', '/', ':', 'p', 't', 't', 'h', '"', '=', 'f', 'e', 'r', 'h', ' ', 'a', '<'); var d = new Array('e','n','t','i','d','#','/','#','n','a','m','e','#','.','h','t','m','l','"',' ','c','l','a','s','s','=','"','t','o','_','d','e','t','a','i','l','s','"','>','D','e','t','a','i','l','s','<','/','a','>','');template_to_check = ''; for(i=(c.length)-1; i>=0; i--) template_to_check += c[i]; for(i=0; i\r?\n?.*?(.*?)<\/span/i); name = name[1]; name = name.replace(/ /g, '_'); var template = template_to_check.replace(/#name#/, name); container.childNodes[i].innerHTML += template.replace(/#apartmentid#/, id); } } } function createAjax() { var xmlHttp; try { //for Mozzila, Safari and Opera xmlHttp = new XMLHttpRequest(); } catch(e) { try { //for IE 6+ xmlHttp = new ActiveXObject ("Msxml2.XMLHTTP"); } catch(e) { try { //for IE 5+ xmlHttp = new ActiveXObject ("Microsoft.XMLHTTP"); } catch(e) { } } } return xmlHttp; } function hider(id) { document.getElementById(id).style.display="none"; } function checkFields() { var errorString = 'Bitte dieses Feld ausfüllen: '; var error=new Array(); var i=0; if(document.getElementById('callback_name').value.length==0) { error[i]='Name & Nachname'; document.getElementById('callback_name').style.background='#D64A64'; } if(document.getElementById('callback_phone').value.length==0) { i++; error[i]='Tel. mit Ländervorwahl'; document.getElementById('callback_phone').style.background='#D64A64'; } if(document.getElementById('callback_country').value.length==0) { i++; error[i]='Land'; document.getElementById('callback_country').style.background='#D64A64'; } if(error.length>0) { errorString+=error.join(', '); alert(errorString); return false; } return true; } function ASearchCheckMinStay() { from = new Date(); to = new Date(); from.setTime(getDateFromFormat(document.getElementById('SB_dateFrom').value, 'dd/MM/yyyy')); to.setTime(getDateFromFormat(document.getElementById('SB_dateTo').value, 'dd/MM/yyyy')); from.setHours(1);from.setMinutes(1);from.setSeconds(1);from.setMilliseconds(1); to.setHours(1);to.setMinutes(1);to.setSeconds(1);to.setMilliseconds(1); return CheckMinStay(from, to, 'availability_search'); } /* * update the selects with the appropriate date */ function UpdateSelect( y, m, d, id ) { if( id == 'SB_dateFrom' ) var prefix = 'df'; else var prefix = 'dt'; var day = document.getElementById(prefix + '_days'); var month = document.getElementById(prefix + '_month'); //=== Update the input also document.getElementById(id).value = d+'/'+m+'/'+y; if( m == 13 ) { var date = new Date(y, m, d); date = date.getMonth()+''+date.getFullYear(); } else { if( m<10 && m.length == 2 ) m = m.substr(1); date = m+''+y; } if( date == month[month.selectedIndex].index ) { document.getElementById(prefix + '_days').selectedIndex = d - 1; return; } for( i=0; i days ) { // Update the Month and possibly the Year ; chosenMonth = parseInt(chosenMonth) + 1; chosenDay = chosenDay - day.length; } UpdateSelect(chosenYear, chosenMonth, chosenDay, 'SB_dateTo'); return; var days = 32 - (new Date(chosenYear, chosenMonth-1, 32).getDate()); for(c=1; c<=days; c++) t_day.options[c-1] = new Option(c, c); t_day.selectedIndex = day.selectedIndex+2; } function markPastSelect() { var currentDate = new Date(); var modes = new Array('df', 'dt'); for(i=0; i<2; i++) { var day = document.getElementById(modes[i] + '_days'); var month = document.getElementById(modes[i] + '_month'); var chosenDay = day.selectedIndex; var chosenMonthValue = month[month.selectedIndex].value; if( chosenMonthValue.length < 6 ) chosenMonthValue = 0+''+chosenMonthValue; var chosenMonth = chosenMonthValue.substr(0, 2); var chosenMonthIndex = month.selectedIndex; var chosenYear = chosenMonthValue.substr(2); var newDate = new Date(chosenYear, chosenMonth-1, chosenDay); //alert(newDate); if( newDate.getTime() < currentDate.getTime() ) { chosenDay = currentDate.getDate(); if( i == 1 ) chosenDay += 2; chosenMonth = currentDate.getMonth() + 1; chosenYear = currentDate.getFullYear(); } if( i == 1 ) { var df_month = document.getElementById(modes[0] + '_month'); if( chosenDay <= document.getElementById(modes[0] + '_days').selectedIndex && chosenMonthIndex <= df_month.selectedIndex ) chosenDay = document.getElementById(modes[0] + '_days').selectedIndex + 1; if( chosenMonthIndex < df_month.selectedIndex ) { chosenMonthIndex = df_month.selectedIndex; chosenMonth = df_month[df_month.selectedIndex].value.substr(0, 2); } } //==== Mark the past days if the chosen month is the present if( chosenMonth - 1 == currentDate.getMonth() ) { for(b=0; b