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=="Busca no site") objInput.value = "";}

function clearProductFinder(objInput)
{if (objInput.value=="BUSCA DE PRODUTOS") 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("Posso fazer alguma coisa com a identifica\347\343o do tipo de produto\047" + objSel.value + "'");
 }
}

// ---- Function called from onChange event in Product Finder "by industry" dropdown
function fn_PF_by_industry(objSel)
{
 if(objSel.value!="")
 {
  alert("Posso fazer alguma coisa com a identifica\347\343o da ind\372stria\047" + objSel.value + "'");
 }
}

// ---- Function called from onSubmit event on Product Finder form
function fn_QuickSearch_Verify(objForm)
{
 var tmpVal = objForm.Query.value;
 if(tmpVal!="" && tmpVal!="Busca no 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!="BUSCA DE PRODUTOS"){return true;}
 return false;
}

// ---- Function called from onChange event in a Service Centre region dropdown
function fn_SelectServiceRegion(objSel)
{
 if(objSel.value!="")
 {
  alert("Posso fazer alguma coisa com a identifica\347\343o da regi\343o\047" + objSel.value + "'");
 }
}

// ---- Function called from onChange event in Product Pages "Other related products" dropdown
function fn_RelatedProducts(objSel)
{
 if(objSel.value!="")
 {
  alert("Posso fazer alguma coisa com a identifica\347\343o do produto\047" + objSel.value + "'");
 }
}
