String.prototype.RTrim = function() {return this.replace(/\s+$/, "");}
String.prototype.LTrim = function() {return this.replace(/^\s+/, "");}
String.prototype.Trim  = function() {return this.RTrim().LTrim();}

function SubmitToBasket(strProductRef, fPrice, strDescription, strProductCode) {
	if ((strProductRef.Trim() == "") || ( fPrice.Trim() == "") || (strDescription.Trim() == "")) alert("Error: Could not Add Item To Basket");
	document.DataForm.hfProductRef.value      = strProductRef.Trim();
	document.DataForm.hfPrice.value           = fPrice.Trim();
	document.DataForm.hfDescription.value     = strDescription.Trim();
	//document.DataForm.hfProductQuantity.value = document.DataForm.elements["cboQty"+strProductRef.Trim()].value;
	document.DataForm.hfProductCode.value     = strProductCode.Trim();
	//alert(document.DataForm.hfProductRef.value + "\n" +	document.DataForm.hfPrice.value + "\n" + document.DataForm.hfDescription.value +"\n" + document.DataForm.hfProductQuantity.value);
	document.DataForm.submit();
}


function verify() {
	 if (document.contactForm.name.value == "") {
		alert("Please enter your name");
		if (parseInt(navigator.appVersion.substring(0,1))>=3) document.contactForm.name.focus();
	}  else if (document.contactForm.telephone.value == "") {
		alert("Please enter your telephone number");
		if (parseInt(navigator.appVersion.substring(0,1))>=3) document.contactForm.telephone.focus();
	}  else if (document.contactForm.email.value == "") {
		alert("Please enter your email address");
		if (parseInt(navigator.appVersion.substring(0,1))>=3) document.contactForm.email.focus();	
	} else {
		window.document.contactForm.submit();
	}
}


function Validate() {
	if(document.archive.newsID.value == "") {
		alert("Please select an archived news story");
		document.archive.newsID.focus();
	} else {
		document.archive.submit();
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validateSearch()
{
	 if (document.SearchForm.SearchValue.value == '') {
		alert('Please Enter a Value');
		document.SearchForm.SearchValue.focus();
	} else if (document.SearchForm.SearchValue.value == ' ') {
		alert('You Must Enter a Value');
		document.SearchForm.SearchValue.focus();
	} else {
		document.SearchForm.submit();
	}
}
