var activate_dropdown="";
var current_dropdown="";
var animation_state=1;

$(document).ready(function()
{
	$(".effect").bind("mouseover",function(){
        $(this).animate({opacity: 0.3},400,'',function(){
            $(this).animate({opacity: 1.0},400);
        });
     });
	
	//Dropdown Scripts
	$(".dropdown_menu").bind("mouseover",function(){											  
		activate_dropdown = $(this).attr('title');
		if(activate_dropdown != current_dropdown)
		{
			$(".dropdown").fadeOut(100);
			current_dropdown = activate_dropdown;
			var offsetposition = $(this).offset();
			$(activate_dropdown).css('left', offsetposition.left-30);
			$(activate_dropdown).css('top', offsetposition.top+34);
			$(activate_dropdown).fadeIn(500);
		}
     });
	$(".no_dropdown").bind("mouseover",function(){	
		$(".dropdown").fadeOut(100);
		current_dropdown=null;
	});
	$(".dropdown").mouseleave(function() {
		$(this).fadeOut(100);
		current_dropdown=null;	
	});
	
	$(".loadframe").click(function(){
        section_load = $(this).attr('href');
		$(".dropdown").fadeOut(100);
		if(animation_state==0){
			LoadContent(section_load);
		}
		else{
			SkipAnimation();
			LoadContent(section_load);
		}
		return false;
     });
	
	
});

function SkipAnimation()
{
	document.getElementById('animation').innerHTML = '<img src="/images/spacer.gif" width="756" height="398" border="0">';
	$("#animation").hide(500, function(){
		$(".main_illustration").fadeIn(500);
		animation_state=0;
	});
}
function LoadContent(section_url)
{
	$(".content_window").animate({opacity: 0.1},400,'',function(){
		$(".content_padding").load(section_url, function(){
			$(".content_window").animate({opacity: 1.0},400);
		});
    });
}
