// set up horizontal scroll
var setupFeaturedBoxes = function (value) {
	var buttons = {
		previous: {
			enabled: 'images/slider-button-left.gif',
			hover: 'images/slider-button-hover-left.gif'
		},
		next: {
			enabled: 'images/slider-button-right.gif',
			hover: 'images/slider-button-hover-right.gif'
		}
	};
	var featuredContentWidth = value;
	var featuredContentScrollPrefs = {
		speed: 800,
		axis: 'x'
	};
	jQuery('.featuredBox').each( function (i) {
		var featuredBox = jQuery(this);
		featuredBox
			.find('.scrollArrow')
				.filter('.next')
					.hover(
						function () {
							jQuery(this)
								.attr( 'src', buttons.next.hover )
								.css( 'cursor', 'pointer' )
							;
						},
						function () {
							jQuery(this)
								.attr( 'src', buttons.next.enabled )
								.css( 'cursor', 'default' )
							;
						}
					)
					.click( function() {
						featuredBox.find('.featuredContent').scrollTo(
							'+=' + featuredContentWidth + 'px',
							featuredContentScrollPrefs
						);
						return false;
					})
				.end()
				.filter('.prev')
					.hover(
						function () {
							jQuery(this)
								.attr( 'src', buttons.previous.hover )
								.css( 'cursor', 'pointer' )
							;
						},
						function () {
							jQuery(this)
								.attr( 'src', buttons.previous.enabled )
								.css( 'cursor', 'default' )
							;
						}
					)
					.click( function() {
						featuredBox.find('.featuredContent').scrollTo(
							'-=' + featuredContentWidth + 'px',
							featuredContentScrollPrefs
						);
						return false;
					})
		;
	});
	jQuery('.featuredBox .featuredContent .featuredDisplayDiv').each( function (i) {
		jQuery(this).css( 'width', ( featuredContentWidth * jQuery(this).find('ul li').size() ) + 'px' );
	});
};

function linkBG(target) {
	var targetDiv=document.getElementById(target);
	if(typeof targetDiv != 'undefined'){
		var elementLI=targetDiv.getElementsByTagName('li');
		for(var i=0; i<elementLI.length;i++)
		{
			elementLI[i].onmouseover = function() {	this.className=" over";	}
			elementLI[i].onmouseout = function() { this.className=" out"; }
		}
	}
}

