
function newWindow()
{
	window.open(
		"contact.php",
		"contactWindow",
		"width=520, height=450, toolbar=no, statusbar=no, left=100, top=100"
	);
}

function submitStartForm()
{
	if( validateStartForm() )
	{
		document.startForm.submit();
	}
}

function validateStartForm()
{
	var returnValue = false;
	
	if( document.startForm.problemNum.value == "" )
	{
		alert( "You must make a selection from the menu to proceed." );
		returnValue = false;
	}
	else
	{
		returnValue = true;
	}
	
	return returnValue;
}


function submitFinishForm( whichForm )
{
	switch( whichForm )
	{
		case 'shortFormOne':
			if( validateFinishShortFormOne() )	{	document.finishForm.submit();	}
			break;

		case 'longFormOne':
			if( validateFinishLongFormOne() )	{	document.finishForm.submit();	}
			break;

		case 'longFormTwo':
			if( validateFinishLongFormTwo() )	{	document.finishForm.submit();	}
			break;
					
		case 'longFormThree':
			if( validateFinishLongFormThree() )	{	document.finishForm.submit();	}
			break;
	}
}

function validateFinishShortFormOne()
{
	var returnValue = false;
	var fails = 0;
	var text = "The following field(s) are required:\n\n";
	
	var names = new Array(
		"serialNumber",
		"emailAddress",
		"description"
	);
	
	var labels = new Array(
		" -Serial Number\n",
		" -Email Address\n",
		" -Description\n"
	);
	
	for( count = 0; count < names.length; count++ )
	{
		if( document.finishForm[names[count]].value == "" )
		{
			fails++;
			text += labels[count];
		}
	}
	
	if( fails > 0 )
	{
		alert( text );
		returnValue = false;
	}
	else
	{
		returnValue = true;
	}
	
	return returnValue;
}

function validateFinishLongFormOne()
{
	var returnValue = false;
	var fails = 0;
	var text = "The following field(s) are required:\n\n";
	
	var names = new Array(
		"serialNumber",
		"emailAddress",
		"os",
		"processor",
		"description"
	);
	
	var labels = new Array(
		" -Serial Number\n",
		" -Email Address\n",
		" -Operating System\n",
		" -Processor\n",
		" -Description\n"
	);
	
	for( count = 0; count < names.length; count++ )
	{
		if( document.finishForm[names[count]].value == "" )
		{
			fails++;
			text += labels[count];
		}
	}
	
	if( fails > 0 )
	{
		alert( text );
		returnValue = false;
	}
	else
	{
		returnValue = true;
	}
	
	return returnValue;
}

function validateFinishLongFormTwo()
{
	var returnValue = false;
	var fails = 0;
	var text = "The following field(s) are required:\n\n";
	
	var names = new Array(
		"serialNumber",
		"emailAddress",
		"os",
		"processor",
		"hardware",
		"description"
	);
	
	var labels = new Array(
		" -Serial Number\n",
		" -Email Address\n",
		" -Operating System\n",
		" -Processor\n",
		" -Third Party Audio Hardware\n",
		" -Description\n"
	);
	
	for( count = 0; count < names.length; count++ )
	{
		if( document.finishForm[names[count]].value == "" )
		{
			fails++;
			text += labels[count];
		}
	}
	
	if( fails > 0 )
	{
		alert( text );
		returnValue = false;
	}
	else
	{
		returnValue = true;
	}
	
	return returnValue;
}

function validateFinishLongFormThree()
{
	var returnValue = false;
	var fails = 0;
	var text = "The following field(s) are required:\n\n";
	
	var names = new Array(
		"serialNumber",
		"emailAddress",
		"os",
		"processor",
		"software",
		"description"
	);
	
	var labels = new Array(
		" -Serial Number\n",
		" -Email Address\n",
		" -Operating System\n",
		" -Processor\n",
		" -Third Party Software\n",
		" -Description\n"
	);
	
	for( count = 0; count < names.length; count++ )
	{
		if( document.finishForm[names[count]].value == "" )
		{
			fails++;
			text += labels[count];
		}
	}
	
	if( fails > 0 )
	{
		alert( text );
		returnValue = false;
	}
	else
	{
		returnValue = true;
	}
	
	return returnValue;
}


