
jQuery(document).ready(function(){
	jQuery("#author").Watermark("Nome");
	jQuery("#email").Watermark("Email (não será publicado)");
	jQuery("#url").Watermark("Website");
	//jQuery(document).pngFix();

	jQuery(".widget_links ul").hide();
	jQuery(".widget_links h2").click(function(){
		jQuery(this).parent().find("ul").slideToggle('slow');
	});
	jQuery(".widget_archive ul").hide();
	jQuery(".widget_archive h2").click(function(){
		jQuery(this).parent().find("ul").slideToggle('slow');
	});

	if (jQuery("form#contato").length > 0) {
		jQuery("#resposta").ajaxStart(function(){
			jQuery(this).html("Enviando mensagem, por favor aguarde...");
		});
		jQuery("form#contato").submit(function(){
			var contato = {
				nome:     jQuery("input[name='nome']").val(),
				email:    jQuery("input[name='email']").val(),
				assunto:  jQuery("input[name='assunto']").val(),
				mensagem: jQuery("textarea[name='mensagem']").val(),
				contato:  true
			}

			// validação
			if (contato.email.length == 0) {
				alert("Preencha seu email");
				jQuery("input[name='email']").focus();
				return false;
			}
			if (contato.nome.length == 0) {
				alert("Preencha seu nome");
				jQuery("input[name='nome']").focus();
				return false;
			}
			if (contato.assunto.length == 0) {
				alert("Preencha o assunto");
				jQuery("input[name='assunto']").focus();
				return false;
			}
			if (contato.mensagem.length == 0) {
				alert("Sua mensagem não deve ficar em branco");
				jQuery("textarea[name='mensagem']").focus();
				return false;
			}

			jQuery.post("/wp-content/themes/longplay/contato.php", contato, function(data, textStatus){
				jQuery("#resposta").html(data);
			});

			return false;
		});
	}
});

var electra = {
	src: '/wp-content/themes/longplay/lte51575.swf'
};
sIFR.activate(electra);
sIFR.replace(electra, {selector: '.sifr', css: '.sIFR-root {color: #655942;font-size:24px;} .sIFR-root a {color: #655942;text-decoration:none;} .sIFR-root a:hover {color: #655942;}'});
jQuery(".sIFR-active .sifr").css("visibility", "hidden");
jQuery(".sIFR-active .sifr").css("font-family", "Times New Roman");
jQuery(".sIFR-active .sifr").css("visibility", "hidden");
jQuery(".sIFR-active .sifr").css("font-size", "17px");
