	//######################################################################
	//#  Form: Funções em Javascript
	//#  Criado: Felipe Martins - 21/01/2007  17:21
	//#  Ultima Atualização: 
	//######################################################################
	
	//--- Mostra tipo (CNPJ - CPF)
	function MostraTipo(PTipo)
	{
		if (PTipo == "PJ")
		{
			document.getElementById("tblPJ").style.display = "block";
			document.getElementById("tblPF").style.display = "none";
			if(document.getElementById("tblCelular")!=undefined){document.getElementById("tblCelular").style.display = "none"};
			document.getElementById("PJ").checked = true;		
			document.getElementById("PF").checked = false;	
		}
		if (PTipo == "PF")
		{	
		  document.getElementById("tblPJ").style.display = "none";
		  document.getElementById("tblPF").style.display = "block";
			if(document.getElementById("tblCelular")!=undefined){document.getElementById("tblCelular").style.display = "block"};
			document.getElementById("PJ").checked = false;		
			document.getElementById("PF").checked = true;			
		}		
	}
	
	function buscaEndereco()
	{
		var sURL = "PesquisaEndereco.asp?param=";
		var oXMLHttp = criaXMLHttpRequest(); //		
		var sCEP = document.getElementById("CEP").value;
		oXMLHttp.open("GET", sURL + escape(sCEP), true);
		oXMLHttp.onreadystatechange = trataHttpResponse;
		oXMLHttp.send(null);
		function trataHttpResponse()
		{
			if (oXMLHttp.readyState == 4)
			{
				oRetorno = oXMLHttp.responseText.replace(/\+/g," ")
				oRetorno = escape(oRetorno).replace(/\%0D\%0A/g,"")
				oRetorno = unescape(oRetorno)
				oRetorno = oRetorno.split("|");
				if (oRetorno != "")
				{
					document.getElementById('Cidade').value = oRetorno[0];
					document.getElementById('Estado').value = oRetorno[1];
					document.getElementById('Bairro').value = oRetorno[2];
					document.getElementById('Endereco').value = oRetorno[3];
				
					//document.getElementById('Cidade').readOnly = true;
					//document.getElementById('Estado').readOnly = true;
					//document.getElementById('Bairro').readOnly = true;
					//document.getElementById('Endereco').readOnly = true;
					
					document.images["linha10"].src = "IMG/Branco.gif";
					document.images["linha10"].width = 1;
					document.images["linha10"].height = 1;
				
					document.images["linha13"].src = "IMG/Branco.gif";
					document.images["linha13"].width = 1;
					document.images["linha13"].height = 1;
				
					document.images["linha14"].src = "IMG/Branco.gif";
					document.images["linha14"].width = 1;
					document.images["linha14"].height = 1;
				
					document.images["linha15"].src = "IMG/Branco.gif";
					document.images["linha15"].width = 1;
					document.images["linha15"].height = 1;
				
					document.images["linha17"].src = "IMG/Branco.gif";
					document.images["linha17"].width = 1;
					document.images["linha17"].height = 1;
				}
				else
				{
					document.getElementById('Cidade').value = "";
					document.getElementById('Estado').value = "";
					document.getElementById('Bairro').value = "";
					document.getElementById('Endereco').value = "";
				
					//document.getElementById('Cidade').readOnly = false;
					//document.getElementById('Estado').readOnly = false;
					//document.getElementById('Bairro').readOnly = false;
					//document.getElementById('Endereco').readOnly = false;
				}
			}
		}			
	}
	
	function MandaDados()
	{
		var sURLDados = "MandaDados.asp";
		var sPlano = VPlano
		var sSAEmail = document.getElementById("SAEmail").value;
		var sSADominio = document.getElementById("SADominio").value;
		var sSAFoto = document.getElementById("SAFoto").value;
		var sSACreditos = document.getElementById("SACreditos").checked;
		oXMLHttp.open("GET", sURLDados + "?Plano=" + sPlano + "&Email=" + sSAEmail + "&Dominio=" + sSADominio + "&Foto=" + sSAFoto + "&Creditos=" + sSACreditos, false);
		oXMLHttp.send(null);
	}
	
	function MandaDadosTestDrive()
	{
		var sURLDados = "MandaDadosTestDrive.asp";
		oXMLHttp.open("GET", sURLDados, false);
		oXMLHttp.send(null);
	}	
	
	function buscaParceiro()
	{
		var sURLParceiro = "PesquisaParceiro.asp";
		var sParceiro = document.getElementById("Parceiro").value;
		oXMLHttp.open("GET", sURLParceiro + "?Parceiro=" + sParceiro, true);
		oXMLHttp.onreadystatechange = trataHttpResponse2;
		oXMLHttp.send(null);
	}
		
	function trataHttpResponse2()
	{
		if (oXMLHttp.readyState == 4)
		{
			oRetorno2 = oXMLHttp.responseText.split("|");
			if (oRetorno2 != "")
			{
				document.getElementById('inNomeParceiro').innerHTML = oRetorno2[0];
				document.getElementById('trParceiro').style.backgroundColor = "#BDE1CC";
				document.getElementById('trParceiro').style.fontWeight = "bold";
				document.getElementById('trParceiro').style.color = "#003300";
				document.getElementById('trParceiro').style.border = "2px solid #003300";
			}
			else
			{
				document.getElementById('inNomeParceiro').innerHTML = "Não foi encontrado nenhum parceiro com esse registro.";
				document.getElementById('trParceiro').style.fontWeight = "bold";
				document.getElementById('trParceiro').style.border = "1px solid #990000";
				document.getElementById('trParceiro').style.color = "#990000";
				document.getElementById('trParceiro').style.backgroundColor = "#FFECEC";
//				document.getElementById('trMSGParceiro').style.display = "none";
			}
		}
		else
		{
			document.getElementById('trParceiro').style.backgroundColor  = "#EBEBEB";
		}
	}
	
	function CalculaValores(vPlano, vSAEmail, vSADominio, vSAFoto, vSACreditos)
	{
		//document.getElementById("Plano").value = vPlano;
		
		if (vPlano == 1)
		{
			document.getElementById("ValorPlano").innerHTML = FormataValores("95");
		}
		if (vPlano == 2)
		{
			document.getElementById("ValorPlano").innerHTML = FormataValores("190");
		}
		if (vPlano == 3)
		{
			document.getElementById("ValorPlano").innerHTML = FormataValores("300");
		}
		if (vPlano == 4)
		{
			document.getElementById("ValorPlano").innerHTML = FormataValores("450");
		}
		if (vPlano == 5)
		{
			document.getElementById("ValorPlano").innerHTML = FormataValores("600");
		}	
		if (vPlano == 6)
		{
			document.getElementById("ValorPlano").innerHTML = FormataValores("55");
		}			
		if (vSAEmail != "")
		{
			var vValorSAEmail = parseFloat("5");
			var vSAEmail = parseFloat(vSAEmail);			
			document.getElementById("ValorSAEmail").innerHTML = FormataValores(vSAEmail*vValorSAEmail);
		}
		
		if (vSADominio != "")
		{
			var vValorSADominio = parseFloat("20");
			var vSADominio = parseFloat(vSADominio);
			document.getElementById("ValorSADominio").innerHTML = FormataValores(vSADominio*vValorSADominio);
		}
		
		if (vSAFoto != "")
		{
			var vValorSAFoto = parseFloat("30");
			var vSAFoto = parseFloat(vSAFoto);
			document.getElementById("ValorSAFoto").innerHTML = FormataValores(vSAFoto*vValorSAFoto);
		}
		
		if (vSACreditos != "")
		{
			var vValorSACreditos = parseFloat("50");
			document.getElementById("ValorSACreditos").innerHTML = FormataValores(vValorSACreditos);
		}
		else
		{
			document.getElementById("ValorSACreditos").innerHTML = FormataValores("0");
		}
	}
	
	function CalculaMensalidade()
	{
		var vCon = parseFloat("350,00");
		var vPl = parseFloat(document.getElementById("ValorPlano").innerHTML);
		var vSA1 = parseFloat(document.getElementById("ValorSAEmail").innerHTML);
		var vSA2 = parseFloat(document.getElementById("ValorSADominio").innerHTML);
		var vSA3 = parseFloat(document.getElementById("ValorSAFoto").innerHTML);
		var vSA4 = parseFloat(document.getElementById("ValorSACreditos").innerHTML);
		var vSA = parseFloat(vSA1+vSA2+vSA3+vSA4);
		document.getElementById("ValorSA").innerHTML = FormataValores(vSA);
		var vMen = parseFloat(vPl+vSA);		
		document.getElementById("ValorMensalidade").innerHTML = FormataValores(vMen);
		var vTot = parseFloat(vCon+vMen);
		document.getElementById("ValorTotal").innerHTML = FormataValores(vTot);
	}
	
	function janela()
	{
		vpos = window.open('','vpos','scrollbars=auto,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,toolbar=no,width=780,height=460');
		document.form_card_avs.submit();
	}
	
	function formatNumber(num,dec,thou,pnt,curr1,curr2,n1,n2)
	{
		var x = Math.round(num * Math.pow(10,dec));
		if (x >= 0) n1=n2='';
		var y = (''+Math.abs(x)).split('');
		var z = y.length - dec;
		if (z<0) z--;for(var i = z; i < 0; i++) y.unshift('0');y.splice(z, 0, pnt); 
		while (z > 3) {z-=3; y.splice(z,0,thou);}
		var r = curr1+n1+y.join('')+n2+curr2;
		return r;
	}	
	
	function FormataValores(mnt)
	{
    mnt -= 0;
    mnt = (Math.round(mnt*100))/100;
    return (mnt == Math.floor(mnt)) ? mnt + ',00'
			: ( (mnt*10 == Math.floor(mnt*10)) ? mnt + '0' : mnt);
	}
	
	function FormataCNPJ(campo,tammax,teclapres)
	{
		var tecla = teclapres.keyCode;
		var vr = campo.value;
		vr = vr.replace( "-", "" );
		vr = vr.replace( "/", "" );
		vr = vr.replace( ".", "" );
		vr = vr.replace( ".", "" );
		tam = vr.length;
		if (tam < tammax && tecla != 13){ tam = vr.length + 1 ; }
		if (tecla == 13 ){ tam = tam - 1 ; }
		if ( tecla == 13 || (tecla >= 48 && tecla <= 57) || (tecla >= 96 && tecla <= 105) ){
		if ( tam <= 2 ){
		campo.value = vr ; }
		tam = tam - 1;
		if ( (tam > 2) && (tam <= 5) ){
		campo.value = vr.substr( 0, tam - 2 ) + '-' + vr.substr( tam - 2, tam ) ; }
		if ( (tam >= 6) && (tam <= 8) ){
		campo.value = vr.substr( 0, tam - 6 ) + '/' + vr.substr( tam - 6, 4 ) + '-' + vr.substr( tam - 2, tam ) ; }
		if ( (tam >= 9) && (tam <= 11) ){
		campo.value = vr.substr( 0, tam - 9 ) + '.' + vr.substr( tam - 9, 3 ) + '/' + vr.substr( tam - 6, 4 ) + '-' + vr.substr( tam - 2, tam ) ; }
		if ( (tam >= 12) && (tam <= 14) ){
		campo.value = vr.substr( 0, tam - 12 ) + '.' + vr.substr( tam - 12, 3 ) + '.' + vr.substr( tam - 9, 3 ) + '/' + vr.substr( tam - 6, 4 ) + '-' + vr.substr( tam - 2, tam ) ; }
		}
	}	

	function FormataCpf(Campo,ptecla)
	{
		var tam = Campo.value.length;
		var vtecla
  	if (ptecla.keyCode) vtecla = ptecla.keyCode;
	  else if (ptecla.which) vtecla = ptecla.which; // Netscape 4.?		
		if (((vtecla) >= 48 ) && ((vtecla) <= 57 ))
		{
		if ((tam == 3 ) || (tam == 7))
		{
		Campo.value = Campo.value + ".";
		}
		
		if ((tam == 11 ))
		{
		Campo.value = Campo.value + "-";
		}
		}
		else
		{
		}
	}
	
	function FormataRG(Campo,ptecla)
	{
		var tam = Campo.value.length;
		var vtecla
  	if (ptecla.keyCode) vtecla = ptecla.keyCode;
	  else if (ptecla.which) vtecla = ptecla.which; // Netscape 4.?		
		if (((vtecla) >= 48 ) && ((vtecla) <= 57 ))
		{
		if ((tam == 2 ) || (tam == 6))
		{
		Campo.value = Campo.value + ".";
		}
		
		if ((tam == 10 ))
		{
		Campo.value = Campo.value + "-";
		}
		}
		else
		{
		}
	}
	
	// Função de DIV -----------
	
	function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	MM_reloadPage(true);

	function MM_showHideLayers() { //v6.0
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	    obj.visibility=v; }
	}

	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	// --------------------------
	
	function CalculaSimulacao(VQtdPlano1, VQtdPlano2, VQtdPlano3, VQtdPlano4, VQtdPlano5, VQtdPlano6)
	{
		var VTotal150 = 0
		VMes1_Plano1 = ("209.50" * VQtdPlano1)
		VMes2_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 1))
		VMes3_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 2))
		VMes4_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 3))
		VMes5_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 4))
		VMes6_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 5))
		VMes7_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 6))
		VMes8_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 7))
		VMes9_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 8))
		VMes10_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 9))
		VMes11_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 10))
		VMes12_Plano1 = ("209.50" * VQtdPlano1 + ((VQtdPlano1 * "9.50") * 11))
		VAnoTotal_Plano1 = (VMes1_Plano1 + VMes2_Plano1 + VMes3_Plano1 + VMes4_Plano1 + VMes5_Plano1 + VMes6_Plano1 + VMes7_Plano1 + VMes8_Plano1 + VMes9_Plano1 + VMes10_Plano1 + VMes11_Plano1 + VMes12_Plano1)
		
		VMes1_Plano2 = ("219.00" * VQtdPlano2)
		VMes2_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 1))
		VMes3_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 2))
		VMes4_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 3))
		VMes5_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 4))
		VMes6_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 5))
		VMes7_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 6))
		VMes8_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 7))
		VMes9_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 8))
		VMes10_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 9))
		VMes11_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 10))
		VMes12_Plano2 = ("219.00" * VQtdPlano2 + ((VQtdPlano2 * "19.00") * 11))
		VAnoTotal_Plano2 = (VMes1_Plano2 + VMes2_Plano2 + VMes3_Plano2 + VMes4_Plano2 + VMes5_Plano2 + VMes6_Plano2 + VMes7_Plano2 + VMes8_Plano2 + VMes9_Plano2 + VMes10_Plano2 + VMes11_Plano2 + VMes12_Plano2)
		
		VMes1_Plano3 = ("230.00" * VQtdPlano3)
		VMes2_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 1))
		VMes3_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 2))
		VMes4_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 3))
		VMes5_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 4))
		VMes6_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 5))
		VMes7_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 6))
		VMes8_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 7))
		VMes9_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 8))
		VMes10_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 9))
		VMes11_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 10))
		VMes12_Plano3 = ("230.00" * VQtdPlano3 + ((VQtdPlano3 * "30.00") * 11))
		VAnoTotal_Plano3 = (VMes1_Plano3 + VMes2_Plano3 + VMes3_Plano3 + VMes4_Plano3 + VMes5_Plano3 + VMes6_Plano3 + VMes7_Plano3 + VMes8_Plano3 + VMes9_Plano3 + VMes10_Plano3 + VMes11_Plano3 + VMes12_Plano3)
		
		VMes1_Plano4 = ("245.00" * VQtdPlano4)
		VMes2_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 1))
		VMes3_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 2))
		VMes4_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 3))
		VMes5_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 4))
		VMes6_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 5))
		VMes7_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 6))
		VMes8_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 7))
		VMes9_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 8))
		VMes10_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 9))
		VMes11_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 10))
		VMes12_Plano4 = ("245.00" * VQtdPlano4 + ((VQtdPlano4 * "45.00") * 11))
		VAnoTotal_Plano4 = (VMes1_Plano4 + VMes2_Plano4 + VMes3_Plano4 + VMes4_Plano4 + VMes5_Plano4 + VMes6_Plano4 + VMes7_Plano4 + VMes8_Plano4 + VMes9_Plano4 + VMes10_Plano4 + VMes11_Plano4 + VMes12_Plano4)
		
		VMes1_Plano5 = ("260.00" * VQtdPlano5)
		VMes2_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 1))
		VMes3_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 2))
		VMes4_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 3))
		VMes5_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 4))
		VMes6_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 5))
		VMes7_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 6))
		VMes8_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 7))
		VMes9_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 8))
		VMes10_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 9))
		VMes11_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 10))
		VMes12_Plano5 = ("260.00" * VQtdPlano5 + ((VQtdPlano5 * "60.00") * 11))
		VAnoTotal_Plano5 = (VMes1_Plano5 + VMes2_Plano5 + VMes3_Plano5 + VMes4_Plano5 + VMes5_Plano5 + VMes6_Plano5 + VMes7_Plano5 + VMes8_Plano5 + VMes9_Plano5 + VMes10_Plano5 + VMes11_Plano5 + VMes12_Plano5)
		
		VMes1_Plano6 = ("205.50" * VQtdPlano6)
		VMes2_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 1))
		VMes3_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 2))
		VMes4_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 3))
		VMes5_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 4))
		VMes6_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 5))
		VMes7_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 6))
		VMes8_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 7))
		VMes9_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 8))
		VMes10_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 9))
		VMes11_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 10))
		VMes12_Plano6 = ("205.50" * VQtdPlano6 + ((VQtdPlano6 * "5.50") * 11))		
		VAnoTotal_Plano6 = (VMes1_Plano6 + VMes2_Plano6 + VMes3_Plano6 + VMes4_Plano6 + VMes5_Plano6 + VMes6_Plano6 + VMes7_Plano6 + VMes8_Plano6 + VMes9_Plano6 + VMes10_Plano6 + VMes11_Plano6 + VMes12_Plano6)		
		
		VMes1_Total = (VMes1_Plano1 + VMes1_Plano2 + VMes1_Plano3 + VMes1_Plano4 + VMes1_Plano5 + VMes1_Plano6)
		VMes2_Total = (VMes2_Plano1 + VMes2_Plano2 + VMes2_Plano3 + VMes2_Plano4 + VMes2_Plano5 + VMes2_Plano6)
		VMes3_Total = (VMes3_Plano1 + VMes3_Plano2 + VMes3_Plano3 + VMes3_Plano4 + VMes3_Plano5 + VMes3_Plano6)
		VMes4_Total = (VMes4_Plano1 + VMes4_Plano2 + VMes4_Plano3 + VMes4_Plano4 + VMes4_Plano5 + VMes4_Plano6)
		VMes5_Total = (VMes5_Plano1 + VMes5_Plano2 + VMes5_Plano3 + VMes5_Plano4 + VMes5_Plano5 + VMes5_Plano6)
		VMes6_Total = (VMes6_Plano1 + VMes6_Plano2 + VMes6_Plano3 + VMes6_Plano4 + VMes6_Plano5 + VMes6_Plano6)
		VMes7_Total = (VMes7_Plano1 + VMes7_Plano2 + VMes7_Plano3 + VMes7_Plano4 + VMes7_Plano5 + VMes7_Plano6)
		VMes8_Total = (VMes8_Plano1 + VMes8_Plano2 + VMes8_Plano3 + VMes8_Plano4 + VMes8_Plano5 + VMes8_Plano6)
		VMes9_Total = (VMes9_Plano1 + VMes9_Plano2 + VMes9_Plano3 + VMes9_Plano4 + VMes9_Plano5 + VMes9_Plano6)
		VMes10_Total = (VMes10_Plano1 + VMes10_Plano2 + VMes10_Plano3 + VMes10_Plano4 + VMes10_Plano5 + VMes10_Plano6)
		VMes11_Total = (VMes11_Plano1 + VMes11_Plano2 + VMes11_Plano3 + VMes11_Plano4 + VMes11_Plano5 + VMes11_Plano6)
		VMes12_Total = (VMes12_Plano1 + VMes12_Plano2 + VMes12_Plano3 + VMes12_Plano4 + VMes12_Plano5 + VMes12_Plano6)
		
		document.getElementById("Mes1_Total").innerHTML = formatNumber(VMes1_Total,2,'.',',','','','','')
		document.getElementById("Mes2_Total").innerHTML = formatNumber(VMes2_Total,2,'.',',','','','','')
		document.getElementById("Mes3_Total").innerHTML = formatNumber(VMes3_Total,2,'.',',','','','','')
		document.getElementById("Mes4_Total").innerHTML = formatNumber(VMes4_Total,2,'.',',','','','','')
		document.getElementById("Mes5_Total").innerHTML = formatNumber(VMes5_Total,2,'.',',','','','','')
		document.getElementById("Mes6_Total").innerHTML = formatNumber(VMes6_Total,2,'.',',','','','','')
		document.getElementById("Mes7_Total").innerHTML = formatNumber(VMes7_Total,2,'.',',','','','','')
		document.getElementById("Mes8_Total").innerHTML = formatNumber(VMes8_Total,2,'.',',','','','','')
		document.getElementById("Mes9_Total").innerHTML = formatNumber(VMes9_Total,2,'.',',','','','','')
		document.getElementById("Mes10_Total").innerHTML = formatNumber(VMes10_Total,2,'.',',','','','','')
		document.getElementById("Mes11_Total").innerHTML = formatNumber(VMes11_Total,2,'.',',','','','','')
		document.getElementById("Mes12_Total").innerHTML = formatNumber(VMes12_Total,2,'.',',','','','','')
		
		VTotal150 = (VAnoTotal_Plano1 + VAnoTotal_Plano2 + VAnoTotal_Plano3 + VAnoTotal_Plano4 + VAnoTotal_Plano5 + VAnoTotal_Plano6)
		
		document.getElementById("AnoTotal_Planos").innerHTML = formatNumber(VTotal150,2,'.',',','','','','')
		document.getElementById("AnoTotal_PlanosIMG").innerHTML = formatNumber(VTotal150,2,'.',',','','','','')
		//FormataValores(VAnoTotal_Plano1 + VAnoTotal_Plano2 + VAnoTotal_Plano3 + VAnoTotal_Plano4 + VAnoTotal_Plano5)
		
		var v1 = document.getElementById("AnoTotal_PlanosIMG").innerHTML
		v1 = ReplaceCombo(v1,'1','<img src=IMG/Caracteres/Um.gif>')
		v1 = ReplaceCombo(v1,'2','<img src=IMG/Caracteres/Dois.gif>')
		v1 = ReplaceCombo(v1,'3','<img src=IMG/Caracteres/Tres.gif>')
		v1 = ReplaceCombo(v1,'4','<img src=IMG/Caracteres/Quatro.gif>')
		v1 = ReplaceCombo(v1,'5','<img src=IMG/Caracteres/Cinco.gif>')
		v1 = ReplaceCombo(v1,'6','<img src=IMG/Caracteres/Seis.gif>')
		v1 = ReplaceCombo(v1,'7','<img src=IMG/Caracteres/Sete.gif>')
		v1 = ReplaceCombo(v1,'8','<img src=IMG/Caracteres/Oito.gif>')
		v1 = ReplaceCombo(v1,'9','<img src=IMG/Caracteres/Nove.gif>')
		v1 = ReplaceCombo(v1,'0','<img src=IMG/Caracteres/Zero.gif>')
		document.getElementById("AnoTotal_PlanosIMG").innerHTML = v1
		
		MostraSimulacao("2")
	}
	
	function ReplaceCombo(PStr,PCar1,PCar2)
	{
		var VStr1 = PStr
		var VStr2 = "'"
		for(var i=0; i<VStr1.length;i++)
		{
			VStr1 = VStr1.replace(PCar1,PCar2)			
		}	
		return VStr1
	}
	
	function MostraSimulacao(PSim)
	{
		if (PSim == "2")
		{
			document.getElementById("tblResultado").style.display = "block";
			document.getElementById("tblResultado2").style.display = "block";
		}
		if (PSim == "1")
		{	
		  document.getElementById("tblResultado").style.display = "none";
			document.getElementById("tblResultado2").style.display = "none";
		}		
	}
	
	//--- abre janela
	function AbreJanela(PLink, PTitulo, PAltura, PLargura)
	{
		var VAltura = (screen.height-PAltura)/2;
		var VLargura =(screen.width-PLargura)/2;
		popup=window.open(PLink,PTitulo,"top="+VAltura+",left="+VLargura+",height="+PAltura+",width="+PLargura+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no");			
		popup.focus();
		return false;
	}
	
	function AdicionaFavoritos()
	{		
    var VURL = "http://www.dotstore.com.br";
    var VTitle = "Dotstore - Sua loja na internet";
    if (window.sidebar) window.sidebar.addPanel(VTitle, VURL,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',VURL);
        mbm.setAttribute('title',VTitle);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(VURL, VTitle);}
	}	
	
	function AdicionaRSS()
	{		
		window.open("NoticiasXML.asp","_blank")		
	}
	
	function AbreAreaClientes()
	{		
		document.getElementById('AreaCliente').style.left = getPosicaoElemento("BarraNaveg").left-200
		document.getElementById('AreaCliente').style.top = 30	
		if(document.getElementById('AreaCliente')!=undefined)
		{
			if(document.getElementById('AreaCliente').style.display=="none")
			{
				document.getElementById('AreaCliente').style.display="block"				
			}
			else
			{
				document.getElementById('AreaCliente').style.display="none"
			}
		}
	}	
	
	function getPosicaoElemento(elemID){
			var offsetTrail = document.getElementById(elemID);
			var offsetLeft = 0;
			var offsetTop = 0;
			while (offsetTrail) {
					offsetLeft += offsetTrail.offsetLeft;
					offsetTop += offsetTrail.offsetTop;
					offsetTrail = offsetTrail.offsetParent;
			}
			if (navigator.userAgent.indexOf("Mac") != -1 && 
					typeof document.body.leftMargin != "undefined") {
					offsetLeft += document.body.leftMargin;
					offsetTop += document.body.topMargin;
			}
			return {left:offsetLeft, top:offsetTop};
	}	
	
	function PrintPag(PUrl, PTitulo)
	{
		var v1 = ""
		if (PUrl.indexOf("?") <= 0)
		{ 
			v1 = "?"
		}
		else
		{
			v1 = "&"			
		}
		window.open(PUrl+v1+'PTitulo='+PTitulo,'PopPrint' , 'width=700, height=600,top=100,left=100,resizable=1,status=0,menubar=0,scrollbars=1');
	}
	
	function IndiquePag(PUrl, PTitulo)
	{
		window.location = "IndiqueEsteSite.asp?PUrl="+PUrl+"&PTitulo="+PTitulo
	}