imgWidth = -800;


function changeArrows()
{
	var getRArrow = document.querySelectorAll("a.nextButton");
	var getLArrow = document.querySelectorAll("a.previousButton");
	
	for (var i = 0; i < getRArrow.length; i++) 
	{
		if(getRArrow[i].href.indexOf("#"))
		{	 
			getLArrow[i].style.background = "url('/media/Site%20Files/Merchandising%20Files/fadedLeft.png')"; 
			getRArrow[i].style.background = "url('/media/Site%20Files/Merchandising%20Files/whiteRight.png')";
		}
		else
		{ 
			getRArrow[i].style.background = "url('/media/Site%20Files/Merchandising%20Files/fadedRight.png')"; 
			getLArrow[i].style.background = "url('/media/Site%20Files/Merchandising%20Files/whiteLeft.png')"; 
		}
		getRArrow[i].onmouseover = function()
		{ this.style.background = "url('/media/Site%20Files/Merchandising%20Files/grayRight.png')"; };
	
		//change right arrow to white if carousel is not at end
		getRArrow[i].onmouseout= function()
		{ 
			if (this.href.indexOf("#"))
			{ this.style.background = "url('/media/Site%20Files/Merchandising%20Files/whiteRight.png')"; }
			
			else
			{ this.style.background = "url('/media/Site%20Files/Merchandising%20Files/fadedRight.png')"; }
		}
		
		getRArrow[i].onclick = function()
		{
			if(this.href.indexOf("#"))	//if the carousel has reached the end
			{
				//change right arrow to faded
				this.style.background = "url('/media/Site%20Files/Merchandising%20Files/whiteRight.png')";
			}
			else
			{ this.style.background = "url('/media/Site%20Files/Merchandising%20Files/fadedRight.png')"; }
		}
	
		//change left arrow to faded if carousel is at beginning
			
		getLArrow[i].onmouseover = function()
		{ this.style.background = "url('/media/Site%20Files/Merchandising%20Files/grayLeft.png')"; };
	
		
			getLArrow[i].onmouseout= function()
			{ 
				if (this.href.indexOf("#"))
				{ this.style.background = "url('/media/Site%20Files/Merchandising%20Files/whiteLeft.png')"; }
				
				else
				{ this.style.background = "url('/media/Site%20Files/Merchandising%20Files/fadedLeft.png')"; }
			}
			
		//change left arrow to white if carousel is not at beginning
		
		getLArrow[i].onclick = function()
		{
			if(this.href.indexOf("#"))	//if the carousel has reached the beginning
			{
				//change right arrow to faded
				this.style.background = "url('/media/Site%20Files/Merchandising%20Files/whiteLeft.png')";
			}
			else
			{ this.style.background = "url('/media/Site%20Files/Merchandising%20Files/fadedLeft.png')"; }
		}
		
	}
	
} //end of changeArrows()

function init()
{
	if (window.onload) 
	{
		var func = window.onload; 
		window.onload = function() {
			func();
			changeArrows();
		}
	} 
	else 
	{ window.onload = changeArrows; }
}

init();

