// JavaScript Document
$(document).ready(function(){
	$('#faq').css('display', 'none');
	
	var imgtags = $('#newsreleasebutton').find('img').add($('#faqbutton').find('img'));	

	var switchnewstag = function(type, element){
		$('#faq, #newsrelease').css('display', 'none');
		$('#' + type).css('display', 'block');
		imgtags.rollOver().trigger('mouseleave');

		var img = $(element).find('img');
		img.unbind("mouseenter").unbind("mouseleave");
		img.attr('src', img.attr('src').replace('_off.', '_on.'));


		var ahref = function(type){
			switch(type){
				case 'newsrelease':
					return './news/';
				case 'faq':
					return './faq/';
			}
			return '';
		};
		$('#newslist').attr('href', ahref(type));
	};

	$('#newsreleasebutton').click(function(){
		switchnewstag('newsrelease', this);

		return false;
	}).trigger("click");
	$('#faqbutton').click(function(){
		switchnewstag('faq', this);

		return false;
	});
});

