$(document).ready(function(){
	setTimeout(animation,3000);
	setTimeout(slideShow,5000);
	
	$(".navItem").hover(
	    function(){
	        $(this).children("a").css("background-position","0px -28px");
	        $(this).children("div.navSubmenu").show();
	    },
	    function(){
	        $(this).children("a").css("background-position","0px 0px");
	        $(this).children("div.navSubmenu").hide();
	    });

	jQuery("#theatreMenuLink, #musicMenuLink, #presentationsMenuLink").hover(
	    function(){
	        jQuery(this).css("background-position","0px -11px");
	    },
	    function(){
	        jQuery(this).css("background-position","0px 0px");
	    });

	jQuery(".rolloverImageHolder").hover(
	    function(){ $(this).children("img, a").css("top","-" + $(this).height() + "px"); },
	    function(){ $(this).children("img, a").css("top","0px"); }
	);
	
});

function animation(){
	$(".doubleCellInnerHolder").animate({"left": "-656px"}, 1500);
}
function slideShow(){
    startSlideShow(0);
    setTimeout("startSlideShow(5)",3000);
    setTimeout("startSlideShow(2)",6000);
    setTimeout("startSlideShow(4)",9000);
    setTimeout("startSlideShow(6)",12000);
    setTimeout("startSlideShow(3)",15000);
    setTimeout("startSlideShow(1)",18000);

}

function startSlideShow(index){
    var holder = $($(".singleCell")[index]);
    if (holder.children("img").size()<2) return;
    if (holder.children("img:visible").length==3)
        holder.children("img").not(":last").hide();

    holder.children("img:visible").fadeOut(3500);
    
    if (holder.children("img:visible").next().size()==0) 
        holder.children("img:first").fadeIn(3500);
    else holder.children("img:visible").next().fadeIn(3500);
    setTimeout("startSlideShow("+index+")",21000)
}