function popitup(url) {
	newwindow=window.open(url,'name','height=150,width=300');
	if (window.focus) {newwindow.focus()}
	return false;
}

function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
function ReverseDisplay(d) {
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}

function checkform()
{
	var form_is_ok = 1;
	var form_issue_msg = "";

	if (document.signupform.last_name.value=="")
	{
		// something is wrong
		form_is_ok = 0;
		form_issue_msg = form_issue_msg + "\n - Last Name is a required field.";
	}

	if (document.signupform.email.value=="")
	{
		// something is wrong
		form_is_ok = 0;
		form_issue_msg = form_issue_msg + "\n - Email is a required field.";
	}
	else
	{
		var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
     	if (document.signupform.email.value.search(emailRegEx) == -1)
		{
			form_is_ok = 0;
			form_issue_msg = form_issue_msg + "\n - Enter a valid email address.";
		}
	}

	if (document.signupform.company.value=="")
	{
		// something is wrong
		form_is_ok = 0;
		form_issue_msg = form_issue_msg + "\n - Company is a required field.";
	}

	// If the script gets this far through all of your fields
	// without problems, it's ok and you can submit the form

	if (form_is_ok == 1)
	{
		return true;
	}
	else
	{
		alert("Please correct the following to sign up." + form_issue_msg);
		return false;
	}
}
function checkcontactform()
{
	var form_is_ok = 1;
	var form_issue_msg = "";

	if (document.contactform.first_name.value=="")
	{
		// something is wrong
		form_is_ok = 0;
		form_issue_msg = form_issue_msg + "\n - First Name is a required field.";
	}

	if (document.contactform.last_name.value=="")
	{
		// something is wrong
		form_is_ok = 0;
		form_issue_msg = form_issue_msg + "\n - Last Name is a required field.";
	}

	if (document.contactform.email.value=="")
	{
		// something is wrong
		form_is_ok = 0;
		form_issue_msg = form_issue_msg + "\n - Email is a required field.";
	}
	else
	{
		var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
     	if (document.contactform.email.value.search(emailRegEx) == -1)
		{
			form_is_ok = 0;
			form_issue_msg = form_issue_msg + "\n - Enter a valid email address.";
		}
	}

	if (document.contactform.phone.value=="")
	{
		// something is wrong
		form_is_ok = 0;
		form_issue_msg = form_issue_msg + "\n - Phone is a required field.";
	}

	// If the script gets this far through all of your fields
	// without problems, it's ok and you can submit the form

	if (form_is_ok == 1)
	{
		return true;
	}
	else
	{
		alert("Please correct the following to submit this form. " + form_issue_msg);
		return false;
	}
}

