function showOnlineSupport()
{
	var showOnlineSupportLink = document.getElementById("showonlinesupportlink");
	showOnlineSupportLink.style.visibility = "hidden";
	showOnlineSupportLink.style.height = "0px";
	
	var onlineSupportDynamicArea = document.getElementById("onlinesupportdynamicarea");
	onlineSupportDynamicArea.style.visibility = "visible";
	onlineSupportDynamicArea.style.height = "auto";
	onlineSupportDynamicArea.style.marginTop = "10px";
	onlineSupportDynamicArea.style.paddingTop = "16px";
	onlineSupportDynamicArea.style.paddingBottom = "20px";
	onlineSupportDynamicArea.style.marginBottom = "10px";
	
	/* prevent clicked anchor that called this from actually being followed */
	return false;
}

function hideOnlineSupport()
{
	var showOnlineSupportLink = document.getElementById("showonlinesupportlink");
	showOnlineSupportLink.style.visibility = "visible";
	showOnlineSupportLink.style.height = "auto";
	
	var onlineSupportDynamicArea = document.getElementById("onlinesupportdynamicarea");
	onlineSupportDynamicArea.style.visibility = "hidden";
	onlineSupportDynamicArea.style.height = "0px";
	onlineSupportDynamicArea.style.marginTop = "0px";
	onlineSupportDynamicArea.style.paddingTop = "0px";
	onlineSupportDynamicArea.style.paddingBottom = "0px";
	onlineSupportDynamicArea.style.marginBottom = "0px";
	
	/* prevent clicked anchor that called this from actually being followed */
	return false;
}




function showLostKey()
{
	var showLostKeyLink = document.getElementById("showlostkeysupportlink");
	showLostKeyLink.style.visibility = "hidden";
	showLostKeyLink.style.height = "0px";
	
	var lostKeyArea = document.getElementById("lostkeydynamicarea");
	lostKeyArea.style.visibility = "visible";
	lostKeyArea.style.height = "auto";
	lostKeyArea.style.marginTop = "10px";
	lostKeyArea.style.paddingTop = "16px";
	lostKeyArea.style.paddingBottom = "20px";
	lostKeyArea.style.marginBottom = "10px";
	
	/* prevent clicked anchor that called this from actually being followed */
	return false;
}

function hideLostKey()
{
	var showLostKeyLink = document.getElementById("showlostkeysupportlink");
	showLostKeyLink.style.visibility = "visible";
	showLostKeyLink.style.height = "auto";
	
	var lostKeyArea = document.getElementById("lostkeydynamicarea");
	lostKeyArea.style.visibility = "hidden";
	lostKeyArea.style.height = "0px";
	lostKeyArea.style.marginTop = "0px";
	lostKeyArea.style.paddingTop = "0px";
	lostKeyArea.style.paddingBottom = "0px";
	lostKeyArea.style.marginBottom = "0px";
	
	/* prevent clicked anchor that called this from actually being followed */
	return false;
}




function showRegister()
{
	var showregisterLink = document.getElementById("showregisterlink");
	showregisterLink.style.visibility = "hidden";
	showregisterLink.style.height = "0px";
	
	var registerdynamicarea = document.getElementById("registerdynamicarea");
	registerdynamicarea.style.visibility = "visible";
	registerdynamicarea.style.height = "auto";
	registerdynamicarea.style.marginTop = "10px";
	registerdynamicarea.style.paddingTop = "16px";
	registerdynamicarea.style.paddingBottom = "10px";
	registerdynamicarea.style.marginBottom = "10px";
	
	/* prevent clicked anchor that called this from actually being followed */
	return false;
}

function hideRegister()
{
	var showregisterLink = document.getElementById("showregisterlink");
	showregisterLink.style.visibility = "visible";
	showregisterLink.style.height = "auto";
	
	var registerdynamicarea = document.getElementById("registerdynamicarea");
	registerdynamicarea.style.visibility = "hidden";
	registerdynamicarea.style.height = "0px";
	registerdynamicarea.style.marginTop = "0px";
	registerdynamicarea.style.paddingTop = "0px";
	registerdynamicarea.style.paddingBottom = "0px";
	registerdynamicarea.style.marginBottom = "0px";
	
	/* prevent clicked anchor that called this from actually being followed */
	return false;
}




function verifySupportForm( tf )
{
	var returnVal = false;
	
	if (tf.firstname.value == "")
	{
		alert("Please enter your first name.");
		tf.firstname.focus();
	}
	else if (tf.lastname.value == "")
	{
		alert("Please enter your last name.");
		tf.lastname.focus();
	}
	else if( (tf.email.value == "") || (tf.email.value.match( /^.+@(.+\.\w{2,4})$/ ) == null) )
	{
		alert("Please enter a valid e-mail address.");
		tf.email.focus();
		tf.email.select();
	}
	else if ( tf.product.selectedIndex == 0 )
		alert("Please choose the product for which you are seeking support.");
	else if (tf.serial.value == "")
	{
		alert("Please enter the serial number of your product.");
		tf.serial.focus();
	}
	else if (tf.osversion.value == "")
	{
		alert("Please enter your computer's operating system.");
		tf.osversion.focus();
	}
	else if (tf.computer.value == "")
	{
		alert("Please enter the make/model of your computer.");
		tf.computer.focus();
	}
	else if( tf.issue.value == "" || tf.issue.value == tf.issue.defaultValue )
	{
		alert("Please enter a description of the problem.");
		tf.issue.focus();
		tf.issue.select();
	}
	else
		returnVal = true;
	
	return returnVal;
}


function verifyLostKeyForm( tf )
{
	var returnVal = false
	
	if (tf.product.selectedIndex == 0)
		alert("Please select a product and version from the popup menus.")
	else if (tf.version.selectedIndex == 0)
		alert("Please select a product version from the popup menu.")
	else if( (tf.email.value == "") || (tf.email.value.match( /^.+@(.+\.\w{2,4})$/ ) == null) )
	{
		alert("Please enter a valid e-mail address.");
		tf.email.focus();
		tf.email.select();
	}
	else if( tf.serial.value == "" && (tf.problem.value == "" || tf.problem.value == tf.problem.defaultValue) )
	{
		alert( "To best help locate your activation key, please provide either your serial number or detailed notes on your situation." );
		tf.serial.focus();
	}
	else
		returnVal = true
	
	return returnVal
}


function verifyRegisterForm( tf )
{
	var returnVal = false;
	var year = 0;
	
	if (tf.p_year.value.length == 4)
		year = parseInt(tf.p_year.value);
	
	if (tf.p_product.selectedIndex == 0)
		alert("Please select a product and version from the popup menus.")
	else if (tf.p_version.selectedIndex == 0)
		alert("Please select a product version from the popup menu.")
	else if( (tf.email.value == "") || (tf.email.value.match( /^.+@(.+\.\w{2,4})$/ ) == null) )
	{
		alert("Please enter a valid e-mail address.");
		tf.email.focus();
		tf.email.select();
	}
	else if (tf.p_serial.value.length != 7)
	{
		var	serialLen = tf.p_serial.value.length;
		if (serialLen < 7)
			alert("Your serial number should be 7 digits in length.");
		else if (serialLen > 7)
			alert("Your serial number should be 7 digits in length. You may have accidentally entered your activation key instead of your serial number.");
			
		tf.p_serial.focus();
		tf.p_serial.select();
	}
	else if (tf.firstname.value == "")
	{
		alert("Please enter your first name.");
		tf.firstname.focus();
	}
	else if (tf.lastname.value == "")
	{
		alert("Please enter your last name.")
		tf.lastname.focus();
	}
	else if (tf.address.value == "")
	{
		alert("Please enter your address.")
		tf.address.focus();
	}
	else if (tf.city.value == "")
	{
		alert("Please enter your city.")
		tf.city.focus();
	}
	else if (tf.zip.value == "")
	{
		alert("Please enter your zip/postal code.")
		tf.zip.focus();
	}
	else if (tf.country.selectedIndex == 0)
		alert("Please select your country.")
	else if( tf.country[tf.country.selectedIndex].value == "USA" && tf.state.value == "" )
	{
		alert( "Please enter your state" );
		tf.state.focus();
	}
	else if (tf.p_month.selectedIndex == 0 || tf.p_day.selectedIndex == 0)
		alert("Please enter the date of your purchase.")
	else if (tf.p_year.value.length != 4 || isNaN(year) || year < 1984 || year > Date().getFullYear())
	{
		alert("Please enter the year of your purchase.")
		tf.p_year.focus();
		tf.p_year.select();
	}
	else
		returnVal = true
	
	return returnVal
}
