﻿// Functions specific to a site.
Cufon.replace('h1', { color: '-linear-gradient(.1=#636363, .9=#3a3a3a)' });
Cufon.replace('h2, .pane-title span');
Cufon.replace('h3', { fontFamily: 'Gotham Rounded Book' });
Cufon.replace('.subnav-header');
Cufon.replace('.blurb', { fontFamily: 'Gotham Rounded Book' });
Cufon.replace('.table-heading, .city-heading', { fontFamily: 'Gotham Rounded Book' });
Cufon.replace('.overview-header');
Cufon.replace('.gallery-header');
Cufon.replace('.station-header');
Cufon.replace('.learn-more, .sf_back, #util-link', { fontFamily: 'Gotham Rounded Book' });
Cufon.replace('.content-utilities li', { fontFamily: 'Gotham Rounded Book' });
Cufon.replace('.station-channel', { fontFamily: 'Gotham Rounded Book' });
Cufon.replace('.view-list', { fontFamily: 'Gotham Rounded Book', hover: true });
Cufon.replace('.illum-header, .home-title, .text-cycle div', { fontFamily: 'Gotham Rounded Book' });		

(function($) {
    $(document).ready(function() {
        // Place document manipulation code here

        $(".rounded-img").load(function() {
            $(this).wrap(function() {
                return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: ' + $(this).width() + 'px; height: ' + $(this).height() + 'px;" />';
            });
            $(this).css("opacity", "0");
        });

        $(".rounded-bio").load(function() {
            $(this).wrap(function() {
                return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: ' + $(this).width() + 'px; height: ' + $(this).height() + 'px;" />';
            });
            $(this).css("opacity", "0");
        });

        $('.bannerList').wrapAll('<ul>');

        $('#util-link').wrapInner('<span />');
        $('#content ol li').wrapInner('<span />');
        $('.table-wrap').wrap('<div class="table-wrapper" />');
        $('.col-heading td:first').addClass('col-head-left');
        $('.col-heading td:last').addClass('col-head-right');
        $('#content td:last-child').addClass('last-cell');
		$('.job-content li:last-child').addClass('last-child');

        $('.c-w3 p:last-child').addClass('vision-last');


        // Export //
        $('.overview-item').wrapAll('<div class="over-wrapper" />');
        $('.thumb img:first-child').addClass('hover-state');
        $(".hover-state").each(function(i) {
            $(this).addClass("item" + (i + 1));
        });
        $(".thumb").each(function(i) {
            $(this).addClass("thumb" + (i + 1));
        });
        for (var i = 0; i <= 100; i++) {
            $('.item' + i).clone().removeClass('hover-state').addClass('normal-state' + i).addClass('normal-state').appendTo('.thumb' + i);
            $('.normal-state' + i).each(function() {
                var url = $(this).attr("src");
                /* Change 031011 */
                $('.thumb').attr('title', '');
                $('.thumb img').attr('title', '');                
                /* Change 031011 */
                if (url.indexOf("/Export_Financial/")) {
                 
                    $(this).attr("src", $(this).attr("src").replace("/Export_Financial/", "/Export_Financial_Thumb/"));
                }
                if (url.indexOf("/Packaging/")) {
                    $(this).attr("src", $(this).attr("src").replace("/Packaging/", "/Packaging_Thumb/"));
                }
                if (url.indexOf("/Automotive/")) {

                    $(this).attr("src", $(this).attr("src").replace("/Automotive/", "/Automotive_Thumb/"));
                }
                if (url.indexOf("/OFG/")) {

                    $(this).attr("src", $(this).attr("src").replace("/OFG/", "/OFG_Thumb/"));
                }
                if (url.indexOf("/Canfisco/")) {

                    $(this).attr("src", $(this).attr("src").replace("/Canfisco/", "/Canfisco_Thumb/"));
                }
                if (url.indexOf("/Buy-Low/")) {

                    $(this).attr("src", $(this).attr("src").replace("/Buy-Low/", "/Buy-Low_Thumb/"));
                }
                if (url.indexOf("/Periodical/")) {
                    $(this).attr("src", $(this).attr("src").replace("/Periodical/", "/Periodical_Thumb/"));
                }
                if (url.indexOf("/Aquarium/")) {
                    $(this).attr("src", $(this).attr("src").replace("/Aquarium/", "/Aquarium_Thumb/"));
                }
                if (url.indexOf("/BION/")) {
                    $(this).attr("src", $(this).attr("src").replace("/BION/", "/BION_Thumb/"));
                }
                if (url.indexOf("/Mini_Golf/")) {
                    $(this).attr("src", $(this).attr("src").replace("/Mini_Golf/", "/Min_Golf_Thumb/"));
                }
                if (url.indexOf("/GWL/")) {
                    $(this).attr("src", $(this).attr("src").replace("/GWL/", "/GWL_Thumb/"));
                }
                if (url.indexOf("/Haunted/")) {
                    $(this).attr("src", $(this).attr("src").replace("/Haunted/", "/Haunted_Thumb/"));
                }
                if (url.indexOf("/Louis_Tussaud_s/")) {
                    $(this).attr("src", $(this).attr("src").replace("/Louis_Tussaud_s/", "/Louis_Tussaud_s_Thumb/"));
                }
                if (url.indexOf("/Mirror_Maze/")) {
                    $(this).attr("src", $(this).attr("src").replace("/Mirror_Maze/", "/Mirror_Maze_Thumb/"));
                }
                if (url.indexOf("/Illuminated_Signs/")) {
                    $(this).attr("src", $(this).attr("src").replace("/Illuminated_Signs/", "/Illuminated_Signs_Thumb/"));
                }
            });
        }
        var time = 100;
        $(".thumb .normal-state").hover(function() {
            $(this).animate({ opacity: 0 }, time, '');
        }, function() {
            $(this).animate({ opacity: 100 }, time, '');
        });



        $(".thumb").hover(function() {

            var url = $(this).children("img:first-child").attr("src");

            if (url.indexOf("/Automotive/")) {

                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Automotive/", "/Automotive_Hover/"));
            }
            if (url.indexOf("/Packaging/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Packaging/", "/Packaging_Hover/"));
            }
            if (url.indexOf("/Export_Financial/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Export_Financial/", "/Export_Financial_Hover/"));
            }
            if (url.indexOf("/OFG/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/OFG/", "/OFG_Hover/"));
            }
            if (url.indexOf("/Canfisco/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Canfisco/", "/Canfisco_Hover/"));
            }
            if (url.indexOf("/Buy-Low/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Buy-Low/", "/Buy-Low_Hover/"));
            }
            if (url.indexOf("/Periodical/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Periodical/", "/Periodical_Hover/"));
            }
            if (url.indexOf("/Aquarium/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Aquarium/", "/Aquarium_Hover/"));
            }
            if (url.indexOf("/BION/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/BION/", "/BION_Hover/"));
            }
            if (url.indexOf("/Mini_Golf/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Mini_Golf/", "/Mini_Golf_Hover/"));
            }
            if (url.indexOf("/GWL/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/GWL/", "/GWL_Hover/"));
            }
            if (url.indexOf("/Haunted/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Haunted/", "/Haunted_Over/"));
            }
            if (url.indexOf("/Louis_Tussaud_s/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Louis_Tussaud_s/", "/Louis_Tussaud_s_Hover/"));
            }
            if (url.indexOf("/Mirror_Maze/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Mirror_Maze/", "/Mirror_Maze_Hover/"));
            }
            if (url.indexOf("/Illuminated_Signs/")) {
                $(this).children("img:first-child").attr("src", $(this).children("img:first-child").attr("src").replace("/Illuminated_Signs/", "/Illuminated_Signs_Hover/"));
            }
            $(this).animate({ top: '-4px' }, time, '');

        }, function() {
            $(this).animate({ top: '0px' }, time, '');
        });

        $(window).load(function() {
            $('.thumb img').css({ visibility: 'visible' });
            //return false;
        });


        var yearFilter = $('.RadTreeView');
        if (yearFilter) {
            var querystring = location.search.replace('?', '').split('&');
            // declare object
            var queryObj = {};
            // loop through each name-value pair and populate object
            for (var i = 0; i < querystring.length; i++) {
                // get name and value
                var name = querystring[i].split('=')[0];
                var value = querystring[i].split('=')[1];
                // populate object
                queryObj[name] = value;
            }
            var currentYear = queryObj['Year'];
            yearFilter.find('a[href*=' + currentYear + ']').addClass('selectedItem');
        }


        // Broadcast Overview //
        $('#slideshow ul').cycle({
            fx: 'fade',
            pager: '.broad-nav'
        });
        $('.map-header .map-all').click(function() {
            $('.current-station').removeClass('current-station');
            $(this).addClass('current-station');
            $('.locations a').css('display', 'block');
        });
        $('.map-header .map-radio').click(function() {
            $('.current-station').removeClass('current-station');
            $(this).addClass('current-station');
            $('.locations .pin-tv').css('display', 'none');
            $('.locations .pin-r').css('display', 'block');
			if ($('.locations .pin-tv').hasClass('current')) {
				$('.details li').removeClass('current');
				$('.details .pin4').addClass('current');
				$('.locations .current').removeClass('current');
				$('#pin4').addClass('current');
			}
        });
        $('.map-header .map-tv').click(function() {
            $('.current-station').removeClass('current-station');
            $(this).addClass('current-station');
            $('.locations .pin-r').css('display', 'none');
            $('.locations .pin-tv').css('display', 'block');
			if ($('.locations .pin-r').hasClass('current')) {
				$('.details li').removeClass('current');
				$('.details .pin1').addClass('current');
				$('.locations .current').removeClass('current');
				$('#pin1').addClass('current');
			}
        });

        $(".locations a").each(function(i) {
            $(this).attr('id', 'pin' + (i + 1));
        });
        $(".details li").each(function(i) {
            $(this).addClass("pin" + (i + 1));
        });


        $(".locations a").click(
        function() {

            $('.locations .current').removeClass('current');
            $(this).addClass('current');
            var divId = this.id;

            $('.details li').removeClass('current');
            $("." + divId).addClass('current');

        });
        $(".pin1").addClass('current');

        // Media Overview //
        $('.media-btn').hover(function() {
            $(this).css('height', 'auto');
            var height = $(this).height();
            $(this).css('height', '132px');
            $(this).parent().addClass('media-hover');
            $(this).animate({ height: height, top: '-65px' }, 100);
        }, function() {
            $(this).parent().removeClass('media-hover');
            $(this).animate({ height: '132px', top: '0px' }, 100);
        });

        // Automotive //
        $('#auto-overview li:last-child').addClass('last-child');
        $('.auto-content p:last-child').addClass('last-child')
        var anTime = 400;
        $('#automotive > .auto-lease').hover(function() {
            $('.auto-lease').animate({ opacity: 1, paddingBottom: 0 }, anTime, function() { $(this).css('zIndex', '10'); });
            $('.auto-lease img').animate({ height: '294px', top: 0 }, anTime);
            $('.auto-retail').animate({ opacity: .4, paddingBottom: '50px' }, anTime);
            $('.auto-retail img').animate({ height: '200px', top: '50px' }, anTime);
            $('#auto-overview a img').animate({ opacity: 1 }, anTime);
        });
        $('#automotive > .auto-retail, #auto-overview').hover(function() {
            $('.auto-retail').animate({ opacity: 1, paddingBottom: 0 }, anTime);
            $('.auto-retail img').animate({ height: '294px', top: 0 }, anTime);
            $('.auto-lease').animate({ opacity: .4, paddingBottom: '50px' }, anTime, function() { $(this).css('zIndex', '2'); });
            $('.auto-lease img').animate({ height: '200px', top: '50px' }, anTime);
            $('#auto-overview a img').animate({ opacity: 0 }, anTime);
        });

        //Shadowbox
        Shadowbox.init();
        //Shadowbox.open({ type: 'img' });


        // Foods //
        $('.food-icon').addClass('active');

        $('.filter-links li a').mouseover(function() {
            if ($(this).hasClass('filter-overwaitea')) {
                $('.food-icon').removeClass('active');
                $('#filter-overwaitea').addClass('active');
                $('.overwaitea-category').addClass('active');
            }
            if ($(this).hasClass('filter-buy-low')) {
                $('.food-icon').removeClass('active');
                $('#filter-buy-low').addClass('active');
                $('.buy-low-category').addClass('active');
            }
            if ($(this).hasClass('filter-canfisco')) {
                $('.food-icon').removeClass('active');
                $('#filter-canfisco').addClass('active');
                $('.canfisco-category').addClass('active');
            }
        });

        $('.food-icon').mouseover(function() {
            if ($(this).hasClass('overwaitea-category')) {
                $('.food-icon').removeClass('active');
                $('#filter-overwaitea').addClass('active');
            }
            if ($(this).hasClass('buy-low-category')) {
                $('.food-icon').removeClass('active');
                $('#filter-buy-low').addClass('active');
            }
            if ($(this).hasClass('canfisco-category')) {
                $('.food-icon').removeClass('active');
                $('#filter-canfisco').addClass('active');
            }
        });

        $('#cta-sunrype, #cta-monfitello').mouseover(function() {
            $('.food-icon').removeClass('active');
            $(this).addClass('active');
        });

        $('.filter-links li a').mouseout(function() {
            $('.food-icon').removeClass('active');
            $(this).removeClass('active');
        });

        $('#food-container').mouseleave(function() {
            $('.food-icon').addClass('active');
        });

        $('.food-icon').mouseout(function() {
            $('#food-container .filter-links a').removeClass('active');
        });

        Cufon.replace('.food-heading', { color: '-linear-gradient(#fff, #fff)' });

        // Corporate Slider //
        Cufon.replace('.corporate-subtitle', { fontFamily: 'Gotham Rounded Book' });
				Cufon.replace('.corporate-title', { color: '-linear-gradient(.1=#636363, .9=#3a3a3a)' });
				Cufon.replace('.corporate-date', { fontFamily: 'ZapfHumnst Ult BT' });
				
				var conveyor = $(".content-conveyor", $(".sliderGallery-wrapper")),
				item = $(".item", $(".sliderGallery-wrapper"));
				
				var sliderOpts = {
				  max: 6476,
				  slide: function(e, ui) {
					conveyor.css("left", "-" + ui.value + "px");
				  }
				};
			
				$(".slider").slider(sliderOpts, {
					range: "min",
					value: 701
				});
				
				$('.content-conveyor').css('left','-702px', function (){
				});
				
				$('.content-conveyor').delay('1000').animate({'left':'0px'}, '500');
				$('.handle').delay('1000').animate({'left':'0px'}, '500');
				$('.ui-slider-range').delay('1000').animate({'width':'0px'}, '500');


				$('#content .sliderGallery ul li:even').addClass('even');
				
				$('.corporate-cycle')
				.after('<div id="cycle-button"><ul>') 
				.cycle({ 
					fx:     'fade', 
					speed:  '800', 
					timeout: 4000, 
					pager:  '#cycle-button ul',
					pagerAnchorBuilder: function(idx, slide) {
						var anchor = '';
						anchor = '<li><a href="#" id="btn-cycle-' + (idx + 1) + '">' + (idx + 1) + '</a></li>';
						return anchor;
					}
				});
				
        // Packaging //
        $("#carousel-container").show();
        $("#carousel").featureCarousel({
            largeFeatureWidth: '650',
            largeFeatureHeight: '421',
            smallFeatureWidth: '.25',
            smallFeatureHeight: '.25',
            sidePadding: '20',
            smallFeatureOffset: '1',
            startingFeature: '1',
            autoPlay: '0'
        });

        // Broadcast Internal //
        Cufon.replace('.broadcast-title', { color: '-linear-gradient(#969696, #767676)' });
        Cufon.replace('.section-header', { color: '-linear-gradient(.1=#636363, .9=#3a3a3a)' });
        Cufon.replace('.listen-live a', { fontFamily: 'Gotham Rounded Book' });
        Cufon.replace('.s-header', { fontFamily: 'Gotham Rounded Book' });
        $('.station-anchor:last-child').addClass('last-child');
        $('.contact-btn').wrapInner('<span />');
        $('.contact-btn').click(function() {
            var height = $(this).parent().css('height');
            if (height == '40px') {
                $(this).parent().css('height', 'auto');
                var actHeight = $(this).parent().css('height');
                $(this).parent().css('height', '40px');
                $(this).parent().animate({ height: actHeight }, 100);
                $(this).parent().addClass('active');
            } else {
                $(this).parent().animate({ height: '40px' }, 100);
                $(this).parent().removeClass('active');
            }
        });

        // Entertainment //
        if ($.browser.msie) {
            $('.background-opaque').remove();

            $('#accordion-container .active .background-opaque').animate({ opacity: '0' }, 0);
            $('.active .trigger').animate({ opacity: '0' }, 0);
            $('.content-container').hide();
            $('.active .content-container').show();

            $('.trigger').click(function() {
                $('.trigger').fadeTo('300', 1);
                $(this).fadeTo('300', 0);

                $('#accordion-container .active').stop().animate({ width: '63' }, 500);
                $('#accordion-container .active').children('.background').stop().animate({ width: '63' }, 500);

                $('.trigger').parent().find('.background').stop().animate({ width: '63', opacity: '1' }, 500);

                $(this).parent().stop().animate({ 'width': '824' }, 500);
                $(this).parent().find('.background').stop().animate({ width: '824', opacity: '1' }, 500);

                $('#accordion-container .active').removeClass('active');
                $('.pane').addClass('inactive');
                $(this).parent().removeClass('inactive');
                $(this).parent().addClass('active');

                $(this).parent().find('.background-color').stop().animate({ width: '824', opacity: '0' }, 500);

                $('.content-container').stop().hide();
                $(this).parent().find('.content-container').show();
            });

            $('.background-color').click(function() {
                $('.trigger').fadeTo('300', 1);
                $(this).next().fadeTo('300', 0);

                $('#accordion-container .active').stop().animate({ width: '63' }, 500);
                $('#accordion-container .active').children('.background').stop().animate({ width: '63' }, 500);

                $('.trigger').parent().find('.background').stop().animate({ width: '63', opacity: '1' }, 500);

                $(this).parent().stop().animate({ 'width': '824' }, 500);
                $(this).parent().find('.background').stop().animate({ width: '824', opacity: '1' }, 500);

                $('#accordion-container .active').removeClass('active');
                $('.pane').addClass('inactive');
                $(this).parent().removeClass('inactive');
                $(this).parent().addClass('active');

                $(this).parent().find('.background-color').stop().animate({ width: '824', opacity: '0' }, 500);

                $('.content-container').stop().hide();
                $(this).parent().find('.content-container').show();
            });

            $('.trigger').click(function() {
                if ($(this).hasClass('trigger1')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg1').stop().animate({ 'opacity': '1' }, 700);
                    $('#pane-2 .trigger').css('background-image', 'url(/images/skin/entertainment/trigger-guiness2.png)');
                }
                if ($(this).hasClass('trigger2')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg2').stop().animate({ 'opacity': '1' }, 700);
                }
                if ($(this).hasClass('trigger3')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg3').stop().animate({ 'opacity': '1' }, 700);
                    $('#pane-2 .trigger').css('background-image', 'url(/images/skin/entertainment/trigger-guiness.png)');
                }
            });

            $('.background-color').click(function() {
                if ($(this).next().hasClass('trigger1')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg1').stop().animate({ 'opacity': '1' }, 700);
                    $('#pane-2 .trigger').css('background-image', 'url(/images/skin/entertainment/trigger-guiness2.png)');
                }
                if ($(this).next().hasClass('trigger2')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg2').stop().animate({ 'opacity': '1' }, 700);
                }
                if ($(this).next().hasClass('trigger3')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg3').stop().animate({ 'opacity': '1' }, 700);
                    $('#pane-2 .trigger').css('background-image', 'url(/images/skin/entertainment/trigger-guiness.png)');
                }
            });
        }
        else {

            $('#accordion-container .active .background-opaque').animate({ opacity: '0' }, 0);
            $('.active .trigger').animate({ opacity: '0' }, 0);
            $('.content-container').hide();
            $('.active .content-container').show();

            $('.trigger').click(function() {
                $('.trigger').fadeTo('300', 1);
                $(this).fadeTo('300', 0);

                $('#accordion-container .active').stop().animate({ width: '63' }, 500);
                $('#accordion-container .active').children('.background').stop().animate({ width: '63' }, 500);

                $('.trigger').parent().find('.background').stop().animate({ width: '63', opacity: '1' }, 500);

                $(this).parent().stop().animate({ 'width': '824' }, 500);
                $(this).parent().find('.background').stop().animate({ width: '824', opacity: '1' }, 500);

                $('#accordion-container .active').removeClass('active');
                $('.pane').addClass('inactive');
                $(this).parent().removeClass('inactive');
                $(this).parent().addClass('active');

                $(this).parent().find('.background-opaque').stop().animate({ width: '824', opacity: '0' }, 500);

                $('.content-container').stop().hide();
                $(this).parent().find('.content-container').show();
            });

            $('.background-opaque').click(function() {
                $('.trigger').fadeTo('300', 1);
                $(this).next().fadeTo('300', 0);

                $('#accordion-container .active').stop().animate({ width: '63' }, 500);
                $('#accordion-container .active').children('.background').stop().animate({ width: '63' }, 500);

                $('.trigger').parent().find('.background').stop().animate({ width: '63', opacity: '1' }, 500);

                $(this).parent().stop().animate({ 'width': '824' }, 500);
                $(this).parent().find('.background').stop().animate({ width: '824', opacity: '1' }, 500);

                $('#accordion-container .active').removeClass('active');
                $('.pane').addClass('inactive');
                $(this).parent().removeClass('inactive');
                $(this).parent().addClass('active');

                $(this).parent().find('.background-opaque').stop().animate({ width: '824', opacity: '0' }, 500);

                $('.content-container').stop().hide();
                $(this).parent().find('.content-container').show();
            });

            $('.trigger').click(function() {
                if ($(this).hasClass('trigger1')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg1').stop().animate({ 'opacity': '1' }, 700);
                    $('#pane-2 .trigger').css('background-image', 'url(/images/skin/entertainment/trigger-guiness2.png)');
                }
                if ($(this).hasClass('trigger2')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg2').stop().animate({ 'opacity': '1' }, 700);
                }
                if ($(this).hasClass('trigger3')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg3').stop().animate({ 'opacity': '1' }, 700);
                    $('#pane-2 .trigger').css('background-image', 'url(/images/skin/entertainment/trigger-guiness.png)');
                }
            });

            $('.background-opaque').click(function() {
                if ($(this).next().hasClass('trigger1')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg1').stop().animate({ 'opacity': '1' }, 700);
                    $('#pane-2 .trigger').css('background-image', 'url(/images/skin/entertainment/trigger-guiness2.png)');
                }
                if ($(this).next().hasClass('trigger2')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg2').stop().animate({ 'opacity': '1' }, 700);
                }
                if ($(this).next().hasClass('trigger3')) {
                    $('.entertainment-bg').stop().animate({ 'opacity': '0' }, 700);
                    $('#bg3').stop().animate({ 'opacity': '1' }, 700);
                    $('#pane-2 .trigger').css('background-image', 'url(/images/skin/entertainment/trigger-guiness.png)');
                }
            });
        }


    });

})(jQuery);

// Entertainment //

// Home //
(function($) {
    $(document).ready(function() {
        Cufon.replace('.home-title, .text-cycle div', { fontFamily: 'Gotham Rounded Book' });

        $('.carousel_inner').css('cursor', 'pointer');
				
				$('#home-banner, .text-cycle').cycle({
					fx: 'fade',
					speed: 800,
					prev: '.left_scroll', 
					next: '.right_scroll', 
					autostop: 0,
					timeout: 0
				});
				
				$('.carousel_ul, .carousel_ul2').carouFredSel({
					items: 5,
					auto: {
						onBefore: function() {
							$('#home-banner, .text-cycle').cycle('next'); 
						}
					},
					prev: {
						button: '.left_scroll',
						onBefore: function() {
						}
					},
					next: {
						button: '.right_scroll',
						onBefore: function() {
						}
					},
					scroll : {
						items: 1,
						onBefore: function() {
							
						}
					} 
				}).find('li').click(function() {
					if($(this).hasClass('trigger-1')) {	
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','7'))
					}
					if($(this).hasClass('trigger-2')) {	
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','8'))
					}
					if($(this).hasClass('trigger-3')) {
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','9'))
					}
					if($(this).hasClass('trigger-4')) {
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','1'))
					}
					if($(this).hasClass('trigger-5')) {	
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','2'))
					}
					if($(this).hasClass('trigger-6')) {	
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','3'))
					}
					if($(this).hasClass('trigger-7')) {	
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','4'))
					}
					if($(this).hasClass('trigger-8')) {	
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','5'))
					}
					if($(this).hasClass('trigger-9')) {
						$('.carousel_ul, .carousel_ul2').trigger('slideTo', ('destination ','6'))
					}
				});
				
				$('.trigger-1').click(function (){
					$('#home-banner, .text-cycle').cycle(7); 	
				});
				$('.trigger-2').click(function (){
					$('#home-banner, .text-cycle').cycle(8); 	
				});
				$('.trigger-3').click(function (){
					$('#home-banner, .text-cycle').cycle(9); 	
				});
				$('.trigger-4').click(function (){
					$('#home-banner, .text-cycle').cycle(1); 	
				});
				$('.trigger-5').click(function (){
					$('#home-banner, .text-cycle').cycle(2); 	
				});
				$('.trigger-6').click(function (){
					$('#home-banner, .text-cycle').cycle(3); 	
				});
				$('.trigger-7').click(function (){
					$('#home-banner, .text-cycle').cycle(4); 	
				});
				$('.trigger-8').click(function (){
					$('#home-banner, .text-cycle').cycle(5); 	
				});
				$('.trigger-9').click(function (){
					$('#home-banner, .text-cycle').cycle(6); 	
				});
				


				$('.carousel_ul2').carouFredSel({
					items: 1,
					prev: '.left_scroll',
					next: '.right_scroll',
					scroll : {
						items: 1
					} 
				});
				
				
    });
})(jQuery);
// Home //
