//-->
	var bString = " "
    var cString = " "
function InitForm(StFormen) {
	var aString = null
	var status = true
	var first = true
	aString = window.location.search
	if(aString.length > 4) {
		for (var i=1; i < aString.length; i++){

            if((aString.charAt(i) == " ") || (aString.charAt(i) == "%")) {
					first = false;
			}

			if (aString.charAt(i) == "%") {
				if (first == false) {
					bString = bString + " ";
				}
				i++;
				i++;
			}
		    else
			   {
				if (first == false) {
					bString = bString + aString.charAt(i);
				}
				if (first == true) 
				  {
					  cString = cString + aString.charAt(i);
				  }
			   }
	     }

		StFormen.EnquiryMessage.value = ""
		StFormen.EquipmentDetails.value = "Equipment-Code: " + bString
			
   }

// Raid the cookie Jar

   document.form1.BusinessName.value=getArnott2(document.form1.BusinessName);
   document.form1.Telephone.value=getArnott2(document.form1.Telephone);
   document.form1.Fax.value=getArnott2(document.form1.Fax);
   document.form1.StreetAddress.value=getArnott2(document.form1.StreetAddress);
   document.form1.State.value=getArnott2(document.form1.State);
   document.form1.City.value=getArnott2(document.form1.City);
   document.form1.Country.value=getArnott2(document.form1.Country);
   document.form1.PostCode.value=getArnott2(document.form1.PostCode);
   document.form1.Contact.value=getArnott2(document.form1.Contact);
   document.form1.Email.value=getArnott2(document.form1.Email);


// Strip any leading %20 or space in the string containing the picture file name

	aString = "";
	for (var i=1; i < cString.length; i++){
        if(cString.charAt(i) == " ") {
					i++;
			}
		else {
				if (cString.charAt(i) == "%") {
					i++;
					i++;
					i++;
				}
				else {
					aString = aString + cString.charAt(i);
				}
		}
	}
   cString = aString;

//	
	if (cString=="")
	{
		cString = "NOPIC";
	}
	if (cString == "NOPIC")
   {
		document.images[2].src = "epics/NOPIC.JPG";
		document.images[2].alt = "";
		document.links[2].href = "epics/nopic.htm";
   }
	else 
	{
		document.images[2].src = "epics/HavePic.jpg";
		document.images[2].alt = "CLICK for a Photograf of Equipment";
		document.links[2].href = "epics/" + cString + ".JPG";
	}

   if ((document.form1.Contact.value.length < 2 ) || (document.form1.Email.value.length < 2 )) {
	if (document.form1.Contact.value.length < 2 )
	   StFormen.Contact.focus();
	else
	   StFormen.Email.focus();
   }
   else
	 StFormen.EnquiryMessage.focus();
}
function nantingC(theobj) {
if ( theobj.Contact.value == '') {
	alert('Please enter at least a Name for a Contact Person and an E-mail Address');
	theobj.Contact.focus();
  }
}
function nantingE(theobj) {
		if (( theobj.Contact.value == '') && (theobj.Email.value == ''))
			theobj.Contact.focus();
		else
			if (theobj.Email.value == '') {
					alert('Please enter at least a Name for a Contact Person and an E-mail Address');
					if ( theobj.Contact.value == '')
						theobj.Contact.focus();
					else
						theobj.Email.focus();
			}
}
                    // Figure out where to put cursor based on mandatory fields present
function nanting(theobj) {
	if ((theobj.Email.value == '') || ( theobj.Contact.value == '')) {
			alert('Please enter at least a Name for a Contact Person and an E-mail Address');
			if ( theobj.Contact.value == '') {
				theobj.Contact.focus();
				return false;
				}
			else
				theobj.Email.focus();
				return false;
	}
	return true;
}                                  // Write protext Equipment field by moving focus
function nexta(theobj) {
	theobj.EnquiryMessage.focus();
}                                  // Before Send Function
function checkBeforeSend(theobj) {
var result=false;
var ett="";
var tva="";

	if (theobj.Email.value == '')  {
			alert('Please enter at least a Name for a Contact Person and an E-mail Address');
			if ( theobj.Contact.value == '') {
				theobj.Contact.focus();
				result=false;
				}
			else
				theobj.Email.focus();
				result=false;
	}
	else
		result=true;

	makeArnott2(document.form1.Contact);
	makeArnott2(document.form1.BusinessName);
	makeArnott2(document.form1.Email);
	makeArnott2(document.form1.Telephone);
	makeArnott2(document.form1.Fax);
	makeArnott2(document.form1.StreetAddress);
	makeArnott2(document.form1.City);
	makeArnott2(document.form1.State);
	makeArnott2(document.form1.PostCode);
	makeArnott2(document.form1.Country);
	makeArnott2(document.form1.State);
	return result;
}
//  End -->
