  function valuetoUpperCase(pagevalue){
	var tempvalue = pagevalue.value;
	pagevalue.value = tempvalue.toUpperCase();
 }
 
 function FormatoTelFax( evento ){
    //if ( (evento.keyCode < 47|| evento.keyCode > 57 ) && evento.keyCode !=  45 )
    //  evento.returnValue = false;
    if ((evento.keyCode!=32&&evento.keyCode!=40&&evento.keyCode!=41&&evento.keyCode!=43)&&(evento.keyCode < 45|| evento.keyCode > 57)) 
    evento.returnValue = false;
 } 
 
 function checkemail(email,form){
	var ind1, ind2, ind3;
  if (email.value != ''){
    ind1 = email.value.indexOf('@');
    ind2 = email.value.indexOf('.');
    ind3 = email.value.lastIndexOf('@');
    if ((ind1<=0) || (ind3 != ind1)) {
          alert("Please introduce a valid email.");
      email.focus();
      email.select();
    }  
  }
}

 function checkLong(year,size){
  if (year.value.length != size){
    alert("The Year Stablished must have length "+size+".");
    year.focus();
    year.select();
  }
}

//--- sw add---
function lTrim(str)  
{  
  if (str.charAt(0) == " ")  
  {  
    str = str.slice(1);
    str = lTrim(str); 
  }  
  return str;  
}  
function rTrim(str)  
{  
  var iLength;  
  iLength = str.length;  
  if (str.charAt(iLength - 1) == " ")  
  {  
    str = str.slice(0, iLength - 1);
    str = rTrim(str);   
  }  
  return str;  
}  

function trim(str)  
{  
  return lTrim(rTrim(str));  
} 



