
function noSpam(user,domain) 
{
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}


function dostatus(msg)
{
   if (navigator.userAgent.indexOf('Opera')>=0) {
       setTimeout("window.status='"+msg+"'",0);
   }
   else {
       window.status=msg;
   }
   return true;
}


function trim(str) 
{
    var i=1;
    n=str.length;
    cstr=str;
    while (cstr.charAt(0)==' ' || cstr.charAt(0)=='\n' || cstr.charAt(0)=='\t') {
        cstr=str.substring(i, n);
        i=i+1;
    }
    n=cstr.length;
    while (cstr.charAt(n-1)==' ' || cstr.charAt(n-1)=='\n' || 
           cstr.charAt(n-1)=='\t') {
        cstr=cstr.substring(0, n-1);
        n=cstr.length;
    }
    return cstr;
}


function testa_data(sdata)
{
    var re=/^(0[1-9]|[12][0-9]|3[0-1]){1}\/{1}(0[1-9]|1[0-2]){1}\/{1}(19|20){1}[0-9]{2}$/;
    if (re.test(sdata)) {
        return true;
    }
    else {
        return false;
    }
}


function testa_mail(email)
{
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)) {
        return true;
    }
    else {
        return false;
    }
}


function dofocus(objeto, estado)
{
    var st=objeto.style;
    if (estado) {
        st.backgroundColor="white";
    }
    else {
        st.backgroundColor="#E7E7E7";
    }
    return true;
}
