// all scripts at the bottom of the page should be added here

/*	this is to add class on "a" w/ submenu for p7mon support
	just change #main-menu to whatever parent class or id of the p7menu
	Revome script if not using p7menu
	Revome script if using p7 tab menu
jQuery("#main-menu ul li:has(ul) > a").addClass("p7PMtrg"); */

jQuery(document).ready(function() {
	addspan();
	changesubmenu();
	flashheader();
});

function addspan()
{
	jQuery("#nav_568044 li a").each(function(i) {
		jQuery(this).html("<span>"+jQuery(this).text()+"</span>");
	});
	
	jQuery("#nav_568044 li ul li a").each(function(i) {
		jQuery(this).html("<span>"+jQuery(this).text()+"</span>");
	});
}

function changesubmenu()
{
	jQuery("#nav_568044 li ul").each(function(i) {
		jQuery(this).children("li:last").children("a").css({"background-image":"url('/images/navnewright-bg.png')"});
		jQuery(this).children("li:last").children("a").children("span").css({"background-image":"url('/images/navnewleft-bg.png')"});
	});
}

var currentflashheadercolor = 0;

function flashheader()
{
	
	if(currentflashheadercolor == 0)
	{
		jQuery(".header-tag h4").fadeIn("slow",function(){
			Cufon.set('fontFamily', 'Helvetica Bold Oblique');
				Cufon.replace('.header-tag h4',{
				color:"red",
				fontSize:"24px"
			});
			
		});
		currentflashheadercolor = 1;
	}
	else
	{
		jQuery(".header-tag h4").fadeIn("slow",function(){
			Cufon.set('fontFamily', 'Helvetica Bold Oblique');
				Cufon.replace('.header-tag h4',{
				color:"#F7E20A",
				fontSize:"24px"
			});
			
		});
		currentflashheadercolor = 0;
	}

	setTimeout(
		  function() 
		  {
			flashheader();
		  }, 2000
	);
}
