$(document).ready(function(){

$("#sendmail_LIRA").click(function(){

var valid = "";
var isr = ' is required.';
var yourname = $("#formail_LIRA #yourname").val();
var lastname = $("#formail_LIRA #lastname").val();
var phone = $("#formail_LIRA #phone").val();
var mail = $("#formail_LIRA #mail").val();
var company = $("#formail_LIRA #company").val();
var acreg = $("#formail_LIRA #acreg").val();
var actype = $("#formail_LIRA #actype").val();
var icao = $("#formail_LIRA #icao").val();
var arrdate = $("#formail_LIRA #arrdate").val();
var depdate = $("#formail_LIRA #depdate").val();
var text = $("#formail_LIRA #text").val();

if (yourname.length<1) {
valid += 'Please fill all the fields';
}
if (!mail.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
valid += 'Please fill all the fields';
}
/*if (terms.length<1) {
valid += '<br />You must agree to the Terms and Conditions';
}*/
if (text.length<1) {
valid += 'Please fill all the fields';
}

if($("#formail_LIRA #terms").attr("checked")==true){

	if (valid!="") {
	$("#response_LIRA").fadeIn("slow");
	$("#response_LIRA").html('Please fill correctly all the fields.');
	}
	else {
	var datastr ='yourname=' + yourname + '&mail=' + mail +  '&text=' + text +  '&lastname=' + lastname +  '&phone=' + phone +  '&mail=' + mail +  '&company=' + company +  '&acreg=' + acreg +  '&actype=' + actype +  '&icao=' + icao +  '&arrdate=' + arrdate +  '&depdate=' + depdate;
	$("#response_LIRA").css("display", "block");
	$("#response_LIRA").html("Thank you, your request has been successfully sent.<br/>Our OCC will contact you as soon as possible.");
	$("#response_LIRA").fadeIn("slow");
	setTimeout("send('"+datastr+"')",2000);
	}
}else{
	$("#response_LIRA").fadeIn("slow");
	$("#response_LIRA").html('You must agree to the Terms and Conditions.');
	}
return false;
});
$("#sendmail_LIEE").click(function(){

var valid = "";
var isr = ' is required.';
var yourname = $("#formail_LIEE #yourname").val();
var lastname = $("#formail_LIEE #lastname").val();
var phone = $("#formail_LIEE #phone").val();
var mail = $("#formail_LIEE #mail").val();
var company = $("#formail_LIEE #company").val();
var acreg = $("#formail_LIEE #acreg").val();
var actype = $("#formail_LIEE #actype").val();
var icao = $("#formail_LIEE #icao").val();
var arrdate = $("#formail_LIEE #arrdate").val();
var depdate = $("#formail_LIEE #depdate").val();
var text = $("#formail_LIEE #text").val();

if (yourname.length<1) {
valid += 'Please fill all the fields';
}
if (!mail.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
valid += 'Please fill all the fields';
}
/*if (terms.length<1) {
valid += '<br />You must agree to the Terms and Conditions';
}*/
if (text.length<1) {
valid += 'Please fill all the fields';
}

if($("#formail_LIEE #terms").attr("checked")==true){

	if (valid!="") {
	$("#response_LIEE").fadeIn("slow");
	$("#response_LIEE").html('Please fill correctly all the fields.');
	}
	else {
	var datastr ='yourname=' + yourname + '&mail=' + mail +  '&text=' + text +  '&lastname=' + lastname +  '&phone=' + phone +  '&mail=' + mail +  '&company=' + company +  '&acreg=' + acreg +  '&actype=' + actype +  '&icao=' + icao +  '&arrdate=' + arrdate +  '&depdate=' + depdate;
	$("#response_LIEE").css("display", "block");
	$("#response_LIEE").html("Thank you, your request has been successfully sent.<br/>Our OCC will contact you as soon as possible.");
	$("#response_LIEE").fadeIn("slow");
	setTimeout("send('"+datastr+"')",2000);
	}
}else{
	$("#response_LIEE").fadeIn("slow");
	$("#response_LIEE").html('You must agree to the Terms and Conditions.');
	}
return false;
});
$("#sendmail_LIML").click(function(){

var valid = "";
var isr = ' is required.';
var yourname = $("#formail_LIML #yourname").val();
var lastname = $("#formail_LIML #lastname").val();
var phone = $("#formail_LIML #phone").val();
var mail = $("#formail_LIML #mail").val();
var company = $("#formail_LIML #company").val();
var acreg = $("#formail_LIML #acreg").val();
var actype = $("#formail_LIML #actype").val();
var icao = $("#formail_LIML #icao").val();
var arrdate = $("#formail_LIML #arrdate").val();
var depdate = $("#formail_LIML #depdate").val();
var text = $("#formail_LIML #text").val();

if (yourname.length<1) {
valid += 'Please fill all the fields';
}
if (!mail.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
valid += 'Please fill all the fields';
}
/*if (terms.length<1) {
valid += '<br />You must agree to the Terms and Conditions';
}*/
if (text.length<1) {
valid += 'Please fill all the fields';
}

if($("#formail_LIML #terms").attr("checked")==true){

	if (valid!="") {
	$("#response_LIML").fadeIn("slow");
	$("#response_LIML").html('Please fill correctly all the fields.');
	}
	else {
	var datastr ='yourname=' + yourname + '&mail=' + mail +  '&text=' + text +  '&lastname=' + lastname +  '&phone=' + phone +  '&mail=' + mail +  '&company=' + company +  '&acreg=' + acreg +  '&actype=' + actype +  '&icao=' + icao +  '&arrdate=' + arrdate +  '&depdate=' + depdate +  '&terms=' + terms;
	$("#response_LIML").css("display", "block");
	$("#response_LIML").html("Thank you, your request has been successfully sent.<br/>Our OCC will contact you as soon as possible.");
	$("#response_LIML").fadeIn("slow");
	setTimeout("send('"+datastr+"')",2000);
	}
}else{
	$("#response_LIML").fadeIn("slow");
	$("#response_LIML").html('You must agree to the Terms and Conditions.');
	}
return false;
});
$("#sendmail_LIPZ").click(function(){

var valid = "";
var isr = ' is required.';
var yourname = $("#formail_LIPZ #yourname").val();
var lastname = $("#formail_LIPZ #lastname").val();
var phone = $("#formail_LIPZ #phone").val();
var mail = $("#formail_LIPZ #mail").val();
var company = $("#formail_LIPZ #company").val();
var acreg = $("#formail_LIPZ #acreg").val();
var actype = $("#formail_LIPZ #actype").val();
var icao = $("#formail_LIPZ #icao").val();
var arrdate = $("#formail_LIPZ #arrdate").val();
var depdate = $("#formail_LIPZ #depdate").val();
var text = $("#formail_LIPZ #text").val();

if (yourname.length<1) {
valid += 'Please fill all the fields';
}
if (!mail.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
valid += 'Please fill all the fields';
}
/*if (terms.length<1) {
valid += '<br />You must agree to the Terms and Conditions';
}*/
if (text.length<1) {
valid += 'Please fill all the fields';
}

if($("#formail_LIPZ #terms").attr("checked")==true){

	if (valid!="") {
	$("#response_LIPZ").fadeIn("slow");
	$("#response_LIPZ").html('Please fill correctly all the fields.');
	}
	else {
	var datastr ='yourname=' + yourname + '&mail=' + mail +  '&text=' + text +  '&lastname=' + lastname +  '&phone=' + phone +  '&mail=' + mail +  '&company=' + company +  '&acreg=' + acreg +  '&actype=' + actype +  '&icao=' + icao +  '&arrdate=' + arrdate +  '&depdate=' + depdate;
	$("#response_LIPZ").css("display", "block");
	$("#response_LIPZ").html("Thank you, your request has been successfully sent.<br/>Our OCC will contact you as soon as possible.");
	$("#response_LIPZ").fadeIn("slow");
	setTimeout("send('"+datastr+"')",2000);
	}
}else{
	$("#response_LIPZ").fadeIn("slow");
	$("#response_LIPZ").html('You must agree to the Terms and Conditions.');
	}
return false;
});

$("#sendmail_LIRP").click(function(){

var valid = "";
var isr = ' is required.';
var yourname = $("#formail_LIRP #yourname").val();
var lastname = $("#formail_LIRP #lastname").val();
var phone = $("#formail_LIRP #phone").val();
var mail = $("#formail_LIRP #mail").val();
var company = $("#formail_LIRP #company").val();
var acreg = $("#formail_LIRP #acreg").val();
var actype = $("#formail_LIRP #actype").val();
var icao = $("#formail_LIRP #icao").val();
var arrdate = $("#formail_LIRP #arrdate").val();
var depdate = $("#formail_LIRP #depdate").val();
var text = $("#formail_LIRP #text").val();

if (yourname.length<1) {
valid += 'Please fill all the fields';
}
if (!mail.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
valid += 'Please fill all the fields';
}
/*if (terms.length<1) {
valid += '<br />You must agree to the Terms and Conditions';
}*/
if (text.length<1) {
valid += 'Please fill all the fields';
}

if($("#formail_LIRP #terms").attr("checked")==true){

	if (valid!="") {
	$("#response_LIRP").fadeIn("slow");
	$("#response_LIRP").html('Please fill correctly all the fields.');
	}
	else {
	var datastr ='yourname=' + yourname + '&mail=' + mail +  '&text=' + text +  '&lastname=' + lastname +  '&phone=' + phone +  '&mail=' + mail +  '&company=' + company +  '&acreg=' + acreg +  '&actype=' + actype +  '&icao=' + icao +  '&arrdate=' + arrdate +  '&depdate=' + depdate;
	$("#response_LIRP").css("display", "block");
	$("#response_LIRP").html("Thank you, your request has been successfully sent.<br/>Our OCC will contact you as soon as possible.");
	$("#response_LIRP").fadeIn("slow");
	setTimeout("send('"+datastr+"')",2000);
	}
}else{
	$("#response_LIRP").fadeIn("slow");
	$("#response_LIRP").html('You must agree to the Terms and Conditions.');
	}
return false;
});

});
//END DOCUMENT READY

function send(datastr){
$.ajax({
type: "POST",
url: "http://www.argosvph.aero/mail_fbo.php",
data: datastr,
cache: false,
success: function(html){
$("#response_LIRA").fadeIn("slow");
$("#response_LIRA").html(html);
setTimeout('$("#response_LIRA").fadeOut("slow")',6000);
$("#response_LIEE").fadeIn("slow");
$("#response_LIEE").html(html);
setTimeout('$("#response_LIEE").fadeOut("slow")',6000);
$("#response_LIML").fadeIn("slow");
$("#response_LIML").html(html);
setTimeout('$("#response_LIML").fadeOut("slow")',6000);
$("#response_LIPZ").fadeIn("slow");
$("#response_LIPZ").html(html);
setTimeout('$("#response_LIPZ").fadeOut("slow")',6000);
$("#response_LIRP").fadeIn("slow");
$("#response_LIRP").html(html);
setTimeout('$("#response_LIRP").fadeOut("slow")',6000);
}
});
}
