frontnavimg1 = new Image();
frontnavimg1.src = "/images/frontnav/drinkingfilters_lg.jpg";
frontnavimg2 = new Image();
frontnavimg2.src = "/images/frontnav/showerfilters_lg.jpg";
frontnavimg3 = new Image();
frontnavimg3.src = "/images/frontnav/filteraccessories_lg.jpg";
frontnavimg4 = new Image();
frontnavimg4.src = "/images/frontnav/waterbottles_lg.jpg";
frontnavimg5 = new Image();
frontnavimg5.src = "/images/frontnav/wholehousefilters_lg.jpg";
frontnavimg6 = new Image();
frontnavimg6.src = "/images/frontnav/filtercombopacks_lg.jpg";
frontnavimg7 = new Image();
frontnavimg7.src = "/images/frontnav/replacementfilters_lg.jpg";

frontnavimg1_2 = new Image();
frontnavimg1_2.src = "/images/frontnav/drinkingfilters_lg_undercounter.jpg";
frontnavimg2_2 = new Image();
frontnavimg2_2.src = "/images/frontnav/showerfilters_lg_4105.jpg";
frontnavimg4_2 = new Image();
frontnavimg4_2.src = "/images/frontnav/waterbottles_lg_glass.jpg";

rotatorSequence = 1;

function showTopDiv(d) {
	if (showTopDiv.arguments.length == 2) {
		moused = showTopDiv.arguments[1];
	}
	else {
		moused = true;
	}
	document.getElementById('topnavdiv1').style.display = "none";
	document.getElementById('topnavdiv2').style.display = "none";
	document.getElementById('topnavdiv3').style.display = "none";
	document.getElementById('topnavdiv4').style.display = "none";
	document.getElementById('topnavdiv5').style.display = "none";
	document.getElementById('topnavdiv6').style.display = "none";
	document.getElementById('topnavdiv7').style.display = "none";
	document.getElementById(d).style.display = "block";
	if (moused) {
		switch(d) {
			case "topnavdiv1":
				rotatorSequence = 1;
				break
			case "topnavdiv2":
				rotatorSequence = 3;
				break
			case "topnavdiv3":
				rotatorSequence = 6;
				break
			case "topnavdiv4":
				rotatorSequence = 5;
				break
			case "topnavdiv5":
				rotatorSequence = 7;
				break
			case "topnavdiv6":
				rotatorSequence = 8;
				break
			case "topnavdiv7":
				rotatorSequence = 9;
				break
		}
		resetRotator();
	}
}

function showTopDivNEW(d) {
	if (showTopDivNEW.arguments.length == 2) {
		moused = showTopDivNEW.arguments[1];
	}
	else {
		moused = true;
	}
	document.getElementById('topdivdetail1').style.display = "none";
	document.getElementById('topdivdetail2').style.display = "none";
	document.getElementById('topdivdetail3').style.display = "none";
	document.getElementById('topdivdetail4').style.display = "none";
	document.getElementById('topdivdetail5').style.display = "none";
	document.getElementById('topdivdetail6').style.display = "none";
	document.getElementById('topdivdetail7').style.display = "none";
	document.getElementById(d).style.display = "block";
	switch(d) {
		case "topdivdetail1":
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg1.src+")";
			if (moused) rotatorSequence = 1;
			break
		case "topdivdetail2":
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg2.src+")";
			if (moused) rotatorSequence = 3;
			break
		case "topdivdetail3":
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg3.src+")";
			if (moused) rotatorSequence = 7;
			break
		case "topdivdetail4":
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg4.src+")";
			if (moused) rotatorSequence = 5;
			break
		case "topdivdetail5":
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg5.src+")";
			if (moused) rotatorSequence = 8;
			break
		case "topdivdetail6":
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg6.src+")";
			if (moused) rotatorSequence = 9;
			break
		case "topdivdetail7":
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg7.src+")";
			if (moused) rotatorSequence = 10;
			break
	}
	if (moused) resetRotator();
}

function goNav(url) {
	window.location=url;
}

function rotateThingy() {
	rotatorSequence++;
	switch (rotatorSequence) {
		case 1:
			showTopDivNEW('topdivdetail1',false);
			break
		case 2:
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg1_2.src+")";
			break
		case 3:
			showTopDivNEW('topdivdetail2',false);
			break
		case 4:
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg2_2.src+")";
			break
		case 5:
			showTopDivNEW('topdivdetail4',false);
			break
		case 6:
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg4_2.src+")";
			break
		case 7:
			showTopDivNEW('topdivdetail3',false);
			break
		case 8:
			showTopDivNEW('topdivdetail5',false);
			break
		case 9:
			showTopDivNEW('topdivdetail6',false);
			break
		case 10:
			showTopDivNEW('topdivdetail7',false);
			break
		default:
			rotatorSequence = 1;
			document.getElementById('topnavdiv1').style.backgroundImage = "url("+frontnavimg1.src+")";
			showTopDivNEW('topdivdetail1',false);
	}
}

function rotatorThingy() {
	intervalID = setInterval('rotateThingy()',4000);
}

function resetRotator() {
	clearInterval(intervalID);
	intervalID = setInterval('rotateThingy()',4000);
}
