

/* brand tray */

function brandTray(dir) {	 
if(brandTray != 0) {

	//move left
	if(dir != 0) {
		if(brandTrayCounter == 0) { $('brandLogosGroup2').style.left = brandTrayWidth }
		//reset the photo containers and the counter 
		if(brandTrayCounter == (brandTrayTotal-(brandTrayTotal*2))) { 
			$('brandLogosGroup1').style.left = '0px'; 
			$('brandLogosGroup2').style.left = brandTrayWidth;
			brandTrayCounter = 0}	
				brandTrayCounter = brandTrayCounter -1;
				Effect.MoveBy( 'brandLogosGroup1', 0, -115, { 
				beforeStart: function() { disableBrandTrayBtns(0); }, afterFinish: function() { disableBrandTrayBtns(1); }, duration:1} ); 
				Effect.MoveBy( 'brandLogosGroup2', 0, -115, {duration:1} );
							
		} else { 
		
		//move right
		if(brandTrayCounter == 0) { $('brandLogosGroup2').style.left = brandTrayWidthRight; }
		//reset the photo containers and the counter 
		if(brandTrayCounter == brandTrayTotal) { 
			$('brandLogosGroup1').style.left = '0px'; 
			$('brandLogosGroup2').style.left = brandTrayWidthRight;
			brandTrayCounter = 0}
				brandTrayCounter = brandTrayCounter +1;
				Effect.MoveBy( 'brandLogosGroup1', 0, 115, { 
				beforeStart: function() { disableBrandTrayBtns(0); }, afterFinish: function() { disableBrandTrayBtns(1); }, duration:1} ); 
				Effect.MoveBy( 'brandLogosGroup2', 0, 115, {duration:1} ); 
		}
	}
}	

//this function deactivates button while photo gallery is moving
function disableBrandTrayBtns(active) {	
	if(active == 0) { 
		$('next').onclick =  null;
		$('prev').onclick =  null;
	  }
	if(active == 1) { 
		$('next').onclick =  brandTray;
		$('prev').onclick =  new Function("brandTray("+0+")");
		}
}


//*************New Product Rotator*************/

function nextFeatProd(num) {
	
	//featProdCounter = featProdCounter;
	
	/*if(recipeCounter == -1) { recipeCounter = recipeTxt.length-1; }
	if(recipeCounter == recipeTxt.length) {recipeCounter = 0; }
	if(recipeCounter > recipeTxt.length) {recipeCounter = 1; }
	*/
	
	//recipeURL = recipeLink[recipeCounter];
	//recipeNamePath = '<a href='+recipeURL+'>'+recipeTxt[recipeCounter]+'</a>';
	featProdImgPath = featProdImg[num];
	
	//Element.update('ms-home-howto-text',recipeNamePath);
	//$('ms-home-howto-lnk').setAttribute('href', recipeURL);
	$('main-feat-img').src = featProdImgPath;	
	
	switch (num) {
		case 0: 
			$('arrow_1').src = './images/arrow.jpg'; 
			$('arrow_2').src = './images/no_arrow.jpg';
			$('arrow_3').src = './images/no_arrow.jpg';
			$('arrow_4').src = './images/no_arrow.jpg';
			break;
		case 1: 
			$('arrow_1').src = './images/no_arrow.jpg'; 
			$('arrow_2').src = './images/arrow.jpg';
			$('arrow_3').src = './images/no_arrow.jpg';
			$('arrow_4').src = './images/no_arrow.jpg';
			break;
		case 2: 
			$('arrow_1').src = './images/no_arrow.jpg'; 
			$('arrow_2').src = './images/no_arrow.jpg';
			$('arrow_3').src = './images/arrow.jpg';
			$('arrow_4').src = './images/no_arrow.jpg';
			break;
		case 3: 
			$('arrow_1').src = './images/no_arrow.jpg'; 
			$('arrow_2').src = './images/no_arrow.jpg';
			$('arrow_3').src = './images/no_arrow.jpg';
			$('arrow_4').src = './images/arrow.jpg';
			break;
	}
	

}

