// JavaScript Document
Shadowbox.init({
    language: 'pt-PT',
    players:  ['img', 'html', 'iframe', 'swf', 'flv']
});

$(function() {		
	$(".rollUp").jCarouselLite({
    	auto: 1800,
	    speed: 1100,
		vertical: true,
		visible:2
	});
	
	$("#news h2").css("cursor","pointer").click(function() {
		var e = location.href;
		var i = $(this).attr("rel");
		if (e.indexOf('aviationtour.htm') == -1) {
			window.location = "aviationtour.htm#"+i;
		}
		else {
			$(".tour tbody tr[id='"+i+"']").children("td").css("background-color","pink");
		}	
	});
	
	$("#fnome").focus(function() {
		if ($(this).val() == "Your name here") {
			$(this).val("");
		}
	}).blur(function() {
		if ($(this).val() == "") {
			$(this).val("Your name here");
		}
	});
	
	$("#fmail").focus(function() {
		if ($(this).val() == "Your email") {
			$(this).val("");
		}
	}).blur(function() {
		if ($(this).val() == "") {
			$(this).val("Your email");
		}
	});

	$("#f1").click(function() {
		$.ajax({
  			type: "POST",
			url: "remote/n.php",
			data: "n="+$("#fmail").val()+"&n2="+$("#fnome").val(),
			success: function(msg){
				if (msg == "1") {
				    $("#newsMSG").html("<span style=\"color:green\">Thank you for your subscription!</span>");
					$("#fnome").val("Your name here"); $("#fmail").val("Your email");
				}
				else {
				    $("#newsMSG").html("<span style=\"color:red\">Your e-mail seems to be incorrect!</span>");	
				}
			}
		});
	});
	
	$("#store").click(function() {
		window.location = 'loja.htm';						   
	});
	
	$("#area_banner2").click(function() {
		window.location = 'loja2.htm';						   
	});

});
