$(document).ready(function() {
   $('#langblk a.language-link img').css('opacity',0.3);
   $('#langblk a.active img').css('opacity',1);
   
	$("#esForm").validate();
	
	$('#mnav ul li:nth-child(3) ul').css('display', 'none');

		$("#langblk ul li").hover(function(){

		    $(this).addClass("hover");
		    $('ul:first',this).css('visibility', 'visible');

		}, function(){

		    $(this).removeClass("hover");
		    $('ul:first',this).css('visibility', 'hidden');

		});

});

function Cancel(thisform) {
if (confirm("Are you sure you want to cancel your booking?"))
thisform.submit();
else
 return false;
}

function Delete(thisform) {
if (confirm("Are you sure you want to remove your booking request?"))
thisform.submit();
else
 return false;
}


function slideSwitch2() {
    var $active = $('#rotator DIV.active');

    if ( $active.length == 0 ) $active = $('#rotator DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#rotator DIV:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch2()", 5000 );
});	



	// Apply the Highslide settings
	hs.registerOverlay({
		useOnHtml: true,
		html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
		position: 'top right',
		fade: 2 // fading the semi-transparent overlay looks bad in IE
	});
	hs.showCredits = false;
	hs.align = 'center';
	hs.dimmingOpacity = 0.75;
	hs.dimmingGeckoFix = true;
	
	hs.graphicsDir = '/highslide/graphics/';
	//hs.outlineType = 'rounded-white';
	hs.wrapperClassName = 'borderless no-footer';
	hs.allowSizeReduction = false;
	// always use this with flash, else the movie will be stopped on close:
	hs.preserveContent = false;
	
// Image Swap
$.swapImage(".swapImage");
