/****************************************
| ** MCLAREN | LEWIS HAMILTON JS BASICS **
|
| Created by: Adam Foster
| Date Created: 2008-06-06
| Copyright 2008 Lightmaker Manchester
|
****************************************/

$(document).ready(function(){
 	
	/*rollover*/
	var navLinks = $("#globalnavigation li a:not('#selected')");
	navLinks.children('em').css({opacity: '0', backgroundPosition: '0px'});
	navLinks.hoverIntent({sensitivity: 1,interval: 1,over: linkOver,	timeout: 0, out: linkOut}); 
	function linkOver(){$(this).children('em').stop().animate({opacity:"1"}, 150, "easeInOutQuad")};
	function linkOut(){ $(this).children('em').animate({opacity:"0"}, 750, "easeInOutQuad")};
	
	/*login*/
	$('#loginpanel').children('a').attr("href","#");
	$('#login').css({opacity:"0",display:"block"});
	
	$('#loginpanel').children('a').click(function () {
		if($('#login').hasClass("loggedincheck")){
			$('#login').stop().animate({height: 0, opacity:0},600, "easeInOutQuad").removeClass("loggedincheck");
			$('#loginpanel').children('a').html("Login");
		}
		else{
			$('#login').stop().animate({height: 118, opacity:1},600, "easeInOutQuad").addClass("loggedincheck");
			$('#loginpanel').children('a').html("Close");
		}
	});
	
	/* SIFR rollover */
	
	$("h4")
	
});