function showColor(what){
        thestyle=document.getElementById(what).style;
        if(thestyle.background == "#FFFFFF"){
                
        	thestyle.background = "#8897AE";
	}
	else{
                thestyle.background = "#ffffff";
        }
        return false;
}

function setBoth() {
	document.forms['signup'].elements['send_cell'].checked = true;
	showColor('area');
	showColor('first3');
	showColor('last4');
	document.forms['signup'].elements['send_email'].checked = true;
	showColor('signupemail');
}

function validateSignup() {

	var missing_info = "You are missing the following fields:\n";
	var stopsign = 0;

	//Check Terms of Service
	if (document.forms['signup'].elements['agree_terms'].checked == false) {
		missing_info = missing_info + ' - You must agree to the terms of service\n';
		stopsign = 1;
	}

	//Check phone fields if phone notices selected
	if (document.forms['signup'].elements['send_cell'].checked == true) {
		if (!document.forms['signup'].elements['area'].value) {
			missing_info = missing_info + ' - Area Code\n';
			stopsign = 1;
		}
		if (!document.forms['signup'].elements['first3'].value) {
			missing_info = missing_info + ' - First 3 Digits of Phone#\n';
			stopsign = 1;
		}
		if (!document.forms['signup'].elements['last4'].value) {
			missing_info = missing_info + ' - Last 4 Digits of Phone#\n';
			stopsign = 1;
		}
	}

	//Check email fields if email notices selected
	if (document.forms['signup'].elements['send_email'].checked == true) {
		if (!document.forms['signup'].elements['signupemail'].value) {
			missing_info = missing_info + ' - Email\n';
			stopsign = 1;
		}
	}

	//Check to make sure either cell or email notices have been selected
	if ((document.forms['signup'].elements['send_email'].checked == false)&&(document.forms['signup'].elements['send_cell'].checked == false)) {
		missing_info = missing_info + ' - You must select at least one notification method\n';
		stopsign = 1;
	}

	if (stopsign) {	
		alert(missing_info + 'Please correct these fields.');
		return false;
	} else {
		document.forms['signup'].submit();
	}
}

function validateLogin() {

	var missing_info = "You are missing the following fields:\n";
	var stopsign = 0;
	if (!document.forms['login'].elements['username'].value) {
		missing_info = missing_info + ' - Username\n';
		stopsign = 1;
	}
	if (!document.forms['login'].elements['password'].value) {
		missing_info = missing_info + ' - Password\n';
		stopsign = 1;
	}
	if (stopsign) {
		alert(missing_info + 'Please correct these fields.')
		return false;
	} else {
		document.forms['login'].submit();
	}
}

function toggleHoliday() {
//	document.forms['login'].elements['username'].disabled = false;
}
