$(document).ready(function() {
$(".intbanscrol").each(function(){
$(".third-carousel").jcarousel({
        vertical: true,
           scroll: 1
    });


});
$('.holdingbanner').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
   	speedIn:	   1500,  // speed of the 'in' transition
	speedOut:	   1500,
	timeout: 5000, 
    cleartypeNoBg: true,
    pager:  '.holdingnavmain ul',
    pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.holdingnavmain ul li:eq(' + (idx) + ')';
    } 
});
$('.intbanner').cycle({ 
    fx:     'fade', 
    speed:  'slow',
    speedIn:	   1000,  // speed of the 'in' transition
	speedOut:	   1000,
    timeout: 0, 
    cleartypeNoBg: true,
    pager:  '.intnav',
    pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.intnav li:eq(' + (idx) + ') ';
    } 
});
$('.ba').cycle({ 
    fx:     'scrollRight', 
    speed:  'slow',
    speedIn:	   1000,  // speed of the 'in' transition
	speedOut:	   1000,
    timeout: 5000 
});


$('.ban2').cycle({ 
    fx:     'fade', 
    speed:  'slow',
    speedIn:	   1000,  // speed of the 'in' transition
	speedOut:	   1000,
    timeout: 0, 
    cleartypeNoBg: true,
    pager:  '.nav2',
    pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav2 li:eq(' + (idx) + ') ';
    } 
});
$('.ban3').cycle({ 
    fx:     'fade', 
    speed:  'slow',
    speedIn:	   1000,  // speed of the 'in' transition
	speedOut:	   1000,
    timeout: 0, 
    cleartypeNoBg: true,
    pager:  '.nav3',
    pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav3 li:eq(' + (idx) + ') ';
    } 
});
$('.ban4').cycle({ 
    fx:     'fade', 
    speed:  'slow',
    speedIn:	   1000,  // speed of the 'in' transition
	speedOut:	   1000,
    timeout: 0, 
    cleartypeNoBg: true,
    pager:  '.nav4',
    pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav4 li:eq(' + (idx) + ') ';
    } 
});
$('.ban5').cycle({ 
    fx:     'fade', 
    speed:  'slow',
    speedIn:	   1000,  // speed of the 'in' transition
	speedOut:	   1000,
    timeout: 0, 
    cleartypeNoBg: true,
    pager:  '.nav5',
    pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav5 li:eq(' + (idx) + ') ';
    } 
});
$('.mainsliderabs').hoverIntent(function(){
$('.intbanscrol').animate({"right": "+=138px"}, "slow")
},function(){$('.intbanscrol').animate({"right": "-=138px"}, "slow")})
$('a').css("cursor", "pointer");

$('.guestbookbtn').click (function () {
	var fboxheight = $('.fbguestbook').height();
    $('#overlay').fadeTo("slow", 0.7);
    $('#overlay').css('height',$(document).height());
    $('.fbguestbook').animate({"opacity": "show"},500 );
    if ($('#overlay').is(':visible')){
    $('#overlay').click(function(){
    $('#overlay').animate({"opacity": "hide"},500 );
    $('.fbguestbook').animate({"opacity": "hide"},500 );
     });
     }
    Gototop();
});
$('.enewsletterbtn').click (function () {
	var fboxheight = $('.fbnewsletter').height();
    $('#overlay').fadeTo("slow", 0.7);
    $('#overlay').css('height',$(document).height());
    $('.fbnewsletter').animate({"opacity": "show"},500 );
    if ($('#overlay').is(':visible')){
    $('#overlay').click(function(){
    $('#overlay').animate({"opacity": "hide"},500 );
    $('.fbnewsletter').animate({"opacity": "hide"},500 );
     });
     }
    Gototop();
});
$('.reservebtn').click (function () {
	var fboxheight = $('.fbresrvation').height();
    $('#overlay').fadeTo("slow", 0.7);
    $('#overlay').css('height',$(document).height());
    $('.fbresrvation').animate({"opacity": "show"},500 );
    if ($('#overlay').is(':visible')){
    $('#overlay').click(function(){
    $('#overlay').animate({"opacity": "hide"},500 );
    $('.fbresrvation').animate({"opacity": "hide"},500 );
     });
     }
    Gototop();
});

$('.closefbox').click (function () {
    $('#overlay').animate({"opacity": "hide"},500 );
    $('.fbguestbook').animate({"opacity": "hide"},500 );
    $('.fbnewsletter').animate({"opacity": "hide"},500 );
    $('.fbresrvation').animate({"opacity": "hide"},500 );
});

//$('.namechanger ').cycle({ 
//    fx:     'fade', 
//    speed:  'slow', 
//   	speedIn:	   1500,  // speed of the 'in' transition
//	speedOut:	   1500,
//	timeout: 5000, 
//    cleartypeNoBg: true,
//    pager:  '.holdingnavmain ul',
//    pagerAnchorBuilder: function(idx, slide) {
//            // return sel string for existing anchor
//            return '.holdingnavmain ul li:eq(' + (idx) + ')';
//    } 
//});
$("#marquee").marquee({		  
		yScroll: "top"                          // the position of the marquee initially scroll (can be either "top" or "bottom")
		, showSpeed: 1000                          // the speed of to animate the initial dropdown of the messages
		, scrollSpeed: 25                         // the speed of the scrolling (keep number low)
		, pauseSpeed: 450                        // the time to wait before showing the next message or scrolling current message
}); 

$('.arrows').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 5000, 
    next:   '#nextslide', 
    prev:   '#prevslide'
  
});
//// BOB //////
heigghtfix();
fixfooter();
fixshadows();

$('.mainsliderabs').cycle({ 
    fx:     'scrollHorz', 
    speed:  'slow', 
   	speedIn:	   1500,  // speed of the 'in' transition
	speedOut:	   1500,
	timeout: 0, 
    cleartypeNoBg: true
});
$('.glaimagedetails').cycle({ 
    fx:     'scrollVert', 
    speed:  'slow', 
   	speedIn:	   1500,  // speed of the 'in' transition
	speedOut:	   1500,
	timeout: 0, 
    cleartypeNoBg: true
});

$(".countrylisting div.countryitemholder").filter(function(idx) {
    return (idx % 2) == 1
}).addClass('countryitemholderalt');

if ($('.topbannersub').is(':visible')) {
	$('.bottomshadow').hide();
}

$('.roomreserveul').jcarousel({
    vertical: true,
    scroll: 1
});
var acticlinav = $('.roomgalnav li.activeli').prevAll().length + 1;
$('.roomgalnav').jcarousel({
	scroll: 1,
	start:acticlinav
});
var uldetectwidth = ($('.holdingnavmain ul li').length) * ($('.holdingnavmain ul li').outerWidth({includeMargin:true})) ;
$('.holdingnavmain ul').width(uldetectwidth);

$('#overlay').css({ opacity: 0});


$("#mcs4_container").mCustomScrollbar("vertical",200,"easeOutCirc",1.25,"fixed","yes","no",0); 
});

function Gototop(){
if($.browser.safari){ bodyelem = $("body") } else{ bodyelem = $("html") } bodyelem.animate({scrollTop:0},500);};

//// BOB //////
function heigghtfix() {
	var part1 = $('.head').height();
	var part2 = $('.branchtitle').height();
	var part3 = $('.menu').height();
	var part4 = $('.logoheadermain').height();
	var part5 = $('.mainsliderrel').height();
	var part6 = $('.glaimagedetails').height();
	var part7 = $('.navmainrel').height();
	var part8 = $('.subpageimgholder').height();
	var part9 = $('.subpagemaincontent').height();
	var bigheight ;
	if ( $.browser.msie && $.browser.version <= 7) {
    bigheight = part1 + part2 + part3 + part4 + part5 + part6 + part7 + part8 + part9 ;	
     }
     else {	
	bigheight = part1 + part2 + part3 + part4 + part5 + part6 + part7 + part8 + part9 + 115;
	}
	$('.topbannersub').height(bigheight);
}
function fixfooter() {
	var part1 = $('.contentfooter').height();
	var part2 = $('.contentfooter33').height();
	var newheight = part1 + 80 + part2;
	if (newheight < 200){
	$('.bottom2').height(200);
	}
	else {
	$('.bottom2').height(newheight);}
}
function fixshadows() {
	$('.shadowcontentleft').height($('.subpagemaincontent').height());
	$('.shadowcontentright').height($('.subpagemaincontent').height());
}

/////////////
