function swapImg(inImage, t){
	if (t == 1){
		if (inImage.src.indexOf('_on.gif') == -1) {
			inImage.src = inImage.src.slice(0,inImage.src.length-4) + '_on.gif';
		}
	}
	else {
		inImage.src = inImage.src.slice(0,inImage.src.length-7) + '.gif';
	}
}

function swapNav(inImage, t){
	if (t == 1){
		if (inImage.src.indexOf('spacer.gif') != -1) {
			inImage.src = '../images/sidenav_arrow.gif';
		}
	}
	else {
		inImage.src = '../images/spacer.gif';
	}
}

function swapSubcats(inCat, t) {
	if (document.getElementById(inCat) != null) {
		if (t == 1) {
			document.getElementById(inCat).style.display = 'block';
		} else {
			document.getElementById(inCat).style.display = 'none';
		}
	}
}

function boxSelect(boxID) {
	
	var catIDarray = catIDs.split(',');
	
	for (var i in catIDarray) {
		try {
			document.getElementById("box" + catIDarray[i]).style.visibility = 'hidden';
		} catch(err) {}
	}
	
	document.getElementById(boxID).style.visibility = 'visible';
	
	if (document.getElementById('boxZone').style.display == 'none') {
		document.getElementById('boxZone').style.display = 'block';
	}
}

function openWin(url, height, width) {
	var height = height;
	var width = width;
	var scroll = 0;
	var wleft = (screen.width - width-20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(url,'thewin','fullscreen=0,scrollbars='+scroll+',height='+height+',width='+width+',top='+wtop+',left='+wleft+'');
}
function openWin2(url, height, width) {
	var height = height;
	var width = width;
	var scroll = 1;
	var wleft = (screen.width - width-20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(url,'thewin','fullscreen=0,scrollbars='+scroll+',height='+height+',width='+width+',top='+wtop+',left='+wleft+'');
}
function openProdWin(url) {
	var width = 800
	var height = 600;
	var wleft = (screen.width - width-20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(url,'prodWin','status=no,toolbar=no,menubar=no,location=no,height='+height+',width='+width+',top='+wtop+',left='+wleft);
}

function SearchFormCheck() {
	if (document.search.keyword.value == "") {
		alert("Please enter a Part Number you'd like to search for.");
		document.search.keyword.focus();
		return false;
	}
}