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=="Recherche sur site") objInput.value = "";}

function clearProductFinder(objInput)
{if (objInput.value=="RECHERCHE PRODUIT") objInput.value = "";}

function resetSearch(objInput)
{if (objInput.value=="") {objInput.value = objInput.defaultValue;}}

function clearText(objInput)
{
}
// ---- Function called from onChange event in Product Finder "by type" dropdown
function fn_PF_by_type(objSel)
{
 if(objSel.value!="")
 {
  alert("Possibilit\351 de faire quelque chose avec l\047identifiant de type de produit" + objSel.value + "'");
 }
}

// ---- Function called from onChange event in Product Finder "by industry" dropdown
function fn_PF_by_industry(objSel)
{
 if(objSel.value!="")
 {
  alert("Possibilit\351 de faire quelque chose avec l\047identifiant d\047industrie" + objSel.value + "'");
 }
}

// ---- Function called from onSubmit event on Product Finder form
function fn_QuickSearch_Verify(objForm)
{
 var tmpVal = objForm.Query.value;
 if(tmpVal!="" && tmpVal!="Recherche sur site"){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!="RECHERCHE PRODUIT"){return true;}
 return false;
}

// ---- Function called from onChange event in a Service Centre region dropdown
function fn_SelectServiceRegion(objSel)
{
 if(objSel.value!="")
 {
  alert("Possibilit\351 de faire quelque chose avec l\047identifiant de r\351gion" + objSel.value + "'");
 }
}

// ---- Function called from onChange event in Product Pages "Other related products" dropdown
function fn_RelatedProducts(objSel)
{
 if(objSel.value!="")
 {
  alert("Possibilit\351 de faire quelque chose avec l\047identifiant de produit" + objSel.value + "'");
 }
}

// ---- MotionPoint translations
var MP = {
<!-- mp_trans_disable_start --> 
    Version: '1.0.15',
    Domains: {'fr':'fr.weirpowerindustrial.com'},			
	SrcLang: 'en',
<!-- mp_trans_disable_end -->
	UrlLang: 'fr',
	SrcUrl: unescape('http%3A%2F%2Fwww.weirpowerindustrial.com%2FScripts%2Futils.js'),
<!-- mp_trans_disable_start --> 	
	init: function() {
	   if (MP.SrcUrl.indexOf('p_js_')==1) {
	       MP.SrcUrl = location.href;
           MP.UrlLang = MP.SrcLang;
	   }
	},
    switchLanguage: function(lang) {
		if (lang!=MP.SrcLang) {
            var script = document.createElement('SCRIPT');
            script.src = location.protocol+'//'+MP.Domains[lang]+'/en'+lang+'/?1023749632;'+escape(MP.SrcUrl);
            document.body.appendChild(script);
        } else if (lang==MP.SrcLang) {
		    MP.switchToLang(MP.SrcUrl);		
		}
		return false;
    },
	switchToLang: function(url) {
        var mplink=document.createElement('A');
		if (mplink.click) { // using location.href will cause IE6 to not report referrer
		    mplink.href=url;
            document.body.appendChild(mplink);
            mplink.click();
		} else {
		    location.href=url; 
		}
	}
<!-- mp_trans_disable_end -->	
};
