//JS in Special Promotions Landing Page
//This JS will move the promotions/programs one place to the left or right.
    
    // the variable place is used to keep track of the position one's in when clicking through a module.
    var place=0;
	var placePromo=0;
	var placeProg=0;
	var show=3;
	var right=1;
		
	function click(module, direction)
	{
	    //alert("Debug: click");
	    
		if (module == "Promo") 
	    {
	        place = placePromo;
	    }
	    else 
	    {
	        place = placeProg;
	    }
	        
	    if (direction == "left")
	    {
	        place = place - 1;
	        if (place < 0) {place = 0;}
	        
	        showImages(module, direction);
	    }
	    
	    if (direction == "right")
	    {   
	    	var maxItems;
	        if (module == "Promo") 
	        {
	            maxItems=maxItemsPromo;
	        }
	        else 
	        {
	            maxItems = maxItemsProg;
	        }
			
			if (maxItems <= show)
			{
				place = 0
			}
			else
	    	{
	    		place = place + 1;
	    	}
	        
	        showImages(module, direction);
	    }
	    
	    if (module == "Promo") 
	    {
	        placePromo = place;
	    }
	    else 
        {
	        placeProg = place;
	    }
	}
	    
	    function showImages(module, direction)
	    {        	
	    
	        var maxItems;
	        if (module == "Promo") 
	        {
	            maxItems=maxItemsPromo;
	        }
	        else 
	        {
	            maxItems = maxItemsProg;
	        }
	        
	        var lastToShow = place + show - 1;
            //alert("module = " + module + "; direction = " + direction + "; place = " + place + "; lastToShow = " + lastToShow);
	        
	        var j = 0;
	        for (var i = 0; i < maxItems; i++)
	        {
	            if ((i >= place) && (i <= lastToShow))
	            {
	                //alert("i = " + i + "; place = " + place + ";lastToShow = " + lastToShow);
	                j = j +1;
	                //alert("i = " + i + "; place = " + place + ";lastToShow = " + lastToShow+ ";j = " + j + ";show = " + show);
	                if (j < show)
	                {
	                	//alert("div"+module+i+"block");
	                	//document.getElementById("div"+module+i).style.display = "block";
	                	document.getElementById("div"+module+i).className = "promotionsItem displayBlock";
	                }
	                else
	                {
	                	//alert("div"+module+i+"last");
	                	document.getElementById("div"+module+i).className = "promotionsItemLast displayBlock";
	                }
	            }
	            else
	            {	
					//alert("div"+module+i+"none");
	                //document.getElementById("div"+module+i).style.display = "none";
	                document.getElementById("div"+module+i).className = "displayNone";
	            }
	        }
	        
	        if (direction == "left")
	        {
	            if (place < 0) 
	            {
	                right = show;
	            }
	            else
	            {
	                right = place + show;
	            }
	            
	            //alert("module = " + module + "; place = " + place + ";right = " + right);
	            if (place ==0) 
	            {	
	                document.getElementById("div"+module+"Left").style.display = "none";
	                //alert("here");
	            }
	            if ((right > (show-1)) && (right < maxItems))
	            {
	                document.getElementById("div"+module+"Right").style.display = "";
	            }
	        }
	        else
	        {
	            right = place + show;
	            
	            if (right >= maxItems)
	            {
	                //place = place - 1;
	                document.getElementById("div"+module+"Right").style.display = "none";	                
	            }
	            else
	            {
	                document.getElementById("div"+module+"Right").style.display = "";
	            }
	            document.getElementById("div"+module+"Left").style.display = "";
	            //alert("module = " + module + "; place = " + place + ";right = " + right);
	        }
	    }
