/*
Code is Copyright 2002 Quantrix.
Use or copying without permission is strictly prohibited.
*/

function processform1(){
	
	var AlreadyAnchored;
	AlreadyAnchored=false;

	form2output.style.display='none';

	if(checkContents(form1.name)==0) {
		alertComplete();
		return 0;
	}
	if(checkContents(form1.email)==0) {
		alertComplete();
		return 0;
	}
	if(form1.product.value=='specify') {
		if(checkContents(form1.productspecify)==0) {
			alertComplete();
			return 0;
		}
	}
	if(form1.product.value=='null'){
		alertComplete();
		return 0;
	}
	if(checkContents(form1.productversion)==0) {
		alertComplete();
		return 0;
	}
	if(checkContents(form1.problem)==0) {
		alertComplete();
		return 0;
	}

	var sText;
	sText='';

	if(form1.chkBugreport.checked) {
		sText += "---BUG REPORT---\n\n";
	} else {
		sText += "---TECHNICAL SUPPORT---\n\n";
	}

	sText += "Name: " + form1.name.value + "\n";
	sText += "E-mail: " + form1.email.value + "\n";
	if(form1.product.value=='specify') {
		sText += "Product: " + form1.productspecify.value + "\n";
	} else {
		sText += "Product: " + form1.product.value + "\n";
	}
	sText += "Version: " + form1.productversion.value + "\n";
	sText += "OS: " + form1.os.value + "\n";
	sText += "RAM: " + form1.ram.value + "\n";
	sText += "HDD: " + form1.hdd.value + "\n";
	sText += "CPU: " + form1.processor.value + "\n";
	sText += "CPU speed: " + form1.processorspeed.value + "\n";
	sText += "System Configuration: \n" + form1.sysconfig.value + "\n";
	sText += "Issue experienced: \n" + form1.problem.value + "\n";

	form2.output.value = sText;

	form2output.style.display='inline';

	if(AlreadyAnchored==false) {
		location.href += "#form2outputa";
		AlreadyAnchored = true
	}

	return 0;

}

function checkContents(oControl){
	if(oControl.value==''){
		return 0;
	} else {
		return 1;
	}
}

function alertComplete(){
	alert("Please fill in all required fields before proceeding.");
}
