function changeOn(id) {
	var imagem=document.getElementById(id);
	imagem.src = "imgs/"+id+"_on.png";
}
function changeOff(id) {
	var imagem=document.getElementById(id);
	imagem.src = "imgs/"+id+"_off.png";
}
//Newsletter
function newsletterOn()
{
	$('#newsletter-off').fadeOut(500);			
	$('#newsletter-on').delay(500).fadeIn(500);
}
function newsletterOff()
{
	documento = document.frm_news;	
	with(documento){
		if (newsletter.value == ""){
			alert("Por favor nao deixe campos em branco!");
			newsletter.focus();
			return (false);
		}else{
			if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(newsletter.value))) {
				alert("Email invalido.");
				newsletter.focus();
				return (false);
			}
		}
	}
	
	$('#newsletter-on').fadeOut(500);
	$('#newsletter-obrigado').delay(500).fadeIn(500);
	$('#newsletter-obrigado').delay(1500).fadeOut(500);
	$('#newsletter-off').delay(3000).fadeIn(500);	
}

/*function trocaPagina(pagina)
{	
	if(!(pagina == "content-main-home"))
	{
		$('#content-main-home').animate({
			'margin-top':'+=43px'
		}, { duration: 100 })
		$('#content-main-home').fadeOut(100,function(){$('#content-main-home').css('margin-top', '0px')});
	}
	if(!(pagina == "content-main-sobre"))
	{
		$('#content-main-sobre').animate({
			'margin-top':'+=43px'
		}, { duration: 100 })
		$('#content-main-sobre').fadeOut(100,function(){$('#content-main-sobre').css('margin-top','0px')});
	}
	if(!(pagina == "content-main-servicos"))
	{
		$('#content-main-servicos').animate({
			'margin-top':'+=43px'
		}, { duration: 100 })
		$('#content-main-servicos').fadeOut(100,function(){$('#content-main-servicos').css('margin-top','0px')});
	}
	if(!(pagina == "content-main-unidades"))
	{
		$('#content-main-unidades').animate({
			'margin-top':'+=43px'
		}, { duration: 100 })
		$('#content-main-unidades').fadeOut(100,function(){$('#content-main-unidades').css('margin-top','0px')})
	}
	if(!(pagina == "content-main-blog"))
	{
		$('#content-main-blog').animate({
			'margin-top':'+=43px'
		}, { duration: 100 })
		$('#content-main-blog').fadeOut(100,function(){$('#content-main-blog').css('margin-top','0px')})
	}
	
	$('#'+pagina).delay(300).fadeIn(300);
}*/

function aparece()
{
	montaVideo();
	document.getElementById("box2-off").style.display = "none";
	document.getElementById("box2").style.display = "block";
}
