$(function() {
	Shadowbox.init();
});

function cacher(frame) {
	//frame.setAttribute("visibility","hidden");
	//frame.style.display = 'none';
	i=80;
	while (i>=0) {
	frame.style["filter"] = "alpha(opacity="+i+")";
	frame.style["-moz-opacity"] = i/100;
	frame.style["-khtml-opacity"] = i/100;
	frame.style["opacity"] = i/100;
	i=i-10;
	}
}

function rien (){
	alert ("bonjour");
	return true;}
	
function sendPage(form) {
	dateArrivée = $('input[name=dateA]',form).val();
	dateDepart = $('input[name=dateD]',form).val();	
	if (dateArrivée == '') {
		alert('Date Arrivée manquante');
		return false;
	}

	if (dateDepart == '') {
		alert('Date Départ Manquante');
		return false;
	}
	

	lien = "http://ambreetepices.factobox.com/modules/recherchechambre/search.php?recherche_debut=date_debut&date_debut=" +
	dateArrivée +
	"&recherche_fin=date_fin&date_fin=" +
	dateDepart;
	
	window.open(lien,"Reservation en Ligne","width=600","height=400");
	
	return true;
}

function check(form) {
	if ($(form).hasClass('reservEn')) {

		if ($('input[name=prenom]', form).val() == '') {
			alert('Fill Prenom value.');
			return false;
		}

		if ($('input[name=nom]', form).val() == '') {
			alert('Fill Nom value.');
			return false;
		}

		if ($('input[name=telephone]', form).val() == '') {
			alert('Fill Telephone value.');
			return false;
		}

		if ($('input[name=email]', form).val() == '') {
			alert('Fill Email value.');
			return false;
		}

	}
	if ($(form).hasClass('reservFr')) {
		
		if ($('input[name=prenom]', form).val() == '') {
			alert('Le champ "Prenom" est requis.');
			return false;
		}

		if ($('input[name=nom]', form).val() == '') {
			alert('Le champ "Nom" est requis.');
			return false;
		}

		if ($('input[name=telephone]', form).val() == '') {
			alert('Le champ "Telephone" est requis.');
			return false;
		}

		if ($('input[name=email]', form).val() == '') {
			alert('Le champ "Email" est requis.');
			return false;
		}

	}
	if ($(form).hasClass('contactEn')) {

		if ($('input[name=email]', form).val() == '') {
			alert('Fill Email value.');
			return false;
		}

	}
	if ($(form).hasClass('contactFr')) {

		if ($('input[name=email]', form).val() == '') {
			alert('Le champ "Email" est requis.');
			return false;
		}

	}

	return true;
}

