// Flash and CSS init (c) Agents.se - v3.0


// CSS Browser Selector   v0.2.3
// Documentation:         http://rafael.adm.br/css_browser_selector
var css_browser_selector = function() {
	var 
		ua = navigator.userAgent.toLowerCase();
		is = function(t){ return ua.indexOf(t) != -1; },
		h = document.getElementsByTagName('html')[0],
		b = (!(/opera|webtv/i.test(ua)) && /msie (\d)/.test(ua)) ? ((is('mac') ? 'ieMac ' : '') + 'ie ie' + RegExp.$1)
			: is('gecko/') ? 'gecko' : is('opera') ? 'opera' : is('konqueror') ? 'konqueror' : is('applewebkit/') ? 'webkit safari' : is('mozilla/') ? 'gecko' : '',
		os = (is('x11') || is('linux')) ? ' linux' : is('mac') ? ' mac' : is('win') ? ' win' : '';
	var c = b+os+' js';
	h.className += h.className?' '+c:c;
}();



// No spam e-mail address
function noSpam(a,b,c) {
	document.write('<a href="mai'+'lto:'+c+'@'+b+'.'+a+'">'+c+'@'+b+'.'+a+'</a>');
}


// png fix ie background images
if (document.all && document.styleSheets && document.styleSheets[0] &&
  document.styleSheets[0].addRule)
 {
  // Feel free to add rules for specific tags only, you just have to call it several times.
  document.styleSheets[0].addRule('*', 'behavior: url(js/iepngfix.htc)');
 }

var new_window;
function openWindowPopup(page,name,width,height,scrollbars,resizable,callInit,centered) {
	var configWidthHeight="";
	if(width!=-1 && height!=-1) {
		//new_window.resizeTo(width,height);
		configWidthHeight='height=' + height + ',width=' + width + ',';
	}
	new_window = window.open (page, 'PopUp' + name, config= configWidthHeight + 'toolbar=no, menubar=no, scrollbars=' + scrollbars + ', resizable=' + resizable + ',location=no, directories=no, status=no');

	if(callInit) {
		try {
			setTimeout("new_window.init(" +centered + ")",300);
		} catch (error) {
			setTimeout("new_window.init(" +centered + ")",1000);
		}

	}
	//self.name=name;
	return;
}


function changeRooms() {
	var selected=document.getElementById("Hotel").selectedIndex;
	
	/*

	<option value="Grace Riverside Inn">Grace Riverside Inn</option>
	<option value="Grace Kea">Grace Kea</option>               
	*/
	
	if(selected==0) 
	{
							
		//Grace Mykonos
		document.getElementById("roomtypeDiv").innerHTML ='<select name="roomtype" id="roomtype" class="hotelSelect"><option value="VIP suites">VIP suites</option><option value="Junior Suites with Plunge Pool">Junior Suites with Plunge Pool</option><option value="Family Suites">Family Suites</option><option value="Deluxe with plunge pool">Deluxe with plunge pool</option><option value="Junior Suites">Junior Suites</option><option value="Deluxe Rooms">Deluxe Rooms</option><option value="The Grace Suite">The Grace Suite</option><option value="The Honeymoon Suite">The Honeymoon Suite</option><option value="The VIP suite">The VIP suite</option></select>';
	}
	else if(selected==1)
	{
		//Grace Santorini
		document.getElementById("roomtypeDiv").innerHTML ='<select name="roomtype" id="roomtype" class="hotelSelect"><option value="The Grace Suite">The Grace Suite</option><option value="The Honeymoon Suite">The Honeymoon Suite</option><option value="The Superior Suites">The Superior Suites</option><option value="The Junior Suites">The Junior Suites</option><option value="The Deluxe Rooms">The Deluxe Rooms</option></select>';
	}
	
	else if(selected==2)
	{
		//Vanderbilt Grace
		document.getElementById("roomtypeDiv").innerHTML ='<select name="roomtype" id="roomtype" class="hotelSelect"><option value="Grace Suite">Grace Suite</option><option value="VIP Suites">VIP Suites</option><option value="Superior Suites">Superior Suites</option><option value="Loft Suites">Loft Suites</option><option value="Junior Suites">Junior Suites</option><option value="Deluxe Rooms">Deluxe Rooms</option><option value="Grace Suite Two Bedroom">Grace Suite Two Bedroom</option><option value="Two Bedroom Superior Suite">Two Bedroom Superior Suite</option><option value="400 sq ft Junior Suites">400 sq ft Junior Suites</option></select>';
	}


	else if(selected==3)
	{
		//Grace Beijing
		document.getElementById("roomtypeDiv").innerHTML ='<select name="roomtype" id="roomtype" class="hotelSelect"><option value="Artist Studios">Artist Studios</option><option value="Superior Rooms">Superior Rooms</option><option value="Deluxe Rooms">Deluxe Rooms</option><option value="VIP Suites">VIP Suites</option><option value="Grace Suite">Grace Suite</option></select>';
	}
	else if(selected==4)
	{
		//Grace Riverside Inn
		document.getElementById("roomtypeDiv").innerHTML ='<select name="roomtype" id="roomtype" class="hotelSelect"><option value="">Coming soon</option></select>';
	}
	else if(selected==5)
	{
		//vanderbilt in
		document.getElementById("roomtypeDiv").innerHTML ='<select name="roomtype" id="roomtype" class="hotelSelect"><option value="">Coming soon</option></select>';
	}
	
	else
	{
		document.getElementById("roomtypeDiv").innerHTML ='<select name="roomtype" id="roomtype" class="hotelSelect"><option value=""></option></select>';
	}
}

/*

function change_hotel()
{
	var sel = document.getElementById('destination').selectedIndex;
	


	if (sel==0)  {
		document.getElementById('booking_form').action="https://mykonosgrace.reserve-online.net/";
	     document.getElementById('book_holder').style.display = 'block';
		   document.getElementById('book_holder_msg').style.display = 'none';
		$(function() {
			$( ".date-pick" ).datepicker({
				showOn: "both",
				buttonImage: "images/calendar.png",
				buttonImageOnly: true,
				showAnim: "slideDown"
			});
		});


}else if (sel==1) {
		document.getElementById('booking_form').action="https://mykonosgrace.reserve-online.net/";
	     document.getElementById('book_holder').style.display = 'block';
		   document.getElementById('book_holder_msg').style.display = 'none';
		$(function() {
			$( ".date-pick" ).datepicker({
				showOn: "both",
				buttonImage: "images/calendar.png",
				buttonImageOnly: true,
				showAnim: "slideDown"
			});
		});

}else if (sel==2) {
		document.getElementById('booking_form').action="https://santorinigrace.reserve-online.net/";
	     document.getElementById('book_holder').style.display = 'block';
		   document.getElementById('book_holder_msg').style.display = 'none';
		$(function() {
			$( ".date-pick" ).datepicker({
				showOn: "both",
				buttonImage: "images/calendar.png",
				buttonImageOnly: true,
				showAnim: "slideDown"
			});
		});

}else if (sel==3) {
		document.getElementById('booking_form').action="https://vanderbiltgrace.reserve-online.net/";
	     document.getElementById('book_holder').style.display = 'block';
		   document.getElementById('book_holder_msg').style.display = 'none';
		$(function() {
			$( ".date-pick" ).datepicker({
				showOn: "both",
				buttonImage: "images/calendar.png",
				buttonImageOnly: true,
				showAnim: "slideDown"
			});
		});

}else if (sel==4) {
		document.getElementById('booking_form').action="https://book.ehbox.com/reserve/preloader/867";
		document.getElementById('book_holder').style.display = 'block';
		document.getElementById('book_holder_msg').style.display = 'none';
		document.getElementById('checkin').name = 'checkInDate';
		
		$(function() {
			$( ".date-pick" ).datepicker({
				showOn: "both",
				buttonImage: "images/calendar.png",
				buttonImageOnly: true,
				showAnim: "slideDown",
				dateFormat: "yy-mm-dd"
			});
		});
		

}else{ 
	//alert("ddd");
	 document.getElementById('book_holder').style.display = 'none';
	   document.getElementById('book_holder_msg').style.display = 'block';

//document.ElementById("id").style.visibility = "visible";
			//document.getElementById("roomtypeDiv").innerHTML ='<select name="roomtype" id="roomtype" class="hotelSelect"><option value=""></option></select>';
	//	document.getElementById('booking_form').action="http://www.gracehotels.com/";
	}
}
*/
