// JavaScript Document

function chgImg(id,newImg) {
	document.getElementById(id).src = newImg;
}

function chgDisplay(id,status) {
	document.getElementById(id).style.display = status;
}

function chgSubnav(id,color) {
	document.getElementById(id).style.backgroundColor = color;
}

function chgContent(targetID,newID) {
	document.getElementById(targetID).innerHTML=document.getElementById(newID).innerHTML;
}

function thisYear() {
	thisYear = new Date();
	currYear = thisYear.getFullYear();
	document.write(currYear);
}


// Check Browser

function checkBrowser() {
	var browser=navigator.appName;
	var version=navigator.appVersion;
	if (browser.indexOf("Microsoft") != -1) {
		if (version.indexOf("MSIE 6.") != -1 || version.indexOf("MSIE 5.") != -1) {
			window.location = "browser-upgrade.html";
		}
	}
}


// Product Tour Lightbox

var screenW, screenH;

function openLB(newLoc) {
	new Ajax.Updater('productTourContainer', newLoc, { 
		method: 'get',
		onComplete: function() {
			screenW = document.body.scrollWidth;
			document.getElementById('lightbox').style.left = (screenW-980)/2+"px";
			document.getElementById('lightbox').style.top = "30px";
			document.getElementById('overlay').style.display = "block";
			document.getElementById('lightbox').style.display = "block";
		}
	});
}

function closeLB() {
	document.getElementById('overlay').style.display = "none";
	document.getElementById('lightbox').style.display = "none";
}
