
function getElement(element) {
	
	return document.getElementById ? document.getElementById(element): document.layers[element];
	
}

function setup(page, height, width, headline) {
    
    var attractionVariables = new Object();
    attractionVariables.page = page;
    attractionVariables.headline = headline;
    attractionVariables.width = width;
    attractionVariables.height = height;
    
    var attraction = getElement('attraction');
    attraction.style.height = height+100;
    
    swfobject.embedSWF('components/flash/attraction.swf?dafs', 'attraction', 940, height, '9.0.0', '', attractionVariables);
    
}

function embedHighlight(div, image, text, url) {
	
    var flashVars = new Object();
    
    flashVars.image = image;
    flashVars.text = text;
    flashVars.url = url;
    
	swfobject.embedSWF('components/flash/highlight.swf', div, 220, 220, '9.0.0', '', flashVars);
    
}

// Menu

var g_mouse_on_menu = false;
var g_mouse_entered_item = false;

$(document).ready(function(){
    
    $("#mainMenu").mouseenter(function() {
    	
    	g_mouse_on_menu = true;
    	
    	$("#menuBackground").css({height: $(this).outerHeight(), top: $(this).offset().top, width: 0});
        
    });
    
    $("#mainMenu").mouseleave(function() {
        
        g_mouse_on_menu = false;
        g_mouse_entered_item = false;
        
        $("#menuBackground").animate({width: 0}, 200);
        $("#menuArrow").stop();
        $("#menuArrow").animate({top: $(this).offset().top + $(this).outerHeight()-15}, 100);
     
    });
    
    $(".menuItem").mouseenter(function() {
        
        if ( g_mouse_entered_item == false ) {
          
          g_mouse_entered_item = true;
          
          $("#menuBackground").css({left: $(this).offset().left, width: 0});
          
        }
        
        $("#menuBackground").stop();
        $("#menuBackground").animate({width: $(this).outerWidth(), left: $(this).offset().left}, 100);
        $("#menuArrow").show();
        $("#menuArrow").width($(this).innerWidth()-20);
        $("#menuArrow").css({'left': $(this).offset().left + parseInt($(this).css("borderLeftWidth").split("px")[0]), 'top': $(this).offset().top + $(this).outerHeight() - 15});
        $("#menuArrow").animate({top: $(this).offset().top + $(this).outerHeight()}, 200);
     
    });
    
});