/****************************************************************************
* Flash Tag Write Object v1.6 - by Lucas Ferreira - www.lucasferreira.com	*
* Info and Usage: www.lucasferreira.com/flashtag							*
* bugs/reports: contato@lucasferreira.com									*
****************************************************************************/

if(Browser == undefined){
	var Browser = {
		isIE: function(){ return (window.ActiveXObject && document.all && navigator.userAgent.toLowerCase().indexOf("msie") > -1  && navigator.userAgent.toLowerCase().indexOf("opera") == -1) ? true : false; }
	}
}

var Flash = function(movie, id, width, height, initParams)
{
	this.html = "";
	this.attributes = this.params = this.variables = null;
	
	this.variables = new Array();
	this.attributes = {
		"classid": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
		"codebase": "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=7,0,0,0",
		"type": "application/x-shockwave-flash"
	}
	this.params = { "pluginurl": "http://www.macromedia.com/go/getflashplayer_br" };
	
	if(movie) {
		this.addAttribute("data", movie);
		this.addParameter("movie", movie);
	}
	
	if(id && id != null) this.addAttribute("id", id);
	if(width) this.addAttribute("width", width);
	if(height) this.addAttribute("height", height);
	
	if(initParams != undefined){
		for(var i in initParams){
			this.addParameter(i.toString(), initParams[i]);
		}
	}
}
Flash.version = "v1.6";
Flash.getObjectByExceptions = function(obj, excep)
{
	var tempObj = {};
	for(var i in obj){
		var inclui = true;
		for(var j=0; j<excep.length; j++)
			if(excep[j] == i.toString()) { inclui = false; break; };
		if(inclui) tempObj[i] = obj[i];
	}
	return tempObj;
}
Flash.prototype.addAttribute = function(prop, val){ this.attributes[prop] = val; }
Flash.prototype.addParameter = function(prop, val){ this.params[prop] = val; }
Flash.prototype.addVariable = function(prop, val){ this.variables.push([prop, val]); }
Flash.prototype.getFlashVars = function()
{
	var tempString = new Array();
	for(var i=0; i<this.variables.length; i++)
		tempString.push(this.variables[i].join("="));
	return tempString.join("&");
}
Flash.prototype.toString = function()
{
	this.params.flashVars = this.getFlashVars();
	if(Browser.isIE()){
		//IE
		this.html = "<ob" + "ject";
		var attr = Flash.getObjectByExceptions(this.attributes, ["type", "data"]);
		for(var i in attr) if(i.toString() != "extend") this.html += " " + i.toString() + " = \"" + attr[i] + "\"";
		this.html += "> ";
		var params = Flash.getObjectByExceptions(this.params, ["pluginurl", "extend"]);
		for(var i in params) if(i.toString() != "extend") this.html += "<param name=\"" + i.toString() + "\" value=\"" + params[i] + "\" /> ";
		this.html += " </obj" + "ect>";
	} else {
		//non-IE
		this.html = "<!--[if !IE]> <--> <obj" + "ect";
		var attr = Flash.getObjectByExceptions(this.attributes, ["classid", "codebase"]);
		for(var i in attr) if(i.toString() != "extend") this.html += " " + i.toString() + " = \"" + attr[i] + "\"";
		this.html += "> ";
		var params = Flash.getObjectByExceptions(this.params, ["extend"]);
		for(var i in params) if(i.toString() != "extend") this.html += "<param name=\"" + i.toString() + "\" value=\"" + params[i] + "\" /> ";
		this.html += " </obj" + "ect> <!--> <![endif]-->";
	}
	return this.html;
}
Flash.prototype.write = Flash.prototype.outIn = Flash.prototype.writeIn = function(w)
{
	if(typeof w == "string" && (w = document.getElementById(w)));
	if( w != null ) { w.innerHTML = this.toString(); }
	else if( w == undefined ) { document.write( this.toString() ); }
    else { return false; }
}

//funções de automatização...
Flash.correctAll = function()
{
	if(!/MSIE (5|6|7|8)/.test(navigator.userAgent) || !document.getElementsByTagName) return false;
	for (var i = 0, objects = document.getElementsByTagName("OBJECT");
			i < objects.length; (objects[i].outerHTML ? (objects[i].outerHTML = objects[i].outerHTML, objects[i].style.visibility = "visible") : null), i++);
}
Flash.automatic = function(r)
{
	if(r && window.attachEvent){	
		for (var i = 0, objects = document.getElementsByTagName("OBJECT");
				i < objects.length; (objects[i].style.visibility = "hidden"), i++);
		window.attachEvent("onload", Flash.correctAll);
		window.attachEvent("onunload", function(){	window.detachEvent("onload", Flash.correctAll);	});
	} else {
		Flash.correctAll();
	}
}
//FIM DO FLASH NOVO


//INICIO v1.0 "ESCREVE NA BARRA DE STATUS"
function MM_displayStatusMsg(msgStr) { 
  status=msgStr;
  document.MM_returnValue = true;
}

//BLOQUEA BOTAO DIREITO
function Mouse(codigo) { 
        if(codigo>1){alert("Proibido a cópia de material sem autorização expressa da VISÃO 3")}
} //inserir no BODY ou HTML => <body onMouseDown="Mouse(event.button)">


<!-- VALIDAÇÃO DE FORMULÁRIO "PLANOS" -->
// INÍCIO autoTab - PREENCHIMENTO AUTOMÁTICO DO "CEP" e "TELEFONE" -->
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}
// FIM autoTab - PREENCHIMENTO AUTOMÁTICO DO "CEP" e "TELEFONE" -->

function valida() {

				if (document.cadastro.nome.value !="")
				{
					if (document.cadastro.nome.value.length < 4)
					{
						alert("Por favor, preencha seu nome Completo!");
						document.cadastro.nome.focus();
						return false;
					}
				}
				else
				{
					alert("Por favor, preencha seu Nome!");
					document.cadastro.nome.focus();
					return false;
				}
				
				if (cadastro.cpf_cnpj.value=="") 
				{
					alert("Preencha seu CPF ou CNPJ!");
					cadastro.cpf_cnpj.focus();
					return false;
				}
				
				if (cadastro.endereco.value=="") 
				{
					alert("Preencha seu Endereço!");
					cadastro.endereco.focus();
					return false;
				}
				
				if (cadastro.cep1.value=="") 
				{
					alert("Preencha seu CEP!");
					cadastro.cep1.focus();
					return false;
				}
				if (cadastro.cep2.value=="") 
				{
					alert("Preencha seu CEP!");
					cadastro.cep2.focus();
					return false;
				}
			
				if (cadastro.cidade.value=="") 
				{
					alert("Preencha sua Cidade!");
					cadastro.cidade.focus();
					return false;
				}       
				
				if (cadastro.uf.value == -1)
				{
			    alert("Preencha seu Estado!");
			    cadastro.uf.focus();
              return false;
				}

				if (document.cadastro.email1.value !="")
				{
					email=document.cadastro.email1.value;
					if (email.indexOf("@",0) == -1)
					{
						alert("Por favor, preencha seu E-mail completo!");
						document.cadastro.email1.focus();
						return false;
					}
				}
				else
				{
					alert("Por favor, preencha seu E-mail!");
					document.cadastro.email1.focus();
					return false;
				}

				if (cadastro.ddd.value=="") 
				{
					alert("Preencha o DDD do telefone!");
					cadastro.ddd.focus();
					return false;
				}       

				if (cadastro.telefone.value=="") 
				{
					alert("Preencha seu Telefone!");
					cadastro.telefone.focus();
					return false;
				}       

				if (cadastro.concordo.checked == false)
                {
                	alert("Você é obrigado a aceitar a nossa Política de Uso!");
					cadastro.concordo.focus();
					return false;
				}                 
}
// -->

// VALIDA CONTATOS
function validaContatos() {

				if (document.contatos.nome.value !="")
				{
					if (document.contatos.nome.value.length < 4)
					{
						alert("Por favor, preencha seu nome Completo!");
						document.contatos.nome.focus();
						return false;
					}
				}
				else
				{
					alert("Por favor, preencha seu Nome!");
					document.contatos.nome.focus();
					return false;
				}
				
				if (document.contatos.email1.value !="")
				{
					email=document.contatos.email1.value;
					if (email.indexOf("@",0) == -1)
					{
						alert("Por favor, preencha seu E-mail completo!");
						document.contatos.email1.focus();
						return false;
					}
				}
				else
				{
					alert("Por favor, preencha seu E-mail!");
					document.contatos.email1.focus();
					return false;
				}

				if (contatos.ddd.value=="") 
				{
					alert("Preencha o DDD do telefone!");
					contatos.ddd.focus();
					return false;
				}       

				if (contatos.telefone.value=="") 
				{
					alert("Preencha seu Telefone!");
					contatos.telefone.focus();
					return false;
				}       
}
// FIM VALIDA CONTATOS-->

// VALIDA MONITORAMENTO
function validaMonitoramento() {

				if (document.monitoramento.nome.value !="")
				{
					if (document.monitoramento.nome.value.length < 4)
					{
						alert("Por favor, preencha seu nome Completo!");
						document.monitoramento.nome.focus();
						return false;
					}
				}
				else
				{
					alert("Por favor, preencha seu Nome!");
					document.monitoramento.nome.focus();
					return false;
				}
				
				if (monitoramento.endereco.value=="") 
				{
					alert("Preencha seu Endereço!");
					monitoramento.endereco.focus();
					return false;
				}
				
				if (monitoramento.cep1.value=="") 
				{
					alert("Preencha seu CEP!");
					monitoramento.cep1.focus();
					return false;
				}
				if (monitoramento.cep2.value=="") 
				{
					alert("Preencha seu CEP!");
					monitoramento.cep2.focus();
					return false;
				}
			
				if (monitoramento.cidade.value=="") 
				{
					alert("Preencha sua Cidade!");
					monitoramento.cidade.focus();
					return false;
				}       
				
				if (monitoramento.uf.value == -1)
				{
			    alert("Preencha seu Estado!");
			    monitoramento.uf.focus();
              return false;
				}

				if (document.monitoramento.email1.value !="")
				{
					email=document.monitoramento.email1.value;
					if (email.indexOf("@",0) == -1)
					{
						alert("Por favor, preencha seu E-mail completo!");
						document.monitoramento.email1.focus();
						return false;
					}
				}
				else
				{
					alert("Por favor, preencha seu E-mail!");
					document.monitoramento.email1.focus();
					return false;
				}

				if (monitoramento.ddd.value=="") 
				{
					alert("Preencha o DDD do telefone!");
					monitoramento.ddd.focus();
					return false;
				}       

				if (monitoramento.telefone.value=="") 
				{
					alert("Preencha seu Telefone!");
					monitoramento.telefone.focus();
					return false;
				}       

}
// FIM VALIDA MONITORAMENTO-->


/*
Modo de usar:
javascript:popimg('img/imagem.jpg','');
*/

function abrejanela () { // cria uma janela para mostrar uma imagem
	var fotos, attribs, a = abrejanela.arguments;
	fotos = a[0];
	attribs = "\'scrollbars="+a[2]+",resizable=yes\'";
	viewer = window.open ('',a[1],attribs);
	doc = viewer.document;
	doc.open();
	doc.write ('<html>\n<head>\n<title>InvistaCerto.com</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n</head>\n<body bgcolor=\"#FFFFFF\" topmargin=\"0\" marginheight=\"0\" leftmargin=\"0\" marginwidth=\"0\" onLoad=\"window.focus();resdetect()\">\n');
	doc.write ('<a href="JavaScript:self.close()"><img src=\"'+fotos+'\" name=pop border=0 alt="Fechar"></a>');
	doc.write ('<br><center><FONT FACE=\"Arial, Helvetica, sans-serif\" SIZE=\"2\"> '+a[1]+'</FONT></center></body><SCRIPT LANGUAGE="JavaScript">function resdetect(){if((screen.Width <= (document.images.pop.width)) && (screen.availHeight <= (document.images.pop.height))){window.resizeTo(screen.Width, screen.availHeight)}else{window.resizeTo(document.images.pop.width+10,document.images.pop.height+28)}}</script></html>');
	doc.close();
}