// JavaScript Document

$(document).ready(function () {
    $('.primaryNav .item').hover(
	 function () {
	     $('.submenu').hide();

	     if ($(this).find('.submenu').length > 0) {
	         //$(this).find('.submenu').fadeIn('fast');
	         $(this).find('.submenu').show();
	     }
	 },
	 function () {
	     $('.submenu').hide();
	 });
});

// SHOW OPTION CONTENT ON BUTTON HOVER
$(document).ready(function() {
	$('div.hideoption span.styleoption').hide();
	$('div.hideoption div.revealoption').mouseover(function () {
		$(this).children('span.styleoption').stop(true, true).show();
		return false;
	});
	
	$('div.hideoption div.revealoption').mouseout(function () {
		$(this).children('span.styleoption').stop(true, true).fadeOut('fast');
		return false;
	});
});

// SLIDE swap CONTENT ON CLICK of button or associated text link
$(document).ready(function() {
	$('div.tobeshown').hide();
	$('a.triggershow').click(function () {
		$(this).parent().siblings('div.tobeshown').stop(true, true).fadeIn('fast');
		$('a.triggershow').stop(true, true).hide();
		return false;
	});
	$('a.triggershowtext').click(function () {
		$(this).parent().siblings('div.tobeshown').stop(true, true).fadeIn('fast');
		$('a.triggershow').stop(true, true).hide();
		return false;
	});
	$('li a.accordionlink').click(function () {
		$('div.tobeshown').stop(true, true).hide();
		$('a.triggershow').stop(true, true).show();
	return false;
	});
});

// table styling function
$(document).ready(function(){
	   $(".standardtable tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
	   $(".standardtable tr").mouseover(function(){$(this).children("td").addClass("over");}).mouseout(function(){$(this).children("td").removeClass("over");});
	   $(".standardtable tr:even").addClass("even");
	   $(".standardtable tr:odd").addClass("odd");
	   $(".standardtable tr").find("td:first").addClass("firstcell");
	   $(".standardtable tr").find("td:last").addClass("lastcell");
	   $(".standardtable").find("tr:last").addClass("lastrow");
	  $(".standardtable thead").has("span.positionIcon").addClass("hasIcon");
	   Cufon.refresh();
});




