/**
 * Application specific Javascript code
 */
 
var ArticlePage = {
	
	/**
	 * Shows the selected product ID in the feature box.
	 */
	
	showFeature: function (articleNode) {

		// Find the feature content node within the article node
		articleNode.descendants().each (function (node) {
			if (node.hasClassName("featurecontent")) {
				$("feature").innerHTML = node.innerHTML;
			}
		});
		
		// De-highlight all articles
		var articles = document.getElementsByClassName("article");
		articles.each (function (a) {
			a.removeClassName("on");		
		});
		
		// Highlight the current node
		$(articleNode).addClassName("on");
		
	},
	
	/**
	 * Initialise the events for the articles/features
	 */
	
	initialise: function (featureID) {

		// Get articles node list
		var articles = document.getElementsByClassName("article");
		
		// Bind events for each article
		articles.each (function (a) {

			// Mouse over
			Event.observe (a, "mouseover", function () {
				a.toggleClassName("over");
			});
			
			// Mouse out
			Event.observe (a, "mouseout", function () {
				a.toggleClassName("over");
			});
			
			// Mouse click
			Event.observe(a, "click", function () {
				ArticlePage.showFeature(a);
			});
		
		});
		
		ArticlePage.showFeature($("article" + featureID));
		
	}
	
}; 

/**
 * Service rotator for home page
 */
 
var ServiceRotator = {
	
	
	
};