data_win=0;
function data_win_do_bis(data,hotel) {
   if(!policies_to_generate||!eval("policies_to_generate.".concat(hotel))) return false;
   html=[
      '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
      '<!-- xhtml 1.0 strict validated by w3.org :: copyright llllllllllllllll.com 2008 :: for any other use, please contact llllllllllllllll for agreement -->',
      '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'+policies_info.language+'" lang="'+policies_info.language+'" dir="'+policies_info.language_dir+'">',
      '<head><title>'+policies_info.title+'</title>',
      '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',
      '<meta http-equiv="content-language" content="'+policies_info.language+'" />',
      '<link rel="stylesheet" type="text/css" href="'+policies_info.css+'.css" />',
      '</head><body>',
      eval("policies_to_generate.".concat(hotel)),
      '</body></html>'];
   html=html.join("").split("/");
   if(!data_win||!data_win.open||data_win.closed) data_win=window.open("","data_win","width=600,innerWidth=600,height=450,innerHeight=450,resizable=1,location=1,menubar=1,toolbar=1,scrollbars=1");
   if(data_win && data_win.open && !data_win.closed) {
      data_win.location.href=data;data_win.document.open("text/html","replace");
      for(i=0;i<html.length-1;i++)  data_win.document.write(html[i],"/");data_win.document.write(html[html.length-1]);
      data_win.document.close();data_win.focus();};
   return false;}
function data_win_do(data) {   
   if(!data_win||!data_win.open||data_win.closed) data_win=window.open("","data_win","width=600,innerWidth=600,height=450,innerHeight=450,resizable=1,location=1,menubar=1,toolbar=1,scrollbars=1");
   if(data_win && data_win.open && !data_win.closed) {
      data_win.location.href=data;data_win.focus();}}
function booking_treat(data) {
   document.getElementById("booking_process_step").value=data;
   document.getElementById("booking_process").action+=window.location.search;
   document.getElementById("booking_process").submit();}
function booking_step(step_data) {
   steps=["dates","rooms","emailrequest","order","details","offer","final","book_final"];
   for(i=0;i<steps.length;i++) {
      if(document.getElementById("step_"+steps[i])) document.getElementById("step_"+steps[i]).style.borderColor=document.getElementById("step_"+steps[i]).style.backgroundColor=(steps[i]==step_data)?"#a60000":"#d6d4d4";
      if(document.getElementById("booking_"+steps[i])) document.getElementById("booking_"+steps[i]).style.display=(steps[i]!=step_data)?"none":(!window.getComputedStyle)?"block":"table";}}
function switch_treat_hotel_language(data) {
   data=data.split(",");x="";
   if(window.location.search) {
      x=window.location.search.substr(1).split("&");
      for(i=0;i<x.length;i++) {y=x[i].split("=");if(y[0]=="lang") x[i]="lang="+data[1];};
      x="?"+x.join("&");};
   window.location=data[0]+x;}      
function booking_end(booking_form,data) {
   i=0;while(i<document.getElementById(booking_form+"_end_date").length) document.getElementById(booking_form+"_end_date").options[i]=null;
   data_ori=data.split("-");year=data_ori[0];month=data_ori[1];day=data_ori[2];
   dates_arr_cur=eval("dates_arr[1].".concat("m",year,month));
   if(dates_arr_cur[dates_arr_cur.length-1][1]==data) {
      day="01";
      if(month==12) {year=parseInt(year,10)+1;month="01";}
      else {month=(parseInt(month,10)<9)?"0"+(parseInt(month,10)+1):parseInt(month,10)+1;}}
   else {day=(8<parseInt(day,10))?parseInt(day,10)+1:"0"+(parseInt(day,10)+1);};
   dates_arr_cur=0;day_ind_cur=-1;
   for(i=0;i<30;i++) {
      if(!dates_arr_cur) {
         dates_arr_cur=eval("dates_arr[1].".concat("m",year,month));
         if(month!=data_ori[1]) {
            for(j=0;j<dates_arr[0].length;j++) {
               if(dates_arr[0][j][1]!="m"+year+month) continue;
               document.getElementById(booking_form+"_end_date").options[document.getElementById(booking_form+"_end_date").length]=new Option(dates_arr[0][j][0],"",false,false);
               document.getElementById(booking_form+"_end_date").options[document.getElementById(booking_form+"_end_date").length-1].setAttribute("class","month");
               document.getElementById(booking_form+"_end_date").options[document.getElementById(booking_form+"_end_date").length-1].setAttribute("className","month");
               document.getElementById(booking_form+"_end_date").options[document.getElementById(booking_form+"_end_date").length-1].disabled=true;}}};
      if(!dates_arr_cur) break;
      if(day_ind_cur==-1) {
         for(j=0;j<dates_arr_cur.length;j++) {
            if(dates_arr_cur[j][1]=="".concat(year,"-",month,"-",day)) {
               day_ind_cur=j;break;}}};
      if(day_ind_cur==-1) break;
      document.getElementById(booking_form+"_end_date").options[document.getElementById(booking_form+"_end_date").length]=new Option(dates_arr_cur[day_ind_cur][0],dates_arr_cur[day_ind_cur][1],(!i)?true:false,(!i)?true:false);
      if(dates_arr_cur[day_ind_cur][2]) {
         document.getElementById(booking_form+"_end_date").options[document.getElementById(booking_form+"_end_date").length-1].setAttribute("class","we");
         document.getElementById(booking_form+"_end_date").options[document.getElementById(booking_form+"_end_date").length-1].setAttribute("className","we");};
      ++day_ind_cur;
      if(day_ind_cur==dates_arr_cur.length) {
         dates_arr_cur=0;day_ind_cur=-1;day="01";
         if(month==12) {year=parseInt(year,10)+1;month="01";}
         else {month=(8<parseInt(month,10))?parseInt(month,10)+1:"0"+(parseInt(month,10)+1);}}}}      
function booking_begin(booking_form,month) {
   i=0;while(i<document.getElementById(booking_form+"_begin_date").length) document.getElementById(booking_form+"_begin_date").options[i]=null;      
   dates_arr_cur=eval("dates_arr[1].".concat(month));
   last_month=[month.substr(0,1),month.substr(1,4),month.substr(5)];
   if(last_month[2]==12) {last_month[1]=parseInt(last_month[1],10)+1;last_month[2]="01";}
   else {last_month[2]=(8<parseInt(last_month[2],10))?parseInt(last_month[2],10)+1:"0"+(parseInt(last_month[2],10)+1);};
   last_month=((eval("dates_arr[1].".concat(last_month.join("")))))?0:1;
   for(i=0;i<dates_arr_cur.length-last_month;i++) {
      document.getElementById(booking_form+"_begin_date").options[i]=new Option(dates_arr_cur[i][0],dates_arr_cur[i][1],(!i)?true:false,(!i)?true:false);
      if(dates_arr_cur[i][2]) {
         document.getElementById(booking_form+"_begin_date").options[i].setAttribute("class","we");
         document.getElementById(booking_form+"_begin_date").options[i].setAttribute("className","we");};
      continue;};
   booking_end(booking_form,dates_arr_cur[0][1]);}
booking_forms_ori=["booking_main","booking_process"];booking_forms=[];
function ini() {
   for(i=0;i<booking_forms_ori.length;i++) {
      if(document.getElementById(booking_forms_ori[i])) booking_forms[booking_forms.length]=booking_forms_ori[i];};
   if(booking_forms.length) {
      if(dates_arr && lang_cur!=gmt_lang) dates_arr=0;
      if(!dates_arr) {
         window.location=self.location.href+(self.location.href.indexOf("?")==-1)?"?lang="+lang_cur+"&gmt="+new Date().getTimezoneOffset():"&lang="+lang_cur+"&gmt="+new Date().getTimezoneOffset();}}}
window.onload=ini;