// JavaScript Document

var tabItems = new Array("buzz","labels","about");
var tabOn = "buzz";



function hiLight() {
	document.images[tabOn].src = "/img/tabs/" + tabOn + "-on.gif";
	document.images["tabsbg"].src = "/img/tabs/bg-" + tabOn + ".gif";
}

function goTab(tabName) {
	tabOn = tabName;
	for (i=0;i<tabItems.length;i++) {
		document.images[tabItems[i]].src = "/img/tabs/" + tabItems[i] + ".gif";
	}
	document.images["tabsbg"].src = "/img/tabs/bg-" + tabOn + ".gif";
	hiLight();
	top.window.areaThreeFrame.location.href = tabName + ".cfm";
}

function specialsInfo(specialName) {
	var url = "/specials.php?" + specialName;
	var width = "565";
	var height = "420";
	
	var windowName = "specialsWin" ;
	var featureString = "," + "status=no,toolbar=no,directories=no,location=no,resizable=yes,scrolling=auto,scrollbars=yes,favorites=no,menubar=no";
	
	var x = Math.round((screen.availWidth - width) / 2);
	var y = Math.round((screen.availHeight - height) / 2);
	windowStuff = "left=" + x + ",top=" + y + ",width=" + width + ",height=" + height + featureString;
	return open (url, windowName, windowStuff);
	
}

function valForm() {
var emailStr = document.listForm.email_address.value ;
var emailPat = /^(.+)@(.+)$/ ;
var matchArray = emailStr.match(emailPat) ;

if ((document.listForm.email_address.value != '') && (matchArray==null)) {
		alert('Please enter a Valid Email Address.') ;
		document.listForm.email_address.focus();
		return false ;
	} else if (document.listForm.email_address.value == '') {
		alert('Please enter your Email Address.') ;
		document.listForm.email_address.focus();
		return false ;
	} else {
		//alert('Thanks for signing up!');
		document.listForm.submit();
	}
}

function viewBuzz(buzzNum,picWidth,picHeight) {
	var url = "/buzzfiles/buzzpop.php?" + buzzNum;
	if (picHeight > screen.availHeight) {
	var width = picWidth + 20;
	var height = screen.availHeight - 20;
	var featureString = "," + "status=yes,toolbar=no,directories=no,location=no,resizable=yes,scrolling=yes,scrollbars=yes,favorites=no,menubar=no";
	} else {
	var width = picWidth;
	var height = picHeight;
	var featureString = "," + "status=no,toolbar=no,directories=no,location=no,resizable=no,scrolling=no,scrollbars=no,favorites=no,menubar=no";
	}
	
	var windowName = "buzzWin" ;
	
	var x = Math.round((screen.availWidth - width) / 2);
	var y = Math.round((screen.availHeight - height) / 2);
	windowStuff = "left=" + x + ",top=" + y + ",width=" + width + ",height=" + height + featureString;
	return open (url, windowName, windowStuff);
	
}


function init() {
	top.window.areaThreeFrame.location.href = "buzz.cfm";
}