function makeFlash(arquivo,id,largura,altura) {
    if (window.navigator.appName == "Microsoft Internet Explorer") {
        document.write('<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+largura+'" height="'+altura+'">');
        document.write('<param name="movie" value="'+arquivo+'">');
        document.write('<param name="quality" value="high">');
        document.write('<param name="menu" value="false">');
        document.write('<param name="wmode" value="transparent">');
        document.write('</object>');

    }else{
        document.write('<embed src="'+arquivo+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+largura+'" height="'+altura+'" menu="false" wmode="transparent"></embed>');
    }
}

function abrirAtendimento() {
	window.open('http://www.cyber1.net.br/craft/livehelp.php?page=livehelp.php&department=2&tab=1', 'AtendimentoOnline', 'width=1020,height=580,resize=no,scrollbars=no,menubar=no,status,no');
}

function verificaContato(){
		form = document.formContato;
		if(form.nome.value.length==0){
			alert('Campo Nome Obrigatório!');
			form.nome.focus();
			return false;
		}
		if(form.empresa.value.length==0){
			alert('Campo Empresa Obrigatório!');
			form.empresa.focus();
			return false;
		}
		if(form.email.value.length==0){
			alert('Campo E-mail Obrigatório!');
			form.email.focus();
			return false;
		}
		if(form.pretelefone.value.length==0){
			alert('Campo DDD Obrigatório!');
			form.pretelefone.focus();
			return false;
		}
		if(form.telefone.value.length==0){
			alert('Campo telefone Obrigatório!');
			form.telefone.focus();
			return false;
		}
		if(form.mensagem.value.length==0){
			alert('Campo mensagem Obrigatório!');
			form.telefone.focus();
			return false;
		}
		document.formContato.remetente.value = form.email.value;
}

function abrirJanela(arquivo, nome, largura, altura) {
    window.open(arquivo, nome, "width="+largura+",height="+altura+"");
}
function liberarBotao(id){
	if(document.getElementById("aceito").checked == true){
		document.getElementById(id).disabled = false;
	}else{
		document.getElementById(id).disabled = true;
	}
}
function numeros(e){
	if(e.keyCode){
		tecla = e.keyCode;
	}else{
		tecla= e.which;
	}
	if (tecla >= 48 && tecla <= 57 || tecla==8 || tecla==9){
	    return true;
	}else{
	    return false;
	}
}

function formataCnpj(campo, teclapres){
	campo = document.getElementById(campo);
	tecla = teclapres.keyCode;
	vr = new String(campo.value);
	vr = vr.replace(".", "");
	vr = vr.replace("/", "");
	vr = vr.replace("-", "");
	tam = vr.length + 1;
	if (tecla != 14)
	{
		if (tam == 3)
			campo.value = vr.substr(0, 2) + '.';
		if (tam == 6)
			campo.value = vr.substr(0, 2) + '.' + vr.substr(2, 5) + '.';
		if (tam == 10)
			campo.value = vr.substr(0, 2) + '.' + vr.substr(2, 3) + '.' + vr.substr(6, 3) + '/';
		if (tam == 15)
			campo.value = vr.substr(0, 2) + '.' + vr.substr(2, 3) + '.' + vr.substr(6, 3) + '/' + vr.substr(9, 4) + '-' + vr.substr(13, 2);
	}
}
function formataCep(campo, teclapres){
	Campo = document.getElementById(campo);
	tecla = teclapres.keyCode;
	vr = new String(Campo.value);
	vr = vr.replace("-", "");
	tam = vr.length + 1;
	if (tecla != 8)
	{
		if (tam == 6)
			Campo.value = vr.substr(0, 5) + '-' + vr.substr(5, 5);
	}
}
function validaPasso2(){
	if (document.getElementById("nome_site").value == "") {	
	 alert("Nome do Site preenchido incorretamente.\n");
	 document.getElementById("nome_site").focus();
	 return false;
  }
  return true;
}
function validaPasso3(){
	if (document.getElementById("nome_site").value == "") {	
	 alert("Nome do Site preenchido incorretamente.\n");
	 document.getElementById("nome_site").focus();
	 return false;
  }
  return true;
}