//////////////////////////////////////////////////////
//
//	The purpose of this file is to
//	apply a hover class on mouseover
//	on the <li> elements in the nav.
//	This is because IE doesn't put
//	the pseudo class :hover on <li> elements
//
//	This is code that uses the
//	jquery javascript library (http://jquery.com/)
//
//////////////////////////////////////////////////////

$(document).ready(function() {
	//comment this out if you have no png images
	if(jQuery.isFunction(jQuery.fn.ifixpng)) {
    		$('img[@src$=.png]').ifixpng();
		$('#ftop').ifixpng();
		$('#topLeftImage p').ifixpng(); 	
	}
});

$(window).load(function() {
	if (document.all&&document.getElementById) {
		// this is needed for the IE 6 pseudo hover class bug
		$(".navtop > li").hover(function() {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
		});
		
		$(".navtop > li li ").hover(function () {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
		});

		$(".navtop > li.hide_job_listings ul li ul li ul").hover(function () {
			$(this).addClass("hover_hide_job_listings");
		},
		function () {
			$(this).removeClass("hover_hide_job_listings");
		});
	} else {
		// this is need for safari when nav covers flash
		$(".navtop li ul").hover(function () {
			$(this).addClass("redraw");
		},
		function () {
			$(this).removeClass("redraw");
		});
	}

	function setPageFontPercentage(val)
	{
		$('#page').css('font-size', val + "%");
		fontSizePercentage = val;
		Set_Cookie( cookieName, fontSizePercentage , 30 , '/' , '' , '' );
	}

	var fontSizePercentage = 100;
	var cookieName = 'sizecookie';
	var cookie = Get_Cookie(cookieName);
	if(cookie == undefined || cookie == null)
	{
		Set_Cookie( cookieName, fontSizePercentage , 30 , '/' , '' , '' );
	}
	else
	{
		var val = parseInt(Get_Cookie(cookieName));
		fontSizePercentage = val;
		setPageFontPercentage(fontSizePercentage);
	}
	
	$('#larger').click(function(){
		setPageFontPercentage(fontSizePercentage + 7);
		return false;
	});
	$('#smaller').click(function(){
		if(fontSizePercentage - 7 > 77 )
			setPageFontPercentage(fontSizePercentage - 7);
		return false;
	});
	
	$('#cc_nav .payonline a').attr('target','_blank');
});

