function checkAffiliateSignup()
{
  if (document.affiliateForm.name.value.length < 1)
  	{
	 	   alert("Please enter your Website name.");
		document.affiliateForm.name.focus();
           return false;
	}
	 
  if (document.affiliateForm.url.value.length < 1)
  	{
	 	   alert("Please enter your site's URL.");
		document.affiliateForm.url.focus();
           return false;
	}

  if (document.affiliateForm.url.value == 'http://')
	{
	 	   alert("Please enter your site's URL.");
		document.affiliateForm.url.focus();
           return false;
	}

  if (document.affiliateForm.description.value.length < 1)
  	{
	 	   alert("Please enter your site's description.");
		document.affiliateForm.description.focus();
           return false;
	}

  if (document.affiliateForm.unique.value.length < 1)
  	{
	 	   alert("Please enter your site's no. of monthly unique page views.");
           return false;
	}

  if (document.affiliateForm.pageviews.value.length < 1)
  	{
	 	   alert("Please enter your site's no. of monthly page views.");
           return false;
	}

  if (document.affiliateForm.company.value.length < 1)
  	{
	 	   alert("Please enter your company name.");
		document.affiliateForm.company.focus();
           return false;
	}

  if (document.affiliateForm.contact.value.length < 1)
  	{
	 	   alert("Please enter your contact name.");
		document.affiliateForm.contact.focus();
           return false;
	}

  if (document.affiliateForm.email.value.length > 0)
          {
          	     
          if ((document.affiliateForm.email.value.indexOf("@") == -1))
          {
           alert("Please enter a valid Email address, that contains an '@' and a '.'");
           return false;
          }
    
          if ((document.affiliateForm.email.value.indexOf(".") == -1))
          {
           alert("Please enter a valid Email address, that contains an '@' and a '.'");
           return false;
          }
      } 
	
  if (document.affiliateForm.email.value.length < 1)
  	{
	 	   alert("Please enter your email address.");
		document.affiliateForm.email.focus();
           return false;
	}  
  
  if (document.affiliateForm.category.value.length < 1)
  	{
	 	   alert("Please select your website's category.");
		document.affiliateForm.category.focus();
           return false;
	}  

  if (document.affiliateForm.category.value == 'OTHER' && document.affiliateForm.other.value.length < 1)
  	{
	 	   alert("Please specify your web site category, if 'OTHER'.");
           return false;
	}  

  if (document.affiliateForm.address.value.length < 1)
  	{
	 	alert("Please enter your address, your cheque will be sent to this address.");
           	document.affiliateForm.address.focus();
		return false;
	}  

  if (document.affiliateForm.postcode.value.length < 1)
  	{
	 	   alert("Please enter your postcode.");
		document.affiliateForm.postcode.focus();
           return false;
	}

  if (document.affiliateForm.postcode.value.length > 0)
  { 

	test = document.affiliateForm.postcode.value; size = test.length
 	test = test.toUpperCase(); //Change to uppercase
 
	while (test.slice(0,1) == " ") //Strip leading spaces
  	{
	test = test.substr(1,size-1);size = test.length
  	}
 	
	while(test.slice(size-1,size)== " ") //Strip trailing spaces
  	{
	test = test.substr(0,size-1);size = test.length
  	}
 	document.affiliateForm.postcode.value = test; //write back to form field
 
	if (size < 6 || size > 8)
		{ //Code length rule
  		alert(test + " is not a valid postcode - wrong length");
  		document.affiliateForm.postcode.focus();
  		return false;
  		}
 
	if (!(isNaN(test.charAt(0))))
		{ //leftmost character must be alpha character rule
   		alert(test + " is not a valid postcode - cannot start with a number");
   		document.affiliateForm.postcode.focus();
   		return false;
  		}
 	if (isNaN(test.charAt(size-3)))
	{ //first character of inward code must be numeric rule
   	alert(test + " is not a valid postcode - alpha character in wrong position");
   	document.affiliateForm.postcode.focus();
   	return false;
  	}
 	if (!(isNaN(test.charAt(size-2))))
	{ //second character of inward code must be alpha rule
   	alert(test + " is not a valid postcode - number in wrong position");
   	document.affiliateForm.postcode.focus();
   	return false;
  	}
 	if (!(isNaN(test.charAt(size-1))))
	{ //third character of inward code must be alpha rule
   	alert(test + " is not a valid postcode - number in wrong position");
   	document.affiliateForm.postcode.focus();
   	return false;
  	}
 	if (!(test.charAt(size-4) == " "))
	{//space in position length-3 rule
   	alert(test + " is not a valid postcode - no space or space in wrong position");
   	document.affiliateForm.postcode.focus();
   	return false;
   	}
 	count1 = test.indexOf(" ");count2 = test.lastIndexOf(" ");
 	if (count1 != count2)
	{//only one space rule
   	alert(test + " is not a valid postcode - only one space allowed");
   	document.affiliateForm.postcode.focus();
   	return false;
  	}
    }



  if (document.affiliateForm.country.value.length < 1)
  	{
	 	   alert("Please select a country.");
		document.affiliateForm.country.focus();
           return false;
	}

  if (document.affiliateForm.phone.value.length < 1)
  	{
	 	   alert("Please enter your phone no.");
		document.affiliateForm.phone.focus();
           return false;
	}


  if (document.affiliateForm.cheque.value.length < 1)
  	{
	 	   alert("Please enter a name the commission cheque should be made payable to.");
		document.affiliateForm.cheque.focus();
           return false;
	}

  if  ((document.affiliateForm.accept.checked) == false)
   
  	{
	 	   alert("Please accept our Terms & Conditions before submitting this form.");
		document.affiliateForm.accept.focus();
           return false;
	}

  if (document.affiliateForm.txtNumber.value.length < 1)
  	{
	 	   alert("Please enter the random number into the field.");
		document.affiliateForm.txtNumber.focus();
           return false;
	}

// default (ok)
	return true;
}