/************************************************************
Global Javascript for JUST SHOP
Author: Ben Smithett
Created: 23/2/09
************************************************************/

$(document).ready(function () {
    
/* UPDATE NAV
***********************************/

//Collect page hierarchy information from body class and make available to all JavaScript
var bodyClass = $("body").attr("class");

/*  Header active link
************************************************/
$("#header_small_links div."+bodyClass+" a").removeClass("inactive");
$("#header_small_links div."+bodyClass+" a").addClass("active");

/*  Footer active link
************************************************/
$("#footer_links div."+bodyClass+" a").removeClass("inactive");
$("#footer_links div."+bodyClass+" a").addClass("active");



/* ARTICLE ROLLOVERS
***********************************/

$(".article a").not(".exclude").hover(
	function() {
		$(this).parent().parent().find("a").not(".exclude").addClass("hovered");
	},
	function() {
		$(this).parent().parent().find("a").not(".exclude").removeClass("hovered");
	}
);

/* FOOTNOTE FADES
***********************************/
initFades();

/* YOUR STYLE RATE BUTTON ROLLOVER
***********************************/
$("#rateButton").hover(
	function() {
		$(this).attr("src","/images/poll_images/button-over.jpg");
	},
	function() {
		$(this).attr("src","/images/poll_images/button.jpg");
	}
);

/* FORM SUBMIT BUTTON ROLLOVERS
***********************************/
$("#submitButton").hover(
	function() {
		$(this).attr("src","/images/forms/submit_button_over.jpg");
	},
	function() {
		$(this).attr("src","/images/forms/submit_button.jpg");
	}
);


});

