<!--

	function checkValue(field,thingywotsit)
	{
			var temp = eval("document.contactForm."+field+".value;");
			if(temp=="" || temp==" " || temp=="Select Country")
			{
					alert("Please fill in your " + thingywotsit + ", and try again.");
					eval("document.contactForm."+field+".focus();");
					return false;
			} else {
					return true;
			}

	}

	function checkForm()// amended dg 15/07/08
	{
			if(checkValue("word","word") && checkValue("name","name") && checkValue("enquiry","enquiry") && checkValue("country","country") && checkValue("postcode","postcode") && checkValue("company_name","Company Name") )
			{
  				if(emailCheck(document.contactForm.email.value))
  				{
  				      document.contactForm.submit();
  				} 
  				else
  				{
    						alert("Please fill in your email address, and try again.\nIf you have filled in your email address, check the '.' and '@' sign are correct, an email address will look something like this:\n\nyourname@somewhere.com                   or                  yourname@somewhere.co.uk\n");
    						document.contactForm.email.focus();
  				}
			}
	}

  function new_freecap()
  {
      // loads new freeCap image
      if(document.getElementById)
      {
        	// extract image name from image source (i.e. cut off ?randomness)
        	thesrc = document.getElementById("freecap").src;
        	thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
        	// add ?(random) to prevent browser/isp caching
        	document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000);
      } 
      else 
      {
          alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
      }
  }

// clear text and add text to the default field
// --> Del
function clearText(thefield) {
    if (thefield.defaultValue==thefield.value) {
        thefield.value = ""
    }
} 

function addText(thefield) {
    // if the field is blank (by being clicked)
    if (thefield.value=="") {
        // set it to the default value
        thefield.value = thefield.defaultValue;
    }
} 


//--> Suckerfish 

//curtosy of suckerfish ;)
sfHover = function() {
	
  // Horizontal Navigation
  
  var sfEls = document.getElementById("hnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	
	// Vertical Navigation
  var sfElsVertical = document.getElementById("vnav").getElementsByTagName("LI");
	for (var i=0; i<sfElsVertical.length; i++) {
		sfElsVertical[i].onmouseover = function() {
			this.className+=" sfhover";
		}
		sfElsVertical[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);


//-->
