var navOpen = false;

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 swapBg(item, color){
	item.style.background = color;
}
function openWin(url, height, width) {
	var scroll = 0;
	var wleft = (screen.width - width-20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(url,'win','fullscreen=0,scrollbars='+scroll+',height='+height+',width='+width+',top='+wtop+',left='+wleft+'');
}

function showNav(inSection) {
    var sect = document.getElementById(inSection);
    if (inSection == "productnav") {
        $(sect).clonePosition($(inSection + '_button'), { offsetTop: 20, offsetLeft: 55 });
    } else {
        $(sect).clonePosition($(inSection + '_button'), { offsetTop: 20 });
    }
    sect.style.visibility = 'visible';
}
function closeNav(inSection) {
    if (!navOpen) {
        document.getElementById(inSection).style.visibility = 'hidden';
    }
}

function popWindow(whichURL, height, width) {
	window.open( whichURL, "myWindow", 
	"status = 1, height ="+height+", width ="+width+", resizable = 0" )
}
