// JavaScript Document

var divarray = new Array("div1","div2","div3","div4","div5");
	var divbuttonarray = new Array("divbutton1","divbutton2","divbutton3","divbutton4","divbutton5");
    var step=1;
    var t;
    
    function showdivtag()
    {
	    var args = showdivtag.arguments;
	    var i;	    
        if(args.length==1) {
            stopCount();
            step = args[0];
                        
            if (step<5)
                step++
            else
                step=1
        }
        
	    for(i=0;i<divarray.length;i++)
	    {
		    if(divarray[i]=='div' + args[0]){
				//alert(aprocessed.src);
			    document.getElementById(divarray[i]).style.display = "block";
				document.getElementById(divbuttonarray[i]).style.backgroundImage = 'url(http://www.babyshoppy.co.uk/images/banner1/featured_active_button.png)';
			}else{
				//alert(divbuttonarray[i]);
				document.getElementById(divarray[i]).style.display = "none";
				document.getElementById(divbuttonarray[i]).style.backgroundImage = 'url(http://www.babyshoppy.co.uk/images/banner1/featured_nonactive_button.png)';
			}
	    }	
    }
        
    function slideit(){
        showdivtag(step,1)
        if (step<5)
            step++
        else
            step=1
        
        //call function "slideit()" every 2.5 seconds
        t=setTimeout("slideit()",2500)
    }
    
    function stopCount()
    {
        clearTimeout(t);
    }    
