function toggleCheckBox(argCheckBoxId) {
	document.getElementById(argCheckBoxId).checked = !(document.getElementById(argCheckBoxId).checked);
}

function toggleRadio(argRadioId) {
	if (document.getElementById(argRadioId).checked == false) {
		document.getElementById(argRadioId).checked = !(document.getElementById(argRadioId).checked);
	}
}


function toggleCheckBoxStyle(argCheckBoxTextId) {
	if (document.getElementById(argCheckBoxTextId).style.textDecoration != "underline") {
		document.getElementById(argCheckBoxTextId).style.textDecoration = "underline";
		document.getElementById(argCheckBoxTextId).style.color = "#867A77";
	} else {
		document.getElementById(argCheckBoxTextId).style.textDecoration = "none";
		document.getElementById(argCheckBoxTextId).style.color = "#666666";
	}
}

function validateForm() {
	if (document.shopperForm.fUserName.value=="") {
		alert("Please provide your name.");
		document.shopperForm.fUserName.focus();
		return false;
	}
	
	if (document.shopperForm.fAddressStreet.value=="") {
		alert("Please provide your street address.");
		document.shopperForm.fAddressStreet.focus();
		return false;
	}
	
	if (document.shopperForm.fAddressCity.value=="") {
		alert("Please provide your city.");
		document.shopperForm.fAddressCity.focus();
		return false;
	}
	
	if (document.shopperForm.fAddressState.value=="") {
		alert("Please provide your state.");
		document.shopperForm.fAddressState.focus();
		return false;
	}
	
	if (document.shopperForm.fAddressZip.value=="") {
		alert("Please provide your zip code.");
		document.shopperForm.fAddressZip.focus();
		return false;
	}
	
	if (document.shopperForm.fUserPhone.value=="") {
		alert("Please provide your phone number.");
		document.shopperForm.fUserPhone.focus();
		return false;
	}
	
	if( !checkEmail( document.shopperForm.fUserEmail.value ) ){
		alert("Please provide a valid email address.");
		document.shopperForm.fUserEmail.focus();
		return false;
	}
	
	/*
	if (document.shopperForm.fUserEmail.value=="") {
		alert("Please provide your email address.");
		document.shopperForm.fUserEmail.focus();
		return false;
	}
	
	if (document.shopperForm.fUserEmail.value.indexOf("@") == -1) {
		alert("Email address must contain an @.");
		document.shopperForm.fUserEmail.focus();
		return false;
	}
	
	if (document.shopperForm.fUserEmail.value.indexOf(".") == -1) {
		alert("Email address must contain a dot (.)");
		document.shopperForm.fUserEmail.focus();
		return false;
	}
	*/
	
	if (document.shopperForm.fRoomDescription.value=="") {
		alert("Please provide your a description of the room.");
		document.shopperForm.fRoomDescription.focus();
		return false;
	}
	
	return true;
}

//validate das email
function checkEmail( sValue ){
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if( filter.test( sValue ) ){ return true; } //alert('YES! Correct email address');
	else { return false; } //alert('NO! Incorrect email address');
}
