$(document).ready(function() {
  
  
  var language = $("meta").attr("content");

   
   if (language == 'it'){
//replace tag content, search by id
$("#label-start-date").empty(); 
$("#label-start-date").append("Arrivo"); 


$("#label-end-date").empty(); 
$("#label-end-date").append("Partenza"); 

$("#openPopupButton").attr('value', 'Iniziare ricerca');

// change script language
// change substring 
// <script type="text/javascript" src="../js/date_de.js">

 }
   
      if (language == 'en'){
//replace tag content, search by id
$("#label-start-date").empty(); 
$("#label-start-date").append("Arrival"); 


$("#label-end-date").empty(); 
$("#label-end-date").append("Departure"); 

$("#openPopupButton").attr('value', 'Online Booking');

	  }
   
  
 });


// empty content
/*function booking() {
	$('#CONTENT').empty();
	$('#CONTENT').append("<iframe src='http://hotels.stc.ch/hoteldirect.aspx?&idhotel=11983&language=de&bs=875&checkin=28.03.2010&checkout=29.03.2010&numrooms=&adults=' name='mbe' width='580' height='2000' frameborder='0'><h2><a href=''>Online booking</a></h2></iframe>");

	

} */


// variante stc
// src='http://hotels.stc.ch/hoteldirect.aspx?&idhotel=11983&language=de&bs=875&checkin=23.03.2010&checkout=24.03.2010&numrooms=&adults='


// variante engadinbook
// https://www.engadinbooking.ch/minibooking/individual_hotel_form.html?hotel=Hotel%20Chesa%20Rosatsch&place=Celerina&id=11983&lang=de&short=1









function startBooking(){
 var checkin = document.getElementById('start-date').value;
 var checkout = document.getElementById('end-date').value;
var lang = $("meta").attr("content");

 if (checkout=="") { checkout=checkin };
 if (checkin=="") { checkin=checkout};
//alert (checkin+" "+checkout);


 MM_openBrWindow('http://hotels.stc.ch/hoteldirect.aspx?bs=875&idhotel=11983&checkin='+checkin+'&checkout='+checkout+'&adults=1&children=0&cribs=0&numrooms=1&language='+lang+'&css=http://www.rosatsch.ch/css/booking','STC','scrollbars=yes,resizable=yes,width=700,height=750')
} 



function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function MM_openWindow(theURL,winName,launchWin,features) { //v1.0
 if (launchWin == ''){
 window.open(theURL,winName,features);
 }else{
 var controller = window.open(theURL,winName,features);
 if(controller.opener == null){
 controller.opener = self;
 }
 controller.opener.name = launchWin;
 return controller;
 }
}



		