// JavaScript Document


//scripts HOME
function vai_rem(){
var cnpj = document.f1.cnpj.value;

if(cnpj == ""){
	alert("Informe o CNPJ/CPF do remetente!");
	document.f1.cnpj.focus();
return false;
}

if(cnpj.length != 11 && cnpj.length != 14){
	alert("CNPJ/CPF incorreto!");
	document.f1.cnpj.focus();
	return false;
	}

if(isNaN(cnpj)){
	alert("CNPJ/CPF incorreto, informe apenas números!");
	document.f1.cnpj.focus();
	return false;
	}
	
if(document.f1.nr.value == ""){
alert("Informe a Nota Fiscal!");
document.f1.NR.focus();
return false;
}

document.f1.action = "http://www.ssw.inf.br/ssw_resultSSW.asp?cnpj="+document.f1.cnpj.value+"&nr="+document.f1.nr.value;
document.f1.submit();

}


function vai_dest(){
var cnpj = document.f1.cnpjdest.value;

if(cnpj == ""){
	alert("Informe o CNPJ/CPF do destinatário!");
	document.f1.cnpjdest.focus();
return false;
}

if(cnpj.length != 11 & cnpj.length != 14){
	alert("CNPJ/CPF incorreto!");
	document.f1.cnpjdest.focus();
	return false;
	}

if(isNaN(cnpj)){
	alert("CNPJ/CPF incorreto, informe apenas números!");
	document.f1.cnpjdest.focus();
	return false;
	}


if(cnpj.length == 14){
	
	if(document.f1.senha_dest.value == ""){
	alert("Informe a Senha!");
	document.f1.senha_dest.focus();
	return false;
	}
}

document.f1.action = "http://www.ssw.inf.br/ssw_resultSSW_dest.asp?cnpjdest="+document.f1.cnpjdest.value+"&senha="+document.f1.senha_dest.value;
document.f1.submit();

}


function vai_pag(){
var cnpj = document.f1.cnpjpag.value;

if(cnpj == ""){
	alert("Informe o CNPJ/CPF do pagador!");
	document.f1.cnpjpag.focus();
return false;
}

if(cnpj.length != 11 & cnpj.length != 14){
	alert("CNPJ/CPF incorreto!");
	document.f1.cnpjpag.focus();
	return false;
	}

if(isNaN(cnpj)){
	alert("CNPJ/CPF incorreto, informe apenas números!");
	document.f1.cnpjpag.focus();
	return false;
	}


if(document.f1.senha_pag.value == ""){
alert("Informe a Senha!");
document.f1.senha_pag.focus();
return false;
}

document.f1.action = "http://www.ssw.inf.br/ssw_resultSSW_pag.asp?cnpjpag="+document.f1.cnpjpag.value+"&senha="+document.f1.senha_pag.value;
document.f1.submit();

}
