/*
 * JCarousel
 * 
 */
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 5,
        scroll: 1,
        wrap: 'circular',
        animation: 1000,
        buttonNextHTML: '<a href="#" id="frontPageSliderButtonRight"><!-- --></a>',
        buttonPrevHTML: '<a href="#" id="frontPageSliderButtonLeft"><!-- --></a>'
    });
});


// Ride the carousel...
$(document).ready(function() {

	if ($('#header').length ) {
		$('#header').cycle();
	}

	$('a#webcode').click(function() {
		$("#dialog").slideDown("fast");
		return false;
	});
	$('a[rel=booknow]').click(function() {
		var hotelnumber = $(this).attr('id');
		$("#bookingiframe").html('<iframe src="https://booking.krohotel.dk/book?hotelNumber=' + hotelnumber + '" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto" title="Booking" id="bookingIframerInner"></iframe>');
		$("#booking").fadeIn('fast');
	});

	$('a#btnBooking').click(function() {
		$("#bookingiframe").html("<iframe src='https://booking.krohotel.dk/book ' frameborder='0' marginheight='0' marginwidth='0' scrolling='auto' title='Booking' id='bookingIframerInner'></iframe>");
		// $("#bookingiframe").html("<iframe src='http://krohotel.dev.novicell.dk/booking/gammelbookingvindue/' frameborder='0' marginheight='0' marginwidth='0' scrolling='auto' title='Booking' id='bookingIframerInner'></iframe>");
		$("#booking").fadeIn('fast');
		return false;
	});
	$('a#btnBookingClose').click(function() {
		$("#booking").fadeOut('fast');
		$("#bookingiframe").html("");		
		return false;
	});

	$('a#dialogclose').click(function() {
		$("#dialog").slideUp("fast");
		return false;
	});

if ($('#membergooglemap').length ) {
		initialize();
	}

	if ($('#memberImage').length ) {
		 $('#memberImage').galleria({
				image_crop: false,
				transition: 'fade',
				autoplay: true,
				carousel_follow: true
			});
	}
	if ($('#product-image').length ) {
		 $('#product-image').galleria({
				image_crop: true,
				transition: 'slide',
				autoplay: true,
				carousel_follow: true
			});
	}
	
	

});