﻿// Initilise the Quiz
var quiz = new quizScript();
quiz.startQuiz();

// Initilise the Transition banner
var banner = new transitionBanner();
banner.startBanner();

// Initilise the Vertical Accordion banner
var vertAccordion = new verticalAccordion();

// Initilise the footer gallery
var footerGallery = new galleryTimeLine();

// Initilise the slide show gallery for all elements with .pizza-hut-slideshow
$('.pizza-hut-slideshow').promoSlider({
    width: 450,
    boxesPerScreen: 1,
    boxesToMove: 1,
    enableRotate: false,
    nextButtonText: " ",
    previousButtonText: " ",
    boxType: "img"
});

// Initilise the slide show gallery for all elements with .training-slideshow
$(".training-slideshow").promoSlider({
    width: 207,
    height:204,
    enableRotate: false,
    nextButtonText: " ",
    previousButtonText: " ",
    boxType: "div"
});

// This manages the main navigation
$("#navigation ul li ul").hide().parent().mouseover(function() {
    $(this).children("ul").show();
}).mouseout(function() {
    $(this).children("ul").hide();
});

// Show all flash content
$(".hide-on-load").removeClass("hide-on-load");
// This is for managing the state of the vertical accordion
$(".link-to-slider-content").click(function() {
    window.location.hash = this.title;
    // force IE 6&7 to fire the hash change 
    if ($.browser.msie && parseInt($.browser.version, 10) <= 7) $(window).trigger('hashchange');
    // scroll to the vertical accordian
    $('html,body').animate({scrollTop:$('.vertical-accordion').offset().top - 20},400);
});

// Show all flash content
$(".hide-without-flash").removeClass("hide-without-flash");

// Hide all non-flash messages - these are shown by default and hidden if the user doesn't have flash
$(".non-flash-message").addClass("hide-without-flash");
