//navigationAjax();

$('#e-mail, #e-mail2, #nome, #mensagem').focus(function(){
	$(this).prev().hide();
}).blur(function(){
	if(!$(this).val()) {
		$(this).prev().show();
	}
});
if($('#e-mail').val()) {
	$('#e-mail').prev().hide()
}
/*
$('#newsletter').submit(function() {
	if(!isValidEmailAddress($("#e-mail").val())){
		alert("Endereço de e-mail inválido")
	} else {
		jQuery.ajax({
			type: "POST",
			url: "inc_newsletter-subscribe.php",
			data: "e-mail="+$('#e-mail').val(),
			success: function(response){
				$("#newsletter-response").html(response)
			},
			error: function(response){
				alert('Este serviço encontra-se temporáriamente indisponível');
			}
		});
	}
	return false;
})



$('#form-contacto').submit(function() {
	if(!isValidEmailAddress($("#e-mail2").val())){
		alert("Endereço de e-mail inválido")
	} else {
		jQuery.ajax({
			type: "POST",
			url: "inc_contacto.php",
			data: ({
				   "e-mail2" : $('#e-mail2').val(),
				   "nome" : $('#nome').val(),
				   "mensagem" : $('#mensagem').val(),
				   "newslettersubscribe" :$('#newslettersubscribe').is(':checked')
			}),
			success: function(response){
				$("#contacto-response").html(response)
			},
			error: function(response){
				alert('Este serviço encontra-se temporáriamente indisponível');
			}
		});
	}
	return false;
})*/

$(document).pngFix();

runsIRF();

$(".linkvideo").click(function(){
	$.modal('<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'+youtubeIDextract($(this).attr("href"))+'&hl=en_GB&fs=1&autoplay=1&"></param><param name="wmode" value="transparent"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+youtubeIDextract($(this).attr("href"))+'&hl=en_GB&fs=1&autoplay=1&" wmode="transparent" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>',{persist:true, overlayClose:true, opacity:70, containerCss:{background:"#000"}});
	return false;
})