var stepArray=new Array(1,2,3,4,5,6,7,8);

function showStep(divId) {
    //divId is the integer of the div we want to show, all others will be hidden
    for(var i=1; i <= stepArray.length; i++) {
	    //this goes through and turns off all divs except the one we want to show.
	    var divTemp = document.getElementById("step"+i);
	    var aTemp = document.getElementById("steps_nav");
	    if(divTemp==null) {
	        return;
	    } else if(divId != i) {
		    //hide the sucker
		    divTemp.style.display = "none";
	    } else {
		    //this one is good, show it
		    divTemp.style.display = "block";
		    aTemp.setAttribute("class", "active"+i);
		    aTemp.setAttribute("className", "active"+i);
	    }
    }
}
var s=1;
var l=0;
function prev(){
	if(s<2){
	    showStep(8);
		s=8;
	} else {
		l = s-=1;
	    showStep(l);
	}
}

function next(){
	if(s>7){
	    showStep(1);
		s=1;
	} else {
		l = s+=1;
	    showStep(l);
	}  
}