String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

// ==== FUNCTIONS FOR DEALING GENERIC FORMS ====
// ---- Functions called from onFocus & onBlur events in generic form elements
function clearSearch(objInput)
{if (objInput.value=="Site search") objInput.value = "";}

function clearProductFinder(objInput)
{if (objInput.value=="PRODUCT SEARCH") objInput.value = "";}

function resetSearch(objInput)
{if (objInput.value=="") {objInput.value = objInput.defaultValue;}}

// ---- Function called from onChange event in Product Finder "by type" dropdown
function fn_PF_by_type(objSel)
{
 if(objSel.value!="")
 {
  alert("Can do something with the product type id '" + objSel.value + "'");
 }
}

// ---- Function called from onChange event in Product Finder "by industry" dropdown
function fn_PF_by_industry(objSel)
{
 if(objSel.value!="")
 {
  alert("Can do something with the industry id '" + objSel.value + "'");
 }
}

// ---- Function called from onSubmit event on Product Finder form
function fn_QuickSearch_Verify(objForm)
{
 var tmpVal = objForm.Query.value;
 if(tmpVal!="" && tmpVal!="Site search"){return true;}
 return false;
}
// ---- Function called from onSubmit event on Product Finder form
function fn_PF_Verify(objForm)
{
 var tmpVal = objForm.ProductSearch.value;
 if(tmpVal!="" && tmpVal!="PRODUCT SEARCH"){return true;}
 return false;
}

// ---- Function called from onChange event in a Service Centre region dropdown
function fn_SelectServiceRegion(objSel)
{
 if(objSel.value!="")
 {
  alert("Can do something with the region id '" + objSel.value + "'");
 }
}

// ---- Function called from onChange event in Product Pages "Other related products" dropdown
function fn_RelatedProducts(objSel)
{
 if(objSel.value!="")
 {
  alert("Can do something with the product id '" + objSel.value + "'");
 }
}


