function validar (form) {
        var strErrorMsg=''

        //var str1=document.form.nome.value;
        //if ((str1 == "") || (str1.length < 3)) {
                //strErrorMsg+='* Nome \n';
        //}
 
        var str2=form.email.value;
        if (!verifyEmail(str2)) {
                strErrorMsg+='* E-mail \n';
        }
		

        if (strErrorMsg!='') {
                strErrorMsg ='Error!\n\nPlease correct the following fields:\n' + strErrorMsg
                alert (strErrorMsg);
                return false;
				
        }       else {
			
                return true;
        }

}

function verifyEmail(s) {
	var chrs = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-@';
	var sLen = s.length; var i=0, c=0, cCnt=0, step=0;
	if (sLen < 6) return false;
	while (i < sLen){
		c=s.charAt(i);
		if (!(chrs.indexOf(c)>=0 || (c=='_' && step<1))) return false;
		if (c=='.') { if (cCnt<1) return false; cCnt=0; }
		if (c=='@') { if (step>0) return false; if (cCnt<1) return false; step++; cCnt=0; }
		cCnt=cCnt+1; i++;
	}	
	if (cCnt < 3 || cCnt > 5 || step==0 || (s.indexOf(".")<0) ) return false;
	return true;
}

function verifyNumeric(strInput) {
        if (strInput != '') {
                if (!strInput.match(/[^0-9]/)) {
                        return true;
                }
        }

}

function openPresentation (page, size) {
  window.open(page,'formpopup','menubar=no,status=yes,scrollbars=no,resizable=yes,'+size);
}

function submitPopup (form) {
  openPresentation ('','width=391,height=251');
  form.submit();	
}

function popupImg (img) {
 window.open('/web/popup_img.html?'+img,'img','width=1, height=1, scrollbars=no, resizable=yes, status=yes');
}


