if (document.images) {
   var demo2 = new Image();
   demo2.src = "images/topnav_demo_on.gif";
   var moto2 = new Image();
   moto2.src = "images/topnav_moto_on.gif";
   var stock2 = new Image();
   stock2.src = "images/topnav_stock_on.gif";
   var store2 = new Image();
   store2.src = "images/topnav_store_on.gif";
   var drag2 = new Image();
   drag2.src = "images/topnav_drag_on.gif";
   var monster2 = new Image();
   monster2.src = "images/topnav_monster_on.gif";
   var mud2 = new Image();
   mud2.src = "images/topnav_mud_on.gif";
   var contact2 = new Image();
   contact2.src = "images/topnav_contact_on.gif";
   var rtarrow2 = new Image();
   rtarrow2.src = "images/rt_arrow_on.gif";
   var leftarrow2 = new Image();
   leftarrow2.src = "images/left_arrow_on.gif";
   var stburst2 = new Image();
   stburst2.src = "images/sidenav_store_on.gif";
   var gear2 = new Image();
   gear2.src = "images/topnav_md-gear_on.gif";
}


function swapNavImage (obj){
	if (document.images) {
		if (document.images[obj].src.indexOf("_on.") == -1){
			var newSrc = document.images[obj].src.substring(0,document.images[obj].src.lastIndexOf(".")) + "_on" + document.images[obj].src.substring(document.images[obj].src.lastIndexOf("."),document.images[obj].src.length);
			document.images[obj].src = newSrc;
		} else {
			var newSrc = document.images[obj].src.substring(0,document.images[obj].src.lastIndexOf(".") - 3) + document.images[obj].src.substring(document.images[obj].src.lastIndexOf("."),document.images[obj].src.length);
			document.images[obj].src = newSrc;
		}
		
	}
}

function showNavArrow (obj,arrow){
	if (document.images) {
		if (document.images[obj].src.indexOf("_on.") == -1){
			document.images[obj].src = "images/" + arrow;
		} else {
			document.images[obj].src = "images/blank.gif";
		}
		
	}
}

function popWindow(url,w,h,bars){
	if (bars == null){
		bars = "no";
	}
	params='height='+ h +',width='+ w +',top=15,left=15,screenX=15,screenY=15,scrollbars='+ bars +',resizable';
	newwin = window.open(url,'newwin',params)
	newwin.focus();
	
}
	
function linkAlert(){
	return window.confirm('This is a link to another website. Certain links on this web site lead to resources located on other web sites maintained by third parties over whom Pepsi-Cola Company has no control. Pepsi-Cola Company makes no representations about any other web site or its contents that you may access through this one. In addition, a link to a non-Pepsi-Cola Company web site does not mean that Pepsi-Cola Company endorses or accepts any responsibility for the content, or the use, of such other web site and no link to this web site from any other web site shall be construed to suggest the existence of any endorsement or other relationship by the owners of such other web sites and Pepsi-Cola Company It also is up to you to take precautions to ensure that whatever you select for your use is free of such items as viruses, worms, trojan horses and other items of a destructive nature.');
}
	
function isselected(form){
    if (form.item[form.item.selectedIndex].value  == "style") { 
    	alert("Please select a style.");
    	return false;
    }
	 if (form.item[form.item.selectedIndex].value  == "size") { 
    	alert("Please select a size.");
    	return false;
    }
	 if (form.item[form.item.selectedIndex].value  == "color") { 
    	alert("Please select a color.");
    	return false;
    }
	 if (form.item[form.item.selectedIndex].value  == "sizecolor") { 
    	alert("Please select a size and color.");
    	return false;
    }
	return true;
}

var isID = 0;
var isAll = 0;
var isLayers = 0;

if (document.getElementById){
	isID = 1;
} else {
	if (document.all){
		isAll = 1;
	} else {
		var browserType = parseInt(navigator.appVersion);
		if ((navigator.appName.indexOf('Netscape') != -1) && (browserType == 4)){
			isLayers = 1;
			var origWidth = innerWidth;
			var origHeight = innerHeight;
			onResize = reloadPage;
		}
	}
}

function reloadPage(){
	if (innerWidth != origWidth || innerHeight != origHeight){
		location.reload();
	}
}
	
function findObject (objectID){
	if (isID){
		return (document.getElementById(objectID).style);
	} else {
		if (isAll){
			return (document.all[objectID].style);
		} else {
			if (isLayers){
				return (document.layers[objectID]);
			}
		}
	}
}

function prodZoom(obj){
	var theObject = findObject(obj);
	state = theObject.visibility;
	if (state == 'hidden' || state == 'hide'){
		theObject.visibility = 'visible';
		return true;
	}
	if (state == 'visible' || state == 'show'){
		theObject.visibility = 'hidden';
		return true;
	}
	theObject.visibility = 'visible'
}