<!--Begin
//Danish quote
var exrate=7.44156; 
var vat=1.25;
var discount=1;
var factor=exrate*vat*discount;
var grupp_6=411*factor; //muudatused 28.03.2011 
//var grupp_6=379*factor;//grupp_4*1,20 (indrek 28.01.2011: Black Marinace hind= Emerald Pearl +20%)
var grupp_5=347*factor;
var grupp_4=316*factor;
var grupp_4a=316*0.85*factor;//12 mm paksused kvartskivid on 15% odavamad kui 30 mm paksused kvartskivid
var grupp_3=280*factor;
var grupp_2=244*factor;
var grupp_1=169*factor;

function sumit(plans){ 
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("Skriv venligst antal plader!");
		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("Skriv venligst et positivt tal fra 1 til 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("Skriv venligst længden på dit køkkenbord!");
  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("Skriv venligst et positivt tal!");
	document.form_2.length_1.focus();
	return (false);
    }
    if (ch == "." || ch == "," || document.form_2.length_1.value < 100)
	{ alert("Skriv venligst længden i mm!\n Minimumlængde er 100 mm");
	document.form_2.length_1.focus();
	return (false);
    }
  }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst bredden på dit køkkenbord!");
	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("Skriv venligst et positivt tal!");
		document.form_2.width_1.focus();
		return (false);
		}
	 if (ch == "." || ch == "," || document.form_2.width_1.value < 100)
		{ alert("Skriv venligst bredden i mm!\n Minimumbredde er 100 mm");
		document.form_2.width_1.focus();
		return (false);
        }
	 }
  if (!allValid)
	{
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også længden på den 2. plade!");
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("Skriv venligst et positivt tal!");
			document.form_2.length_2.focus();
			return (false);
			}
	if (ch == "." || ch == "," || document.form_2.length_2.value < 100)
		{
		alert("Skriv venligst længden på den 2. plade i mm!\n Minimumlængde er 100 mm");
		document.form_2.length_2.focus();
		return (false);
		}
	}
	if (!allValid)
	{alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også bredden på den 2. plade!");
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("Skriv venligst et positivt tal!");
	document.form_2.width_2.focus();
	return (false);
    }
	if (ch == "." || ch == "," || document.form_2.width_2.value < 100)
	{ alert("Skriv venligst bredden på den 2. plade i mm  \Minimumbredde er 100 mm");
	document.form_2.width_2.focus();
	return (false);
    }
  }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også længden på den 3. plade!");
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("Skriv venligst længden på den 3. plade i mm!\n Minimumlængde er 100 mm!");
	document.form_2.length_3.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også bredden på den 3. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst bredden på den 3. plade i mm \n Minimumbredde er 100 mm");
	document.form_2.width_3.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også længden på den 4. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på den 4. plade i mm!\n Minimumlængde er 100 mm");
	document.form_2.length_4.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også bredden på den 4. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst bredden på den 4. plade i mm  \Minimumbredde er 100 mm");
	document.form_2.width_4.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også længden på den 5. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på den 5. plade i mm!\n Minimumlængde er 100 mm");
	document.form_2.length_5.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også bredden på den 5. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst bredden på den 5. plade i mm  \Minimumbredde er 100 mm");
	document.form_2.width_5.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også længden på den 6. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på den 6. plade i mm  \Minimumlængde er 100 mm");
	document.form_2.length_6.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også bredden på den 6. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst bredden på den 6. plade i mm  \Minimumbredde er 100 mm");
	document.form_2.width_6.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også længden på den 7. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på den 7. plade i mm \n Minimumlængde er 100 mm");
	document.form_2.length_7.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst også bredden på den 7. plade!");
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("Skriv venligst et positivt tal!");
 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("Skriv venligst bredden på den 7. plade i mm  \Minimumbredde er 100 mm");
	document.form_2.width_7.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på lige slebte kanter i mm \n Minimumlængde er 100 mm!");
		document.form_2.straight.focus();
		return (false);
		}
	}
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på halvrunde kanter i mm \n Minimumlængde er 100 mm!");
	document.form_2.halfrounded.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på runde kanter i mm! \n Minimumlængde er 100 mm!");
	document.form_2.rounded.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på buede kanter i mm! \n Minimumlængde er 100 mm!");
	document.form_2.straight_c.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på buede kanter i mm! \n Minimumlængde er 100 mm!");
	document.form_2.halfrounded_c.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst et positivt tal!");
 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("Skriv venligst længden på buede kanter i mm! \n Minimumlængde er 100 mm!");
	document.form_2.rounded_c.focus();
	return (false);
    }
 }
  if (!allValid)
  {
    alert("Skriv venligst kun etcifrede tal!");
    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("Skriv venligst et positivt tal!");
 document.form_2.roundcornera.focus();
 return (false);
 }

 if (isNaN(checkStr)) 
  {
    alert("Skriv venligst en talværdi i \"runde hjørner R<100\"-feltet!");
    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("Skriv venligst et heltal i \"runde hjørner  R<100\"-feltet!");
	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("Skriv venligst et positivt tal!");
 document.form_2.roundcornerb.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"runde hjørner  100<R<300\"-feltet!");
    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("Skriv venligst et heltal i \"runde hjørner 100<R<300\"-feltet!");
	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("Skriv venligst højden på bagvægspladen!");
document.form_2.splashwidth_1.focus();
return (false);
}
 
 var checkStr = document.form_2.splashwidth_1.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Skriv venligst et positivt tal!");
 document.form_2.splashwidth_1.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"bagvægplade\"-feltet!");
    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("Skriv venligst højden på bagvægspladen i mm!\n Minimumhøjde er 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("Skriv venligst længden på bagvægspladen!");
document.form_2.splashlength_1.focus();
return (false);
}

 var checkStr = document.form_2.splashlength_1.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Skriv venligst et positivt tal!");
 document.form_2.splashlength_1.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"bagvægspladens længde\"-feltet!");
    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("Skriv venligst længden på bagvægspladen i mm! \n Minimumlængde er 50 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("Skriv venligst højden på bagvægspladen!");
document.form_2.splashwidth_2.focus();
return (false);
}
 
 var checkStr = document.form_2.splashwidth_2.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Skriv venligst et positivt tal!");
 document.form_2.splashwidth_2.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"bagvægpladens højde\"-feltet!");
    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("Skriv venligst højden på bagvægspladen i mm! \n Minimumhøjde er 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("Skriv venligst længden på bagvægspladen!");
document.form_2.splashlength_2.focus();
return (false);
}

 var checkStr = document.form_2.splashlength_2.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Skriv venligst et positivt tal!");
 document.form_2.splashlength_2.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"bagvægspladens længde\"-feltet!");
    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("SSkriv venligst længden på bagvægspladen i mm! \nMinimumlængde er 50 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("Skriv venligst højden på bagvægspladen!");
document.form_2.splashwidth_3.focus();
return (false);
}
 
 var checkStr = document.form_2.splashwidth_3.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Skriv venligst et positivt tal!");
 document.form_2.splashwidth_3.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"bagvægpladens højde\"-feltet!");
    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("Skriv venligst højden på bagvægspladen i mm! \n Minimumhøjde er 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("Skriv venligst længden på bagvægspladen!");
document.form_2.splashlength_3.focus();
return (false);
}

 var checkStr = document.form_2.splashlength_3.value;
  var prsVal = parseFloat(checkStr);
 if (checkStr < "0")
 {
 alert("Skriv venligst et positivt tal!");
 document.form_2.splashlength_3.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"bagvægspladens længde\"-feltet!");
    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("Skriv venligst længden på bagvægspladen i mm! \n Minimumlængde er 50 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("Skriv venligst et positivt tal!");
 document.form_2.draininggroove.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"drænfurer\"-feltet!");
    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("Skriv venligst et positivt tal!");
 document.form_2.standard.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"topmonteret\"-feltet!");
    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("Skriv venligst et positivt tal!");
 document.form_2.flushfit.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"flush-fit\"-feltet!");
    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("Skriv venligst et positivt tal!");
 document.form_2.under.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"undermonteret\"-feltet!");
    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("Skriv venligst et positivt tal!");
 document.form_2.underup.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"under-op-monteret\"-feltet!");
    document.form_2.underup.focus();
    return (false);
  }	
//-------------------------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("Skriv venligst et positivt tal!");
 document.form_2.hob.focus();
 return (false);
 }
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"udskæringer for kogeplader\"-feltet!");
    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("Skriv venligst et positivt tal!");
	document.form_2.taphole.focus();
	return (false);
	}
 if (isNaN(prsVal)) 
  {
    alert("Skriv venligst en talværdi i \"huller for haner og stikkontakter\"-feltet!");
    document.form_2.taphole.focus();
    return (false);
  }	
//Validation of form_2 ends
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;//templating cost is GBP 15 per metre
var tempsum=L_total*te;  //cost of templating; minimum cost is GBP 80
	if (tempsum < 80){
	tempsum=80;
	}
	else {
	tempsum = tempsum;
	}
var fitsum=tempsum/15*40;
	if (fitsum < 140){
	fitcost=140;
	}
	else {
	fitcost=fitsum;
	}
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.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
//////////////////Granite prices in GBP per sqm for different brands//////////////////
if (document.plans.brand.value=="Labrador Antique" ||
	document.plans.brand.value=="Quartz Super Black" ||	
	document.plans.brand.value=="Quartz Super White" ) gpm=grupp_6;

else if (document.plans.brand.value=="Black Marinace" ||
	document.plans.brand.value=="Star Gate") gpm=grupp_5;

else if (document.plans.brand.value=="Absolute Black Honed" || 
	document.plans.brand.value=="Absolute Black Leather Finish" || 
	document.plans.brand.value=="Blue Pearl" || 
	document.plans.brand.value=="Black Marinace" || 
	document.plans.brand.value=="Blue in the Night" || 
	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=="Aspen"||
	document.plans.brand.value=="Honey Blush"||
	document.plans.brand.value=="Quartz White"||
	document.plans.brand.value=="Carrara") gpm=grupp_4; 

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=grupp_4a; 

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=="Black Pearl"	 || 
	document.plans.brand.value=="Sorella") gpm=grupp_3; 

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=="Ambrosia White" || 
	document.plans.brand.value=="Spike Black" || 
	document.plans.brand.value=="Regal Black") gpm=grupp_2;  
else gpm=grupp_1;// Gris Cordoba, Rosa Limbara, Rosa Sardo, Bianco Sardo, Royal Black, Taurus DT Kansas, Vesta Negro
  }
//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 millimetres
gmsw_1=eval(document.plans.splashwidth_1.value);
gmsl_1=eval(document.plans.splashlength_1.value);
gms_1=gmsw_1*gmsl_1;

gmsw_2=eval(document.plans.splashwidth_2.value);
gmsl_2=eval(document.plans.splashlength_2.value);
gms_2=gmsw_2*gmsl_2;

gmsw_3=eval(document.plans.splashwidth_3.value);
gmsl_3=eval(document.plans.splashlength_3.value);
gms_3=gmsw_3*gmsl_3;

//total surface area of SPLASHBACKS in SQ METRES
gms=(gms_1+gms_2+gms_3)/1000000;
//total length of splashbacks in metres
gmsl=(gmsl_1+gmsl_2+gmsl_3)/1000;
//cost of splashbacks: (cost of granite)+(cost of polished edge)+(cost of fitting)
	sb=Math.round(gpm*gms/1.33+gmsl*(10+10)*factor);
//cost of straight polished edges GBP/mm
	pmstr=10/1000; 	
	pmhr=20/1000;
	pmfr=26/1000;
//cost of curved polished edges GBP/mm
	cmstr=26/1000;
	cmhr=38/1000;
	cmfr=43/1000;
//cost of rounded corners R<100mm GBP/piece
	rca=13;
//cost of rounded corners 100<R<300mm GBP/piece
	rcb=18;
//cost of draining grooves (1 set of 5 grooves) GBP/set
	dg=64;
//cost of cutouts for sink GBP/piece
	sco=79;
	ff=105;
	uco=105;
	uuco=120;
//number of cutouts for hob GBP/piece
	hob=58;
//cost of tap and switch holes GBP/piece
	th=5;
////////////////////////if templating and fitting costs depend on region///////////////////////
var ficost=0; //ficost depends on location
var koht=document.form_2.asukoht[document.form_2.asukoht.selectedIndex].value;
if (koht=="none")
	{
	alert("Vælg region!");
	document.form_2.asukoht.focus();
	return false;
	}
else {
if (koht=="1") ficost=0;
else if (koht=="2") ficost=486;
else if (koht=="3") ficost=271;
else if (koht=="4") ficost=533;
else if (koht=="5") ficost=423;
else if (koht=="6") ficost=1237;
else if (koht=="7") ficost=4000;
}
tempsum = Math.round(tempsum*10.757*1.07*1.25);
fitcost=Math.round(fitcost*10.757*1.07*1.25); 
var fittcost=fitcost+ficost; //basic fitting cost 'fitcost' + region dependent 'ficost'

document.form_2.templating.value = tempsum;
document.form_2.fitting.value=fittcost;
//document.plans.templating.value=tempsum;
//document.plans.fitting.value=fittcost;
//calculate total workcost plus cost of splashbacks in GBP and convert to SEK (1 GBP = 10.757 DKK)
workcost = ((pmstr * document.plans.straight.value) + (pmhr * document.plans.halfrounded.value)+(pmfr * document.plans.rounded.value) + 
(cmstr * document.plans.straight_c.value) + (cmhr * document.plans.halfrounded_c.value) + (cmfr * document.plans.rounded_c.value) + 
(rca * document.plans.roundcornera.value) + (rcb * document.plans.roundcornerb.value) + (dg * document.plans.draininggroove.value) +
(sco * document.plans.standard.value) + (ff * document.plans.flushfit.value) + (uco * document.plans.under.value) +
(uuco * document.plans.underup.value) + (hob * document.plans.hob.value) + (th * document.plans.taphole.value))*10.757*1.07*1.25;

granitecost = gm_total*gpm+sb;
//alert("tööpind="+Math.round(gm_total*gpm));
//alert("seinakivi="+Math.round(sb));
//alert("granitecost="+Math.round(granitecost));
totalcost = Math.round(workcost + granitecost)+tempsum+fittcost; //in Denmark, 25% VAT is included in total cost
//totalcost = Math.round(totalcost*1.05);
document.plans.estimate.value = totalcost;
document.plans.check.value = totalcost;
var hobweight=22*document.plans.hob.value;
var sinkweight=22*document.plans.standard.value+22*document.plans.flushfit.value+22*document.plans.under.value+22*document.plans.underup.value;
weight=Math.round((gm_total+gms)*81-sinkweight-hobweight);
if (document.plans.brand.value=="Quartz Red Galaxy 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")
	{
	weight=Math.round(weight*12/30);
}
document.weightform.weight.value=weight;
//document.form_2.test.value=fittcost;//see on minu testbox, tuleb ära kustutada
} 
// End-->
