// JavaScript Document
 
$(function(){
	if(loggedIn == 1){
		//alert("You\'re Logged In and can go to resources");
		$("li#loggedIn a").attr('href','/LogOutProcess.aspx').text("logout");
		}
		if (loggedIn == 0){
		//alert("You\'re not logged in\n log in or go away ");
		$("li#loggedIn a").attr('href','/Login.htm').text("login");	
		}
		//else{$("li#loggedIn a").attr('href','/Login.htm').text("login");	}
		//browser check
if ( $.browser.msie ) {
  $("body").addClass("explorer"  + parseInt($.browser.version) );
  		if($.browser.version == 7){
	  								//alert("IE7 - Good luck");
	  								//var zIndexNumber = 1000;
									//$('div').each(function(){
									//						$(this).css('zIndex', zIndexNumber);
									//						zIndexNumber -= 10;
									//						});
	 
								}
					}
if ( $.browser.opera ) {
	//alert("This is Opera");
  $("body").addClass("opera"  +  parseInt($.browser.version) );
}
if ( $.browser.webkit ) {
	//alert("This is either Google or Safari");
  $("body").addClass("webkit");
}
if ( $.browser.mozilla ) {
  $("body").addClass("firefox");
}

			//remove the no-js class from the body to prove that javascript has loaded
			$("body, div").removeClass('no-js');
			
			
							
			//start the news ticker				
			$("#tickerInner ul").liScroll();
			
			//On Hover Over
function megaHoverOver(){
    $(this).find(".sub").stop().fadeTo('fast', 1).show(); //Find sub and fade it in
	$("a",this).addClass('hover');
};        


//On Hover Out
function megaHoverOut(){
	
  $(this).find(".sub").stop().fadeTo('fast', 0, function() { //Fade to 0 opactiy
      $(this).siblings("a").removeClass('hover');	
	  $(this).hide();  //after fading, hide it
	  	
  });
}
//Set custom configurations
var config = {
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
     interval: 100, // number = milliseconds for onMouseOver polling interval
     over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
     timeout: 0, // number = milliseconds delay before onMouseOut
     out: megaHoverOut // function = onMouseOut callback (REQUIRED)
};

$("ul#topnav li .sub").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
$("ul#topnav li").hoverIntent(config); //Trigger Hover intent with custom configurations




});
$(window).load(function(){
		
	 //equal Heights
			

 						  var max = 0
 						  $(".equalHeights").each(function(){
 						  if ($(this).height() > max)
 						  max = $(this).height();
 								});
		$(".equalHeights").height(max);
	
	});
	
