
var FBRESA="http://www.fastbookings.biz/DIRECTORY/";var FB_nb_day_delay=7;var FB_book_image=new Image();function start(){var nbm=[31,28,31,30,31,30,31,31,30,31,30,31];build_year_select();MD=new Date();nday=MD.getDate();aday=MD.getDay();amois=MD.getMonth();ayear=takeYear(MD);cur_year=ayear;nday+=FB_nb_day_delay;if(nday>nbm[amois])
{nday-=nbm[amois];amois++;if(amois>11){ayear++;amois=0;}}
indexDay=nday-1;indexMois=amois;indexYear=ayear-cur_year;if(indexDay<0||indexDay>30)
indexDay=0;if(indexMois<0||indexMois>11)
indexMois=0;if(indexYear<0||indexYear>1)
indexDay=0;document.idForm.fromday.selectedIndex=indexDay;document.idForm.frommonth.selectedIndex=indexMois;document.idForm.fromyear.selectedIndex=indexYear;update_departure();}
function hhotelPTC(cname,lg,codeprice,codetrack,cluster)
{hhotelResa(cname,lg,codeprice,"","",codetrack,cluster,"","")}
function hhotelPromo(cname,lg,theme)
{hhotelResa(cname,lg,"DYNPROMO","","","","",theme,"")}
function hhotelOnePromo(cname,lg,codeprice,codetrack,cluster)
{hhotelResa(cname,lg,codeprice,"","",codetrack,cluster,"","style=DIRECTPROMO")}
function hhotelNegociated(cname,lg,codeprice,codetrack,cluster)
{hhotelResa(cname,lg,codeprice,"","",codetrack,cluster,"","negociated=1");}
function hhotelResaDirect(cname,lg,codeprice,firstroom,codetrack,firstdate)
{hhotelResa(cname,lg,codeprice,firstroom,firstdate,codetrack,"","","style=DIRECT");}
function hhotelSearchGroup(cluster,lg,price,nights,title)
{hhotelSearch(cluster,lg,price,nights,title,"","");}
function hhotelSearchPartner(cluster,lg,price,codetrack,title)
{if(codetrack!="")args="&from="+codetrack;else args="";hhotelSearch(cluster,lg,price,"",title,"",args);}
function hhotelSearchPriceDate(cluster,price,nights,title,firstdate)
{var args="";if(firstdate!="")args="FirstDate="+firstdate;hhotelSearch(cluster,"",price,nights,title,"",args);}
function hhotelSearchPriceDateTrack(cluster,lg,price,codetrack,nights,title,firstdate)
{var args="";if(codetrack!="")args="from="+codetrack;if(firstdate!="")args+="&FirstDate="+firstdate;hhotelSearch(cluster,lg,price,nights,title,"",args);}
function hhotelSearchPromo(cluster,lg,theme)
{hhotelSearch(cluster,lg,"","","",theme,"");}
function hhotelSearchExtra(cluster,lg,price,codetrack,extratitle,extraval,extrashow)
{var args="Extrafield="+escape(extratitle)+";"+extraval+";"+extrashow;if(codetrack!="")args+="&from="+codetrack;hhotelSearch(cluster,lg,price,"","","",args);}
function hhotelcancel(cname,lg)
{var waction=FBRESA+"cancel.phtml?state=77&Hotelnames="+cname;if(lg!="")waction+="&langue="+lg;window.open(waction,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");}
function hhotelExtract(cname,lg)
{var waction=FBRESA+"getresa.phtml?Hotelnames="+cname+"&langue="+lg;window.open(waction,'getresa','toolbar=no,width=700,height=300,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes');return false;}
function hhotelcheckrates(cname,lg)
{var waction=FBRESA+"crs.phtml?clusterName="+cname;if(lg!="")waction+="&langue="+lg;waction+="&checkPromo=1";window.open(waction,"search","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");}
var FB_code_interface="";var FB_profil="";function hhotelProfil(code_interface,profil)
{FB_code_interface=code_interface;FB_profil=profil;}
function hhotelResa(cname,lg,codeprice,firstroom,firstdate,codetrack,cluster,theme,args)
{var waction=FBRESA+"preresa.phtml?Hotelnames="+cname;if(lg!="")waction+="&langue="+lg;if(firstroom!=""){waction+="&FirstRoomName="+firstroom;if(codeprice=="")
codeprice="DIRECT";}
if(firstdate!=""){waction+="&FirstDate="+firstdate;if(codeprice=="")
codeprice="DIRECT";}
if(codeprice!="")waction+="&FSTBKNGCode="+codeprice;if(codetrack!="")waction+="&FSTBKNGTrackLink="+codetrack;if(cluster!="")waction+="&clustername="+cluster;if(theme!="")waction+="&theme="+theme;if(args!=""&&(args.indexOf("=")!=-1))waction+="&"+args;if(FB_profil!=""){waction+="&code="+FB_code_interface;waction+="&profil="+FB_profil;}
waction+="&HTTP_REFERER="+escape(document.location.href);window.open(waction,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");}
function hhotelSearch(cluster,lg,price,nights,title,theme,args)
{var waction=FBRESA+"crs.phtml?clusterName="+cluster;if(lg!="")waction+="&langue="+lg;if(price!="")waction+="&FSTBKNGCode="+price;if(nights!="")waction+="&nights="+nights;if(title!="")waction+="&title="+escape(title);if(theme!="")waction+="&theme="+theme;if(args!=""&&(args.indexOf("=")!=-1))waction+="&"+args;if(FB_profil!=""){waction+="&code="+FB_code_interface;waction+="&profil="+FB_profil;}
window.open(waction,"search","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");}
function hhotelSearchMultCode(cluster,lg,clecode,title,codetrack)
{var waction=FBRESA+"crs.phtml?clusterName="+cluster;if(lg!="")waction+="&langue="+lg;if(clecode!="")waction+="&AccessCode="+clecode;if(title!="")waction+="&title="+escape(title);if(codetrack!="")waction+="&FSTBKNGTrackLink="+codetrack;waction+="&crossSelling=NO";if(FB_profil!=""){waction+="&code="+FB_code_interface;waction+="&profil="+FB_profil;}
window.open(waction,"search","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");}
function hhotelSearchCrossSell(cluster,lg,codetrack,crossSelling)
{var waction=FBRESA+"crs.phtml?clusterName="+cluster;if(lg!="")waction+="&langue="+lg;if(codetrack!="")waction+="&FSTBKNGTrackLink="+codetrack;if(crossSelling!="")waction+="&crossSelling="+crossSelling;if(FB_profil!=""){waction+="&code="+FB_code_interface;waction+="&profil="+FB_profil;}
window.open(waction,"search","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");}
function hhotelDispopriceFHP(cname,lg,codetrack,year,month,day,nights,currency)
{var waction=FBRESA+"dispoprice.phtml?clusterName="+cname+"&Hotelnames="+cname;if(lg!="")waction+="&langue="+lg;if(codetrack!="")waction+="&FSTBKNGTrackLink="+codetrack;if(year!="")waction+="&fromyear="+year;if(month!="")waction+="&frommonth="+month;if(day!="")waction+="&fromday="+day;if(nights!="")waction+="&nbdays="+nights;if(currency!="")waction+="&CurrencyLabel="+currency;waction+="&showPromotions=3";if(FB_profil!=""){waction+="&code="+FB_code_interface;waction+="&profil="+FB_profil;}
window.open(waction,"reservation","toolbar=no,width=750,height=600,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");}
function hhotelDispoprice(myForm)
{hhotelFormValidation(myForm,0);}
function hhotelFormValidation(myForm,mandatoryCode){if(mandatoryCode==1&&myForm.AccessCode.value==""){alert("You must type in your code ID");return(false);}
var languetype=typeof myForm.action;myForm.action=FBRESA+"dispoprice.phtml";window.open('','dispoprice','toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes');myForm.submit();return(true);}
function hhotelFormUpdateHotelnames(myForm)
{menuNum=myForm.HotelList.selectedIndex;if(menuNum==null)
return;myForm.Hotelnames.value=myForm.HotelList.options[menuNum].value;}
function hhotelFormCancel(myForm){var CName=myForm.Hotelnames.value;var languetype=typeof myForm.langue;var langue;if(languetype=="undefined")
langue="";else
langue=myForm.langue.value;if(CName==null||CName=='All'||CName==''){alert('Please select a hotel first');return(false);}
return hhotelcancel(CName,langue);}
function hhotelFormExtract(myForm)
{var CName=myForm.Hotelnames.value;var languetype=typeof myForm.langue;var langue;if(languetype=="undefined")
langue="";else
langue=myForm.langue.value;if(CName==null||CName=='All'||CName==''){alert('Please select a hotel first');return(false);}
return hhotelExtract(CName,langue);}
function hhotelShowLang(lang)
{hhotelShowLang__(this.document,lang);}
function hhotelShowLangOpener(lang)
{hhotelShowLang__(window.opener.document,lang);window.close();}
function hhotelShowLang__(mydoc,lang)
{mydoc.idForm.langue.value=lang;var imgLang=hhotelLang2Img(lang);if(imgLang!=""){var formFlag=mydoc.selLgFlag;if(formFlag!=null)
mydoc.selLgFlag.src="fastbooking/flags/"+imgLang+".gif";var formFlag=mydoc.selLgTxt;if(formFlag!=null)
mydoc.selLgTxt.src="fastbooking/flags/"+imgLang+"lg.gif";}}
var FBLangCode=new Array("uk","france","germany","spain","portuguese","italy","nether","russian","dansk","svensk","islensk","norsk","turk","hungria","greek","arab","china","coreen","japan","croate","czech","poland");var FBLangImg=new Array("grandbret","france","germany","spain","portuguese","italy","nether","russia","denmark","sweeden","iceland","norway","turkey","hungary","greek","arab","china","coreen","japan","croate","czech","poland");function hhotelLang2Img(lang)
{for(i=0;i<FBLangCode.length;i++){if(FBLangCode[i]==lang)
break;}
return FBLangImg[i];}
function hhotelLangSelector()
{window.open('fastbooking/flags/langSelector.html','','width=330,height=180');}
var langcodes=new Array("en","uk","fr","france","de","germany","es","spain ","pt","portuguese","it","italy","nl","nether","ja","japan ","ko","coreen","zh","china","ar","arab","ru","russian","tr","turk","el","greek","hu","hungria","da","dansk","sv","svensk","is","islensk","no","norsk","hr","croate","cs","czech","pl","poland","iw","hebrew");function selectLang()
{if(navigator.appName=="Microsoft Internet Explorer")UL=navigator.userLanguage.substring(0,2);else if(navigator.appName=="Netscape")UL=navigator.language;else return;for(i=0;i<langcodes.length;i+=2)
if(UL==langcodes[i])
break;lang=(i<langcodes.length)?langcodes[i+1]:"uk";hhotelShowLang(lang);}
function build_year_select(){var cur_date=new Date();var cur_year=takeYear(cur_date);cur_y=new Option(cur_year,cur_year,true,true);document.idForm.fromyear.options[0]=cur_y;if(document.idForm.toyear!=null){cur_yb=new Option(cur_year,cur_year,true,true);document.idForm.toyear.options[0]=cur_yb;}
next_y=new Option(cur_year+1,cur_year+1,false,false);document.idForm.fromyear.options[1]=next_y;next_yb=new Option(cur_year+1,cur_year+1,false,false);if(document.idForm.toyear!=null){document.idForm.toyear.options[1]=next_yb;}}
function check_departure(){if(document.idForm.today!=null){var nbm=[31,28,31,30,31,30,31,31,30,31,30,31];var ar_day=parseInt(document.idForm.fromday.value)+1;var ar_month=parseInt(document.idForm.frommonth.value);var ar_year=parseInt(document.idForm.fromyear.value);if(ar_day>nbm[ar_month-1]){ar_day=1;ar_month+=1;if(ar_month>12){ar_month=1;ar_year+=1;}}
var cur_date=new Date();var cur_year=takeYear(cur_date);document.idForm.today.selectedIndex=ar_day-1;document.idForm.tomonth.selectedIndex=ar_month-1;document.idForm.toyear.selectedIndex=ar_year-cur_year;}}
function update_departure(){if(document.idForm.today!=null){var ar_day=parseInt(document.idForm.fromday.value)+1;var ar_month=parseInt(document.idForm.frommonth.value);var ar_year=parseInt(document.idForm.fromyear.value);var de_day=parseInt(document.idForm.today.value)+1;var de_month=parseInt(document.idForm.tomonth.value);var de_year=parseInt(document.idForm.toyear.value);if(de_year<ar_year){check_departure();}else{if(de_year==ar_year){if(de_month<ar_month){check_departure();}else{if(de_month==ar_month){if(de_day<=ar_day){check_departure();}}}}}}}
function takeYear(theDate)
{x=theDate.getYear();var y=x%100;y+=(y<38)?2000:1900;return y;}
function popup(url)
{window.open(url,"","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");}
var day_ar=["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"];var month_ar=["Janvier","Fevrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre"];var days_month_ar=[31,28,31,30,31,30,31,31,30,31,30,31];var old_mousedown_hdl;var g_day_element,g_month_element,g_year_element;var g_sync_elt;var g_offset_x=4;var g_offset_y=8;function calendarPos(obj){this.x=g_offset_x;this.y=g_offset_y;if(obj){if(obj.offsetParent){this.x+=obj.offsetLeft;this.y+=obj.offsetTop;while(obj=obj.offsetParent){this.x+=obj.offsetLeft;this.y+=obj.offsetTop;}}}}
function SelElement(elt){this.elt=elt;this.value=parseInt(elt.options[elt.selectedIndex].value);}
function CalSyncElement(day_elt,month_elt,year_elt){this.day=new SelElement(day_elt);this.month=new SelElement(month_elt);this.year=new SelElement(year_elt);}
function getIdProperty(id,property){var styleObject=document.getElementById(id);if(styleObject!=null)
{styleObject=styleObject.style;if(styleObject[property])
{return styleObject[property];}}
return null;}
function setIdProperty(id,property,value)
{var styleObject=document.getElementById(id);if(styleObject!=null)
{styleObjectStyle=styleObject.style;if(styleObjectStyle[property]){styleObjectStyle[property]=value;}}}
function do_show_calendar(){if(getIdProperty("calendar_frame","display")!='block')
setIdProperty("calendar_frame","display","block");}
function do_hide_calendar(){if(getIdProperty("calendar_frame","display")=='block')
setIdProperty("calendar_frame","display","none");}
function show_calendar(a_event,src_elt,day_element,month_element,year_element){g_sync_elt=new CalSyncElement(day_element,month_element,year_element);a_elt=document.getElementById("calendar");if(a_elt!=null){a_point=new calendarPos(src_elt);setIdProperty("calendar","top",a_point.y+"px");setIdProperty("calendar","left",a_point.x+src_elt.width+"px");do_show_calendar();build_month_select();var iframe=document.getElementById("iframe");iframe.style.width=a_elt.offsetWidth;iframe.style.height=a_elt.offsetHeight;iframe.style.left=a_elt.offsetLeft;iframe.style.top=a_elt.offsetTop;if(document.addEventListener){document.addEventListener("mousedown",track_mouse_down,true);}
else if(document.attachEvent){cal_content=document.getElementById("calendar");cal_content.attachEvent("onmousedown",track_mouse_downie);document.attachEvent("onmousedown",track_hide_calendar);}else{old_mousedown_hdl=document.onmousedown;document.onmousedown=track_mouse_down;}}}
function hide_calendar(){do_hide_calendar();if(document.removeEventListener)
document.removeEventListener("mousedown",track_mouse_down,true);else if(document.detachEvent){cal_content=document.getElementById("calendar");cal_content.detachEvent("onmousedown",track_mouse_downie);document.detachEvent("onmousedown",track_hide_calendar);}
else
document.onmousedown=old_mousedown_hdl;}
function track_mouse_down(evt){cal_elt=document.getElementById("calendar");tgt=evt.target;if(tgt==cal_elt)
return;if(tgt.offsetParent){while(tgt=tgt.offsetParent){if(tgt==cal_elt)
return;}}
hide_calendar();}
function track_mouse_downie(evt){evt.cancelBubble=true;}
function track_hide_calendar(evt){hide_calendar();}
function build_month_select(){if(g_sync_elt.month!=undefined){month_val=parseInt(g_sync_elt.month.value);if(month_val<=9){month_str="0"+month_val;}else{month_str=String(month_val);}
year_val=g_sync_elt.year.value;select_str=month_str+year_val;}
document.calendar_form.calendar_month.options.length=0;var current_date=new Date();var cur_year=current_date.getFullYear();var cur_month=current_date.getMonth();select_month=cur_month;tot_month=12+(12-cur_month);for(i=0;i<tot_month;i++){label=month_ar[cur_month]+" ";label=label+cur_year;if(cur_month<9)
val="0"+(cur_month+1);else
val=String(cur_month+1);val=val+cur_year;if(val==select_str){is_selected=true;select_month=cur_month;}
else
is_selected=false;a_option=new Option(label,val,false,is_selected);document.calendar_form.calendar_month.options[i]=a_option;cur_month++;if(cur_month==12){cur_month=0;cur_year++;}}
build_days_array(month_val-1,year_val);}
function build_days_array(a_month,a_year){a_date=new Date(a_year,a_month,1,1,1,1);if(((a_month+1)==g_sync_elt.month.value)&&(a_year==g_sync_elt.year.value))
can_select=true;else
can_select=false;today=new Date();today_day=today.getDate();today_month=today.getMonth();today_year=today.getFullYear();day_of_week=a_date.getDay();index_day=1;inner_str="<table class='cal_class'><tr>"
inner_str=inner_str+build_day_line();inner_str=inner_str+"<\/tr><tr>";for(i=0;i<7;i++){str="<td class='cal_td'>";if(i<day_of_week)
str=str+"&nbsp;";else{active_day=((a_year>today_year)||(a_month>today_month)||(index_day>=today_day))?true:false;if(active_day&&can_select&&(index_day==g_sync_elt.day.value))
style_elt=" style='background-color: #aaaaaa;'";else
style_elt="";if(active_day){str=str+"<span class='cal_text'"+style_elt+">";str=str+"<a href='javascript:void(0);' onclick='do_select_day(";str=str+index_day;str=str+")'>";str=str+index_day;str=str+"<\/a>";str=str+"<\/span>";}else{str=str+"<span style='text-decoration: line-through'>";str=str+index_day;str=str+"<\/span>";}
index_day++;}
str=str+"<\/td>";inner_str=inner_str+str;}
inner_str=inner_str+"<\/tr>";do_loop=true;max_day=days_month_ar[a_month];if((a_year%4==0)&&(a_month==1))
max_day++;while(do_loop){inner_str=inner_str+"<tr>";for(i=0;i<7;i++){str="<td class='cal_td'>";if(index_day>max_day)
str=str+"&nbsp;";else{active_day=((a_year>today_year)||(a_month>today_month)||(index_day>=today_day))?true:false;if(active_day&&can_select&&(index_day==g_sync_elt.day.value))
style_elt=" style='background-color: #aaaaaa;'";else
style_elt="";if(active_day){str=str+"<span class='cal_text'"+style_elt+">";str=str+"<a href='javascript:void(0);' onclick='do_select_day(";str=str+index_day;str=str+")'>";str=str+index_day;str=str+"<\/a>";str=str+"<\/span>";}else{str=str+"<span style='text-decoration: line-through'>";str=str+index_day;str=str+"<\/span>";}
index_day++;if(index_day>max_day)
do_loop=false;}
str=str+"<\/td>";inner_str=inner_str+str;}
inner_str=inner_str+"<\/tr>";}
inner_str=inner_str+"<\/table>";daynums_elt=document.getElementById("cal_days");daynums_elt.innerHTML=inner_str;}
function build_day_line(){var str="";var ct=day_ar.length;for(i=0;i<ct;i++){str=str+"<td class='cal_td'>";str=str+day_ar[i];str=str+"<\/td>";}
return str;}
function do_month_change(){var val=document.calendar_form.calendar_month.value;a_month=parseInt(val.substr(0,2),10);a_year=parseInt(val.substr(2,4),10);build_days_array(a_month-1,a_year);}
function do_next_month(){var idx=document.calendar_form.calendar_month.selectedIndex;if(idx<(document.calendar_form.calendar_month.options.length-1)){document.calendar_form.calendar_month.selectedIndex=++idx;do_month_change();}}
function do_prev_month(){var idx=document.calendar_form.calendar_month.selectedIndex;if(idx>0){document.calendar_form.calendar_month.selectedIndex=--idx;do_month_change();}}
function do_select_day(day_index){var val=document.calendar_form.calendar_month.value;a_month=parseInt(val.substr(0,2),10);a_year=parseInt(val.substr(2,4),10);if(g_sync_elt.month!=undefined){g_sync_elt.day.elt.value=day_index;g_sync_elt.month.elt.value=a_month;g_sync_elt.year.elt.value=a_year;}
hide_calendar();}