<!--

function getValuesResults()
{

enquiries = document.AddEnquiry.AddItem
itemname = enquiries.value

for (i=0;i<enquiries.length; ++ i)
 {
    itemname = enquiries[i].value
	if (Get_Cookie(itemname))
		{
		enquiries[i].checked = true
		}
 }
}

function getValuesResultsDouble()
{

enquiries = document.AddEnquiry2.AddItem2
itemname = enquiries.value

for (i=0;i<enquiries.length; ++ i)
 {
    itemname = enquiries[i].value
	if (Get_Cookie(itemname))
		{
		enquiries[i].checked = true
		}
 }
}


function checkcart(ItemRemove,SecondForm,PageType)
{
Item = ""

if (SecondForm == true)
{
	enquiries = document.AddEnquiry2.AddItem2;
	if (PageType == true)
	{
	document.AddEnquiry.AddItem[1].checked=document.AddEnquiry2.AddItem2[1].checked;
	}
}
else
{
	enquiries = document.AddEnquiry.AddItem;
	if (PageType == true)
	{
	document.AddEnquiry2.AddItem2[1].checked=document.AddEnquiry.AddItem[1].checked;	
	}
	
}

var ItemCheckName = unescape(ItemRemove)

for (i = 0; i<enquiries.length; ++ i)
{
	var Item = enquiries[i].value;	 
	var ItemName = /[^\$]+/.exec(Item);
	if (enquiries[i].checked) 
	  { 				
	 	if ((Item != '') && (ItemName == ItemCheckName))
		{
		alert('You have added this item to your Golf Cart:' + ' ' + ItemName);
		Set_Cookie(Item,Item);
		}
	  }
	  else
	  {
	  	if ((Item != '') && (ItemName == ItemCheckName))
		{
	 	alert('You have removed this item from your Golf Cart:' + ' ' + ItemName);
		Delete_Cookie(Item);
		}
				
	  }
 }
}


function Get_Cookie(name) {
  var start = document.cookie.indexOf(name + '=');
  var len = start + name.length + 1;
  if ((!start) && (name != document.cookie.substring(0,name.length)))
    return null;
  if (start == -1)
    return null;
  var end = document.cookie.indexOf(';',len);
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len,end));
}


function Set_Cookie(name,value)
{
  path = "/"
  document.cookie = 
  name + '=' + escape(value) +
  ( (path) ? ";path=" + path : "")  ;    
}

function Delete_Cookie(name)
{
  path = "/"	
  if (Get_Cookie(name))
  document.cookie =
  name + '=' +
  ((path) ? "; path=" + path : "") +
   ';expires=Thu, 01-Jan-1970 00:00:01 GMT';
}

function explodeArray(item,delimiter)
{
  tempArray=new Array(1);
  var Count=0;
  var tempString=new String(item);

  while (tempString.indexOf(delimiter)>0) {
    tempArray[Count]=tempString.substr(0,tempString.indexOf(delimiter));
    tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1); 
    Count=Count+1
  }
  tempArray[Count]=tempString;
  return tempArray;
}

function StrReplace(str1, str2, str3)
	{
		str1 = str1.replace(str2, str3);
		return str1;
	}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

//-->	
