$(document).ready(function()
{
	/*
	 * Options
	 */
	
    var lightBoxOptions = {
	    overlayBgColor: '#333',
	    overlayOpacity: 0.6,
	    imageLoading:  '/Themes/Royalwestmoreland/Images/lightbox/lightbox-ico-loading.gif',
	    imageBtnClose: '/Themes/Royalwestmoreland/Images/lightbox/lightbox-btn-close.gif',
	    imageBtnPrev:  '/Themes/Royalwestmoreland/Images/lightbox/lightbox-btn-prev.gif',
	    imageBtnNext:  '/Themes/Royalwestmoreland/Images/lightbox/lightbox-btn-next.gif',
		imageBlank:    '/Themes/Royalwestmoreland/Images/lightbox/lightbox-blank.gif',
	    containerResizeSpeed: 350,
	    txtImage: 'Imagem'
	};
	
	/*
	 * Effects
	 */
	
	// LHS Header Slideshow
    $("#header-banner .slideshow").cycle(
    { 
        prev: '#header-banner .previous', 
        next: '#header-banner .next', 
        timeout: 3600
    });
	
    // Handle Menu Hover
	$("#nav li.show-nav").each(function(i, element)
	{
	    $(element).bind('mouseenter', function(e) { $(e.currentTarget).addClass('active'); });
	    $(element).bind('mouseleave', function(e) { $(e.currentTarget).removeClass('active'); });
	});
	
	// Telephone Dropdown
    $(".dropdown dt a").click(function() {
        $(".dropdown dd ul").toggle();
    });
                        
    $(".dropdown dd ul li a").click(function() {
        var text = $(this).html();
        $(".dropdown dt a span").html(text);
        $(".dropdown dd ul").hide();
    });
	
    // Handle Header Menu Hover
	$("#header-nav li.show-nav").each(function(i, element)
	{
	    $(element).bind('mouseenter', function(e) { $(e.currentTarget).addClass('active'); });
	    $(element).bind('mouseleave', function(e) { $(e.currentTarget).removeClass('active'); });
	});
	
	// General Carousels
    $(".content-carousel").jCarouselLite(
	{
        btnNext: ".carousel .next",
        btnPrev: ".carousel .previous",
		speed: 600,
		auto: 10000,
		easing: "easeinout",
		visible: 3
    });
	
	$('.content-carousel a.lightbox').each(function(index)
	{
		$(this).lightBox(lightBoxOptions);
	});
	
	// Quick Contact Dropdown
    $(".quick-contact-button").click(function() {
        $("#quick-contact-container").slideToggle("slow");
    });
	
	// LHS Header Slideshow
    $("#header-banner .slideshow").cycle(
    { 
        prev: '#header-banner .previous', 
        next: '#header-banner .next', 
        timeout: 3600
    });

	// LHS Header Slideshow
    $("#small-slide .slideshow").cycle(
    { 
        prev: '#small-slide .previous', 
        next: '#small-slide .next', 
        timeout: 3600
    });

});


