var myamount = getCookie("amount");


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length

    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return "<a href='calc.htm'>Calculator Not Used</a>"
} 


function clear()
{
var drop = document.getElementById("pcode");
var map = document.getElementById("map");

}


function search()
{
var letterdump = "";
var dump;
var yes = 0;
var drop = document.getElementById("pcode");
dropvalue = document.getElementById("pcode").value.toLowerCase();
var temp = new Array();
temp = dropvalue.split('');





var johnfothergill = new Array()
johnfothergill[0] = "ng1"
johnfothergill[1] = "ng2"
johnfothergill[2] = "ng3"
johnfothergill[3] = "ng4"
johnfothergill[4] = "ng5"
johnfothergill[5] = "ng6"
johnfothergill[6] = "ng7"
johnfothergill[7] = "ng8"
johnfothergill[8] = "ng9"
johnfothergill[9] = "ng10"
johnfothergill[10] = "ng11"
johnfothergill[11] = "ng12"
johnfothergill[12] = "ng14"
johnfothergill[13] = "ng15"
johnfothergill[14] = "ng16"
johnfothergill[15] = "ng17"
johnfothergill[16] = "ng18"
johnfothergill[17] = "ng19"
johnfothergill[18] = "ng20"
johnfothergill[19] = "ng21"
johnfothergill[20] = "ng22"
johnfothergill[21] = "ng23"
johnfothergill[22] = "ng24"
johnfothergill[24] = "de"
johnfothergill[26] = "le11"

//norwich bloke

var norwich = new Array()
norwich[0] = "nr1"
norwich[1] = "nr2"
norwich[2] = "nr3"
norwich[3] = "nr4"
norwich[4] = "nr5"
norwich[5] = "nr6"
norwich[6] = "nr7"
norwich[7] = "nr8"
norwich[8] = "nr9"
norwich[9] = "nr10"
norwich[10] = "nr11"
norwich[11] = "nr12"
norwich[12] = "nr14"
norwich[13] = "nr15"
norwich[14] = "nr16"


var a = dropvalue.charAt(0);
var b = dropvalue.charAt(1);
var c = dropvalue.charAt(2);
var d = dropvalue.charAt(3);



for (x in johnfothergill)
{

if (johnfothergill[x] == a+b+c+d)
{

var drop = document.getElementById("pcode");
var map = document.getElementById("map");
map.src = "images/maps/notts.gif";
var person = document.getElementById("person");
person.style.visibility ="visible";
person.innerHTML = "<b>Contact details for your nearest supplier</b><br />John Fothergill<br /><b>Telephone:</b><b class='number'>Free phone 0808 166 3263</b><br /><b>Email:</b><a href='mailto:sales@aaaconcrete.co.uk'>sales@aaaconcrete.co.uk</a><br /><br />Last calculation amount:<u style='color:red'>"+myamount+"</u><br />With exact amounts every time there is no mess and no waste. We also offer a full laying service which is fast and efficient with a High rate of delivery that is quality assured. Wheelbarrows are provided and there are no waiting times or surcharges. No problems of over or under ordering.<ul><li>Footings Foundations</li><li>Shed Bases</li><li>Driveways</li><li>Pathways</li><li>Extensions</li><li>Patios</li></ul>Got any questions? Give us a call.";
yes =1;
}



}




for (x in johnfothergill)
{

if (johnfothergill[x] == a+b+c)
{

var drop = document.getElementById("pcode");
var map = document.getElementById("map");
map.src = "images/maps/notts.gif";
var person = document.getElementById("person");
person.style.visibility ="visible";
person.innerHTML = "<b>Contact details for your nearest supplier</b><br />John Fothergill<br /><b>Telephone:</b><b class='number'>Free phone 0808 166 3263</b><br /><b>Email:</b><a href='mailto:sales@aaaconcrete.co.uk'>sales@aaaconcrete.co.uk</a><br /><br />Last calculation amount:<u style='color:red'>"+myamount+"</u><br />With exact amounts every time there is no mess and no waste. We also offer a full laying service which is fast and efficient with a High rate of delivery that is quality assured. Wheelbarrows are provided and there are no waiting times or surcharges. No problems of over or under ordering.<ul><li>Footings Foundations</li><li>Shed Bases</li><li>Driveways</li><li>Pathways</li><li>Extensions</li><li>Patios</li></ul>Got any questions? Give us a call.";
yes = 1;
}



}




for (x in johnfothergill)
{

if (johnfothergill[x] == a+b)
{

var drop = document.getElementById("pcode");
var map = document.getElementById("map");
map.src = "images/maps/notts.gif";
var person = document.getElementById("person");
person.style.visibility ="visible";
person.innerHTML = "<b>Contact details for your nearest supplier</b><br />John Fothergill<br /><b>Telephone:</b><b class='number'>Free phone 0808 166 3263</b><br /><b>Email:</b><a href='mailto:sales@aaaconcrete.co.uk'>sales@aaaconcrete.co.uk</a><br /><br />Last calculation amount:<u style='color:red'>"+myamount+"</u><br />With exact amounts every time there is no mess and no waste. We also offer a full laying service which is fast and efficient with a High rate of delivery that is quality assured. Wheelbarrows are provided and there are no waiting times or surcharges. No problems of over or under ordering.<ul><li>Footings Foundations</li><li>Shed Bases</li><li>Driveways</li><li>Pathways</li><li>Extensions</li><li>Patios</li></ul>Got any questions? Give us a call.";
yes = 1;
}




}



//norwich bloke

for (x in norwich)
{

if (norwich[x] == a+b+c+d)
{

var drop = document.getElementById("pcode");
var map = document.getElementById("map");
map.src = "images/maps/norwich.gif";
var person = document.getElementById("person");
person.style.visibility ="visible";
person.innerHTML = "<b>Contact details for your nearest supplier</b><br />Ali Potter<br /><b>Telephone:</b><b class='number'>Free phone 01603 555 7777</b><br /><b>Email:</b><a href='mailto:sales@aaaconcrete.co.uk'>sales@aaaconcrete.co.uk</a><br /><br />Last calculation amount:<u style='color:red'>"+myamount+"</u><br />With exact amounts every time there is no mess and no waste. We also offer a full laying service which is fast and efficient with a High rate of delivery that is quality assured. Wheelbarrows are provided and there are no waiting times or surcharges. No problems of over or under ordering.<ul><li>Footings Foundations</li><li>Shed Bases</li><li>Driveways</li><li>Pathways</li><li>Extensions</li><li>Patios</li></ul>Got any questions? Give us a call.";
yes =1;
}



}




for (x in norwich)
{

if (norwich[x] == a+b+c)
{

var drop = document.getElementById("pcode");
var map = document.getElementById("map");
map.src = "images/maps/norwich.gif";
var person = document.getElementById("person");
person.style.visibility ="visible";
person.innerHTML = "<b>Contact details for your nearest supplier</b><br />Ali Potter<br /><b>Telephone:</b><b class='number'>Free phone 01603 555 7777</b><br /><b>Email:</b><a href='mailto:sales@aaaconcrete.co.uk'>sales@aaaconcrete.co.uk</a><br /><br />Last calculation amount:<u style='color:red'>"+myamount+"</u><br />With exact amounts every time there is no mess and no waste. We also offer a full laying service which is fast and efficient with a High rate of delivery that is quality assured. Wheelbarrows are provided and there are no waiting times or surcharges. No problems of over or under ordering.<ul><li>Footings Foundations</li><li>Shed Bases</li><li>Driveways</li><li>Pathways</li><li>Extensions</li><li>Patios</li></ul>Got any questions? Give us a call.";
yes = 1;
}



}




for (x in norwich)
{

if (norwich[x] == a+b)
{

var drop = document.getElementById("pcode");
var map = document.getElementById("map");
map.src = "images/maps/norwich.gif";
var person = document.getElementById("person");
person.style.visibility ="visible";
person.innerHTML = "<b>Contact details for your nearest supplier</b><br />Ali Potter<br /><b>Telephone:</b><b class='number'>Free phone 01603 555 7777</b><br /><b>Email:</b><a href='mailto:sales@aaaconcrete.co.uk'>sales@aaaconcrete.co.uk</a><br /><br />Last calculation amount:<u style='color:red'>"+myamount+"</u><br />With exact amounts every time there is no mess and no waste. We also offer a full laying service which is fast and efficient with a High rate of delivery that is quality assured. Wheelbarrows are provided and there are no waiting times or surcharges. No problems of over or under ordering.<ul><li>Footings Foundations</li><li>Shed Bases</li><li>Driveways</li><li>Pathways</li><li>Extensions</li><li>Patios</li></ul>Got any questions? Give us a call.";
yes = 1;
}




}

if (yes == 0)
{
var person = document.getElementById("person");
person.style.visibility ="visible";
person.innerHTML = "Sorry we don't currently cover your area.";
}













}



