function identifica() {
missinginfo = "";
if ((document.form.email.value == "") ||
(document.form.email.value.indexOf("@") == -1) ||
(document.form.email.value == "e-mail") ||
(document.form.email.value.indexOf(".") == -1)) {
missinginfo += "\n     -  E-MAIL";
}
if ((document.form.nome.value == "") || 
(document.form.nome.value == "seu nome")) {
missinginfo += "\n     -  SEU NOME";
}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"Os seguintes dados estão em branco:\n" +
missinginfo + "\n_____________________________" +
"\nPor favor, preencha os dados corretamente!";
alert(missinginfo);
return false;
}
}

function novoComent() {
missinginfo = "";
if (document.form.msg.value == "")
{
missinginfo += "\n     -  CAMPO MENSAGEM EM BRANCO.";
}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"Os seguintes dados estão em branco:\n" +
missinginfo + "\n_____________________________" +
"\nPor favor, preencha os dados corretamente!";
alert(missinginfo);
return false;
}
}


function HabiDsabi(){
if(document.getElementById('habi1').checked == true){
document.getElementById('file1').disabled = ""
}
if(document.getElementById('habi1').checked == false){
document.getElementById('file1').disabled = "disabled"
}
if(document.getElementById('habi2').checked == true){
document.getElementById('file2').disabled = ""
}
if(document.getElementById('habi2').checked == false){
document.getElementById('file2').disabled = "disabled"
}
}



var exts = "jpg|gif|png|bmp|mp3|mpg|mpeg|avi|rar|zip|7z|gz|txt|avi|mpg";
//var exts = ".*"; //Use this to accept all Extensions

function StartUpload2(f1)
{ 

missinginfo = "";
if (document.form.assunto.value == "")
{
missinginfo += "\n     -  DIGITE UM ASSUNTO PARA O CHAMADO.";
}
if (document.form.msg.value == "")
{
missinginfo += "\n     -  CAMPO MENSAGEM EM BRANCO.";
}
if (document.form.contato.value == "")
{
missinginfo += "\n     -  DIGITE SEU NOME.";
}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"Os seguintes dados estão em branco:\n" +
missinginfo + "\n_____________________________" +
"\nPor favor, preencha os dados corretamente!";
alert(missinginfo);
return false;
}
}

function StartUpload(f1)
{
missinginfo = "";
if (document.form.assunto.value == "")
{
missinginfo += "\n     -  DIGITE UM ASSUNTO PARA O CHAMADO.";
}
if (document.form.msg.value == "")
{
missinginfo += "\n     -  CAMPO MENSAGEM EM BRANCO.";
}
if (document.form.contato.value == "")
{
missinginfo += "\n     -  DIGITE SEU NOME.";
}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"Os seguintes dados estão em branco:\n" +
missinginfo + "\n_____________________________" +
"\nPor favor, preencha os dados corretamente!";
alert(missinginfo);
return false;
}
var UID = Math.round(10000*Math.random())+'0'+Math.round(10000*Math.random());
f1.action = f1.action.split('?')[0]+'?upload_id='+UID;
win1 = window.open(f1.action.split('upload.cgi')[0]+'upload_status.cgi?upload_id='+UID,'win1','width=320,height=240,resizable=1');
win1.window.focus();
}

function checkExt(value)
{
    if(value=="")return true;
    var re = new RegExp("^.+\.("+exts+")$","i");
    if(!re.test(value))
    {
        alert("This file extension is not allowed: \n" + value + "\n\nOnly these extensions are allowed: "+exts.replace(/\|/g,',')+" \n\n");
        return false;
    }
    return true;
}


function AparecerDiv(div) {

if (document.getElementById(div).style.display == "none") {
document.getElementById(div).style.display = "block";
}
else {
document.getElementById(div).style.display = "none";
}
}

function travaBnt(div) {

document.getElementById('bnt').disabled == "disabled";
}
//Variáveis globais
var _loadTimer	= setInterval(__loadAnima,18);
var _loadPos	= 0;
var _loadDir	= 2;
var _loadLen	= 0;

//Anima a barra de progresso
function __loadAnima(){
	var elem = document.getElementById("barra_progresso");
	if(elem != null){
		if (_loadPos==0) _loadLen += _loadDir;
		if (_loadLen>32 || _loadPos>79) _loadPos += _loadDir;
		if (_loadPos>79) _loadLen -= _loadDir;
		if (_loadPos>79 && _loadLen==0) _loadPos=0;
		elem.style.left		= _loadPos;
		elem.style.width	= _loadLen;
	}
}

//Esconde o carregador
function __loadEsconde(){
	this.clearInterval(_loadTimer);
	var objLoader				= document.getElementById("carregador_pai");
	objLoader.style.display		="none";
	objLoader.style.visibility	="hidden";
}
