function loadSwf(fileName, lenX, lenY)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+lenX+'" height="'+lenY+'">');
	document.write('<param name="allowScriptAccess" value="sameDomain" /><param name="wmode" value="transparent" />');
	document.write('<param name="movie" value="'+fileName+'" /><param name="quality" value="best" /><param name="bgcolor" value="#FFFFFF" /><embed src="'+fileName+'" wmode="transparent" quality="best" width="'+lenX+'" height="'+lenY+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function validaForm(x)
{
	var numeroElementos = x.length;
	var controle;
	var atributo;
	var erros;
	
	erros = "";
	
	for(controle = 0; controle < numeroElementos; controle++)
	{
		atributo = x.elements[controle];
		if(atributo.type != "submit" && atributo.type != "reset" && atributo.type != "button")
		{
			if(atributo.obrigatorio == "s")
			{
				if(atributo.value == "")
				{
					erros += "-"+atributo.nome+"\n";
				}
				else
				{
					if(atributo.name == "email")
					{
						if(atributo.value.indexOf("@") == -1)
						{
							window.alert("E-mail inválido!");
							return false;
						}
					}
				}
			}
		}
	}
	
	if(erros != "")
	{
		window.alert("Preencha os campos:\n\n"+erros);
		return false;
	}
}

var carregar;
function abreImagem(img,url,key)
{    
	carregar = new Image();    
	carregar.src = img; 
	if(url == '')
	{
		if(key == "pop")
		{
		
			var w = 650;
			var h = 350;
			
			var winLeft = (screen.width - w) / 2;
			var winTop = (screen.height - h) / 2;
			
			document.getElementById("display").innerHTML = "<img style='cursor:pointer;' src=\"" + carregar.src + "\" border=\"0\" onclick='window.open(\"mascara.php\",\"\",\"width="+w+", height="+h+", top="+winTop+", left = "+winLeft+", location=no, status=no\");'/>";
		}
		else
		{
			document.getElementById("display").innerHTML = "<img src=\"" + carregar.src + "\" border=\"0\" />";
		}
	} else {
		document.getElementById("display").innerHTML = "<a href=\"" + url + "\"><img src=\"" + carregar.src + "\" border=\"0\" /></a>";
	}
}

function mostraFile()
{
	document.getElementById("colB").style.display = "block";
	document.getElementById("colA").style.display = "none";
}

function mostraForm()
{
	document.getElementById("colB").style.display = "none";
	document.getElementById("colA").style.display = "block";
}

function validaCampos()
{
	var Nome = document.form.nome.value;
	var Empresa = document.form.empresa.value;
	var Email = document.form.email.value;
	var Telefone = document.form.telefone.value;
	var Assunto = document.form.assunto.value;
	
	if(Nome == "" && Empresa == "" && Email == "" && Telefone == "" && Assunto == "")
	{
		window.alert("É necessário preencher o formulário!");
		return false;
	}
	
}


function destaqueHome(url,img,ext,swfw,swfh,trgt,popup,popscr,popw,poph,func)
{    
	if (ext==".swf")
	{
		document.getElementById("display").innerHTML = '<img src=\"images/loading.gif\" border=\"0\" />';
		document.getElementById("display").innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+swfw+'" height="'+swfh+'"><param name="allowScriptAccess" value="sameDomain" /><param name="wmode" value="transparent" /><param name="movie" value="'+img+'" /><param name="quality" value="best" /><param name="bgcolor" value="#FFFFFF" /><embed src="'+img+'" wmode="transparent" quality="best" width="'+swfw+'" height="'+swfh+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	} 
	else {
		document.getElementById("display").innerHTML = '<img src=\"images/loading.gif\" border=\"0\" />';
		var imghome;
		imghome = new Image();    
		imghome.src = img;
		
		//alert(img);
		
		if((url == '') || (url == 'http://'))
		{
			if(func != "")
			{
				document.getElementById("display").innerHTML = "<img style='cursor:pointer;' src=\"" + imghome.src + "\" border=\"0\" onclick=\"" + func + "\" />";
				
			} 
			else 
			{
				document.getElementById("display").innerHTML = "<img src=\"" + imghome.src + "\" border=\"0\" />";	
			}
		} else {
			if(popup == "1")
			{
			
				var w = popw;
				var h = poph;
				var scroll = popscr;
				
				var winLeft = (screen.width - w) / 2;
				var winTop = (screen.height - h) / 2;
				
				document.getElementById("display").innerHTML = "<img style='cursor:pointer;' src=\"" + imghome.src + "\" border=\"0\" onclick='window.open(\""+url+"\",\"\",\"width="+w+", height="+h+", top="+winTop+", left = "+winLeft+", location=no, status=no, scrollbars="+scroll+"\");'/>";
			}
			else
			{
				document.getElementById("display").innerHTML = "<a href=\"" + url + "\" target=\""+trgt+"\"><img src=\"" + imghome.src + "\" border=\"0\" /></a>";
			}
		}
	}
}


function openwin2()
{
	/*$('#window2').TransferTo(
		{
			to:'window2',
			className:'transferer2', 
			duration: 100	
		}
	).show();*/
	
	$('#window2').show();
}

function openwin1()
{
	/*$('#window').TransferTo(
		{
			to:'window',
			className:'transferer2', 
			duration: 100	
		}
	).show();*/
	
	$('#window').show();
}

function closewin1()
{
	/*$('#window').TransferTo(
		{
			to:'img3',
			className:'transferer2', 
			duration: 400
		}
	).hide();*/
	
	$('#window').hide();
}

function closewin2()
{
	/*$('#window2').TransferTo(
		{
			to:'img2',
			className:'transferer2', 
			duration: 400
		}
	).hide();*/
	
	$('#window2').hide();
}


/*
$(document).ready(
	function() {
		var id = $('#display img').attr('id');
		alert(id);
		$(id).bind('click',
			function()
			{
				if($('#window').css('display') == 'none') {
					$('#window').TransferTo(
						{
							to:'window',
							className:'transferer2', 
							duration: 400,
							complete: function()
							{
								$('#window').show();
							}
						}
					);
				}
			}
		);
		
		$('#window').Resizable(
			{
				minWidth: 200,
				minHeight: 60,
				maxWidth: 700,
				maxHeight: 400,
				dragHandle: '#windowTop',
				handlers: {
					se: '#windowResize'
				},
				onResize : function(size, position) {
					$('#windowBottom, #windowBottomContent').css('height', size.height-33 + 'px');
					var windowContentEl = $('#windowContent').css('width', size.width - 25 + 'px');
					if (!document.getElementById('window').isMinimized) {
						windowContentEl.css('height', size.height - 48 + 'px');
					}
				}
			}
		);

	
	});
*/
/*
*    Script:    Mascaras em Javascript
*     Autor:    Matheus Biagini de Lima Dias
*    Data:    26/08/2008
*    Obs:    
*/
    /*Função  Pai de Mascaras*/
    function Mascara(o,f){
        v_obj=o
        v_fun=f
        setTimeout("execmascara()",1)
    }
    
    /*Função que Executa os objetos*/
    function execmascara(){
        v_obj.value=v_fun(v_obj.value)
    }
    
    /*Função que Determina as expressões regulares dos objetos*/
    function leech(v){
        v=v.replace(/o/gi,"0")
        v=v.replace(/i/gi,"1")
        v=v.replace(/z/gi,"2")
        v=v.replace(/e/gi,"3")
        v=v.replace(/a/gi,"4")
        v=v.replace(/s/gi,"5")
        v=v.replace(/t/gi,"7")
        return v
    }
    
    /*Função que permite apenas numeros*/
    function Integer(v){
        return v.replace(/\D/g,"")
    }
    
    /*Função que padroniza telefone (11) 4184-1241*/
    function Telefone(v){
        v=v.replace(/\D/g,"")                 
        v=v.replace(/^(\d\d)(\d)/g,"($1) $2") 
        v=v.replace(/(\d{4})(\d)/,"$1-$2")    
        return v
    }
    
    /*Função que padroniza telefone (11) 41841241*/
    function TelefoneCall(v){
        v=v.replace(/\D/g,"")                 
        v=v.replace(/^(\d\d)(\d)/g,"($1) $2")    
        return v
    }
    
    /*Função que padroniza CPF*/
    function Cpf(v){
        v=v.replace(/\D/g,"")                    
        v=v.replace(/(\d{3})(\d)/,"$1.$2")       
        v=v.replace(/(\d{3})(\d)/,"$1.$2")       
                                                 
        v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2") 
        return v
    }
    
    /*Função que padroniza CEP*/
    function Cep(v){
        v=v.replace(/D/g,"")                
        v=v.replace(/^(\d{5})(\d)/,"$1-$2") 
        return v
    }
    
    /*Função que padroniza CNPJ*/
    function Cnpj(v){
        v=v.replace(/\D/g,"")                   
        v=v.replace(/^(\d{2})(\d)/,"$1.$2")     
        v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3") 
        v=v.replace(/\.(\d{3})(\d)/,".$1/$2")           
        v=v.replace(/(\d{4})(\d)/,"$1-$2")              
        return v
    }
    
    /*Função que permite apenas numeros Romanos*/
    function Romanos(v){
        v=v.toUpperCase()             
        v=v.replace(/[^IVXLCDM]/g,"") 
        
        while(v.replace(/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/,"")!="")
            v=v.replace(/.$/,"")
        return v
    }
    
    /*Função que padroniza o Site*/
    function  Site(v){
        v=v.replace(/^http:\/\/?/,"")
        dominio=v
        caminho=""
        if(v.indexOf("/")>-1)
            dominio=v.split("/")[0]
            caminho=v.replace(/[^\/]*/,"")
            dominio=dominio.replace(/[^\w\.\+-:@]/g,"")
            caminho=caminho.replace(/[^\w\d\+-@:\?&=%\(\)\.]/g,"")
            caminho=caminho.replace(/([\?&])=/,"$1")
        if(caminho!="")dominio=dominio.replace(/\.+$/,"")
            v="http://"+dominio+caminho
        return v
    }

    /*Função que padroniza DATA*/
    function Data(v){
        v=v.replace(/\D/g,"") 
        v=v.replace(/(\d{2})(\d)/,"$1/$2") 
        v=v.replace(/(\d{2})(\d)/,"$1/$2") 
        return v
    }
    
    /*Função que padroniza DATA*/
    function Hora(v){
        v=v.replace(/\D/g,"") 
        v=v.replace(/(\d{2})(\d)/,"$1:$2")  
        return v
    }
    
    /*Função que padroniza valor monétario*/
    function Valor(v){
        v=v.replace(/\D/g,"") //Remove tudo o que não é dígito
        v=v.replace(/^([0-9]{3}\.?){3}-[0-9]{2}$/,"$1.$2");
        //v=v.replace(/(\d{3})(\d)/g,"$1,$2")
        v=v.replace(/(\d)(\d{2})$/,"$1.$2") //Coloca ponto antes dos 2 últimos digitos
        return v
    }
    
    /*Função que padroniza Area*/
    function Area(v){
        v=v.replace(/\D/g,"") 
        v=v.replace(/(\d)(\d{2})$/,"$1.$2") 
        return v
        
    }

