/** Megamenu Settings **/

$(function(){
	var SelfLocation = window.location.href.split('?');
	switch (SelfLocation[1]) {
	  case "justify_right":
		$(".scec-navigation").megamenu({ 'justify':'right' });
		break;
	  case "justify_left":
	  default:
		$(".scec-navigation").megamenu();
	}
});


/** Home Footer Menu Settings **/

$(document).ready(function(){
	$(".scec-purple-content").css('height', 400 - $('h2.scec-purple').height())
	$(".scec-red-content").css('height', 400 - $('h2.scec-red').height())
	$(".scec-green-content").css('height', 400 - $('h2.scec-green').height())
	$(".scec-blue-content").css('height', 400 - $('h2.scec-blue').height())
	$(".scec-yellow-content").css('height', 400 - $('h2.scec-yellow').height())
	
	//When mouse rolls over
	$(".scec-homebox-content-purple").mouseover(function(){
		$(this).stop().animate({height:'380px'},{queue:false, duration:600})
		$(".scec-purple").stop().animate({bottom:373-$('h2.scec-purple').height()},{queue:false, duration:600})
		$(".scec-purple-content").stop().animate({top:20+$('h2.scec-purple').height()},{queue:false, duration:600})
    });
	
	//When mouse is removed
	$(".scec-homebox-content-purple").mouseout(function(){
		$(this).stop().animate({height:'80px'},{queue:false, duration:600})
		$(".scec-purple").stop().animate({bottom:'7px'},{queue:false, duration:600})
		$(".scec-purple-content").stop().animate({top:'90px'},{queue:false, duration:600})
	});
	
	
	//When mouse rolls over
	$(".scec-homebox-content-red").mouseover(function(){
		$(this).stop().animate({height:'380px'},{queue:false, duration:600})
		$(".scec-red").stop().animate({bottom:373-$('h2.scec-red').height()},{queue:false, duration:600})
		$(".scec-red-content").stop().animate({top:20+$('h2.scec-red').height()},{queue:false, duration:600})
    });
	
	//When mouse is removed
	$(".scec-homebox-content-red").mouseout(function(){
		$(this).stop().animate({height:'80px'},{queue:false, duration:600})
		$(".scec-red").stop().animate({bottom:'7px'},{queue:false, duration:600})
		$(".scec-red-content").stop().animate({top:'90px'},{queue:false, duration:600})
	});
	
	//When mouse rolls over
	$(".scec-homebox-content-green").mouseover(function(){
		$(this).stop().animate({height:'380px'},{queue:false, duration:600})
		$(".scec-green").stop().animate({bottom:373-$('h2.scec-green').height()},{queue:false, duration:600})
		$(".scec-green-content").stop().animate({top:20+$('h2.scec-green').height()},{queue:false, duration:600})
    });
	
	//When mouse is removed
	$(".scec-homebox-content-green").mouseout(function(){
		$(this).stop().animate({height:'80px'},{queue:false, duration:600})
		$(".scec-green").stop().animate({bottom:'7px'},{queue:false, duration:600})
		$(".scec-green-content").stop().animate({top:'90px'},{queue:false, duration:600})
	});
	
	//When mouse rolls over
	$(".scec-homebox-content-blue").mouseover(function(){
		$(this).stop().animate({height:'380px'},{queue:false, duration:600})
		$(".scec-blue").stop().animate({bottom:373-$('h2.scec-blue').height()},{queue:false, duration:600})
		$(".scec-blue-content").stop().animate({ top: 20 + $('h2.scec-blue').height() }, { queue: false, duration: 600 })
    });
	
	//When mouse is removed
	$(".scec-homebox-content-blue").mouseout(function(){
		$(this).stop().animate({height:'80px'},{queue:false, duration:600})
		$(".scec-blue").stop().animate({bottom:'7px'},{queue:false, duration:600})
		$(".scec-blue-content").stop().animate({top:'90px'},{queue:false, duration:600})
	});
	
	//When mouse rolls over
	$(".scec-homebox-content-yellow").mouseover(function(){
		$(this).stop().animate({height:'380px'},{queue:false, duration:600})
		$(".scec-yellow").stop().animate({bottom:373-$('h2.scec-yellow').height()},{queue:false, duration:600})
		$(".scec-yellow-content").stop().animate({top:20+$('h2.scec-yellow').height()},{queue:false, duration:600})
    });
	
	//When mouse is removed
	$(".scec-homebox-content-yellow").mouseout(function(){
		$(this).stop().animate({height:'80px'},{queue:false, duration:600})
		$(".scec-yellow").stop().animate({bottom:'7px'},{queue:false, duration:600})
		$(".scec-yellow-content").stop().animate({top:'90px'},{queue:false, duration:600})
	});
});


/** Accordion Sub Nav Settings **/

$().ready(function(){
	$('#scec-accordion').accordion({
		event: 'mouseover',
		active: '.scec-selected',
		autoheight: false
	});
});









