function apagarTudo() {
	$('#esquerda').find('div').each(function(i) {
		$(this).hide();
	});
}

$(document).ready(function() {
	$('a.link1').click(function() {
		apagarTudo();
		$('#box_3.conteudo1').show('slow');
	});
	$('a.link2').click(function() {
		apagarTudo();
		$('#box_3.conteudo2').show('slow');
	});
	$('a.link3').click(function() {
		apagarTudo();
		$('#box_3.conteudo3').show('slow');
	});
	$('a.link4').click(function() {
		apagarTudo(); 
		$('#box_3.conteudo4').show('slow');
	});
	$('a.link5').click(function() {
		apagarTudo();
		$('#box_3.conteudo5').show('slow');
	});
	$('a.link6').click(function() {
		apagarTudo();
		$('#box_3.conteudo6').show('slow');
	});
	$('a.link7').click(function() {
		apagarTudo();
		$('#box_3.conteudo7').show('slow');
	});
	$('a.link8').click(function() {
		apagarTudo();
		$('#box_3.conteudo8').show('slow');
	});
	$('a.link9').click(function() {
		apagarTudo();
		$('#box_3.conteudo9').show('slow');
	});
	$('a.link10').click(function() {
		apagarTudo();
		$('#box_3.conteudo10').show('slow');
	});
	$('a.link11').click(function() {
		apagarTudo();
		$('#box_3.conteudo11').show('slow');
	});
	$('a.link12').click(function() {
		apagarTudo();
		$('#box_3.conteudo12').show('slow');
	});
	$('a.link13').click(function() {
		apagarTudo();
		$('#box_3.conteudo13').show('slow');
	});
	$('a.link14').click(function() {
		apagarTudo();
		$('#box_3.conteudo14').show('slow');
	});
	$('a.link15').click(function() {
		apagarTudo();
		$('#box_3.conteudo15').show('slow');
	});
	$('a.link16').click(function() {
		apagarTudo();
		$('#box_3.conteudo16').show('slow');
	});
	$('a.link17').click(function() {
		apagarTudo();
		$('#box_3.conteudo17').show('slow');
	});
	$('a.link18').click(function() {
		apagarTudo();
		$('#box_3.conteudo18').show('slow');
	});
	$('a.link19').click(function() {
		apagarTudo();
		$('#box_3.conteudo19').show('slow');
	});
	$('a.outroDia').click(function() {
		$('#formCalendario').hide();
		$('#calendario').show();
	});
});

$(function() {
	$('#c a').css( {
		backgroundPosition : "0 0"
	}).mouseover(function() {
		$(this).stop().animate( {
			backgroundPosition : "(0 100px)"
		}, {
			duration : 2
		});
		$(this).css( {
			color : "#198BA1",
			height : "20px"
		});
	}).mouseout(function() {
		$(this).stop().animate( {
			backgroundPosition : "(0 0)"
		}, {
			duration : 2
		});
		$(this).css( {
			color : "#FFF",
			height : "15px"
		});
	});
});

$(function() {
	$('#c a').each(function() {
		$(this).corner("bottom");
	});
});

$(document).ready(function() {
	$("#telefone").mask("(99) 9999 - 9999");
	$("#cpf").mask("999.999.999-99");
	$("#nascimento").mask("99/99/9999");
});

$(document)
		.ready(
				function() {
					$("#formulario")
							.validate(
									{
										rules : {
											nome : {
												required : true
											},
											email : {
												required : true,
												email : true
											},
											telefone : {
												required : true
											},
											destinatario : {
												required : true
											},
											comentario : {
												required : true,
												minlength : 2,
												maxlength : 500
											}
										},
										messages : {
											nome : {
												required : "Informe o seu nome."
											},
											telefone : {
												required : "Informe o seu telefone para contato."
											},
											destinatario : {
												required : "Escolha um destinatário."
											},
											email : {
												required : "Informe o seu e-mail para contato.",
												email : "Digite um e-mail válido."
											},
											comentario : {
												required : "Informe a sua mensagem.",
												minlength : "A sua mensagem deve conter, no mínimo, 2 caracteres.",
												maxlength : "Sua mensagem deve ter até 500 caracteres."
											}
										}
									});
					$("#formularioContato").validate( {
						rules : {
							email : {
								required : true,
								email : true
							},
							cpf : {
								required : true
							}
						},
						messages : {
							email : {
								required : "Informe o seu e-mail cadastrado.",
								email : "Informe um e-mail válido."
							},
							cpf : {
								required : "Informe o número do seu CPF."
							}
						}
					});

					$("#formularioAgendamento").validate( {
						rules : {
							email : {
								required : true,
								email : true
							},
							cpf : {
								required : true
							},
							horarioEscolhido : {
								required : true
							}
						},
						messages : {
							email : {
								required : "Informe o seu e-mail cadastrado.",
								email : "Informe um e-mail válido."
							},
							cpf : {
								required : "Informe o número do seu CPF."
							},
							horarioEscolhido : {
								required : "Informe o horário desejado."
							}
						}
					});

					$("#formularioLogin").validate( {
						rules : {
							usuario : {
								required : true
							},
							senha : {
								required : true
							}
						},
						messages : {
							usuario : {
								required : "Informe o nome do seu usuário."
							},
							senha : {
								required : "Informe a sua senha."
							}
						}
					});

					$("#formularioCadastro")
							.validate(
									{
										rules : {
											nome : {
												required : true
											},
											email : {
												required : true,
												email : true
											},
											cpf : {
												required : true
											},
											nascimento : {
												required : true
											},
											telefone : {
												required : true
											}
										},
										messages : {
											email : {
												required : "Informe o seu e-mail cadastrado.",
												email : "Digite um e-mail válido."
											},
											cpf : {
												required : "Informe o número do seu CPF."
											},
											nome : {
												required : "Informe o seu nome."
											},
											telefone : {
												required : "Informe o seu telefone para contato."
											},
											nascimento : {
												required : "Informe a sua data de nascimento."
											}
										}
									});
				});

$(function() {
	$("#datepicker").datepicker( {
		onSelect : function(dateText, inst) {
			$('#dia').val(dateText);
			$("#diaEscolhido").html(dateText);
			$('#calendario').hide();
			$('#formCalendario').show();
		},
		autoSize : true
	});
});

function incluirVideo(divId, clsId, objectId, width, height, url, autoStart, loop) {
	limparVideo();
	var conteudo = '<object classid="' + clsId + '" id="' + objectId + '"'
			+ ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"'
			+ ' width="' + width + '" height="' + height + '">'
			+ ' <param name="movie" value="' + url + '"/>'
			+ ' <param name="allowScriptAccess" value="sameDomain" />'
			+ ' <param name="quality" value="high" />'
			+ ' <param name="loop" value="' + loop + '"/>'
			+ ' <param name="bgcolor" value="#ccc"/>'
			+ ' <param name="autoStart" value="' + autoStart + '" />'
			+ ' <embed loop="' + loop + '" play="' + autoStart + '" swliveconnect="true"'  
			+ ' name="' + objectId + '" quality="high" bgcolor="#FFFFFF"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" '
			+ ' src="' + url + '" type="application/x-shockwave-flash" '
			+ ' width="' + width + '" height="' + height + '"';
			+ '></embed></object>';
	$(document).ready(function() {
		 $(divId).html(conteudo);
	});
}

function limparVideo(){
	$(document).ready(function() {
		 $("#videoImplante").html("");
		 $("#videoPediatria").html("");
	});
}

