$(document).ready(function() {	
	$( "#dialog:ui-dialog" ).dialog( "destroy" );
	$('#sectionLinks .box').hover(function() {
		$(this).find('h3').css('background-position','0% 100%');
		$(this).find('h3').css('background-color','#ff9900');
		$(this).find('h3 a').css('color','#ffffff');
		$(this).css('border','1px solid #FF9900');
		$(this).find('div').css('color','#333');
		$(this).css('cursor','pointer');
	},
	function() {
		$(this).find('h3').css('background-position','0% 0%');
		$(this).css('border','1px solid #DDDDDD');
		$(this).find('h3').css('background-color','#ccc');
		$(this).find('h3 a').css('color','#333');
		$(this).find('div').css('color','#666');
		$(this).css('cursor','default');
	});
	$('.truck').hover(function() {
		$(this).css('border','1px solid #FF6600');
	},
	function() {
		$(this).css('border','1px solid #FFFFFF');
	});
	$('#sectionLinks .box').click(function() {
		var lnk = $(this).find('h3 a').attr('href');
		document.location.href = lnk;
	});
	$("#language").msDropDown();

	
	var megaConfig = {
		interval: 200,
		sensitivity: 4,
		over: addMega,
		timeout: 500,
		out: removeMega
	};
    $("li.mega").hoverIntent(megaConfig);
	$("li.mega > a").focus(function(){
	 	$("li.mega").find('div').fadeOut('fast');
		$(this).parent().find('div').fadeIn('fast');
	}); 
});

function addMega(){
	$(this).find('div').slideDown(400);
}
function removeMega(){
	$(this).find('div').slideUp(300);
}

