/*!
* jQuery code used by the Storm theme to perform various tasks.
* This code can be edited and customised if required, but take care.
*/
 
// Code to keep certain columns an equal height

var $jeh = jQuery.noConflict();
			function equalHeight(group) {
			tallest = 0;
			group.each(function() {
			thisHeight = $jeh(this).height();
			if(thisHeight > tallest) {
			tallest = thisHeight;
			}
			});
			group.height(tallest);
			}
			$jeh(document).ready(function() {
			equalHeight($jeh(".column"));
			});
            
// Code to create smooth scrolling anchor tags. Speed can be customised below.
 
 var $jss = jQuery.noConflict();
			$jss(document).ready(function() {
			$jss("a.anchorLink").anchorAnimate()
			});
			jQuery.fn.anchorAnimate = function(settings) {
			settings = jQuery.extend({
			speed : 2000
			}, settings);
			return this.each(function(){
			var caller = this
			$jss(caller).click(function (event) {
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $jss(caller).attr("href")
			var destination = $jss(elementClick).offset().top;
			$jss("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
			window.location.hash = elementClick
			});
			return false;
			})
			})
			}
            
// Code to create optional scrolling background. Speed can be customised below.
 
 var $jsb = jQuery.noConflict();
 var scrollSpeed = 50;              // Speed in milliseconds (ms)
			var step = 1; 			// How many pixels to move per millisecond
			var current = 0;		// The current pixel row
			var imageWidth = 1;		// Background image width
			var headerWidth = 500;	// How wide the image is in pixels
			// The pixel row where to start a new loop
			var restartPosition = -(imageWidth - headerWidth);
			function scrollBg(){
			// Go to next pixel row
			current -= step;
			// If at the end of the image, then go to the start
			if (current == restartPosition){
			current = 0;
			}
			// Implement scrolling using CSS background positioning
			$jsb('#scrolling').css("background-position",current+"px 0");
			}
			// Loop the scrolling function repeatedly
			var init = setInterval("scrollBg()", scrollSpeed);
