initNav = function() {
	var navRoot = document.getElementById("nav");
	var lis = navRoot.getElementsByTagName("li");
	for (var i=0; i<lis.length; i++)
	{
		lis[i].onmouseover = function()
		{
			this.className += " hover";
		}
		lis[i].onmouseout = function()
		{
			this.className = this.className.replace("hover", "");
		}
	}
}

$(function() {
	initNav();
	
	$('a[href="/virtual-tour/"]').fancybox({
		frameWidth: 893,
		frameHeight: 675,
		overlayShow: true,
		overlayOpacity: 0.5
	});
	
	$('a[rel*="lightbox"]').fancybox();
	
	$('#contact_ACCOMMODATION').change(function() {
		$('.HOTEL, .CHALET, .APARTMENT').hide().find('select').val('');
		if ($(this).val() == 'Hotel') {
			$('.HOTEL').show();
		} if ($(this).val() == 'Chalet') {
			$('.CHALET').show();
		} if ($(this).val() == 'Vivaldis Apartment') {
			$('.APARTMENT').show();
		}
	});
	$('#contact_ACCOMMODATION').change();
	
	$('.mailing-list input[name="contact[EMAIL]"]').focus(function() {
		if ($(this).val() == 'Enter email') {
			$(this).val('');
		}
	});
	$('.mailing-list input[name="contact[EMAIL]"]').blur(function() {
		if ($(this).val() == '') {
			$(this).val('Enter email');
		}
	});
	
});
