//HOVERFIX FOR IE6
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//SET NOCONFLICT TO WORK WITH OTHER LIBRARIES
jQuery.noConflict();

jQuery(document).ready(function() {
	
	//HIDE EMAILLOGIN
	jQuery('#memberloginarea').hide();
		
	//NEWS SCROLLPANE
	jQuery('ul#news').jScrollPane({ wheelSpeed: 54 });
	
	//EVENTSLIST SCROLLPANE
	jQuery('ul#eventsList').jScrollPane({ wheelSpeed: 54 });
	
	
	//NEWSITEMS
	jQuery('ul#featuredNewsList li').hover(function(){ 
		
		jQuery('ul#featuredNewsList li').removeClass('active');
		jQuery(this).addClass('active');
		
		jQuery('#newsItems div.newsItem').hide();
			
		var newsId = jQuery(this).attr('id');					
		jQuery('#newsItems #item_' + newsId).fadeIn("fast");
		
	},function(){});
	
	//FEATUREDSNEWLIST
	jQuery('ul#featuredNewsList li:first').addClass('first');
	jQuery('ul#featuredNewsList li:last').addClass('last');

	
	//SUBNAV
	jQuery('ul#nav li ul li:first-child').css('border-top','none');
	
	//WHATSNEW LIST
	jQuery('#whatsnew ul li:odd').addClass('odd');
	jQuery('#whatsnew ul li:even').addClass('even');
	jQuery('#whatsnew ul li:last').addClass('last');

	//EVENTS LIST
	jQuery('ul#eventsList li:odd').addClass('odd');
	jQuery('ul#eventsList li:even').addClass('even');
	jQuery('ul#eventsList li:last').addClass('last');
	
	jQuery('a.showLogin').click(function (e)
	{
		e.preventDefault(); 
		
		if (jQuery(this).text() == 'Member Login')
		{
			jQuery(this).text('Hide'); 
			jQuery('#memberloginarea').slideDown(); 
		}
		else
		{
			jQuery(this).text('Member Login'); 
			jQuery('#memberloginarea').slideUp(); 
		}
	}); 
});
