function fGetPrice(aCategoryId, aCountryId, aSubscriptionId){
	new Request({
		url: './home.php?action=lib/requetes_simul_prix&choix=simulation&id_categorie='+aCategoryId+'&id_pays='+aCountryId+'&id_abonnement='+aSubscriptionId,
		onRequest: function(){
		},
		onFailure: function(response){
			$('price_cell').innerHTML = '';
		},
		onSuccess: function(response) {
			$('price_cell').innerHTML = "" + response + "€";
		}
	}).get();
}//fGetPrice				

function fComputePrice(){
	//OGN 20/07/09
	//fGetPrice($('business_select').value, $('country_select').value, $('subscription_select').value);
};

window.addEvent('domready', function() {
	// Gestion des langues avec les drapeaux
	$$('.HPLanguages img').each(function (element) {
		element.addEvent('click', rechargerLangue);
	});

	//Category list
	var business_out = "<select id='business_select' size='1' onchange='fComputePrice();'>";
	//var categories = fGetCategories(); 
	categories.each(function(element){
		business_out += "<option value='" + element.id + "'>" + element.label + "</option>"
	});
	business_out += '</select>';
	$('business_list').innerHTML = business_out; 						
	//Country list
	var country_out = "<select id='country_select' size='1' onchange='fComputePrice();'>";
	//var countries = fGetCountries();
	countries.each(function(element){
		country_out += "<option value='" + element.id + "'>" + element.label + "</option>";
	});
	country_out += '</select>';
	$('country_list').innerHTML = country_out;
	//Subscription list
	var subscription_out = "<select  id='subscription_select' size='1' onchange='fComputePrice();'>";
	//var subscriptions = fGetSubscription();
	subscriptions.each(function(element){
		subscription_out += "<option value='" + element.id + "'>" + element.label + "</option>";
	});
	subscription_out += '</select>';
	$('subscription_list').innerHTML = subscription_out;
		
	fComputePrice();
});
	
function rechargerLangue () {
	var langue = this.id;
	$('langue_choisie').value = langue;
	$('formulaire_langue').action = window.location.href;
	$('formulaire_langue').submit();
};

function showPopUp() {
	$('popup').style.display = 'block';
	$('popup_contenu').innerHTML = $('popup-data3').innerHTML;
	centrerPopup();
}

function oublie_mdp(){
	$('popup').style.display = 'block';
	$('popup_contenu').innerHTML = $('popup-data2').innerHTML;
	$('email_oubli').value = $('client_email').value;
	centrerPopup();
}

function envoi_requete(){
	var my_req = new Request({
		method: 'post',
		url: 'home.php?action=interface/oubli_mdp',
		data : $('formulaire_oubli'),
		onSuccess: function(html) {
			$('popup_contenu').innerHTML = html;
		}
	});
	my_req.send();
}

function previsu_tourisme() {
	window.open('home.php?action=etab/previsualisation&id=1');
}
function previsu_hebergement() {
	window.open('home.php?action=etab/previsualisation&id=2');
}


// FOOTER

var MentionsLegales_window = null;
var CGV_window = null;
var CharteModeration_window = null;
var indexFAQ_window = null;

function showMentionsLegales(){
	if (MentionsLegales_window && !MentionsLegales_window.closed) 
		MentionsLegales_window.focus();
	else {
		MentionsLegales_window = window.open("home.php?action=statiques/afficher&id_page=9","MentionsLegales","menubar=no,status=no,resizable=yes,scrollbars=yes, width=600,height=500");
	}
};//showMentionsLegales

function showCGV(){
	if (CGV_window && !CGV_window.closed) 
		CGV_window.focus();
	else {
		CGV_window = window.open("home.php?action=statiques/afficher&id_page=10","CGV","menubar=no,status=no,resizable=yes,scrollbars=yes, width=600,height=500");
	}
};//showCGV

function showCharteModeration(){
	if (CharteModeration_window && !CharteModeration_window.closed) 
		CharteModeration_window.focus();
	else {
		CharteModeration_window = window.open("home.php?action=statiques/afficher&id_page=11","CharteModeration","menubar=no,status=no,resizable=yes,scrollbars=yes, width=600,height=500");
	}
};//showCharteModeration

function showFAQ(){
	if (indexFAQ_window && !indexFAQ_window.closed) 
		indexFAQ_window.focus();
	else {
		indexFAQ_window = window.open("home.php?action=statiques/afficher&id_page=12","showFAQ","menubar=no,status=no,resizable=yes,scrollbars=yes, width=600,height=500");
	}
};//showFAQ