function validateTrade(tradeEnquiries) // function to ensure order quantity is not zero before proceeding
{
	var fieldCheck = true;	// set the field default check value to be correct, we will test to see if it is incorrect
	var checkMessage = "\nThe Trade Enquiry form has not been completed correctly\n\n";	// set the first part of the message for an invalid entry
	
	var contactName = document.tradeEnquiries.contactName.value; // field for contact name
	var	re = /^[a-z]+ ?[a-z]* ?[a-z]*$/i;
		
	if (re.test(contactName))
	{ }
	else
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your contact name appears to be invalid\n"; // add text to the error message
	}
	
	var companyName = document.tradeEnquiries.companyName.value; // field for company name
	re = /^[a-z0-9,. ]+[a-z0-9,. ]*$/i;
	
	if (companyName == "")
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "You have not entered a company name\n"; // add text to the error message
	}
	else if (re.test(companyName))
	{ }
	else
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your company name appears to be invalid\n"; // add text to the error message
	}	
	
	var companyStreet = document.tradeEnquiries.companyStreet.value; // field for company street address
	var companyCity = document.tradeEnquiries.companyCity.value; // field for company city address
	var companyCounty = document.tradeEnquiries.companyCounty.value; // field for company county address
	re = /^[a-z,\. ]+[a-z,\. ]*$/i; // street address eg 22 some road, 22 name or name

	if (companyStreet == "" && companyCity == "" && companyCounty == "")  // check to see if any address fields contain data
	{
		fieldCheck = false;
		checkMessage += "You have not entered a company address\n"; // add text to the error message
	}
	else if (re.test(companyStreet))
	{
		re = /^[a-z,\. ]*$/i;
		if (re.test(companyCity) && re.test(companyCounty))
		{ }
		else
		{
			fieldCheck = false; 	// if input fails test then field input is invalid
			checkMessage += "Your company address data appears to be invalid\n"; 	// add text to the error message
		}
	}
	else
	{
		fieldCheck = false; 	// if input fails test then field input is invalid
		checkMessage += "Your company address data appears to be invalid\n"; 	// add text to the error message
	}

	var companyPostCode = document.tradeEnquiries.companyPostCode.value; // field for company address postcode
	re = /^(\d{5}(-\d{4})?|[a-z][a-z]?\d\d? ?\d[a-z][a-z])$/i; // regular expression to check for valid zip code or postcode

	if (companyPostCode == "")  // check to see if companyPostCode contains any date
	{
		fieldCheck = false;
		checkMessage += "You have not entered your company postcode\n"; // add text to the error message
	}
	else if (re.test(companyPostCode))  // if companyPostCode contains data, validate that data
	{ } 
	else 
	{
		fieldCheck = false; // if input fails test then field input is invalid
		checkMessage += "Your company postcode data is invalid\n"; // add text to the error message
	}

	var companyTelephone = document.tradeEnquiries.companyTelephone.value; // field for company telephone number
	re = /^[0-9\+\(\) ]{10,22}$/; // regular expression to check for a valid phone number 

	if (companyTelephone == "")  // check to see if companyTelephone contains data
	{
		fieldCheck = false;
		checkMessage += "You have not entered your company telephone number\n"; // add text to the error message
	}
	else if (re.test(companyTelephone))  // if companyTelephone contains data, validate that data
	{ } 
	else 
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your company telephone number format appears to be invalid."; // add text to the error message
	}
	
	var companyFax = document.tradeEnquiries.companyFax.value; // field for company fax number
	re = /^[0-9\+\(\) ]{10,22}$/; // regular expression to check for a valid phone number 

	if (companyFax == "")  // check to see if companyFax contains data
	{ }
	else if (re.test(companyFax))  // if companyFax contains data validate the data
	{ } 
	else
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your company fax number format is invalid."; // add text to the error message
    }
		
	companyEmail = document.tradeEnquiries.companyEmail.value; // field for company email address
	re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/i; // regular expression to check for valid email address

	if (companyEmail == "")  // check to see if companyEmail contains data
	{
		fieldCheck = false;
		checkMessage += "You have not entered your company email address\n"; // add text to the error message
	}
	else if (re.test(companyEmail))  // if companyEmail contains data validate the data
	{ } 
	else 
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your company email address appears to be invalid\n"; // add text to the error message
	}


// enquiryMessage clean up and make content safe to be submitted

	enquiryMessage = document.tradeEnquiries.enquiryMessage.value; // field for company email address
	re = /^[a-z0-9"£$%&()@:;,\.\s]+$/i;  // need to add " £ $ % & , . @ : ; and whitespace characters

	if (enquiryMessage == "")  // check to see if companyEmail contains data
	{
		fieldCheck = false;
		checkMessage += "You have not entered an enquiry message\n"; // add text to the error message
	}
	else if (re.test(enquiryMessage))
	{ }
	else
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your enquiry message appears to contain invalid characters.\n"; // add text to the error message
		checkMessage += "   Only alphanumeric characters and \" \£ \$ \% \& \@ \: \; \, \. \( \) are allowed.\n"; // add text to the error message
	}


 // finished checking form fields, alert user on error

	if(fieldCheck == true) 
	{
		return fieldCheck; // if all is ok return true so that data is sent to server
	}
	else 
	{
 		alert(checkMessage) // display alert box with all error messages
 		return fieldCheck; // if there are any errors return false to stop data being sent to the server
	}
}

function validateOrder(orderDetails) // function to ensure order quantity is not zero before proceeding
{
	fieldCheck = true;	// set the field default check value to be correct, we will test to see if it is incorrect
	checkMessage = "\nThe order form has not been completed correctly\n\n";	// set the first part of the message for an invalid entry
	
	red_2L = document.orderDetails.red_2L.value;	// quantity of Red 2L
	red_2L = red_2L * 1; // convert from string to number
	blue_2L = document.orderDetails.blue_2L.value;	// quantity of Blue 2L
	blue_2L = blue_2L * 1;  // convert from string to number
	green_2L = document.orderDetails.green_2L.value;	// quantity of Green 2L
	green_2L = green_2L * 1; // convert from string to number
	lGreen_2L = document.orderDetails.lGreen_2L.value;	// quantity of L Green 2L
	lGreen_2L = lGreen_2L * 1; // convert from string to number
	green_4L = document.orderDetails.green_4L.value;	// quantity of Green 4L
	green_4L = green_4L * 1; // convert from string to number
	totalQuantity = red_2L + blue_2L + green_2L + lGreen_2L + green_4L;
	
	if (totalQuantity == 0)
	{
		fieldCheck = false;
		checkMessage += "Your order quantity cannot be zero"; // add text to the error message
	} 

 // finished checking form fields, alert user on error

	if (fieldCheck == true) 
	{
		return fieldCheck; // if all is ok return true so that data is sent to server
	}
	else 
	{
 		alert(checkMessage) // display alert box with all error messages
 		return fieldCheck; // if there are any errors return false to stop data being sent to the server
	}
}

function validatePayment(paymentDetails) 	// function to validate standard form fields
{
	var fieldCheck = true;	// set the field default check value to be correct, we will test to see if it is incorrect
	var checkMessage = "\nThe Payment and Delivery form has not been completed correctly\n\n";	// set the first part of the message for an invalid entry
	
	var firstName = document.paymentDetails.firstName.value;	// field for first name
	var re = /^[a-z]+\s?[-]?[a-z]?$/i;	// regular expression to check for single, double or hyphenated first name

	if (firstName == "") 	// check to see if FirstName contains data
	{
		fieldCheck = false;
		checkMessage += "You have not entered your first name\n"; // add text to the error message
	}
	else if (re.test(firstName))	// if firstName contains data, validate that data
	{ }
	else 
	{
		fieldCheck = false;	// if input fails test then field input is invalid
		checkMessage += "Your first name data is invalid\n";	// add text to the error message
	}

	var surname = document.paymentDetails.surname.value; 	// field for surname
	re = /^[a-z]+[-]?[a-z]?$/i; 	// regular expression to check for single, double or hyphenated surname

	if (surname == "")  	// check to see if Surname contains data
	{
		fieldCheck = false;
		checkMessage += "You have not entered your surname\n"; 	// add text to the error message
	}
	else if (re.test(surname))  	// if surname contains data, validate that data
	{ }
	else 
	{
		fieldCheck = false; 	// if input fails test then field input is invalid
		checkMessage += "Your surname data is invalid\n"; 	// add text to the error message
	}

	var cardStreet = document.paymentDetails.cardStreet.value; // field for card holders street address
	var cardCity = document.paymentDetails.cardCity.value; // field for card holders city address
	var cardCounty = document.paymentDetails.cardCounty.value; // field for county address
	re = /^[a-z0-9,\. ]+[a-z,\. ]*$/i; // street address eg 22 some road, 22 name or name

	if (cardStreet == "" && cardCity == "" && cardCounty == "")  // check to see if any address fields contain data
	{
		fieldCheck = false;
		checkMessage += "You have not entered your address\n"; // add text to the error message
	}
	else if (re.test(cardStreet))
	{
		re = /^[a-z,\. ]*$/i;
		if (re.test(cardCity) && re.test(cardCounty))
		{ }
		else
		{
			fieldCheck = false; 	// if input fails test then field input is invalid
			checkMessage += "Your address data appears to be invalid\n"; 	// add text to the error message
		}
	}
	else
	{
		fieldCheck = false; 	// if input fails test then field input is invalid
		checkMessage += "Your address data appears to be invalid\n"; 	// add text to the error message
	}

	var cardPostCode = document.paymentDetails.cardPostCode.value; // field for card holders postcode
	re = /^(\d{5}(-\d{4})?|[a-z][a-z]?\d\d? ?\d[a-z][a-z])$/i; // regular expression to check for valid zip code or postcode

	if (cardPostCode == "")  // check to see if cardPostCode contains any date
	{
		fieldCheck = false;
		checkMessage += "You have not entered your postcode\n"; // add text to the error message
	}
	else if (re.test(cardPostCode))  // if cardPostCode contains data, validate that data
	{ } 
	else 
	{
		fieldCheck = false; // if input fails test then field input is invalid
		checkMessage += "Your postcode data is invalid\n"; // add text to the error message
	}

	var cardTelephone = document.paymentDetails.cardTelephone.value; // field for card holders telephone number
	re = /^[0-9\+\(\) ]{10,22}$/; // regular expression to check for a valid phone number 

	if (cardTelephone == "")  // check to see if cardTelephone contains data
	{
		fieldCheck = false;
		checkMessage += "You have not entered your telephone number\n"; // add text to the error message
	}
	else if (re.test(cardTelephone))  // if cardTelephone contains data, validate that data
	{ } 
	else 
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your telephone number format appears to be invalid."; // add text to the error message
	}

	var cardFax = document.paymentDetails.cardFax.value; // field for fax number
	re = /^[0-9\+\(\) ]{10,22}$/; // regular expression to check for a valid phone number 

	if (cardFax == "")  // check to see if cardFax contains data
	{ }
	else if (re.test(cardFax))  // if cardFax contains data validate the data
	{ } 
	else
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your fax number data format is invalid."; // add text to the error message
   	}
		
	var cardEmail = document.paymentDetails.cardEmail.value; // field for email address
	re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/i; // regular expression to check for valid email address

	if (cardEmail == "")  // check to see if cardEmail contains data
	{
		fieldCheck = false;
		checkMessage += "You have not entered your email address\n"; // add text to the error message
	}
	else if (re.test(cardEmail))  // if emailAddress contains data validate the data
	{ } 
	else 
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your email address is invalid\n"; // add text to the error message
	}

	var cardNumber = document.paymentDetails.cardNumber.value // field for card number
	var cardType = document.paymentDetails.cardType.value // field for card type
	var cardNumbersOnly = cardNumber.replace(/ /g,"");
	var cardNumberLength = cardNumbersOnly.length;
	var validLength = false;
	var validPrefix = false;
	re = /^[0-9]{10,}$/ // regular expression to check for only digits and a valid card number length

	if (cardNumber == "" && cardType == "NULL")  // check to see if cardNumber contains data
	{
		fieldCheck = false
		checkMessage += "You have not entered your card number\n" // add text to the error message
		checkMessage += "You have not selected a card type\n" // add text to the error message
	}
	else if (cardNumber == "")
	{
		fieldCheck = false
		checkMessage += "You have not entered your card number\n" // add text to the error message
	}
	else if (cardType == "NULL")
	{
		fieldCheck = false
		checkMessage += "You have not selected a card type\n" // add text to the error message		
	}
	else 
	{
		if	(re.test(cardNumber))  // if cardNumber contains data validate the data
		{
			switch (cardType)
			{
				case "MASTERCARD":
				validLength = (cardNumberLength == 16);
				re = /^5[1-5]/;
				break
	
				case "VISA":
				validLength = (cardNumberLength == 16 || cardNumberLength == 13);
				re = /^4/;
				break
	
				case "AMEX":
				validLength = (cardNumberLength == 15 || cardNumberLength == 13);
				re = /^3[4,7]/;
				break
	
				case "SWITCH":
				validLength = (cardNumberLength == 16 || cardNumberLength == 18 || cardNumberLength == 19);
				re = /^(49030[2-9])|(49033[5-9])|(49110[1-2])|(49117[4-9])|(49118[0-2])|(4936)|(564182)|(6333[0-4])|(6759)/;
				break
	
				case "MAESTRO":
				validLength = (cardNumberLength >= 13 && cardNumberLength <= 20);
				re = /^(50)|(5[6-8])|(6)/;
				break
	
				case "SOLO":
				validLength = (cardNumberLength == 16 || cardNumberLength == 18 || cardNumberLength == 19);
				re = /^(6334[5-9])|(6767)/;
				break
	
				case "DELTA":
				validLength = (cardNumberLength == 16);
				re = /^(41373[3-7])|(4462)|(45397[8-9])|(454313)|(45443[2-5])|(454742)|(45672[5-9])|(45673)|(45674[0-5])|(4658[3-7])|(484409)|(484410)|(4909[6-7])|(49218[1-2])|(498824)/;
				break
	
				case "ELECTRON":
				validLength = (cardNumberLength == 16);
				re = /^(450875)|(48440[6-8])|(48441[1-9])|(4844[2-4])|(48445[0-5])|(4917[3-5])|(491880)/;
				break
	
				case "NULL":
				re = /^$/;
				fieldCheck = false; // if card length test fails then field input is incorrect
				checkMessage += "Your card number length is invalid.\n";
				break
	
				default:
				re = /^$/;
				fieldCheck = false; // if card length test fails then field input is incorrect
				checkMessage += "Your card number length is invalid.\n";
				break
			}
	
			validPrefix = re.test(cardNumbersOnly)
			validCard = validPrefix && validLength
	
			if (validCard)
			{
				var numberProduct;
				var numberProductDigitIndex;
				var checkSumTotal =0;
				for (digitCounter = cardNumberLength -1; digitCounter >= 0; digitCounter--)
				{
					checkSumTotal += parseInt (cardNumbersOnly.charAt(digitCounter));
					digitCounter--;
					numberProduct = String((cardNumbersOnly.charAt(digitCounter) * 2));
					for (var productDigitCounter = 0; productDigitCounter < numberProduct.length; productDigitCounter++)
					{
						checkSumTotal += parseInt(numberProduct.charAt(productDigitCounter));
					}	
				}
			}

			validCard = (checkSumTotal % 10 == 0);

			if (validCard)
			{ }
			else
			{
				fieldCheck = false; // if input fails test then field input is incorrect
				checkMessage += "Your card number appears to be invalid\n"; // add text to the error message
			}
		} 
		else 
		{
			fieldCheck = false; // if input fails test then field input is incorrect
			checkMessage += "Your card number format is invalid.\n   Please only use spaces to seperate numbers.\n"; // add text to the error message
		}
	}
	
	var expiryMonth = document.paymentDetails.expiryMonth.value; // field for card expiry year
	var expiryYear = document.paymentDetails.expiryYear.value; // field for card expiry year
	var todayDate = new Date();
	
	if (expiryMonth == "NULL" && expiryYear == "NULL")
	{
		fieldCheck = false;
		checkMessage += "You have not selected a card expiry date\n"; // add text to the error message	
	}
	else if (expiryMonth < todayDate.getMonth() && expiryYear == todayDate.getFullYear())
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your card expiry date appears to be invalid\n"; // add text to the error message
	}
	else if (expiryYear < todayDate.getFullYear())
	{
		fieldCheck = false; // if input fails test then field input is incorrect
		checkMessage += "Your card expiry date appears to be invalid\n"; // add text to the error message
	}

	var securityNumber = document.paymentDetails.securityNumber.value; // field for card security number
	var securityNumbersOnly = securityNumber.replace(/ /g,"");
	var securityNumberLength = securityNumbersOnly.length;
	re = /^[0-9]{3,4}$/;
	
	if (securityNumber == "")
	{
		fieldCheck = false;
		checkMessage += "You have not entered a card security number\n"; // add text to the error message	
	}
	else if (re.test(securityNumbersOnly))
	{
		if (cardType == "AMEX")
		{
			validLength = (securityNumberLength == 4);
		}
		else
		{
			validLength = (securityNumberLength == 3);
		}
		
		if (validLength)
		{ }
		else
		{
		fieldCheck = false;
		checkMessage += "Your card security number appears to be invalid\n"; // add text to the error message	
		}
	}
	else
	{
		fieldCheck = false;
		checkMessage += "Your card security number format appears to be invalid\n"; // add text to the error message	
	}
	
	var validFromMonth = document.paymentDetails.fromMonth.value; // field for valid from month
	var validFromYear = document.paymentDetails.fromYear.value; // field for valid from year
	var issueNumber = document.paymentDetails.issueNumber.value; // field for card security number
	var issueNumbersOnly = issueNumber.replace(/ /g,"");
	var issueNumberLength = issueNumbersOnly.length;
	re = /^[0-9]$/;
	
	if (cardType == "SWITCH")
	{
		if (validFromMonth == "NULL" && validFromYear == "NULL")
		{
			fieldCheck = false;
			checkMessage += "You have not selected a valid from date\n" ;// add text to the error message	
		}
		else if (validFromMonth > todayDate.getMonth() && validFromYear == todayDate.getFullYear())
		{
			fieldCheck = false; // if input fails test then field input is incorrect
			checkMessage += "Your card valid from date appears to be invalid\n"; // add text to the error message
		}
		else if (validFromYear > todayDate.getFullYear())
		{
			fieldCheck = false; // if input fails test then field input is incorrect
			checkMessage += "Your card valid from date appears to be invalid\n"; // add text to the error message
		}
		
		if (issueNumber == "")
		{
			fieldCheck = false;
			checkMessage += "You have not entered an issue number\n"; // add text to the error message	
		}
		else if (re.test(issueNumber) && issueNumberLength < 3)
		{ }
		else
		{
			fieldCheck = false; // if input fails test then field input is incorrect
			checkMessage += "Your card issue number appears to be invalid\n"; // add text to the error message
		}
		
	}	
	
	var cardHolderDelivery = document.paymentDetails.cardHolderDelivery.value; // field for delivery option

	if (cardHolderDelivery == "NO")
	{
		var deliveryName = document.paymentDetails.deliveryName.value; // field for delivery name
		re = /^[a-z]+ ?[a-z]* ?[a-z]*$/i;
		
		if (re.test(deliveryName))
		{ }
		else
		{
			fieldCheck = false; // if input fails test then field input is incorrect
			checkMessage += "Your delivery name appears to be invalid\n"; // add text to the error message
		}
	
		var deliveryStreet = document.paymentDetails.deliveryStreet.value; // field for delivery street address
		var deliveryCity = document.paymentDetails.deliveryCity.value; // field for delivery city address
		var deliveryCounty = document.paymentDetails.deliveryCounty.value; // field for delivery county address
		re = /^[a-z0-9]+ ?[a-z]* ?[a-z]*$/i; // street address eg 22 some road, 22 name or name

		if (deliveryStreet == "" && deliveryCity == "" && deliveryCounty == "")  // check to see if any address fields contain data
		{
			fieldCheck = false;
			checkMessage += "You have not entered a delivery address\n"; // add text to the error message
		}
		else if (re.test(deliveryStreet))
		{
			re = /^[a-z]*$/i;
			if (re.test(deliveryCity) && re.test(deliveryCounty))
				{ }
				else
					{
						fieldCheck = false; 	// if input fails test then field input is invalid
						checkMessage += "Your delivery address data appears to be invalid\n"; 	// add text to the error message
					}
		}
		else
		{
			fieldCheck = false; 	// if input fails test then field input is invalid
			checkMessage += "Your delivery address data appears to be invalid\n"; 	// add text to the error message
		}

		var deliveryPostCode = document.paymentDetails.deliveryPostCode.value; // field for delivery address postcode
		re = /^(\d{5}(-\d{4})?|[a-z][a-z]?\d\d? ?\d[a-z][a-z])$/i; // regular expression to check for valid zip code or postcode

		if (deliveryPostCode == "")  // check to see if cardPostCode contains any date
		{
			fieldCheck = false;
			checkMessage += "You have not entered your delivery postcode\n"; // add text to the error message
		}
		else if (re.test(deliveryPostCode))  // if cardPostCode contains data, validate that data
		{ } 
		else 
		{
			fieldCheck = false; // if input fails test then field input is invalid
			checkMessage += "Your delivery postcode data is invalid\n" ;// add text to the error message
		}

		var deliveryTelephone = document.paymentDetails.deliveryTelephone.value; // field for card holders telephone number
		re = /^[0-9\+\(\) ]{10,22}$/; // regular expression to check for a valid phone number 

		if (deliveryTelephone == "")  // check to see if cardTelephone contains data
		{
			fieldCheck = false;
			checkMessage += "You have not entered your delivery telephone number\n"; // add text to the error message
 		}
		else if (re.test(deliveryTelephone))  // if cardTelephone contains data, validate that data
		{ } 
		else 
		{
			fieldCheck = false; // if input fails test then field input is incorrect
			checkMessage += "Your delivery telephone number format appears to be invalid."; // add text to the error message
		}
	}
	
 // finished checking form fields
 // alert user if any fields are invalid

	if(fieldCheck == true) 
	{
		return fieldCheck; // if all is ok return true so that data is sent to server
 	}
	else 
	{
 		alert(checkMessage) // display alert box with all error messages
 		return fieldCheck; // if there are any errors return false to stop data being sent to the server
	}
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
