function actionQuote() {
	
	// validate user-supplied inputs
	pageQuantity = parseInt( document.PriceCalc.PageQty.value );
	pageCopies = parseInt( document.PriceCalc.CopyQty.value );

	if( isNaN( pageQuantity ) ){
		alert("Please enter total quantity of finished items.");
		document.PriceCalc.PageQty.focus();
	}else if( pageQuantity < 1 ){
		alert("Number of finished items cannot be lower than one.");
		document.PriceCalc.PageQty.focus();
	}else if( isNaN( pageCopies ) ){
		alert("Please enter the number of copies required.");
		document.PriceCalc.CopyQty.focus();
	}else if( pageCopies < 1 ){
		alert("Number of copies cannot be lower than one.");
		document.PriceCalc.CopyQty.focus();
	}else if( document.PriceCalc.JobName.value.length == 0 ){
		alert("Please enter a job name for your own reference\r\nthis will help you identify individual jobs later on.");
		document.PriceCalc.JobName.focus();
	}else if( document.PriceCalc.JobOrderRef.value == "" && document.PriceCalc.forcePO.value == "Y" ){
		alert("Please supply a purchase order reference, you\r\ncan change your PO reference later on if required.");
		document.PriceCalc.JobOrderRef.focus();
	}else{
		if( document.PriceCalc.loginPrice.value == "Y" ) {
			document.PriceCalc.submit();
		} else {
			document.PriceCalc.Username.focus();
			alert("Please login before building a full quote, dont worry -\r\nyour current quote will still be here when you get back.");
		}
	}
}

function actionLogin() {
	
	// check required fields
	if( document.PriceCalc.Username.value.length == 0 && document.PriceCalc.Password.value.length == 0 ){
		alert( "Please enter your username and password before logging in." );
		document.PriceCalc.Username.focus();
	}else if( document.PriceCalc.Username.value.length == 0 ){
		alert( "Please enter your username before logging in." );
		document.PriceCalc.Username.focus();
	}else if( document.PriceCalc.Password.value.length == 0 ){
		alert( "Please enter your password before logging in." );
		document.PriceCalc.Password.focus();
	}else{
		document.PriceCalc.mode.value = "login";
		document.PriceCalc.action = "core.asp";
		document.PriceCalc.submit();
	}
}

function actionRegister() {
	document.PriceCalc.mode.value = "preregister";
	document.PriceCalc.submit();
}

function actionUpload(){
	document.PriceCalc.mode.value = "upload";
	document.PriceCalc.submit();
}

function actionSearch(){
	document.location.href = "search.asp";
}

document.PriceCalc.JobName.focus();

