<!--Begin
//UK quote
var exrate=1; 
function sumit(plans){ 
var kood=document.myForm.postikood.value;
if (kood=="")
{
	alert("Please enter your postcode!");
	document.myForm.postikood.focus();
	return (false);
}

if (kood.match(" ")==null){
alert("Please use the correct format. There must be a space in the postcode.");
	document.myForm.postikood.focus();
return (false);
}

var l_2=document.form_2.length_2.value;
var w_2=document.form_2.width_2.value;
var l_3=document.form_2.length_3.value;
var w_3=document.form_2.width_3.value;
var l_4=document.form_2.length_4.value;
var w_4=document.form_2.width_4.value;
var l_5=document.form_2.length_5.value;
var w_5=document.form_2.width_5.value;
var l_6=document.form_2.length_6.value;
var w_6=document.form_2.width_6.value;
var l_7=document.form_2.length_7.value;
var w_7=document.form_2.width_7.value;
if (l_2!=0)
{c2=1}
else 
{c2=0}
if (l_3!=0)
{c3=1}
else 
{c3=0}
if (l_4!=0)
{c4=1}
else 
{c4=0}
if (l_5!=0)
{c5=1}
else 
{c5=0}
if (l_6!=0)
{c6=1}
else 
{c6=0}
if (l_7!=0)
{c7=1}
else 
{c7=0}
check=1+c2+c3+c4+c5+c6+c7;
document.form_2.pieces.value=check;
//--------------1. Validate number of pieces---------------------------------
 if (document.form_2.pieces.value == "")
 {
 document.form_2.pieces.value = 0;
 }
var checkOK = "1234567";
  var checkStr = document.form_2.pieces.value;
  var allValid = true;
  var allNum = "";
  if (checkStr == "0" || checkStr =="")
  {
		alert("Please enter number of pieces!");
		document.form_2.pieces.focus();
		return (false);
  }
 if (checkStr != "0" || checkStr !="")
  {
  for (i = 0;  i < checkStr.length;  i++)
   {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
		{
		allValid = false;
		break;
		}
    }
   if (!allValid)
   {
    alert("Please enter a positive integer from 1 to 7!");
    document.form_2.pieces.focus();
    return (false);
   }
}
//------------------validate length_1----------

 if (document.form_2.length_1.value == "")
 {
 document.form_2.length_1.value = 0;
 }
 
var checkOK = "0123456789.,-";
  var checkStr = document.form_2.length_1.value;
  var allValid = true;
  var allNum = "";
  if (document.form_2.length_1.value=="0" || document.form_2.length_1.value=="")
  {
  alert("Please enter length of your worktop!");
  document.form_2.length_1.focus();
  document.plans.estimate.value=0;
  document.form_2.fitting.value=0;
  document.plans.check.value=0;
  return (false);
  }
  if (document.form_2.length_1.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
		{
		allValid = false;
		break;
		}
    if (ch =="-")
	{
	alert("Please enter a positive number!");
	document.form_2.length_1.focus();
	return (false);
    }
    if (ch == "." || ch == "," || document.form_2.length_1.value < 100)
	{ alert("Please enter length in millimetres! \n Minimum length is 100 mm");
	document.form_2.length_1.focus();
	return (false);
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.length_1.focus();
    return (false);
  }

//---------------validate width_1 -------------------	
 if (document.form_2.width_1.value == "")
 {
 document.form_2.width_1.value = 0;
 }
var checkOK = "0123456789.,-";
  var checkStr = document.form_2.width_1.value;
  var allValid = true;
  var allNum = "";
  if (document.form_2.width_1.value=="0" || document.form_2.width_1.value=="")
  {
	window.alert("Please enter width of your worktop!");
	document.form_2.width_1.focus();
    return (false);
  }	
	if (document.form_2.width_1.value != "0")
  {
  for (i = 0;  i < checkStr.length;  i++)
   {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
      if (j == checkOK.length)
		{
		allValid = false;
		break;
		}
	  if (ch =="-")
		{ alert("Please enter a positive number!");
		document.form_2.width_1.focus();
		return (false);
		}
	 if (ch == "." || ch == "," || document.form_2.width_1.value < 100)
		{ alert("Please enter width in millimetres!  \n Minimum width is 100 mm");
		document.form_2.width_1.focus();
		return (false);
        }
	 }
  if (!allValid)
	{
    alert("Please enter only digit characters!");
    document.form_2.width_1.focus();
    return (false);
	}
}

//--------Validate length_2----------
 if (l_2 == "")
 {
 document.form_2.length_2.value = 0;
 }
if (w_2!=0&&l_2==0)
{
alert("Please enter length of 2nd piece too!");
document.form_2.length_2.focus();
return (false);
}
  var checkOK = "0123456789.,-";
  var checkStr = document.form_2.length_2.value;
  var allValid = true;
  var allNum = "";
  if (document.form_2.length_2.value != "0")
  {
     for (i = 0;  i < checkStr.length;  i++)
		{
		ch = checkStr.charAt(i);
		 for (j = 0;  j < checkOK.length;  j++)
		  if (ch == checkOK.charAt(j))
			break;
			if (j == checkOK.length)
			{
			allValid = false;
			break;
			}
			if (ch =="-")
			{
			alert("Please enter a positive number!");
			document.form_2.length_2.focus();
			return (false);
			}
	if (ch == "." || ch == "," || document.form_2.length_2.value < 100)
		{
		alert("Please enter length of 2nd piece in millimetres! \n Minimum length is 100 mm");
		document.form_2.length_2.focus();
		return (false);
		}
	}
	if (!allValid)
	{alert("Please enter only digit characters!");
    document.form_2.length_2.focus();
    return (false);
	}
}
//---------Validate width_2-------------
  if (w_2 == "")
 {
document.form_2.width_2.value = 0;
 }
if (l_2!=0&&w_2==0)
{
alert("Please enter width of 2nd piece too!");
document.form_2.width_2.focus();
return (false);
}
var checkOK = "0123456789.,-";
  var checkStr = document.form_2.width_2.value;
  var allValid = true;
  var allNum = "";
  if (document.form_2.width_2.value != "0")
  {
	for (i = 0;  i < checkStr.length;  i++)
	{
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
	if (ch =="-")
	{ alert("Please enter a positive number!");
	document.form_2.width_2.focus();
	return (false);
    }
	if (ch == "." || ch == "," || document.form_2.width_2.value < 100)
	{ alert("Please enter width of 2nd piece in millimetres!  \n Minimum width is 100 mm");
	document.form_2.width_2.focus();
	return (false);
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.width_2.focus();
    return (false);
  }
 } 
//----------------validate 3rd piece------------
//Validate length_3
 if (l_3 == "")
 {
 document.form_2.length_3.value = 0;
 }
if (w_3!=0&&l_3==0)
{
alert("Please enter length of 3rd piece too!");
document.form_2.length_3.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.length_3.value;
  var allValid = true;
  var allNum = "";
  if (document.form_2.length_3.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.length_3.value < 100)
	{ alert("Please enter length of 3rd piece in millimetres!  \n Minimum length is 100 mm");
	document.form_2.length_3.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.length_3.focus();
    return (false);
  }
 }
//Validate width_3
 if (w_3 == "")
 {
 document.form_2.width_3.value = 0;
 }
if (l_3!=0&&w_3==0)
{
alert("Please enter width of 3rd piece too!");
document.form_2.width_3.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.width_3.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.width_3.focus();
 return (false);
 }
  if (document.form_2.width_3.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.width_3.value < 100)
	{ alert("Please enter width of 3rd piece in millimetres!  \n Minimum width is 100 mm");
	document.form_2.width_3.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.width_3.focus();
    return (false);
  }
}
//////////////////////////////////////////////
//validate 4th piece
//Validate length_4
 if (l_4 == "")
 {
 document.form_2.length_4.value = 0;
 }
if (w_4!=0&&l_4==0)
{
alert("Please enter length of 4th piece too!");
document.form_2.length_4.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.length_4.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.length_4.focus();
 return (false);
 }
  if (document.form_2.length_4.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.length_4.value < 100)
	{ alert("Please enter length of 4th piece in millimetres!  \n Minimum length is 100 mm");
	document.form_2.length_4.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.length_4.focus();
    return (false);
  }
}
//Validate width_4
 if (w_4 == "")
 {
 document.form_2.width_4.value = 0;
 }
if (l_4!=0&&w_4==0)
{
alert("Please enter width of 4th piece too!");
document.form_2.width_4.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.width_4.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.width_4.focus();
 return (false);
 }
  if (document.form_2.width_4.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.width_4.value < 100)
	{ alert("Please enter width of 4th piece in millimetres!  \n Minimum width is 100 mm");
	document.form_2.width_4.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.width_4.focus();
    return (false);
  }
}
///////////////////////////////////////
//validate 5th piece
//Validate length_5
 if (l_5 == "")
 {
 document.form_2.length_5.value = 0;
 }
if (w_5!=0&&l_5==0)
{
alert("Please enter length of 5th piece too!");
document.form_2.length_5.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.length_5.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.length_5.focus();
 return (false);
 }
  if (document.form_2.length_5.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.length_5.value < 100)
	{ alert("Please enter length of 5th piece in millimetres!  \n Minimum length is 100 mm");
	document.form_2.length_5.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.length_5.focus();
    return (false);
  }
}
//Validate width_5
 if (w_5 == "")
 {
 document.form_2.width_5.value = 0;
 }
if (l_5!=0&&w_5==0)
{
alert("Please enter width of 5th piece too!");
document.form_2.width_5.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.width_5.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.width_5.focus();
 return (false);
 }
  if (document.form_2.width_5.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.width_5.value < 100)
	{ alert("Please enter width of 5th piece in millimetres!  \n Minimum width is 100 mm");
	document.form_2.width_5.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.width_5.focus();
    return (false);
  }
}
/////////////////////////////////
//validate 6th piece
//Validate length_6
 if (l_6 == "")
 {
 document.form_2.length_6.value = 0;
 }
if (w_6!=0&&l_6==0)
{
alert("Please enter length of 6th piece too!");
document.form_2.length_6.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.length_6.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.length_6.focus();
 return (false);
 }
  if (document.form_2.length_6.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.length_6.value < 100)
	{ alert("Please enter length of 6th piece in millimetres!  \n Minimum length is 100 mm");
	document.form_2.length_6.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.length_6.focus();
    return (false);
  }
}
//Validate width_6
 if (w_6 == "")
 {
 document.form_2.width_6.value = 0;
 }
if (l_6!=0&&w_6==0)
{
alert("Please enter width of 6th piece too!");
document.form_2.width_6.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.width_6.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.width_6.focus();
 return (false);
 }
  if (document.form_2.width_6.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.width_6.value < 100)
	{ alert("Please enter width of 6th piece in millimetres!  \n Minimum width is 100 mm");
	document.form_2.width_6.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.width_6.focus();
    return (false);
  }
}
//////////////////////////////////
 //validate 7th piece
//Validate length_7
 if (l_7 == "")
 {
 document.form_2.length_7.value = 0;
 }
if (w_7!=0&&l_7==0)
{
alert("Please enter length of 7th piece too!");
document.form_2.length_7.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.length_7.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.length_7.focus();
 return (false);
 }
  if (document.form_2.length_7.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.length_7.value < 100)
	{ alert("Please enter length of 7th piece in millimetres!  \n Minimum length is 100 mm");
	document.form_2.length_7.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.length_7.focus();
    return (false);
  }
}
//Validate width_7
 if (w_7 == "")
 {
 document.form_2.width_7.value = 0;
 }
if (l_7!=0&&w_7==0)
{
alert("Please enter width of 7th piece too!");
document.form_2.width_7.focus();
return (false);
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.width_7.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.width_7.focus();
 return (false);
 }
  if (document.form_2.width_7.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.width_7.value < 100)
	{ alert("Please enter width of 7th piece in millimetres!  \n Minimum width is 100 mm");
	document.form_2.width_7.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.width_7.focus();
    return (false);
  }
}
//-------2. Validate length of straight polished edges, straight profile
 if (document.form_2.straight.value == "")
 {
 document.form_2.straight.value = 0;
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.straight.value;
  var allValid = true;
//  var allNum = "";
 
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.straight.focus();
 return (false);
 }
  if (document.form_2.straight.value != "0"){
	for (i = 0;  i < checkStr.length;  i++)
	{
	 ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
			break;
			if (j == checkOK.length)
			{
			allValid = false;
			break;
			}
	if (ch == "." || ch == "," || document.form_2.straight.value < 100)
		{ alert("Please enter length of straight polished edges in millimetres!  \n Minimum length is 100 mm");
		document.form_2.straight.focus();
		return (false);
		}
	}
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.straight.focus();
    return (false);
  }
}
//validate straight polished edges, half-rounded profile
 if (document.form_2.halfrounded.value == "")
 {
 document.form_2.halfrounded.value = 0;
}

var checkOK = "0123456789.,";
  var checkStr = document.form_2.halfrounded.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.halfrounded.focus();
 return (false);
 }
  if (document.form_2.halfrounded.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.halfrounded.value < 100)
	{ alert("Please enter length of halfrounded edges in millimetres!  \n Minimum length is 100 mm");
	document.form_2.halfrounded.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.halfrounded.focus();
    return (false);
	}
  }
//validate straight polished edges, rounded profile
 if (document.form_2.rounded.value == "")
 {
 document.form_2.rounded.value = 0;
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.rounded.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.rounded.focus();
 return (false);
 }
  if (document.form_2.rounded.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.rounded.value < 100)
	{ alert("Please enter length of rounded edges in millimetres! \n Minimum length is 100 mm");
	document.form_2.rounded.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.rounded.focus();
    return (false);
	}
  }
//-----------------3. Validate curved polished edges, straight profile
 if (document.form_2.straight_c.value == "")
 {
 document.form_2.straight_c.value = 0;
}

var checkOK = "0123456789.,";
  var checkStr = document.form_2.straight_c.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.straight_c.focus();
 return (false);
 }
  if (document.form_2.straight_c.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.straight_c.value < 100)
	{ alert("Please enter length of curved edges in millimetres! \n Minimum length is 100 mm");
	document.form_2.straight_c.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.straight_c.focus();
    return (false);
	}
  }
//validate curved polished edges, halfrounded profile
 if (document.form_2.halfrounded_c.value == "")
 {
 document.form_2.halfrounded_c.value = 0;
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.halfrounded_c.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.halfrounded_c.focus();
 return (false);
 }
  if (document.form_2.halfrounded_c.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.halfrounded_c.value < 100)
	{ alert("Please enter length of curved edges in millimetres! \n Minimum length is 100 mm");
	document.form_2.halfrounded_c.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.halfrounded_c.focus();
    return (false);
	}
  }
//validate curved polished edges, rounded profile
 if (document.form_2.rounded_c.value == "")
 {
 document.form_2.rounded_c.value = 0;
}
var checkOK = "0123456789.,";
  var checkStr = document.form_2.rounded_c.value;
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.rounded_c.focus();
 return (false);
 }
  if (document.form_2.rounded_c.value != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.rounded_c.value < 100)
	{ alert("Please enter length of curved edges in millimetres! \n Minimum length is 100 mm");
	document.form_2.rounded_c.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Please enter only digit characters!");
    document.form_2.rounded_c.focus();
    return (false);
	}
  }
//-----------------4. Validate number of rounded corners R<100mm 
  if (document.form_2.roundcornera.value == "")
 {
 document.form_2.roundcornera.value = 0;
}
 var checkStr = document.form_2.roundcornera.value;
  var prsVal = parseFloat(checkStr);
  var checkOK = "0123456789.,";
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.roundcornera.focus();
 return (false);
 }

 if (isNaN(checkStr)) 
  {
    alert("Please enter a numeric value in the \"rounded corners R<100\" field!");
    document.form_2.roundcornera.focus();
    return (false);
  }	
  if (checkStr != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == ",")
	{ alert("Please enter an integer number in the \"rounded corners R<100\" field!");
	document.form_2.roundcornera.focus();
	return (false);
    }
 }
  }
//-------------------5. Validate number of rounded corners 100<R<300mm 
  if (document.form_2.roundcornerb.value == "")
 {
 document.form_2.roundcornerb.value = 0;
}
 var checkStr = document.form_2.roundcornerb.value;
  var prsVal = parseFloat(checkStr);
  var checkOK = "0123456789.,";
  var allValid = true;
  var allNum = "";
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.roundcornerb.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"rounded corners 100<R<300\" field!");
    document.form_2.roundcornerb.focus();
    return (false);
  }	
  if (checkStr != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == ",")
	{ alert("Please enter an integer number in the \"rounded corners 100<R<300\" field!");
	document.form_2.roundcornerb.focus();
	return (false);
    }
}
}
//-----------------------------6.Validate upstands 
//-----------------------------6.1 Validate upstands (1)
//Validate splashwidth 1
  if (document.form_2.splashwidth_1.value == "")
 {
 document.form_2.splashwidth_1.value = 0;
}
if (document.form_2.splashlength_1.value !=0 && document.form_2.splashwidth_1.value == 0)
{
alert("Please enter the upstand height!");
document.form_2.splashwidth_1.focus();
return (false);
}
 
 var checkStr = document.form_2.splashwidth_1.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.splashwidth_1.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"upstand height\" field!");
    document.form_2.splashwidth_1.focus();
    return (false);
  }	
  if (checkStr != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.splashwidth_1.value < 50)
	{ alert("Please enter upstand height in millimetres! \n Minimum height is 50 mm");
	document.form_2.splashwidth_1.focus();
	return (false);
    }
}
}
//Validate splashlength
  if (document.form_2.splashlength_1.value == "")
 {
 document.form_2.splashlength_1.value = 0;
}
if (document.form_2.splashwidth_1.value !=0 && document.form_2.splashlength_1.value == 0)
{
alert("Please enter the upstand length!");
document.form_2.splashlength_1.focus();
return (false);
}

 var checkStr = document.form_2.splashlength_1.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.splashlength_1.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"upstand length\" field!");
    document.form_2.splashlength_1.focus();
    return (false);
  }	
  if (checkStr != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.splashlength_1.value < 100)
	{ alert("Please enter upstand length in millimetres! \n Minimum length is 100 mm");
	document.form_2.splashlength_1.focus();
	return (false);
    }
}
}
//-------------------------Validate upstands (2)
//Validate splashwidth
  if (document.form_2.splashwidth_2.value == "")
 {
 document.form_2.splashwidth_2.value = 0;
}
if (document.form_2.splashlength_2.value !=0 && document.form_2.splashwidth_2.value == 0)
{
alert("Please enter the upstand height!");
document.form_2.splashwidth_2.focus();
return (false);
}
 
 var checkStr = document.form_2.splashwidth_2.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.splashwidth_2.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"upstand height\" field!");
    document.form_2.splashwidth_2.focus();
    return (false);
  }	
  if (checkStr != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.splashwidth_2.value < 50)
	{ alert("Please enter upstand height in millimetres! \n Minimum height is 50 mm");
	document.form_2.splashwidth_2.focus();
	return (false);
    }
}
}
//Validate splashlength
  if (document.form_2.splashlength_2.value == "")
 {
 document.form_2.splashlength_2.value = 0;
}
if (document.form_2.splashwidth_2.value !=0 && document.form_2.splashlength_2.value == 0)
{
alert("Please enter the upstand length!");
document.form_2.splashlength_2.focus();
return (false);
}

 var checkStr = document.form_2.splashlength_2.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.splashlength_2.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"upstand length\" field.");
    document.form_2.splashlength_2.focus();
    return (false);
  }	
  if (checkStr != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.splashlength_2.value < 100)
	{ alert("Please enter upstand length in millimetres! \n Minimum length is 100 mm");
	document.form_2.splashlength_2.focus();
	return (false);
    }
}
}
//-------------Validate upstands (3)
//Validate splashwidth
  if (document.form_2.splashwidth_3.value == "")
 {
 document.form_2.splashwidth_3.value = 0;
}
if (document.form_2.splashlength_3.value !=0 && document.form_2.splashwidth_3.value == 0)
{
alert("Please enter the upstand height!");
document.form_2.splashwidth_3.focus();
return (false);
}
 
 var checkStr = document.form_2.splashwidth_3.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.splashwidth_3.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"upstand height\" field.");
    document.form_2.splashwidth_3.focus();
    return (false);
  }	
  if (checkStr != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.splashwidth_3.value < 50)
	{ alert("Please enter upstand height in millimetres! \n Minimum height is 50 mm");
	document.form_2.splashwidth_3.focus();
	return (false);
    }
}
}
//Validate splashlength
  if (document.form_2.splashlength_3.value == "")
 {
 document.form_2.splashlength_3.value = 0;
}
if (document.form_2.splashwidth_3.value !=0 && document.form_2.splashlength_3.value == 0)
{
alert("Please enter the upstand length!");
document.form_2.splashlength_3.focus();
return (false);
}

 var checkStr = document.form_2.splashlength_3.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.splashlength_3.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"upstand length\" field.");
    document.form_2.splashlength_3.focus();
    return (false);
  }	
  if (checkStr != "0"){
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
if (ch == "." || ch == "," || document.form_2.splashlength_3.value < 100)
	{ alert("Please enter upstand length in millimetres! \n Minimum length is 100 mm");
	document.form_2.splashlength_3.focus();
	return (false);
    }
}
}
//---------------------7. Validate number of draining grooves 
   if (document.form_2.draininggroove.value == "")
 {
 document.form_2.draininggroove.value = 0;
}
var checkStr = document.form_2.draininggroove.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.draininggroove.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"draining grooves\" field!");
    document.form_2.draininggroove.focus();
    return (false);
  }	
//------------------8. Validate number of cutouts for sink 

// 8a. top-mounted (standard) 
  if (document.form_2.standard.value == "")
 {
 document.form_2.standard.value = 0;
}
 var checkStr = document.form_2.standard.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.standard.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"top-mounted\" field!");
    document.form_2.standard.focus();
    return (false);
  }	

//8b. flush-fit
 if (document.form_2.flushfit.value == "")
 {
 document.form_2.flushfit.value = 0;
}
  var checkStr = document.form_2.flushfit.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.flushfit.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"flush-fit\" field!");
    document.form_2.flushfit.focus();
    return (false);
  }	
//8c. under-mounted  
 if (document.form_2.under.value == "")
 {
 document.form_2.under.value = 0;
}
  var checkStr = document.form_2.under.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.under.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"under-mounted\" field!");
    document.form_2.under.focus();
    return (false);
  }	
//8d. underup-mounted 
 if (document.form_2.underup.value == "")
 {
 document.form_2.underup.value = 0;
}
  var checkStr = document.form_2.underup.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.underup.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"underup-mounted\" field!");
    document.form_2.underup.focus();
    return (false);
  }	
var hinta1=document.form_2.hinta1.value;
var hinta2=document.form_2.hinta2.value;
var hinta3=document.form_2.hinta3.value;
//-------------------------9. Validate number of cutouts for hob
  if (document.form_2.hob.value == "")
 {
 document.form_2.hob.value = 0;
}
 var checkStr = document.form_2.hob.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Please enter a positive number!");
 document.form_2.hob.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"cutouts for hob\" field!");
    document.form_2.hob.focus();
    return (false);
  }	
//-----------------10. Validate number of tapholes 
if (document.form_2.taphole.value == "")
	{
	document.form_2.taphole.value = 0;
	}
var checkStr = document.form_2.taphole.value;
  var prsVal = parseFloat(checkStr);
  var checkOK = "0123456789.,";
 if (checkStr < "0")
	{
	alert("Please enter a positive number!");
	document.form_2.taphole.focus();
	return (false);
	}
 if (isNaN(prsVal)) 
  {
    alert("Please enter a numeric value in the \"tap and switch holes\" field!");
    document.form_2.taphole.focus();
    return (false);
  }	
//Validation of form_2 ends
var koht=document.form_2.asukoht[document.form_2.asukoht.selectedIndex].value;
var ficost=0;//paigalduse hinnalisa sõltuvalt kaugusest
if (koht=="London"||koht=="Bedfordshire"||koht=="Berkshire" || koht=="Oxfordshire" || koht=="Buckinghamshire" || koht=="Surrey" || koht=="Middlesex" || koht=="Sussex" || koht=="Kent" || koht=="Essex" || koht=="North-Hampshire"||koht=="Hertfordshire")
{ficost=0;}

if (koht=="Cambridgeshire" || koht=="Northamptonshire" || koht=="Huntingtonshire" ||koht=="Wiltshire" || koht=="South-Hampshire" || koht=="Hampshire"|| koht=="Nottinghamshire")
{ficost=50;}

if (koht=="Gloucestershire"|| koht=="Somerset"|| koht=="Dorset"||koht=="Worcestershire"|| koht=="Warwickshire"||koht=="Herefordshire"|| koht=="Leicestershire"||koht=="Lincolnshire"||koht=="Norfolk"||koht=="Suffolk"||koht=="Staffordshire"||koht=="Derbyshire"||koht=="Rutland"||koht=="Shropshire"||koht=="Cheshire"||koht=="Monmouthshire"||koht=="Glamorgan"||koht=="Hants")
{ficost=100;}

if (koht=="Yorkshire"||koht=="Lancashire"||koht=="Flintshire"||koht=="Denbighshire"||koht=="Westmorland"||koht=="Durham"||koht=="Cumberland"||koht=="Northumberland")
{ficost=150;}

if (koht=="Dumfriesshire"||koht=="Roxburghshire"||koht=="Selkirkshire"||koht=="Berwickshire"||koht=="Fife"||koht=="Stirlingshire"||koht=="Lanarkshire"||koht=="West-Lothian"||koht=="Dunbartonshire"||koht=="Renfrewshire"||koht=="Ayrshire"||koht=="Kinross-shire"||koht=="Clackmannanshire"||koht=="Cornwall"||koht=="Devon"||koht=="Edinburgh"||koht=="Carthmarthenshire"||koht=="Pembrokeshire"||koht=="Ceredigion"||koht=="Powes"||koht=="Gwynedd"||koht=="Convy"||koht=="Isle of Anglesey")
{ficost=200;}
//lengths of worktop pieces in millimetres
L_1=eval(document.form_2.length_1.value);
L_2=eval(document.form_2.length_2.value);
L_3=eval(document.form_2.length_3.value);
L_4=eval(document.form_2.length_4.value);
L_5=eval(document.form_2.length_5.value);
L_6=eval(document.form_2.length_6.value);
L_7=eval(document.form_2.length_7.value);

L_tot=L_1 + L_2 + L_3 + L_4 + L_5 + L_6 + L_7;//total length of 30mm granite pieces in MILLIMETRES
L_total = L_tot/1000;//total length of granite pieces in METRES

var te=15;//mõõdistuse maksumus jooksva meetri kohta 15 GBP/m
var tempsum=L_total*te; //mõõdistuse kogumaksumus
	if (tempsum < 60){
	tempcost = 110;
	}
	else if (tempsum >=60){
	tempcost=parseInt(tempsum+50);
	}
	document.form_2.templating.value=tempcost;

var fittcost=0;//paigalduse maksumus koos kauguse lisatasuga
	fitsum=tempsum/15*40;
	if (fitsum < 140)
	{fitcost=140;}//paigalduse miinimummaksumus ilma kauguse lisatasuta
	else if (fitsum >= 140)
	{fitcost=parseInt(fitsum);}
	fittcost=fitcost+ficost;//paigalduse maksumus koos kauguse lisatasuga

	var place=document.form_2.asukoht.options.selectedIndex;
	if (place<=0)
	{
	alert("Please select your location");
	document.form_2.asukoht.focus();
	return false;
	}
	else
	{
	document.form_2.fitting.value=fittcost;
	}
document.plans.brand.value=document.form_1.brand[document.form_1.brand.selectedIndex].value;
document.plans.pieces.value=document.form_2.pieces.value;
document.plans.length_1.value=document.form_2.length_1.value;
document.plans.width_1.value=document.form_2.width_1.value;
document.plans.length_2.value=document.form_2.length_2.value;
document.plans.width_2.value=document.form_2.width_2.value;
document.plans.length_3.value=document.form_2.length_3.value;
document.plans.width_3.value=document.form_2.width_3.value;
document.plans.length_4.value=document.form_2.length_4.value;
document.plans.width_4.value=document.form_2.width_4.value;
document.plans.length_5.value=document.form_2.length_5.value;
document.plans.width_5.value=document.form_2.width_5.value;
document.plans.length_6.value=document.form_2.length_6.value;
document.plans.width_6.value=document.form_2.width_6.value;
document.plans.length_7.value=document.form_2.length_7.value;
document.plans.width_7.value=document.form_2.width_7.value;
document.plans.straight.value=document.form_2.straight.value;
document.plans.halfrounded.value=document.form_2.halfrounded.value;
document.plans.rounded.value=document.form_2.rounded.value;
document.plans.straight_c.value=document.form_2.straight_c.value;
document.plans.halfrounded_c.value=document.form_2.halfrounded_c.value;
document.plans.rounded_c.value=document.form_2.rounded_c.value;
document.plans.roundcornera.value=document.form_2.roundcornera.value;
document.plans.roundcornerb.value=document.form_2.roundcornerb.value;
document.plans.standard.value=document.form_2.standard.value;
document.plans.flushfit.value=document.form_2.flushfit.value;
document.plans.under.value=document.form_2.under.value;
document.plans.underup.value=document.form_2.underup.value;
document.plans.hinta1.value=document.form_2.hinta1.value;
document.plans.hinta2.value=document.form_2.hinta2.value;
document.plans.hinta3.value=document.form_2.hinta3.value;
document.plans.hob.value=document.form_2.hob.value;
document.plans.taphole.value=document.form_2.taphole.value;
document.plans.draininggroove.value=document.form_2.draininggroove.value;
document.plans.splashwidth_1.value=document.form_2.splashwidth_1.value;
document.plans.splashlength_1.value=document.form_2.splashlength_1.value;
document.plans.splashwidth_2.value=document.form_2.splashwidth_2.value;
document.plans.splashlength_2.value=document.form_2.splashlength_2.value;
document.plans.splashwidth_3.value=document.form_2.splashwidth_3.value;
document.plans.splashlength_3.value=document.form_2.splashlength_3.value;
document.plans.templating.value=document.form_2.templating.value;
document.plans.fitting.value=document.form_2.fitting.value;
//////////////     Set unit price for selected granite in form "plans" ////////////////////
if (document.plans.brand.value=="Star Gate") gpm=213;
else if (document.plans.brand.value=="Blue Pearl" || 
	document.plans.brand.value=="Emerald Pearl" || 
	document.plans.brand.value=="Colonial Gold" || 
	document.plans.brand.value=="Madura Gold" ||
	document.plans.brand.value=="River Gold" || 
	document.plans.brand.value=="Star Galaxy" ||
	document.plans.brand.value=="Giallo Veneziano" || 
	document.plans.brand.value=="Quartz Starlight Red" || 
	document.plans.brand.value=="Quartz Starlight Black" || 
	document.plans.brand.value=="Quartz Starlight White" || 
	document.plans.brand.value=="Quartz Black" || 
	document.plans.brand.value=="Quartz Grey" || 
	document.plans.brand.value=="Quartz Yellow"||
	document.plans.brand.value=="Quartz White") gpm=194; 

else if (document.plans.brand.value=="Quartz Starlight Red 12mm" || 
	document.plans.brand.value=="Quartz Black 12mm" || 
	document.plans.brand.value=="Quartz Grey 12mm" || 
	document.plans.brand.value=="Quartz Yellow 12mm"||
	document.plans.brand.value=="Quartz White 12mm") gpm=164; 

else if (document.plans.brand.value=="Absolute Black" || 
	document.plans.brand.value=="Black Mist" || 
	document.plans.brand.value=="Verde Maritaca" ||
	document.plans.brand.value=="Juparana Colombo" ||
	document.plans.brand.value=="Ivory Brown" || 
	document.plans.brand.value=="Tan Brown" || 
	document.plans.brand.value=="Egypt Yellow" || 
	document.plans.brand.value=="Kashmir Gold" || 
	document.plans.brand.value=="Oscuro Mist" ||
	document.plans.brand.value=="Sorella" || 
	document.plans.brand.value=="Carrara") gpm=172; 

else if (document.plans.brand.value=="Balmoral Red" || 
	document.plans.brand.value=="Baltic Brown" || 
	document.plans.brand.value=="Bon Accord"||
	document.plans.brand.value=="Giallo Cecilia" || 
	document.plans.brand.value=="Kashmir White" || 
	document.plans.brand.value=="Multicolor Red" || 
	document.plans.brand.value=="Verde Bahia" || 
	document.plans.brand.value=="Black Pearl") gpm=150;  
else gpm=104;// Rosa Limbara, Rosa Sardo, Bianco Sardo, Royal Black, Spike Black
  }
//set new variables for length and width of each piece (up to 7 pieces) and calculate "gm = total square metres of granite"
//lengths of 7 pieces in millimetres
 gml_1=document.plans.length_1.value;
 gml_2=document.plans.length_2.value;
 gml_3=document.plans.length_3.value;
 gml_4=document.plans.length_4.value;
 gml_5=document.plans.length_5.value;
 gml_6=document.plans.length_6.value;
 gml_7=document.plans.length_7.value;
//widths of 7 pieces in millimetres
 gmw_1=document.plans.width_1.value;
 gmw_2=document.plans.width_2.value;
 gmw_3=document.plans.width_3.value;
 gmw_4=document.plans.width_4.value;
 gmw_5=document.plans.width_5.value;
 gmw_6=document.plans.width_6.value;
 gmw_7=document.plans.width_7.value;
//calculate surface area of all 7 pieces in square millimetres
 gm_1=gml_1*gmw_1;
 gm_2=gml_2*gmw_2;
 gm_3=gml_3*gmw_3;
 gm_4=gml_4*gmw_4;
 gm_5=gml_5*gmw_5;
 gm_6=gml_6*gmw_6;
 gm_7=gml_7*gmw_7;
//calculate total surface area of worktops in sq millimetres and convert to sq metres
 gmm_total=gm_1+gm_2+gm_3+gm_4+gm_5+gm_6+gm_7;
 gm_total=gmm_total/1000000;

//calculate surface area of splashbacks in sq metres
gmsw_1=document.plans.splashwidth_1.value;
gmsl_1=document.plans.splashlength_1.value;
gms_1=gmsw_1*gmsl_1/1000000;

gmsw_2=document.plans.splashwidth_2.value;
gmsl_2=document.plans.splashlength_2.value;
gms_2=gmsw_2*gmsl_2/1000000;

gmsw_3=document.plans.splashwidth_3.value;
gmsl_3=document.plans.splashlength_3.value;
gms_3=gmsw_3*gmsl_3/1000000;

//total surface area of splashbacks
gms=(gmsw_1*gmsl_1+gmsw_2*gmsl_2+gmsw_3*gmsl_3)/1000000;
//total length of splashbacks in metres
gmsl=(1*gmsl_1+1*gmsl_2+1*gmsl_3)/1000;
//cost of straight polished edges
	pmstr=10/1000; 	
	pmhr=20/1000;
	pmfr=26/1000;
//cost of curved polished edges
	cmstr=26/1000;
	cmhr=38/1000;
	cmfr=43/1000;
//cost of rounded corners R<100mm GBP/piece
	rca=13;
//cost or rounded corners 100<R<300mm GBP/piece
	rcb=18;
//cost of splashbacks: (cost of granite)+(cost of polished edge)+(cost of fitting)
	sb=parseInt(gpm*gms/1.33+gmsl*(10+10));
//cost of draining grooves (1 set of 5 grooves)
	dg=54;
//cost of cutouts for sink
	sco=79;
	ff=105;
	uco=105;
	uuco=120;
//number of cutouts for hob
	hob=58;
//cost of tap and switch holes
	th=5;
//cost of templating is hardcoded in form_2 as "templating.value=110" 
//calculate total working cost plus cost of splashbacks 
workcost = (pmstr * plans.straight.value) + (pmhr * plans.halfrounded.value)+(pmfr * plans.rounded.value) + 
(cmstr * plans.straight_c.value) + (cmhr * plans.halfrounded_c.value) + (cmfr * plans.rounded_c.value) + 
(rca * plans.roundcornera.value) + (rcb * plans.roundcornerb.value) + sb + (dg * plans.draininggroove.value) +
(sco * plans.standard.value) + (ff * plans.flushfit.value) + (uco * plans.under.value) +
(uuco * plans.underup.value) + (hob * plans.hob.value) + (th * plans.taphole.value) + 
(1 * plans.templating.value) +  (1 * plans.fitting.value);

var granitecost=gm_total*gpm;
var hinta=hinta1*1+hinta2*1+hinta3*1;
var totalcost=Math.round((((granitecost+workcost)*1.15)+10)*1.05+hinta);
document.plans.estimate.value=totalcost;
document.plans.check.value=totalcost;
document.plans.discount.value=Math.round(totalcost*0.9);
document.getElementById('estimate').style.visibility="visible";

//plans.estimate.value = parseInt((((gm_total*gpm+workcost)*1.15)+10)*1.05);
//plans.check.value = parseInt((((gm_total*gpm+workcost)*1.15)+10)*1.05);


var hobweight=22*plans.hob.value;
var sinkweight=22*plans.standard.value+22*plans.flushfit.value+22*plans.under.value+22*plans.underup.value;
weight=parseInt((gm_total+gms)*73-sinkweight-hobweight);
//var weight=sinkweight;
if (plans.brand.value=="Quartz Red Galaxy 12mm" || 
	plans.brand.value=="Quartz Black 12mm" || 
	plans.brand.value=="Quartz Grey 12mm" || 
	plans.brand.value=="Quartz Yellow 12mm"||
	plans.brand.value=="Quartz White 12mm")
	{
	weight=parseInt(weight*12/30);
}
document.weightform.weight.value=weight;
} 
// End-->