﻿var onScreen=false;var actualDate=new Date();var limitDate=actualDate;var initialFromValue='';var initialToValue='';function CloseCalendar(hide,ele)
{$('ctl00_CT_ContentPlaceHoder_landingSearch_depart_Landing').value='';$('ctl00_CT_ContentPlaceHoder_landingSearch_inbound_Landing').value='';if(initialFromValue!=''&&initialToValue!='')
{$('ctl00_CT_ContentPlaceHoder_landingSearch_depart_Landing').value=initialFromValue;$('ctl00_CT_ContentPlaceHoder_landingSearch_inbound_Landing').value=initialToValue;}
$('calendarwrapper').style.display='none';$('calendarwrapper').style.visibility="hidden";onScreen=false;}
function runToggleDIVCalendar_Landing(hide,ele)
{if(hide)
{if(onScreen)
{$('calendarwrapper').style.visibility="visible";onScreen=false;}
if($('calendarwrapper').style.display=='none')
{$('calendarwrapper').style.top='160px';$('calendarwrapper').style.left='37px';$('calendarwrapper').style.position='absolute';$('calendarwrapper').style.visibility="visible";$('calendarwrapper').style.display='block';$('calendar').style.zIndex="0";onScreen=true;try
{initialFromValue=$('ctl00_CT_ContentPlaceHoder_landingSearch_depart_Landing').value;initialToValue=$('ctl00_CT_ContentPlaceHoder_landingSearch_inbound_Landing').value;setDate(cal1,initialFromValue);if(initialFromValue!='')
{setDate(cal1,initialFromValue);var cal1_yearArray=initialFromValue.split('.');var cal1_month=cal1_yearArray[1];var cal1_year=cal1_yearArray[2];var cal1_day=cal1_yearArray[0];if(cal1_yearArray[0].length==2)
{if(cal1_yearArray[0].substr(0,1)=='0')
{cal1_day=cal1_yearArray[0].substr(1,1);}
else
{cal1_day=cal1_yearArray[0];}}
if(cal1_year==new Date().getFullYear()+1)
{cal1_month=parseInt(cal1_month)+12}
else if(cal1_year==new Date().getFullYear()+2)
{cal1_month=parseInt(cal1_month)+24}
cal1.calendar(cal1_year,cal1_month,cal1_day,'cal1');cal1.showSpecificCal('select_cal1',cal1_month);cal1.setSelected($('cal1_possibleSlelecteDay_'+cal1_day),cal1_day);}
setDate(cal2,initialToValue);if(initialToValue!='')
{var cal2_yearArray=initialToValue.split('.');var cal2_year=cal2_yearArray[2];var cal2_day=cal2_yearArray[0];if(cal2_yearArray[0].length==2)
{if(cal2_yearArray[0].substr(0,1)=='0')
{cal2_day=cal2_yearArray[0].substr(1,1);}
else
{cal2_day=cal2_yearArray[0];}}
var cal2_month=cal2_yearArray[1];if(cal2_year==new Date().getFullYear()+1)
{cal2_month=parseInt(cal2_month)+12}
else if(cal2_year==new Date().getFullYear()+2)
{cal2_month=parseInt(cal2_month)+24}
cal2.calendar(cal2_year,cal2_month,cal2_day,'cal2');cal2.showSpecificCal('select_cal2',cal2_month);cal2.setSelected($('cal2_possibleSlelecteDay_'+cal2_day),cal2_day);}
if(initialToValue==''&&initialFromValue=='')
{var requestDate=new Date();requestDate=new Date(requestDate.getFullYear(),requestDate.getMonth(),requestDate.getDate());cal1.calendar(requestDate.getFullYear(),requestDate.getMonth()+1,requestDate.getDate(),'cal1',null);var toSelect_cal1='cal1_possibleSlelecteDay_'+requestDate.getDate();cal1.showSpecificCal('select_cal1',requestDate.getMonth()+1);cal1.setSelected($(toSelect_cal1),requestDate.getDate());var requestDateNew=new Date();requestDateNew=new Date(requestDate.getFullYear(),requestDate.getMonth(),requestDate.getDate()+3);cal2.calendar(requestDateNew.getFullYear(),requestDateNew.getMonth()+1,requestDateNew.getDate(),'cal2',null);var toSelect_cal2='cal2_possibleSlelecteDay_'+requestDateNew.getDate();cal2.showSpecificCal('select_cal2',requestDateNew.getMonth()+1);cal2.setSelected($(toSelect_cal2),requestDateNew.getDate());}}
catch(ex)
{}}
return true;}
else
{var fromDate=$('ctl00_CT_ContentPlaceHoder_landingSearch_depart_Landing').value;var toDate=$('ctl00_CT_ContentPlaceHoder_landingSearch_inbound_Landing').value;var fromValueArray=fromDate.split('.');var toValueArray=toDate.split('.');var fromDay=fromValueArray[0];var fromMon=fromValueArray[1];var fromYer=fromValueArray[2];var toDay=toValueArray[0];var toMon=toValueArray[1];var toYer=toValueArray[2];if(Number(cal2.year)<Number(cal1.year))
{alert('Invalid date range with YEAR parameter. Please select valid dates.');$('ctl00_CT_ContentPlaceHoder_landingSearch_depart_Landing').value='';$('ctl00_CT_ContentPlaceHoder_landingSearch_inbound_Landing').value='';return false;}
else if((cal2.year==cal1.year)&&(Number(cal2.month)<Number(cal1.month)))
{alert('Invalid date range with MONTH parameter. Please select valid dates.');$('ctl00_CT_ContentPlaceHoder_landingSearch_depart_Landing').value='';$('ctl00_CT_ContentPlaceHoder_landingSearch_inbound_Landing').value='';return false;}
else if((cal2.year==cal1.year)&&(cal2.month==cal1.month)&&(Number(cal2.day)<Number(cal1.day)))
{alert('Invalid date range with DAY parameter. Please select valid dates.');$('ctl00_CT_ContentPlaceHoder_landingSearch_depart_Landing').value='';$('ctl00_CT_ContentPlaceHoder_landingSearch_inbound_Landing').value='';return false;}
else
{$('calendarwrapper').style.display='none';$('calendarwrapper').style.visibility="hidden";onScreen=false;return true;}}}
function setDate(cal,dateString,ele)
{var dateArr=getDayMonthArray(dateString);if(dateArr&&dateArr.length)
{var day=parseInt(dateArr[0]);var month=parseInt(dateArr[1]);if(ele)
{if(cal.id=='cal2'&&(ele.id=='checkout'||ele.id=='checkin'))
{if(dateString&&dateString.length==10&&month&&day)
{var year=dateString.substr(dateString.length-4,4);var newDate=new Date(year,month-1,day);newDate.setDate(day+1);day=newDate.getDate();month=newDate.getMonth()+1;}}}
cal.calendar(null,month,day,cal.id);cal.setSelected($(cal.id+'_possibleSlelecteDay_'+day),day);}}
function getDayMonthArray(dateString)
{var dateValue=dateString.split('.');if(dateValue&&(dateValue.length)&&(parseInt(dateValue[0])>=1)&&(parseInt(dateValue[0])<=31)&&(parseInt(dateValue[1])>=1)&&(parseInt(dateValue[1])<=12))
{return dateValue;}
return null;}
SwissCalendar=function(id,containerId,title,refTextHtml,preSelected,titleImage,prevImage,nextImage,refId)
{this.id=id;this.containerId=containerId;this.title=title;this.maxDays=31;this.refTextHtml=refTextHtml;this.currentSelected;this.currentSelectElement;if(!preSelected)
preSelected=-1;this.preSelected=preSelected;this.titleImage=titleImage;this.prevImage=prevImage;this.prevImageDis=replace(prevImage,".gif","_disabled.gif");this.nextImage=nextImage;this.nextImageDis=replace(nextImage,".gif","_disabled.gif");if(!this.arrayParentControls)
this.arrayParentControls=new Array();this.refId=refId;if(refId)
{this.refObject=eval(refId);this.refObject.registerReferences(this.id);}
this.day=0;this.month=0;if(!this.id)
{alert('config problem with id!');}
if(!this.containerId)
{alert('config problem with containerId!');}
if(!this.title)
{alert('config problem with title!');}
if(!this.refTextHtml)
{alert('config problem with refTextHtml!');}}
SwissCalendar.prototype={Print:function()
{this.currentSelectElement='select_'+this.id;var buffer='';if(this.id=='cal1')
{}
buffer+='<div class="line months" style="text-align:center;">';if(this.id=='cal1')
{buffer+='<font style="font-size:13px;"><b>Früheste Hinreise</b></font><br/> ';}
else if(this.id=='cal2')
{buffer+='<hr><font style="font-size:13px;"><b>Späteste Rückreise</b></font> <br/>';}
buffer+=' <div style="padding-top:5px; text-align:center; width:100%; vertical-align:middle;"><span><a href="#" onclick=\''+this.id+'.showPrevCal("select_'+this.id+'");void(0);return false;\'>';buffer+='  <img border="0" class="arrowleft" id="'+this.id+'_arrowleft" src="'+this.prevImage+'" alt="" />';buffer+=' </a>   </span>';buffer+=' <span><select id=\'select_'+this.id+'\' onchange=\''+this.id+'.onNavigationMonthChange(this);\'></select>';buffer+='    </span><span><a href="#" onclick=\''+this.id+'.showNextCal("select_'+this.id+'");void(0);return false;\'>';buffer+='  <img border="0" class="arrowright" id="'+this.id+'_arrowright"  src="'+this.nextImage+'" alt="" />';buffer+=' </a></span></div>';buffer+='</div>';document.write(buffer);this.fillNavigationMonths('select_'+this.id);var requestDate=new Date();requestDate=new Date(requestDate.getFullYear(),requestDate.getMonth(),requestDate.getDate());if(this.preSelected>0)
{requestDate=new Date(requestDate.getFullYear(),requestDate.getMonth(),requestDate.getDate()+this.preSelected);this.calendar(requestDate.getFullYear(),requestDate.getMonth(),requestDate.getDate(),this.id,null);var toSelect=this.id+'_possibleSlelecteDay_'+requestDate.getDate();this.setSelected($(toSelect),requestDate.getDate());}
else
{requestDate=new Date(requestDate.getFullYear(),requestDate.getMonth(),requestDate.getDate());if(this.id=='cal2')
{var requestDateNew=new Date();requestDateNew=new Date(requestDate.getFullYear(),requestDate.getMonth(),requestDate.getDate()+3);this.calendar(requestDateNew.getFullYear(),requestDateNew.getMonth()+1,requestDateNew.getDate(),this.id,null);var toSelect=this.id+'_possibleSlelecteDay_'+requestDateNew.getDate();this.setSelected($(toSelect),requestDateNew.getDate());}
else
{this.calendar(requestDate.getFullYear(),requestDate.getMonth()+1,requestDate.getDate(),this.id,null);var toSelect=this.id+'_possibleSlelecteDay_'+requestDate.getDate();this.setSelected($(toSelect),requestDate.getDate());}}
this.initRefernceTextbox();if(this.month<=(new Date().getMonth()+1))
{$(this.id+'_arrowleft').src=this.prevImageDis;this.backupHref($(this.id+'_arrowleft').parentNode);}},backupHref:function(ele)
{if(ele&&ele.tagName=="A")
{var href=ele.getAttribute("href");var onclick=ele.getAttribute("onclick");if(href&&href!=""&&href!=null){ele.setAttribute('href_bak',href);}
if(onclick!=null&&onclick!="void(0);"){ele.setAttribute('onclick_bak',onclick);ele.setAttribute('onclick',"void(0);");}}},restoreHref:function(ele)
{if(ele&&ele.tagName=="A")
{if(ele.attributes['onclick_bak']!=null)
{ele.setAttribute('onclick',ele.attributes['onclick_bak'].nodeValue);}
if(ele.attributes['href_bak']!=null)
{ele.setAttribute('href',ele.attributes['href_bak'].nodeValue);}}},registerReferences:function(obj)
{if(obj)
this.arrayParentControls.push(obj);},updateDateSelection:function()
{if(this.arrayParentControls.length>0)
{for(var t=0;t<this.arrayParentControls.length;++t)
{if(this.arrayParentControls[t])
{var parentObject=eval(this.arrayParentControls[t]);if(parentObject)
{parentObject.updateDateSelection();}}}}
if($(this.id+'_possibleSlelecteDay_'+this.day))
{this.markDay($(this.id+'_possibleSlelecteDay_'+this.day));}
if(this.refObject)
{for(var x=1;x<=this.maxDays;++x)
{if($(this.id+'_possibleSlelecteDay_'+x))
{this.enableDay(x);}}
var textData=$(this.refTextHtml).value.split('.');var loc_parentDay=parseInt(this.refObject.day);if(this.refTextHtml=='checkin'||this.refTextHtml=='checkout')
{loc_parentDay=parseInt(this.refObject.day)+1;}
var loc_parentMonth=parseInt(this.refObject.month);var loc_textDay,loc_textMonth;if(textData.length>2)
{loc_textDay=parseInt(textData[0]);loc_textMonth=parseInt(textData[1]);}
if($(this.id+'_possibleSlelecteDay_'+this.day))
{this.markDay($(this.id+'_possibleSlelecteDay_'+this.day));}
if(loc_parentMonth==this.month&&parseInt(this.day)<=loc_parentDay)
{this.unmarkDay($(this.id+'_possibleSlelecteDay_'+this.day));}
var loc_tmpDay=parseInt(this.day)<=loc_parentDay?loc_parentDay:parseInt(this.day);if(loc_parentMonth<(actualDate.getMonth()+1))
{limitDate=new Date(actualDate.getFullYear()+2,loc_parentMonth-1,loc_parentDay+maxNumberOfBookableNightsKuoni);}else
{limitDate=new Date(actualDate.getFullYear(),loc_parentMonth-1,loc_parentDay+maxNumberOfBookableNightsKuoni);}
for(var d=1;d<=31;++d)
{if($(this.id+'_possibleSlelecteDay_'+d))
{if(loc_parentMonth==this.month)
{if(loc_parentDay>=d&&(this.refTextHtml=='checkin'||this.refTextHtml=='checkout'))
{this.unmarkDay($(this.id+'_possibleSlelecteDay_'+loc_tmpDay));this.day=loc_parentDay;if(d!=loc_parentDay)
{this.disableDay(d);}}else if(loc_parentDay>d)
{this.unmarkDay($(this.id+'_possibleSlelecteDay_'+loc_tmpDay));this.day=loc_parentDay;this.disableDay(d);}
else if(this.refTextHtml=='checkin'||this.refTextHtml=='checkout')
{this.unmarkDay($(this.id+'_possibleSlelecteDay_'+(d-1)));}
else
{this.unmarkDay($(this.id+'_possibleSlelecteDay_'+d));}
if(d==loc_tmpDay)
{this.markDay($(this.id+'_possibleSlelecteDay_'+loc_tmpDay));this.printFormattedTextToReference(loc_tmpDay);}else if(((d-1)==loc_tmpDay)&&(this.refTextHtml=='checkin'||this.refTextHtml=='checkout'))
{this.markDay('-1');this.printFormattedTextToReference((loc_tmpDay));}}}}}},disableDay:function(d)
{if($(this.id+'_possibleSlelecteDay_'+d))
{var href=$(this.id+'_possibleSlelecteDay_'+d).getAttribute("href");var onclick=$(this.id+'_possibleSlelecteDay_'+d).getAttribute("onclick");if(href&&href!=""&&href!=null){$(this.id+'_possibleSlelecteDay_'+d).setAttribute('href_bak',href);}
if(onclick!=null){$(this.id+'_possibleSlelecteDay_'+d).setAttribute('onclick_bak',onclick);$(this.id+'_possibleSlelecteDay_'+d).setAttribute('onclick',"void(0);");}
$(this.id+'_possibleSlelecteDay_'+d).removeAttribute('href');$(this.id+'_possibleSlelecteDay_'+d).className='';$(this.id+'_possibleSlelecteDay_'+d).parentNode.className='';$(this.id+'_possibleSlelecteDay_'+d).style.textDecoration='none';$(this.id+'_possibleSlelecteDay_'+d).parentNode.className="";$(this.id+'_possibleSlelecteDay_'+d).parentNode.disable=1;}},enableDay:function(x)
{this.unmarkDay($(this.id+'_possibleSlelecteDay_'+x));if($(this.id+'_possibleSlelecteDay_'+x)){$(this.id+'_possibleSlelecteDay_'+x).parentNode.className="possible";if($(this.id+'_possibleSlelecteDay_'+x).attributes['onclick_bak']!=null)
$(this.id+'_possibleSlelecteDay_'+x).setAttribute('onclick',$(this.id+'_possibleSlelecteDay_'+x).attributes['onclick_bak'].nodeValue);if($(this.id+'_possibleSlelecteDay_'+x).attributes['href_bak']!=null)
$(this.id+'_possibleSlelecteDay_'+x).setAttribute('href',$(this.id+'_possibleSlelecteDay_'+x).attributes['href_bak'].nodeValue);$(this.id+'_possibleSlelecteDay_'+x).style.textDecoration='underline';$(this.id+'_possibleSlelecteDay_'+x).style.fontStyle='';}},setSelected:function(link,day)
{if(this.arrayParentControls.length>0)
{for(var t=0;t<this.arrayParentControls.length;++t)
{if(this.arrayParentControls[t])
{var parentObject=eval(this.arrayParentControls[t]);if(parentObject)
{parentObject.unmarkAll();}}}}
this.unmarkAll();if($(this.currentSelected)){$(this.currentSelected).parentNode.className="possible";}
if(link)
{this.currentSelected=link.id;}
this.printFormattedTextToReference(day);if(link)
{this.markDay(link);}
this.day=day;this.updateDateSelection();return false;},markDay:function(ele)
{ele.parentNode.className="selected";ele.style.color="#fff";ele.style.textDecoration='none';},unmarkDay:function(ele)
{if(ele)
{ele.parentNode.className="possible";ele.className="possible";ele.style.color="#656565";ele.style.textDecoration='underline';}},unmarkAll:function()
{for(var x=1;x<=31;++x)
{if($(this.id+'_possibleSlelecteDay_'+x))
{this.unmarkDay($(this.id+'_possibleSlelecteDay_'+x));}}},ValidateMonth:function(intMonth){while(intMonth>12)
{intMonth=intMonth-12;}
return intMonth;},printFormattedTextToReference:function(day)
{var requestDate=new Date();if(requestDate.getMonth()+1<=this.month){requestDate=new Date(requestDate.getFullYear(),this.month-1,1);}
else{requestDate=new Date(requestDate.getFullYear()+1,this.month-1,1);}
if(this.refTextHtml&&$(this.currentSelectElement))
$(this.refTextHtml).value=this.printFormatter(day)+'.'+this.printFormatter(this.ValidateMonth(this.month))+'.'+requestDate.getFullYear();var depart=$("ctl00_CT_ContentPlaceHoder_landingSearch_depart_Landing");try
{if((depart.value=='')||(depart.value=='All'))
{var currentDate=new Date();var Today=this.printFormatter(currentDate.getDate())+'.'+this.printFormatter((currentDate.getMonth())+1)+'.'+currentDate.getFullYear();depart.value=Today;}}
catch(ex)
{}},printFormatter:function(val)
{if(val)
{var tmp=parseInt(val);if(tmp>9)
return tmp;else
return'0'+tmp;}},initRefernceTextbox:function()
{var day,month;var textData=$(this.refTextHtml).value.split('.');if(textData.length>2)
{day=parseInt(textData[0],10);month=parseInt(textData[1],10);}
if(!isNaN(day)&&!isNaN(month))
{if(day==0)
day=this.day;}},printMonth:function(ele,month){ele=$(ele);var requestDate=new Date();if(requestDate.getMonth()+1<=month){requestDate=new Date(requestDate.getFullYear(),month-1,1);}
else{requestDate=new Date(requestDate.getFullYear()+1,month-1,1);}
this.calendar(requestDate.getFullYear(),requestDate.getMonth()+1,requestDate.getDate(),this.id,null);},toggleMonthSelection:function(dir,val){if(dir){if(val){$(this.id+'_arrowright').src=this.nextImage;this.restoreHref($(this.id+'_arrowright').parentNode);}
else{$(this.id+'_arrowright').src=this.nextImageDis;this.backupHref($(this.id+'_arrowright').parentNode);}}
else{if(val){$(this.id+'_arrowleft').src=this.prevImage;this.restoreHref($(this.id+'_arrowleft').parentNode);}
else{$(this.id+'_arrowleft').src=this.prevImageDis;this.backupHref($(this.id+'_arrowleft').parentNode);}}
var toSelect=this.id+'_possibleSlelecteDay_'+new Date().getDate();this.setSelected($(toSelect),new Date().getDate());},activateMonthSelection:function()
{if(parseInt($('select_'+this.id).selectedIndex)==0)
{this.toggleMonthSelection(false,false);this.toggleMonthSelection(true,true);}
else if(parseInt($('select_'+this.id).selectedIndex)==monthCount)
{this.toggleMonthSelection(true,false);this.toggleMonthSelection(false,true);}
else
{this.toggleMonthSelection(true,true);this.toggleMonthSelection(false,true);}},checkMonthStep:function(val)
{return val;},showPrevCal:function(ele)
{setDropDownValue($(ele),this.checkMonthStep(parseInt($(ele).options[$(ele).selectedIndex].value)-1));this.onNavigationMonthChange($(ele));},showNextCal:function(ele)
{setDropDownValue($(ele),this.checkMonthStep(parseInt($(ele).options[$(ele).selectedIndex].value)+1));this.onNavigationMonthChange($(ele));},showSpecificCal:function(ele,month)
{setDropDownValue($(ele),month);this.onNavigationMonthChange($(ele));},showSpecCal:function(ele,month)
{setDropDownValue($(ele),month);this.onNavigationMonthChange($(ele));},onNavigationMonthChange:function(ele)
{var setMark=false;if(this.month==$(ele).options[$(ele).selectedIndex].value)
{setMark=true;}
this.printMonth(ele,$(ele).options[$(ele).selectedIndex].value);this.month=$(ele).options[$(ele).selectedIndex].value;if(this.arrayParentControls.length>0)
{for(var t=0;t<this.arrayParentControls.length;++t)
{if(this.arrayParentControls[t])
{var parentObject=eval(this.arrayParentControls[t]);if(parentObject)
{if(parentObject.month<this.month)
{parentObject.showSpecificCal('select_'+parentObject.id,this.month);}}}}}
this.activateMonthSelection();if(setMark)
{this.markDay($(this.id+'_possibleSlelecteDay_'+this.day));}
if(this.refTextHtml=='checkin'||this.refTextHtml=='checkout')
{if(this.refTextHtml=='checkout')
{if(actualDate!=limitDate)
{if((limitDate.getMonth()+1)>=(actualDate.getMonth()+1))
{if(Number(this.month)>(limitDate.getMonth()+1))
{try
{for(var i=1;i<32;++i)
{this.disableDay(i);}}catch(e)
{}}else if(Number(this.month)<(limitDate.getMonth()+1))
{if(Number(this.month)<actualDate.getMonth()+1)
{try
{for(var i=1;i<32;++i)
{this.disableDay(i);}}catch(e)
{}}}else
{try
{for(var i=limitDate.getDate()+1;i<32;++i)
{this.disableDay(i);}}catch(e)
{}}}
else
{if(Number(this.month)<limitDate.getMonth()+1)
{}
else if(Number(this.month)==limitDate.getMonth()+1)
{try
{for(var i=limitDate.getDate()+1;i<32;++i)
{this.disableDay(i);}}catch(e)
{}}
else if(actualDate.getMonth()+1<=Number(this.month))
{}
else if(Number(this.month)>limitDate.getMonth()+1)
{try
{for(var i=1;i<32;++i)
{this.disableDay(i);}}catch(e)
{}}else
{}}}
else
{}}
if($(ele).selectedIndex==(maxCheckInNumberOfMonthKuoni-1))
{var calcDate=new Date();var starttime=new Date(calcDate.getFullYear(),calcDate.getMonth(),calcDate.getDate());for(var i=starttime.getDate();i<32;++i)
{this.disableDay(i);}}else if($(ele).selectedIndex>(maxCheckInNumberOfMonthKuoni-1))
{try{for(var i=1;i<32;++i)
{this.disableDay(i);}}catch(e)
{}}}
else if($(ele).selectedIndex==11)
{var calcDate=new Date();var starttime=new Date(calcDate.getFullYear(),calcDate.getMonth(),calcDate.getDate());var dateSpan=339;starttime=new Date(starttime.valueOf()+(dateSpan*86400000));}
monthChanged();},fillNavigationMonths:function(ele)
{var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var twoDiggitYear=today.getFullYear().toString();var maxMonth=monthCount;var currMonthSRS=today.getMonth()+1;for(var i=0;i<=maxMonth;++i){$(ele).options[i]=new Option(calendarData.short_month[today.getMonth()]+' '+twoDiggitYear.substring(2,4),currMonthSRS);currMonthSRS++;today=new Date(today.getFullYear(),today.getMonth()+1,1);twoDiggitYear=today.getFullYear().toString();}},calendar:function(year,month,day,ContainerId)
{this.month=month;var calDate=new Date();var tmpToday=calDate.getDate();var tmpMonth=calDate.getMonth();var tmpYear=calDate.getFullYear();var calYear=(year==null)?calDate.getFullYear():year;var calMte=(month==null)?calDate.getMonth():month-1;while(calMte<0)
{calMte+=12;calYear--;}
while(calMte>=12)
{calMte-=12;calYear++;}
var calDay=(day==null)?0:day;calDate=new Date(calYear,calMte,1);NextMonth=new Date(calYear,calMte+1,1);var firstDayOfMonth=new Date(calDate.getFullYear(),calDate.getMonth(),1);var weekDaysArray=new Array(6,0,1,2,3,4,5);WeekStart=weekDaysArray[firstDayOfMonth.getDay()];MonthDays=Math.round((NextMonth.getTime()-calDate.getTime())/86400000)+1;if(ContainerId!=null)
{ContainerId=ContainerId;Container=document.getElementById(ContainerId);if(!Container)
document.write('<div  id="'+ContainerId+'"> </div>');}
else
{do
{ContainerId='tblCalendar'+Math.round(Math.random()*1000);}
while(document.getElementById(ContainerId));document.write('<div id="'+ContainerId+'"> </div>');}
Container=document.getElementById(ContainerId);HTML='<table>';HTML+='<tr>';HTML+=' <th>'+calendarData.short_days[1]+'</th>';HTML+=' <th>'+calendarData.short_days[2]+'</th>';HTML+=' <th>'+calendarData.short_days[3]+'</th>';HTML+=' <th>'+calendarData.short_days[4]+'</th>';HTML+=' <th>'+calendarData.short_days[5]+'</th>';HTML+=' <th>'+calendarData.short_days[6]+'</th>';HTML+=' <th>'+calendarData.short_days[0]+'</th>';HTML+='</tr>';HTML+='<tr>';for(DayCounter=0;DayCounter<WeekStart;DayCounter++)
{HTML+='<td> </td>';}
for(DayCounter=1;DayCounter<MonthDays;DayCounter++)
{if((DayCounter+WeekStart)%7==1)
HTML+='<tr>';if(tmpMonth==calMte&&(DayCounter<tmpToday)&&(tmpYear==calYear))
{HTML+='<td class="" style=" color: #656565;font-weight: bold;">'+DayCounter+'</td>';}
else if(DayCounter==calDay)
{HTML+='<td class="possible"><a href="#" id="'+this.id+'_possibleSlelecteDay_'+DayCounter+'" onclick="'+this.id+'.setSelected(this, \''+DayCounter+'\');return false;">'+DayCounter+'</a></td>';}
else
{HTML+='<td class="possible"><a href="#" id="'+this.id+'_possibleSlelecteDay_'+DayCounter+'" onclick="'+this.id+'.setSelected(this, \''+DayCounter+'\');return false;">'+DayCounter+'</a></td>';}
if((DayCounter+WeekStart)%7==0)
HTML+='</tr>';}
for(j=(42-(MonthDays+WeekStart)),DayCounter=0;DayCounter<=j;DayCounter++)
{HTML+='<td> </td>';if((j-DayCounter)%7==0)HTML+='</tr>';}
HTML+='</table>';Container.innerHTML=HTML;return ContainerId;},updateRefTextHtml:function(elementName)
{this.refTextHtml=elementName;}}
var debugMode=false;var homeDomain="www.swiss.com";var cookieDomain="swiss.com";var cookieLanguageName='XLANGXCCVD';var serverProtocol="http";if(window.location.protocol=="https:"){serverProtocol="https";}
var formSubmitMethod='post';var formSubmitAction='index.aspx';var formSubmitOnSubmit='javascript:return WebForm_OnSubmit();';var formDestination='';var formAdult=1;var formChildern=0;var formOutbound='';var formInbound='';var popupChecked=false;var submitUrlSwiss="http://booking.swiss.com/web/bbf.htm?";var submitUrlAffiliates="://booking.swiss.com/web/partner.htm?";var submitUrlKuoni="http://booking.swiss.com/web/Loader.aspx?";var submitUrlKuoniTrack="http://booking.swiss.com/web/goto.aspx?WT.ac=Kuoni_QuickSearch&WT.ad=Kuoni_QuickSearch&target=";var maxNumberOfBookableNightsKuoni=40;var maxCheckInNumberOfMonthKuoni=12;var gDomain="webtrends.swiss.com";var autoPresenterTracking=false;var milesAndMoreEuropcar=new Array();milesAndMoreEuropcar[0]='42398133';milesAndMoreEuropcar[1]='48338383';milesAndMoreEuropcar[2]='81511974';milesAndMoreEuropcar[3]='81511974';milesAndMoreEuropcar[4]='81511974';var milesAndMoreAvis=new Array();milesAndMoreAvis[0]='W155400';milesAndMoreAvis[1]='X753100';milesAndMoreAvis[2]='X753500';milesAndMoreAvis[3]='X753700';milesAndMoreAvis[4]='X753900';if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
