var onColor = "#00017D";
var offColor = "#639437";
// Mozilla uses RGB
var onRGB = "rgb(0, 1, 125)";
var offRGB = "rgb(99, 148, 55)";

function rollTab(tab)
{
	var newColor = "";
	tab.style.cursor = "hand";
	if(tab.style.backgroundColor == offColor || tab.style.backgroundColor == offRGB || tab.style.backgroundColor == "") {
		newColor = onColor;
	} else {
		newColor = offColor;
	}
	tab.style.backgroundColor = newColor;
}

function clickTab(url)
{
	window.location.href = url;
}

function popWin(url, width, height, name, properties)
{
	var winProperties = properties;
	if (!winProperties) winProperties = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
	if (width > 0) winProperties = winProperties + ',width=' + width;
	if (height > 0) winProperties = winProperties + ',height=' + height;
	if(!name) name = "popWin";
	var win = window.open(url, name, winProperties);
	win.focus();
}

function printWin()
{
	var newLoc = document.location.href;
	newLoc = newLoc.replace(/#[A-Za-z0-9]*/ig, "");
	newLoc = newLoc + ((newLoc.indexOf("?") > -1) ? "&" : "?");
	newLoc = newLoc + "print=true";
	popWin(newLoc, "_printWin", 700, 0, "toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes")
}

function checkFastBreakForm() {
	if (document.subscribeForm. elements['Email Address'].value.length > 0) {
		return true;
	} else {
		alert('Please enter your email address.');
		document.subscribeForm. elements['Email Address'].focus();
		return false;
	}
}


var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function getStyle(id) {
	return (isNS4 ? getRef(id) : getRef(id).style);
} 

function moveOffer() {
	if (!isDyn) return;	

	var myElementStyle = getStyle("fastbreak");
	myElementStyle.visibility = "hidden";
	//var y = (isNaN(parseInt(myElementStyle.top)) ? 0 : parseInt(myElementStyle.top));
	//alert(y);
	//myElementStyle.top = y + 10 + "px";
}
