		var PainelTimeOut;
		var DestaqueTimeOut;
		var CanalVivolabTimeOut;
		var PainelLoopTime = 30000;
		var CanalVivolabLoopTime = 10000;
		function gE(ID) {
		
			return document.getElementById(ID);
		
		}

		function echeck(str) {
		
				var at="@"
				var dot="."
				var lat=str.indexOf(at)
				var lstr=str.length
				var ldot=str.indexOf(dot)
				if (str.indexOf(at)==-1){
				   //alert("Invalid E-mail ID")
				   return false
				}
		
				if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
				   //alert("Invalid E-mail ID")
				   return false
				}
		
				if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
					//alert("Invalid E-mail ID")
					return false
				}
		
				 if (str.indexOf(at,(lat+1))!=-1){
					//alert("Invalid E-mail ID")
					return false
				 }
		
				 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
					//alert("Invalid E-mail ID")
					return false
				 }
		
				 if (str.indexOf(dot,(lat+2))==-1){
					//alert("Invalid E-mail ID")
					return false
				 }
				
				 if (str.indexOf(" ")!=-1){
					//alert("Invalid E-mail ID")
					return false
				 }
		
				 return true					
			}	
			function ShowModal(Arquivo, Titulo, Id) {
				document.getElementById(Id).innerHTML = '';
				if(Id == "dialogCanalVivoLab") {
					document.getElementById("VideoInicial").innerHTML = document.getElementById("VideoInicial").innerHTML;
					//$("#VideoInicial").hide();
					//$("#ConteudoInicial").slideUp("fast");
				}
				if(Arquivo == "FormularioCadastroProjeto.php") {
					$('#dialog').jqm({modal:true});	
				} else {
					$('#'+Id).jqm({modal:false});
				}
				$('#'+Id).load("paginas/"+Arquivo, false, function(){
					//$('#FecharModal').corner("tr 12px").corner("tl 12px");
					//$('#dialog').jqm();
					//$('#dialog').corner("10px");
					//$('#dialog').corner("bl 12px").corner("br 12px").corner("tl 12px");					
				});
				
				$('#'+Id).jqmShow();
				//$('#'+Id).corner("10px");
				
				//curvyCorners.init();				
			}
			function Login(Key) {
				var Login = document.getElementById("Login").value;
				var Senha = document.getElementById("Senha").value;
				if(Key == 13) {
					$.post("admin/login.php", { Login: Login, Senha: Senha },
					  function(data){
						 if(data == 1) {
							window.location = "admin/sistema/menu.php";
						 } else {
							alert(data);	 
						 }
					  });
				}
			}
			function PainelPrincipalLoop(Tipo,Pagina) {
				if($('#LoopPaginas').val() == 1 && $('#TipoAtual').val() == Tipo) {
					PainelPrincipal(Tipo, Pagina);
				}
			}			
			function PainelPrincipal(Tipo,Pagina,LimparTodos) {
					
					if(Tipo == 1) {
						//document.getElementById("SpanMenuEscolhido").innerHTML = "<span style='color: #999999;'>todos</span>";
						if(LimparTodos == 1) {
							document.getElementById("PainelPrincipal").innerHTML = "<table id='CarregandoTodos' border='0' cellspacing='0' cellpadding='0'><tr><td><span style='color: #999999;'><b>Carregando...</b></span></td></tr></table>";
						}
					} else if(Tipo == 2) {
						//document.getElementById("SpanMenuEscolhido").innerHTML = "<span style='color: #ff9900;'>pessoas</span>";
						document.getElementById("PainelPrincipal").innerHTML = "<table border='0' cellspacing='0' cellpadding='0'><tr><td><span style='color: #ff9900;'><b>Carregando pessoas...</b></span></td></tr></table>";
					} else if(Tipo == 3) {
						//document.getElementById("SpanMenuEscolhido").innerHTML = "<span style='color: #0181c8;'>projetos</span>";
						document.getElementById("PainelPrincipal").innerHTML = "<table border='0' cellspacing='0' cellpadding='0'><tr><td><span style='color: #0181c8;'><b>Carregando projetos...</b></span></td></tr></table>";
					} else if(Tipo == 4) {
						//document.getElementById("SpanMenuEscolhido").innerHTML = "<span style='color: #ee2d24;'>eventos</span>";
						document.getElementById("PainelPrincipal").innerHTML = "<table border='0' cellspacing='0' cellpadding='0'><tr><td><span style='color: #ee2d24;'><b>Carregando eventos...</b></span></td></tr></table>";
					} else if(Tipo == 5) {
						//document.getElementById("SpanMenuEscolhido").innerHTML = "<span style='color: #8ec63d;'>conceitos</span>";
						document.getElementById("PainelPrincipal").innerHTML = "<table border='0' cellspacing='0' cellpadding='0'><tr><td><span style='color: #8ec63d;'><b>Carregando conceitos...</b></span></td></tr></table>";
					}
					if(Tipo == 1) {
						 if(document.getElementById("Todos_"+Pagina)) {
									$('.PaginaTodos').hide();
									$('#Todos_'+Pagina).fadeIn();
									GeraPaginaPainel(Tipo, Pagina, '1',LimparTodos);
						 } else {
							 GeraPaginaPainel(Tipo, Pagina,'0',LimparTodos);
						 }
					} else {
						GeraPaginaPainel(Tipo, Pagina);
					}
					
			}
			function GeraPaginaPainel(Tipo, Pagina, ApenasPaginas,LimparTodos) {
						
						var PonteiroPessoas = document.getElementById("PonteiroPessoas").value;
						var PonteiroProjetos = document.getElementById("PonteiroProjetos").value;
						var PonteiroConceitos = document.getElementById("PonteiroConceitos").value;
						var PonteiroEventos = document.getElementById("PonteiroEventos").value;
						if(LimparTodos == 1) {
							PonteiroPessoas = 0;
							PonteiroProjetos = 0;
							PonteiroConceitos = 0;
							PonteiroEventos = 0;
						}		

						if(Tipo == 1) {
							//alert(document.getElementById("CarregandoTodos"));
							$("#CarregandoTodos").show();
							$('.PaginaTodos').hide();
						}
						$.post("includes/GeraPainelPrincipal.php", { Tipo: Tipo,Pagina:Pagina, ApenasPagina: ApenasPaginas, PonteiroPessoas: PonteiroPessoas, PonteiroProjetos: PonteiroProjetos, PonteiroConceitos: PonteiroConceitos, PonteiroEventos: PonteiroEventos},
						  function(data){				
						 	 $("#CarregandoTodos").hide();
							 var DataSplit = data.split("[Separator]");
							 if(Tipo == 1) {
								 if(ApenasPaginas == 1) {
									//alert("aa");
									$('.PaginaTodos').hide();
									document.getElementById("Paginas").innerHTML = DataSplit[1];
									$('#Todos_'+Pagina).fadeIn();
									if($('#LoopPaginas').val() == 1 && $('#TotalPaginas').val() > 1) {
										Pagina = DataSplit[6];
										PainelTimeOut = setTimeout("PainelPrincipalLoop('"+Tipo+"', '"+Pagina+"')", PainelLoopTime);
									}									
								 } else {
								    //alert("bb");
									//var xHtml = document.getElementById("PainelPrincipal").innerHTML;
									//alert(xHtml);
									//xHtml = xHtml.replace("<table border='0' cellspacing='0' cellpadding='0'><tr><td><span style='color: #999999;'><b>Carregando...</b></span></td></tr></table>", "");
									
									if(LimparTodos == 1) {
										$('#PainelPrincipal').hide();
										document.getElementById("PainelPrincipal").innerHTML = DataSplit[0];
										document.getElementById("PainelPrincipal").innerHTML += "<table id='CarregandoTodos' border='0' cellspacing='0' cellpadding='0' style='display:none;'><tr><td><span style='color: #999999;'><b>Carregando...</b></span></td></tr></table>";										
										$('#PainelPrincipal').show();
									} else {
										$('.PaginaTodos').hide();
										$("#PainelPrincipal").append(DataSplit[0]);
										$('#PainelPrincipal').show();
									}
									document.getElementById("Paginas").innerHTML = DataSplit[1];
									document.getElementById("PonteiroPessoas").value = DataSplit[2];
									document.getElementById("PonteiroProjetos").value = DataSplit[3];
									document.getElementById("PonteiroConceitos").value = DataSplit[4];
									document.getElementById("PonteiroEventos").value = DataSplit[5];
									document.getElementById("PaginaAtual").value = DataSplit[6];
									document.getElementById("TotalPaginas").value = DataSplit[7];
									//alert("Próxima pagina: "+DataSplit[6]);
									//alert("Total Pages: "+DataSplit[7]);
									//alert(document.getElementById("PonteiroPessoas").value);
									//alert(document.getElementById("PonteiroProjetos").value);
									//alert(document.getElementById("PonteiroConceitos").value);
									//alert(document.getElementById("PonteiroEventos").value);
									if($('#LoopPaginas').val() == 1 && $('#TotalPaginas').val() > 1) {
										Pagina = DataSplit[6];
										//alert("aa");
										PainelTimeOut = setTimeout("PainelPrincipalLoop('"+Tipo+"', '"+Pagina+"')", PainelLoopTime);
									}
								 }
							 } else {
								 	$('#PainelPrincipal').hide();
									document.getElementById("PainelPrincipal").innerHTML = DataSplit[0];
									$('#PainelPrincipal').fadeIn();
									document.getElementById("Paginas").innerHTML = DataSplit[1];
									document.getElementById("PaginaAtual").value = DataSplit[6];
									document.getElementById("TotalPaginas").value = DataSplit[7];
									if($('#LoopPaginas').val() == 1 && $('#TotalPaginas').val() > 1) {
										Pagina = DataSplit[6];
										//alert("Tipo: "+Tipo+" - Pagina: "+Pagina);
										PainelTimeOut = setTimeout("PainelPrincipalLoop('"+Tipo+"', '"+Pagina+"')", PainelLoopTime);
									}									
							 }
							 $('.minibox').corner('10px');
							 $('.rounded_mini_img').corner('bl 10px').corner('tl 10px');
							 if(document.getElementById("ControleDestaques").value == 1) {
								// alert(document.getElementById("CountDestaques").value);
								 if(document.getElementById("CountDestaques").value != 0) {
									 if(document.getElementById("Destaque1")) {
										$("#BackgroundImageLoader").image(document.getElementById("Destaque1").src,function(){
											Destaques(); 
											document.getElementById("ControleDestaques").value = 0;																														
										},function(e){
											alert(e);
										});		
									 }
								 }
							 } else {
								if(document.getElementById("CountDestaques").value > 0) {
									PararDestaques(0);	
								}
							 }
						  });	
						$("#PaginaAtual").val(Pagina);
						$("#TipoAtual").val(Tipo);
			}
			function TooglePerfilBox(IDPerfil, Tipo) {
					if(Tipo == 1) { 
						//$("#Td_"+IDPerfil).width(52);
						$("#Nome_"+IDPerfil).hide();
						$("#Foto_"+IDPerfil).show();
					} else {
						//$("#Td_"+IDPerfil).width(133);
						$("#Nome_"+IDPerfil).show();
						$(".Foto").hide();
					}
			}
			function PopupCenter(pageURL, title,w,h) {
				var left = (screen.width/2)-(w/2);
				var top = (screen.height/2)-(h/2);
				var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
			} 				
			function EntrarChat(Chat, CorPerfil) {
					document.getElementById("MensagemChat"+Chat).innerHTML = "<span style='color: green;'>Verificando se o chat já está aberto...</span>";
					$("#MensagemChat"+Chat).fadeIn("fast");
					$.get('includes/Ajax.php', 
					{Acao: "EntrarChat", Chat: Chat },
					function(data){
						if(data) {
							$("#MensagemChat"+Chat).hide();
							document.getElementById("MensagemChat"+Chat).innerHTML = data;
							$("#MensagemChat"+Chat).fadeIn("fast");
						} else {
							document.getElementById("MensagemChat"+Chat).innerHTML = "";
							$("#MensagemChat"+Chat).hide();
							PopupCenter("includes/Chat.php?Chat="+Chat+'&CorPerfil='+CorPerfil, "Chat"+Chat, 500, 500);				
						}
					});		
			}			
			function SeCadastrarChat(Chat) {
				var Email = document.getElementById("Email_Chat_"+Chat).value.trim();
				if(echeck(Email) == false) {
					alert("Email inválido!");
				} else {
					$.get('includes/Ajax.php', 
					{Acao: "GravarEmailChat", Chat: Chat, Email: Email },
					function(data){
						alert(data);
					});			
				}
			}	
		function PesquisarHome(PesquisaInicial, Value, Key, TipoPesquisa, Midia, Categoria, Cidade, Edicao) {
			//if(PesquisaInicial == 1) {
			if(Key == 13) {
				
				//$('#dialog').jqm();	
				ShowModal('Pesquisa.php','Pesquisa','dialog');
				//$('#dialog').load("paginas/pesquisa.php", false, function(){
				//	alert(data);
				//});
				//$('#dialog').jqmShow();				
				//window.location = "index.php?pid=5&pesquisa="+Value+"&tipo_pesquisa=1&midia="+Midia+"&categoria="+Categoria+"&cidade="+Cidade+"&edicao="+Edicao;	
			}				
			///} else {
			//	window.location = "index.php?pid=5&pesquisa="+Value+"&tipo_pesquisa="+TipoPesquisa+"&midia="+Midia+"&categoria="+Categoria+"&cidade="+Cidade+"&edicao="+Edicao;	
			//}
		}
		function Pesquisar(PesquisaInicial, Value, Key, Pagina){
			if(Key == 13) {
				$('#ConteudoBusca').html("");
				$('#CarregandoBusca').show();
				$.get('includes/Ajax.php',  {Acao: "Busca", TextoPesquisa: Value, Pagina: Pagina }, function(data){
							$('#CarregandoBusca').hide();
							var Splitx = data.split("[Separator]");
							if(Splitx[0] == "Perfil") {
								window.location = "index.php?pid=1&pf="+Splitx[1];
							} else {
								document.getElementById("ConteudoBusca").innerHTML = data;
							}
				});	
			}
		}
		function BuscaCanalVivolab(Value, Key, Pagina) {
			if(Key == 13) {
				
			  $('#DivBusca_CanalVivolab').fadeOut('fast', function() {
				  $('#DivBusca_CanalVivolab').html('');
				  $('#DivBusca_CanalVivolab').addClass('ImageLoadingCanalVivolab');
				  $('#DivBusca_CanalVivolab').show();
				  $.get('includes/Ajax.php',  {Acao: "BuscaCanalVivolab", TextoPesquisa: Value, Pagina: Pagina }, function(data){
						var Splitx = data.split("[Separator]");																								   
						$('#DivBusca_CanalVivolab').removeClass('ImageLoadingCanalVivolab');
						$('#DivBusca_CanalVivolab').html(Splitx[0]);
						$('#PagerBusca_CanalVivolab').html(Splitx[1]);
				  });				  
			  });
	
			}
		}
		function AbreCanalVivolab(Conteudo) {
			ShowModal('CanalVivolab.php?Conteudo='+Conteudo,'Canal Vivolab','dialog');
		}
		function SelecionaConteudoCanalVivolab(Conteudo) {
			$('#DivConteudo_CanalVivolab').css('height', 390);
			$('#DivConteudo_CanalVivolab').fadeOut('fast', function() {
				  $('#DivConteudo_CanalVivolab').html('');
				  $('#DivConteudo_CanalVivolab').addClass('ImageLoadingCanalVivolab');
				  $('#DivConteudo_CanalVivolab').show();
				  $.get('includes/Ajax.php',  {Acao: "SelecionaConteudoCanalVivolab", Conteudo: Conteudo }, function(data){																							
						$('#DivConteudo_CanalVivolab').removeClass('ImageLoadingCanalVivolab');
						$('#DivConteudo_CanalVivolab').css('height', 'auto');
						$('#DivConteudo_CanalVivolab').html(data);
				  });				  
			});
		}		
		function Destaques() {
				$('#FecharDestaques').show();
				$('#PauseDestaques').show();
				$('#PlayDestaques').hide();				
				clearTimeout(PainelTimeOut);
				if($('.ImagemDestaque').size() == 1) {
					//$('#Paginas').hide();
					$('.slideshow').show();	
					document.getElementById("CurrentSlide").value = 1;				
					DestaqueTimeOut = setTimeout("PararDestaqueUnico()", 10000);
					//document.getElementById("DestaquesPager").innerHTML = '<a id="LinkDestaque_1" href="#"  class="LinksDestaque LinkSemUndelineDestaques" style="color: #737373; margin-right: 5px; font-size: 9px;" onclick="AbrirDestaque(1)">1</a>';
					$('#DestaquesPager').show();
					$('.LinksDestaque').removeClass("LinkSemUndelineDestaques");
					$('.LinksDestaque').addClass("LinkSemUnderlineDestaquesBold");					
				} else if($('.ImagemDestaque').size() > 1) {
					//$('#Paginas').hide();
					$('#SlideShowAberto').val(1);
					$('.slideshow').show();	
					document.getElementById("CurrentSlide").value = 1;				
					//document.getElementById("DestaquesPager").innerHTML = "";
					$('.slideshow').cycle({
						//fx:    'fade',
						autostop: 1,
						
						//autostopCount:   parseInt(document.getElementById("CountDestaques").value)-1,
						//speed: 1000,
						//timeout: 100000,
						next:   '.map',
						
						pager: '#DestaquesPager',
						pagerAnchorBuilder: function(idx, slide) { 
							/*var index = idx+1;
							if(index == 1) {
								return '<a id="LinkDestaque_'+index+'" href="#"  class="LinksDestaque LinkSemUnderlineDestaquesBold" style="color: #737373; margin-right: 5px; font-size: 9px;" onclick="AbrirDestaque('+index+')">'+index+'</a>';
							} else {
								return '<a id="LinkDestaque_'+index+'" href="#"  class="LinksDestaque LinkSemUndelineDestaques" style="color: #737373; margin-right: 5px; font-size: 9px;" onclick="AbrirDestaque('+index+')">'+index+'</a>';							
							}*/
						},	
						before: function(CurrentSlide) {
							var CurrentSlide = document.getElementById("CurrentSlide").value;
							var CountDestaques = document.getElementById("CountDestaques").value;
							if(CurrentSlide == CountDestaques) {
								PararDestaques();
							}							
						},
						after: function(CurrentSlide) {
							var CurrentSlide = document.getElementById("CurrentSlide").value;
							$('.PaginacaoDestaque').hide();
							$('.PaginacaoDestaque').eq(parseInt(CurrentSlide)-1).show();							
							var CountDestaques = document.getElementById("CountDestaques").value;
							if(CurrentSlide == CountDestaques) {
								PararDestaques();
							} else {
								CurrentSlide++;
								document.getElementById("CurrentSlide").value = CurrentSlide;
							}
						},
					
						end: function () {
						
							PararDestaques();						
						}
						// choose your transition type, ex: fade, scrollUp, shuffle, etc...
					});
				} else {
					$('#Paginas').show();
				}
		}
		function PararDestaques(RecarregarPainel) {
			$('.slideshow').cycle('stop');
			$('.slideshow').fadeOut();
			$('.PaginacaoDestaque').hide();
			//$('.slideshow').hide();
			$('#FecharDestaques').hide();
			$('#PauseDestaques').hide();
			$('#PlayDestaques').show();	
			$('#SlideShowAberto').val(0);
			//$('.LinksDestaque').removeClass("LinkSemUnderlineDestaquesBold");
			//$('.LinksDestaque').removeClass("LinkSemUndelineDestaques");
			//$('.LinksDestaque').addClass("LinkSemUndelineDestaques");				
			ControleDestaques(RecarregarPainel);
			
		}
		function FecharDestaque(Index) {
			if($('#SlideShowAberto').val() == 0) {
				PararDestaques();
				//AbrirDestaque(Index);
			} else {
				//alert("aa");
				$('.slideshow').cycle('resume');
			}
		}
		function FecharDestaques() {
			
			PararDestaques();	
		}
		function AbrirDestaque(Index) {
			
			clearTimeout(PainelTimeOut);
			$('.PaginacaoDestaque').hide();
			$('.PaginacaoDestaque').eq(parseInt(Index)-1).show();				
			$('.slideshow').cycle('stop');
			$('.slideshow').cycle({startingSlide: parseInt(Index)-1});
			$('.slideshow').cycle('pause');
			$('#SlideShowAberto').val(0);
			$('.slideshow').show();
			
			//document.getElementById("CurrentSlide").value = parseInt(Index)-1;
			/*$('.slideshow').cycle({
				autostop: 1,
				next:   '.map',
				pager: '#DestaquesPager',
				startingSlide: parseInt(Index)-1,
				pagerAnchorBuilder: function(idx, slide) { 
				},					
				after: function(CurrentSlide) {
					
					var CurrentSlide = document.getElementById("CurrentSlide").value;						;
					var CountDestaques = document.getElementById("CountDestaques").value;
					$('.PaginacaoDestaque').hide();
					$('.PaginacaoDestaque').eq(CurrentSlide).show();						
					if(CurrentSlide == CountDestaques) {
						PararDestaques();
					} else {
						CurrentSlide++;
						document.getElementById("CurrentSlide").value = CurrentSlide;
					}
				},
			
				end: function () {
					PararDestaques();	
					$('.slideshow').fadeOut();
					$('#Paginas').show();			
					ControleDestaques();
				}
			});		
			$('.slideshow').cycle('pause');	*/	
		}
		function ControleDestaques(RecarregarPainel) {
			$.get('includes/Ajax.php', {Acao: "ControleDestaques" }, function (data) {															   
				document.getElementById("ControleDestaques").value = 0;
				//alert("Tip: "+$("#TipoAtual").val()+" - Pag: "+$("#PaginaAtual").val());
				
				if(RecarregarPainel != 0) {
					PainelTimeOut = setTimeout("PainelPrincipalLoop('"+$("#TipoAtual").val()+"', '"+$("#PaginaAtual").val()+"')", PainelLoopTime);
				}
			});		
		}
		function PararDestaqueUnico() {
			
			PararDestaques();
	
		}
		function CarregarTransmissao(Id) {
			var Player = "";
			Player += '<object id="MediaPlayer" width=240 height=180 classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" standby="Carregando Windows Media Player..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=7,0,0,1954">';
			Player += '<param name="url" name="http://www.vivolab.com.br/v1/paginas/aovivo.asx">';
			Player += '<param name="wmode" value="opaque">';
			Player += '<param name="Showcontrols" value="True">';
			Player += '<param name="autoStart" value="True">';
			Player += '<param name="uiMode" value="mini"> ';
			Player += '<PARAM NAME="ShowStatusBar" VALUE="True">';
			Player += '<embed type="application/x-mplayer2"  wmode="opaque" src="http://www.vivolab.com.br/v1/paginas/aovivo.asx" name="MediaPlayer" uiMode="mini" width=240 height=180></embed>';
			Player += '</object>';
			document.getElementById(Id).innerHTML = Player;
		}
		function Participe(Nome, Email, /*UploadVideo: UploadVideo,*/ Embed ) {
			var Aceito = 0;
			if(document.getElementById("Aceito").checked == true){
						 Aceito = 1;
			} else {
						 Aceito = 0;
			}
			if(document.getElementById("SMS").checked == true){
						 SMS = 1;
			} else {
						 SMS = 0;
			}
			
			$.get('includes/Ajax.php', {Acao: "GravarParticipe", Nome: Nome, Email: Email, /*UploadVideo: UploadVideo,*/ Embed: Embed, Aceito: Aceito, SMS: SMS}, function (data) {
																																																																															
				if(data){
					alert(data);
				} else {
					alert("Cadastro realizado com sucesso!");
					$('#dialog').jqmHide();
				/*	document.getElementById("Nome").value = "";
					document.getElementById("Email").value = "";
					document.getElementById("Embed").value = "";
					document.getElementById("UploadVideo").value = "";
					document.getElementById("Aceito").checked = false;
					document.getElementById("SMS").checked = false;*/
					
				}
				
			});		
		}
		function CarregaConteudosCanalVivolab(Pagina) {
			$('#LoopCanalVivoLab').val('0');
			var VideoHeight = $("#VideoHeight").val();
			if($('.CanalVivolabDestaque').eq(Pagina).length > 0) {

				$('.CanalVivolabDestaque').hide();
				$('.CanalVivolabDestaque').eq(parseInt(Pagina)).fadeIn();
				
				$('.PaginacaoCanalVivolab').hide();
				$('.PaginacaoCanalVivolab').eq(parseInt(Pagina)-1).show();	

			} else {

				$.get('includes/Ajax.php', {Acao: "DestaquesCanalVivoLab", Pagina: Pagina, VideoHeight: VideoHeight }, function (data) {																											 
					var DataSplit = data.split("[Separator]");
					if(Pagina == 1) {
						var PaginaAnterior = DataSplit[4];
						$('#PaginaAnteriorCanalVivolab').val(PaginaAnterior);
					} else {
						var PaginaAnterior = Pagina-1;
						$('#PaginaAnteriorCanalVivolab').val(PaginaAnterior);
					}																																		 
					
					$('#PaginaCanalVivolab').val(DataSplit[3]);
					$('#TotalPaginasCanalVivolab').val(DataSplit[4]);	
					
					$("#BackgroundImageLoaderCanalVivoLab").load("includes/CarregaConteudoDestaqueCanalVivolab.php", { Conteudo:DataSplit[1] }, function(data) {
						$('.CanalVivolabDestaque').hide();																																
						$("#ConteudoCanalVivolab").append(DataSplit[1]);
						$('.CanalVivolabDestaque').eq(parseInt(Pagina)).fadeIn();
						
						$('.PaginacaoCanalVivolab').hide();	
						$('#PaginacaoInicial').append(DataSplit[2]);
						$('.PaginacaoCanalVivolab').eq(parseInt(Pagina)-1).show();	
						
						$('.CanalVivolabDestaquesVerTodos').eq(parseInt(Pagina)-1).corner("10px");
						$('.CanalVivolabDestaquesPaginacao').eq(parseInt(Pagina)-1).corner("10px");						
						
					});									
			
				});
			}			
		}
		function CarregaConteudosCanalVivolab2(Pagina) {
			if($('#LoopCanalVivoLab').val() == 1) {
				var VideoHeight = $("#VideoHeight").val();
				if($('.CanalVivolabDestaque').eq(Pagina).length > 0) {

					$('.CanalVivolabDestaque').hide();
					$('.CanalVivolabDestaque').eq(parseInt(Pagina)).fadeIn();
					
					$('.PaginacaoCanalVivolab').hide();
					$('.PaginacaoCanalVivolab').eq(parseInt(Pagina)-1).show();
					
					CanalVivolabTimeOut = setTimeout("CarregaConteudosCanalVivolabLoop()", CanalVivolabLoopTime);		

				} else {
					//$('.CanalVivolabDestaqueBackground').addClass('ImageLoadingCanalVivolab');
					$.get('includes/Ajax.php', {Acao: "DestaquesCanalVivoLab", Pagina: Pagina, VideoHeight: VideoHeight }, function (data) {																											 					
						var DataSplit = data.split("[Separator]");
						if(Pagina == 1) {
							var PaginaAnterior = DataSplit[4];
							$('#PaginaAnteriorCanalVivolab').val(PaginaAnterior);
						} else {
							var PaginaAnterior = Pagina-1;
							$('#PaginaAnteriorCanalVivolab').val(PaginaAnterior);
						}																																		 
						
						$('#PaginaCanalVivolab').val(DataSplit[3]);
						$('#TotalPaginasCanalVivolab').val(DataSplit[4]);	

						$("#BackgroundImageLoaderCanalVivoLab").load("includes/CarregaConteudoDestaqueCanalVivolab.php", { Conteudo:DataSplit[1] }, function(data) {
							//$('.CanalVivolabDestaqueBackground').removeClass('ImageLoadingCanalVivolab');																																
							$('.CanalVivolabDestaque').hide();																																
							$("#ConteudoCanalVivolab").append(DataSplit[1]);
							$('.CanalVivolabDestaque').eq(parseInt(Pagina)).fadeIn();
							
							$('.PaginacaoCanalVivolab').hide();	
							$('#PaginacaoInicial').append(DataSplit[2]);
							$('.PaginacaoCanalVivolab').eq(parseInt(Pagina)-1).show();
							
							$('.CanalVivolabDestaquesVerTodos').eq(parseInt(Pagina)-1).corner("10px");
							$('.CanalVivolabDestaquesPaginacao').eq(parseInt(Pagina)-1).corner("10px");
							
							CanalVivolabTimeOut = setTimeout("CarregaConteudosCanalVivolabLoop()", CanalVivolabLoopTime);		
							
						});									
				
					});
				}
			}
		}		
		function CarregaConteudosCanalVivolabLoop() {
			var Pagina = $('#PaginaCanalVivolab').val();
			var TotalPaginas = $('#TotalPaginasCanalVivolab').val();
			if(TotalPaginas) {
				Pagina = parseInt(Pagina);
				TotalPaginas = parseInt(TotalPaginas);
				if(Pagina > TotalPaginas) {
					Pagina = 1;
				}
			}
			CarregaConteudosCanalVivolab2(Pagina);			
		}	
		function MaximizarDestaqueCanalVivoLab() {
			var Posicao = $('#PosicaoDestaqueCanalVivolab').val();
			var Pagina = $('#PaginaCanalVivolab').val()-1;
			ShowModal('VideoDestaque.php?Posicao='+Posicao,'VideoDestaque','dialog');
			//CarregaConteudosCanalVivolab(Pagina);
		}
		function EsqueciMinhaSenha(Login, Email) {
		   
		   $.get('../includes/Ajax.php', {Acao: "EmailEsqueciMinhaSenha", Login: Login, Email: Email}, function (data) {
			
			if(data){
			  alert(data);
			} else {
			  $('#dialog').jqmHide();	
			 //alert("S "+data);
			}
			
			
		   });   
		   
		}		
		function ColaboracoesEComentarios() {
			var radioObj = document.FormColaboracao.elements['TipoColaboracao'];
			var radioLength = radioObj.length;
			var TipoColaboracao = ""; 
			
			for(var i = 1; i <= radioLength; i++) {
				
				if(document.getElementById("Colaboracao"+i).checked) {
					TipoColaboracao = document.getElementById("Colaboracao"+i).value;
				}
				
			}	
			//var TipoColaboracao = "Comentario";
			if(TipoColaboracao != "") {
				$(".ComentInicio").hide();
				$(".ComentToogle").hide();
				if(TipoColaboracao == "Hiperlink") {
					$("#TipoColaboracaoVideo").hide();
					$("#coment_AvisoFLV").hide();
					$("#TipoColaboracaoAudio").hide();
					$("#TipoColaboracaoTexto").hide();
					$("#TipoColaboracaoImagemFoto").hide();
					$("#TipoColaboracaoComentario").hide();
					
					$("#TipoColaboracaoHiperlink").show();
					$("#ColaboracaoComHiperlink").show();
					$("#coment_nome").show();
					$("#coment_email").show();			
					$("#DivHiperlink").show();
					$("#coment_voltar").show();
					$("#coment_enviar").show();
				} else if(TipoColaboracao == "Video") {
					$("#TipoColaboracaoHiperlink").hide();
					$("#TipoColaboracaoAudio").hide();
					$("#TipoColaboracaoTexto").hide();
					$("#TipoColaboracaoImagemFoto").hide();
					$("#TipoColaboracaoComentario").hide();
					
					$("#TipoColaboracaoVideo").show();
					$("#ColaboracaoComVideo").show();
					$("#coment_nome").show();
					$("#coment_email").show();			
					$("#coment_titulo").show();
					$("#coment_descricao").show();
					$("#DivTipoUpload").show();
					$("#coment_voltar").show();
					$("#coment_enviar").show();
				} else if(TipoColaboracao == "Audio") {
					$("#TipoColaboracaoHiperlink").hide();
					$("#TipoColaboracaoVideo").hide();
					$("#coment_AvisoFLV").hide();
					$("#TipoColaboracaoTexto").hide();
					$("#TipoColaboracaoImagemFoto").hide();
					$("#TipoColaboracaoComentario").hide();
					
					$("#TipoColaboracaoAudio").show();
					$("#ColaboracaoComAudio").show();
					$("#coment_nome").show();
					$("#coment_email").show();			
					$("#coment_titulo").show();
					$("#coment_descricao").show();
					$("#DivTipoUpload").show();			
					$("#coment_voltar").show();
					$("#coment_enviar").show();
				} else if(TipoColaboracao == "Texto") {
					$("#TipoColaboracaoHiperlink").hide();
					$("#TipoColaboracaoVideo").hide();
					$("#coment_AvisoFLV").hide();
					$("#TipoColaboracaoAudio").hide();
					$("#TipoColaboracaoImagemFoto").hide();
					$("#TipoColaboracaoComentario").hide();
					
					$("#TipoColaboracaoTexto").show();
					$("#ColaboracaoComTexto").show();
					$("#coment_nome").show();
					$("#coment_email").show();
					$("#coment_titulo").show();
					$("#coment_descricao").show();			
					$("#coment_upload").show();
					$("#coment_carregar").show();			
					$("#coment_voltar").show();
					$("#coment_enviar").show();
				} else if(TipoColaboracao == "Imagem") {
					$("#TipoColaboracaoHiperlink").hide();
					$("#TipoColaboracaoVideo").hide();
					$("#coment_AvisoFLV").hide();
					$("#TipoColaboracaoAudio").hide();
					$("#TipoColaboracaoTexto").hide();
					$("#TipoColaboracaoComentario").hide();
					
					$("#TipoColaboracaoImagemFoto").show();
					$("#ColaboracaoComImagem").show();
					$("#coment_nome").show();
					$("#coment_email").show();
					$("#coment_titulo").show();
					$("#coment_descricao").show();			
					$("#comentario_imagem").show();
					$("#coment_upload").show();
					$("#coment_carregar").show();				
					$("#coment_voltar").show();
					$("#coment_enviar").show();
				} else if(TipoColaboracao == "Comentario") {
					$("#TipoColaboracaoHiperlink").hide();
					$("#TipoColaboracaoVideo").hide();
					$("#coment_AvisoFLV").hide();
					$("#TipoColaboracaoAudio").hide();
					$("#TipoColaboracaoTexto").hide();
					$("#TipoColaboracaoImagemFoto").hide();
					
					$("#TipoColaboracaoComentario").show();
					$("#ColaboracaoComComentario").show();
					$("#coment_nome").show();
					$("#coment_email").show();
					$("#coment_txt").show();
					$("#coment_voltar").show();
					$("#coment_enviar").show();
					$("#FundoForm").show();
					
				}
			} else {
				alert("Selecione uma opção na lista acima!");
			}
		}
		function ColaboracaoComentarioTipoUpload() {
			var radioObj = document.FormColaboracao.elements['TipoUpload'];
			var radioLength = radioObj.length;
			var TipoUpload = "";
			for(var i = 1; i <= radioLength; i++) {
				if(document.getElementById("TipoUpload_"+i).checked) {
					TipoUpload = document.getElementById("TipoUpload_"+i).value;
				}
			}	
			$("#coment_embed").hide();
			$("#coment_upload").hide();
			$("#coment_AvisoFLV").hide();
			$("#coment_carregar").hide();
			if(TipoUpload == "UploadEmbed") {
				$("#coment_embed").fadeIn("slow");
			} else {
				$("#coment_upload").fadeIn("slow");
				if(document.getElementById("Colaboracao2").checked) {
						$("#coment_AvisoFLV").fadeIn("slow");
				}
				$("#coment_carregar").fadeIn("slow");
			}
		}
		function InicioColaboracaoComentario() {
			var radioObj = document.FormColaboracao.elements['TipoColaboracao'];
			var radioLength = radioObj.length;
			var TipoColaboracao = "";
			for(var i = 1; i <= radioLength; i++) {
				document.getElementById("Colaboracao"+i).checked = false;
			}	
			radioObj = document.FormColaboracao.elements['TipoUpload'];
			radioLength = radioObj.length;
			var TipoUpload = "";
			for(var i = 1; i <= radioLength; i++) {
				document.getElementById("TipoUpload_"+i).checked = false;
			}	
			//var TipoColaboracao = "Comentario";
			$(".ComentToogle").hide();
			$("#FundoForm").hide();
			document.getElementById("coment_nome").value = document.getElementById("coment_nome").defaultValue;
			document.getElementById("coment_email").value = document.getElementById("coment_email").defaultValue;
			document.getElementById("coment_titulo").value = document.getElementById("coment_titulo").defaultValue;
			document.getElementById("coment_descricao").value = document.getElementById("coment_descricao").defaultValue;
			document.getElementById("coment_embed").value = document.getElementById("coment_embed").defaultValue;
			document.getElementById("coment_upload").value = document.getElementById("coment_upload").defaultValue;
			document.getElementById("coment_link").value = document.getElementById("coment_link").defaultValue;
			document.getElementById("coment_palavra_link").value = document.getElementById("coment_palavra_link").defaultValue;
			document.getElementById("coment_justificativa_link").value = document.getElementById("coment_justificativa_link").defaultValue;
			document.getElementById("coment_txt").value = document.getElementById("coment_txt").defaultValue;
			$(".ComentInicio").show();		
			
		}
		function GravarColaboracaoComentario(IDConteudoDestaquePerfil) {
			
			var Erros = "";
			var radioObj = document.FormColaboracao.elements['TipoColaboracao'];
			var radioLength = radioObj.length;
			var TipoColaboracao = "";
			for(var i = 1; i <= radioLength; i++) {
				
				if(document.getElementById("Colaboracao"+i).checked) {
					TipoColaboracao = document.getElementById("Colaboracao"+i).value;
					
				}
				
			}	
			radioObj = document.FormColaboracao.elements['TipoUpload'];
			radioLength = radioObj.length;
			var TipoUpload = "";
			for(var i = 1; i <= radioLength; i++) {
				if(document.getElementById("TipoUpload_"+i).checked) {
					TipoUpload = document.getElementById("TipoUpload_"+i).value;
				}
			}			
			//var id = document.getElementById("id").value;
			if(document.getElementById("Foto_Id")) {
				var id_foto = document.getElementById("Foto_Id").value;
			} else {
				var id_foto = "";
			} 
			//var TipoColaboracao = "Comentario";
			//var tipo_midia = document.getElementById("tipo_midia").value;
			var titulo_midia = document.getElementById("titulo_midia").value;
			var coment_nome = document.getElementById("coment_nome");
			var coment_email = document.getElementById("coment_email");
			var coment_titulo = document.getElementById("coment_titulo");
			var coment_descricao = document.getElementById("coment_descricao");
			var coment_embed = document.getElementById("coment_embed");
			var coment_upload = document.getElementById("coment_upload");
			var coment_link = document.getElementById("coment_link");
			var coment_palavra_link = document.getElementById("coment_palavra_link");
			var coment_justificativa_link = document.getElementById("coment_justificativa_link");
			var coment_txt = document.getElementById("coment_txt");
			var url = document.getElementById("url");
			var prog = document.getElementById("prog");
			
		/*	alert("id - "+IDConteudoDestaquePerfil);
			alert("titulo_midia - "+titulo_midia.value);
			alert("coment_nome - "+coment_nome.value);
			alert("coment_email - "+coment_email.value);
			alert("coment_titulo - "+coment_titulo.value);
			alert("coment_descricao - "+coment_descricao.value);
			alert("coment_embed - "+coment_embed.value);
			alert("coment_upload - "+coment_upload.value);
			alert("coment_link - "+coment_link.value);
			alert("coment_palavra_link - "+coment_palavra_link.value);
			alert("coment_justificativa_link - "+coment_justificativa_link.value);
			alert("coment_txt - "+coment_txt.value);
			alert("url - "+url.value);
			alert("prog - "+prog.value);*/
			
			if(coment_email.value == coment_email.defaultValue) {
				coment_email.value = "";	
			}	
			if(coment_nome.value == "" || coment_nome.value == coment_nome.defaultValue) {
				Erros += "Nome deve ser preenchido!\n\n";	
			}			
			if(TipoColaboracao == "Hiperlink") {
				if(coment_link.value == "" || coment_link.value == coment_link.defaultValue) {
					Erros += "Link deve ser preenchido!\n\n";	
				}	
				if(coment_palavra_link.value == "" || coment_palavra_link.value == coment_palavra_link.defaultValue) {
					Erros += "Palavra que receberá o link deve ser preenchido!\n\n";	
				}
				if(coment_justificativa_link.value == "" || coment_justificativa_link.value == coment_justificativa_link.defaultValue) {
					Erros += "Justificativa deve ser preenchido!\n\n";	
				}				
			} else if(TipoColaboracao == "Video" || TipoColaboracao == "Audio") {
				if(coment_titulo.value == "" || coment_titulo.value == coment_titulo.defaultValue) {
					Erros += "Título deve ser preenchido!\n\n";	
				}	
				if(TipoUpload == "UploadEmbed") {
					if(coment_embed.value == "" || coment_embed.value == coment_embed.defaultValue) {
						Erros += "Embed deve ser preenchido!\n\n";	
					}					
				} else if(TipoUpload == "UploadArquivo") {
					if(coment_upload.value == "" || coment_upload.value == coment_upload.defaultValue) {
						Erros += "Arquivo deve ser preenchido!\n\n";	
					}					
				} else {
						Erros += "Escolha entre Embed ou Arquivo!\n\n";					
				}
			} else if(TipoColaboracao == "Texto" || TipoColaboracao == "Imagem") {
				if(coment_titulo.value == "" || coment_titulo.value == coment_titulo.defaultValue) {
					Erros += "Título deve ser preenchido!\n\n";	
				}		
				if(coment_upload.value == "" || coment_upload.value == coment_upload.defaultValue) {
					Erros += "Arquivo deve ser preenchido!\n\n";	
				}					
			} else if(TipoColaboracao == "Comentario") {
				if(coment_txt.value == "" || coment_txt.value == coment_txt.defaultValue) {
					Erros += "Mensagem deve ser preenchido!\n\n";	
				}		
			}		
			if(Erros) {
				alert(Erros);
			} else {
					
					$.get('includes/Ajax.php',
					{Acao: "GravarComentario", nome: coment_nome.value, email: coment_email.value, titulo: coment_titulo.value, descricao: coment_descricao.value, embed: coment_embed.value, upload: coment_upload.value, coment_link: coment_link.value, palavra_link: coment_palavra_link.value, justificativa_link: coment_justificativa_link.value, txt: coment_txt.value, TipoColaboracao: TipoColaboracao, id: IDConteudoDestaquePerfil, id_foto: id_foto.value, url: url.value, prog: prog.value, titulo_midia: titulo_midia},
					function(data){
						alert("Obrigado pela sua participação!");
						//window.location = "index.php?"+data+"&colaborou=1";
					});					
			}
		}
		function ToogleColaboracaoComentario(Id) {
			if(document.getElementById("DivColaboracaoComentario"+Id)) {
				if(document.getElementById("DivColaboracaoComentario"+Id).style.display == "" || document.getElementById( "DivColaboracaoComentario"+Id).style.display != "none") {
					var ElementHeight = $("#DivColaboracaoComentario"+Id).outerHeight();
					$("#DivColaboracaoComentario"+Id).hide();
					gE("SinalColaboracaoComentario"+Id).innerHTML = "+";
					var height = $('#conteudo').outerHeight();
					var NewHeight = (height-20)-ElementHeight-48+"px";
					$('#conteudo').css('height', NewHeight);		
				} else {
					$("#DivColaboracaoComentario"+Id).show();
					gE("SinalColaboracaoComentario"+Id).innerHTML = "-";
					var height = $('#conteudo').outerHeight();
					var ElementHeight = $("#DivColaboracaoComentario"+Id).outerHeight();
					var NewHeight = (height-20)+ElementHeight+48+"px";
					$('#conteudo').css('height', NewHeight);	
				}
			}
		}	
		function UploadArquivoParaCampo(IdCampoArquivo, NomeCampoArquivo, Tamanho, Pasta) {
				var theTop=(screen.height/7);
				var theLeft=(screen.width/4.5);			
				var newWin = window.open("includes/UploadArquivoParaCampo.php?IdCampoArquivo="+IdCampoArquivo+"&NomeCampoArquivo="+NomeCampoArquivo+"&Tamanho="+Tamanho+"&Pasta="+Pasta, "UploadArquivoParaCampo","height=200,width=400,left="+theLeft+",top="+theTop+",resizable=0,titlebar=0,menubar=0,scrollbars=0,toolbar=0,status=0");	
				
		}
		function Lembrete_Novaversao() {
			var Nome = $("#Lembrete_Nome").val();
			var Email = $("#Lembrete_Email").val();
			if(Nome != "" && Email != "") {
				$.get('includes/Ajax.php', 
				{Acao:"Lembrete_Novaversao", Nome: Nome, Email:Email},
				function(data){
					alert("Obrigado por sua participação!");
				});					
			} else {
				alert("Nome e E-mail devem ser preenchidos!");	
			}
		
		}
		function VerMaisComentariosEColaboracoes(IDConteudoDestaquePerfil,  CorPerfil, TotalRegistros, Dominio){
			$("#Carregando").show();
			$("#BRCarregando").show();
			var Start = document.getElementById("ProximoStartComentario").value;
			$.ajax({
					url: 'includes/MaisComentariosEColaboracoes.php',
					type: 'GET',
					data: ({IDConteudoDestaquePerfil: IDConteudoDestaquePerfil, Start: Start, CorPerfil: CorPerfil, TotalRegistros: TotalRegistros, Dominio: Dominio}),
					success: function(data){
								$("#Carregando").hide();
								$("#BRCarregando").hide();
								//$("#comentarios").show();
								$("#comentarios").append(data);	
								$('.media').media();								
					}
			   
			});
						
		}
		function SetaProximoStartComentariosEColaboracoes(Start, MostrarBotao){
			document.getElementById("ProximoStartComentario").value = Start;
			if(MostrarBotao == 1){
				$("#VerMais").show();
			} else {
				$("#VerMais").hide();
			}
		}
		
		function ToggleWhiteBox(Id) {
			$('#Toggle'+Id).slideToggle('slow');
			$('.Seta'+Id).toggle();
		}
		
		function formatar(campo, mask, key) {
			  var n = campo.value.length;
			  var saida = mask.substring(0,1);
			  var texto = mask.substring(n);
			  if ((texto.substring(0,1) != saida) && key != 8)  {
				 campo.value += texto.substring(0,1);
			  }
		}	
		
		function formataMoeda(valor) {
			var valorFormatado;
			if(valor != "") {
		
					 var xValor = valor.split(",");
					 if(xValor.length == 1) {
						
						var zValor = valor.split(".");
						if(zValor.length == 2) {
							valor = valor.replace(".",",");
							xValor = valor.split(",");
						} else {
							valor = valor + ",00"; 	
						}
		
						xValor = valor.split(",");
					 }
					 var antesVirgula = xValor[0];
					 var depoisVirgula = xValor[1];
					 var centavos;
					 if(depoisVirgula.length == 0) { 
						centavos = "00"; 
					 } else if(depoisVirgula.length == 1) {
						centavos = depoisVirgula + "0";
					 } else {
						centavos = depoisVirgula;
					 }
					 var tamanhoReais = antesVirgula.length;
					 var reais;
					 if(tamanhoReais > 3) {
						var x;
						var xStart;
						var xPonto;
						for ( x=0; x<tamanhoReais; x++ ) {
							xStart = (tamanhoReais-1) - x;
							if((x%3) == 0) {
								xPonto = antesVirgula.substr(xStart, 1) + ".";
							} else {
								xPonto = antesVirgula.substr(xStart, 1);
							}
							reais = xPonto + reais;
						}
						reais = reais.replace(".undefined","");
						//reais = reais.substr(reais,0,-1);
					 } else {
						reais = antesVirgula;
					 }
					
					 valorFormatado = reais + "," + centavos;
					 return valorFormatado;		 
				 
			} else {
				 valorFormatado = "0,00";
				 return valorFormatado;
			}
		}
		
		function formatar_moeda(campo, separador_milhar, separador_decimal, tecla) {
			var sep = 0;
			var key = '';
			var i = j = 0;
			var len = len2 = 0;
			var strCheck = '0123456789';
			var aux = aux2 = '';
			var whichCode = (window.Event) ? tecla.which : tecla.keyCode;
		
			if (whichCode == 13) return true; // Tecla Enter
			if (whichCode == 8) return true; // Tecla Delete
			key = String.fromCharCode(whichCode); // Pegando o valor digitado
			if (strCheck.indexOf(key) == -1) return false; // Valor inválido (não inteiro)
			len = campo.value.length;
			for(i = 0; i < len; i++)
			if ((campo.value.charAt(i) != '0') && (campo.value.charAt(i) != separador_decimal)) break;
			aux = '';
			for(; i < len; i++)
			if (strCheck.indexOf(campo.value.charAt(i))!=-1) aux += campo.value.charAt(i);
			aux += key;
			len = aux.length;
			if (len == 0) campo.value = '';
			if (len == 1) campo.value = '0'+ separador_decimal + '0' + aux;
			if (len == 2) campo.value = '0'+ separador_decimal + aux;
		
			if (len > 2) {
				aux2 = '';
		
				for (j = 0, i = len - 3; i >= 0; i--) {
					if (j == 3) {
						aux2 += separador_milhar;
						j = 0;
					}
					aux2 += aux.charAt(i);
					j++;
				}
		
				campo.value = '';
				len2 = aux2.length;
				for (i = len2 - 1; i >= 0; i--)
				campo.value += aux2.charAt(i);
				campo.value += separador_decimal + aux.substr(len - 2, len);
			}
		
			return false;
		}
		function IsIe() {
			
			if(navigator.vendor && navigator.vendor.toLowerCase().indexOf("apple") != -1) {
				return 0;	
			} else {
				var isIE = (navigator.appName=="Microsoft Internet Explorer");
				var IEversion = navigator.appVersion;
				if(isIE) {
					IEversion = parseInt(IEversion.substr(IEversion.indexOf("MSIE")+4));
				} else {
					IEversion = 0;
				}
				return isIE;
			}
			//if(isIE == true) {
			//	alert("isIE=" + isIE + ", version=" + IEversion);
			//}
		}		