//<guy>
function CustomPart(frm, price, unit, description)
{
	var qlength
	var qwidth
	var qtotal
	var currsym = "£";
	qlength = document[frm][unit + 'length'].value;
	qwidth = document[frm][unit + 'width'].value;
	qtotal = qlength * qwidth * price;
	
	var totot1
	totot1 = Math.round(  ( (Math.round(qtotal * 100) / 100) + 0.001 ) * 1000 ) / 1000
    var totot1str = '' + totot1
    var xpo = totot1str.length
    var totot2 = CommaFormatted(totot1str.substr(0,xpo - 1))

	document[frm][unit + 'total'].value = currsym + totot2;
	var price
	price = totot1;
	document[frm]['price'].value = totot1;
	var partno
	partno = description + ':' + qlength + 'X' + qwidth + unit;
	document[frm]['partno'].value = description + ':' + qlength + 'X' + qwidth + unit;
	var temp
	temp = description + '. Size ' + qlength + unit + ' by ' + qwidth + unit + '.';
	document[frm]['description'].value = temp;
	//document[frm].action = 'code/addtoorder.asp?type=external&partno=' + partno + '&price=' + price + '&description=' + temp
	//alert('bob');
}


function CustomPartSubmit(frm)
{
	var num
	num = parseFloat(document[frm]['price'].value);
	if (!(isNaN(num))) {
		if (num == 0) {
			alert('Please enter sizes greater than 0');
		}
		else {
			if (num < 0.005) {
				alert('Please enter sizes greater than 0');
			}
			else {
				document[frm].submit()
			}
		}
	}
	else {
		alert('Please enter two dimensions')
	}
}
//</guy>
