$(document).ready(function() {
//appel ajax du carroussel
$.ajax({
type: 'GET',
url: 'RelaisChateaux/hp/ajax_recup_actus.php',
data: '',
success: function(msg){
$('#diapo').html(msg);
// recuperation des variables pour les onglets du slide
var varAeval=$('#nav1').html();
$('#nav1').html('').css('display', 'block');
eval(varAeval);
// cycle
$('#diap').cycle({
fx: 'fade',
speed: 4000,
startingSlide: 0, // zero-based
timeout: 4000,
pager: '#nav1',
delay: -2000,
pagerEvent: 'click',
fastOnEvent: true ,
onPagerEvent: function(idx, slide) {
_gaq.push(['_setCustomVar',4,'clic','Carrousel_ong_'+(idx+1)+'_'+codeGA_slide[idx]+'',1]);
_gaq.push(['_setCustomVar',5,'varComplete','v1_carrousel_pt_marche_am_Carrousel_navig_Carrousel_ong_'+(idx+1)+'_'+codeGA_slide[idx]+'',1]);
_gaq.push(['_trackEvent', 'v1_carrousel_pt', 'Carrousel_navig', 'Carrousel_ong_'+(idx+1)+'_'+codeGA_slide[idx]+'']);
},
pagerAnchorBuilder: function(idx, slide) {
if (idx==(titre_slide.length-1)) {
return '
';
} else {
return '';
}
},
after:function(currSlideElement, nextSlideElement, options, forwardFlag){
$('#'+nextSlideElement.id+' .languette').fadeIn('slow').delay(500);
}
});
}
});
$('#diapo').mouseover(function(){
$('#diap').cycle('pause');
});
$('#diapo').mouseout(function(){
if(stop_cycle_statut==0) $('#diap').cycle('resume');
//$('#diap').cycle('next');
});
/*verifier si pays est deja saisi suite retour navigateur*/
if($('#country').attr('value')>0)
{
$.ajax({ type: 'GET',
url: 'ajax_region.php',
data: 'country='+$('#country').attr('value')+'&lang=de',
success: function(msg){
$('#region').html(msg);
}
});
$('#prop').attr('value',$('#propTrad').attr('value'));
}
//restaurant
if($('#country2').attr('value')>0)
{
$.ajax({ type: 'GET',
url: 'ajax_region.php',
data: 'country='+$('#country2').attr('value')+'&lang=de',
success: function(msg){
$('#region2').html(msg);
}
});
$('#property').attr('value',$('#propertyTrad').attr('value'));
}
/*verifier si dispo est deja cochee suite retour navigateur*/
if($('#verif_dispo').attr('checked') == false)
{
$('#voile').css('display','block');
$('#date_mois').attr('disabled','disabled');
$('#date_jour').attr('disabled','disabled');
$('#date_annee').attr('disabled','disabled');
$('#numberOfNights').attr('disabled','disabled');
$('#numberOfRooms').attr('disabled','disabled');
$('#adults').attr('disabled','disabled');
}
else
{
$('#voile').css('display','none');
$('#date_mois').removeAttr('disabled');
$('#date_jour').removeAttr('disabled');
$('#date_annee').removeAttr('disabled');
$('#numberOfNights').removeAttr('disabled');
$('#numberOfRooms').removeAttr('disabled');
$('#adults').removeAttr('disabled');
}
//modifier tous les liens pour ajouter une fonction de
$('a').click(function (){
var param="parent:id="+$(this).parent().attr('id')+",class="+$(this).parent().attr('class')+";balise:id="+$(this).attr('id')+",class="+$(this).attr('class')+"";
$.ajax({
type: "POST",
url: "RelaisChateaux/hp/ajax_stat_lien.php",
data: "&lien="+$(this).attr('href')+"&pageActu="+$("#pageActuelle").attr('value')+"¶m="+param
});
});
$('body').click(function (){
$('#popinChoix').remove();
});
});
function preg_replace (array_pattern, array_pattern_replace, my_string) {
var new_string = String (my_string);
for (i=0; i=3)
{
texte=no_accent(texte);
var varGET={"cherche": texte, "id":id, "lang":lang, "hotel":hotel};
$.ajax({
url: "RelaisChateaux/hp/ajax_completion_etab.php",
type: "POST",
data: varGET,
dataType: "html",
success: function(msg){
if(msg.length>0)
{
//creer un calque masqué avec une liste et les boutons "+"
if($('#popinChoix').length==0)
$('#content_forms').append('');
//calcul de la position du calque pour le mettre sous le champ
var position=$('#'+id).position();
var posHaute=position.top+$('#'+id).height()+5;
var posGauche=position.left;
$('#popinChoix').css('top', posHaute);
$('#popinChoix').css('left', posGauche-5);
$('#popinChoix').css('width', $('#'+id).width()+20);
// calculer le contenu
$('#popinChoix').html(msg);
//remplir et afficher le calque
$('#popinChoix').css('display', "block");
}
}
});
}
}
/* blocage du cycle du carrousel*/
var stop_cycle_statut=0;
function stop_cycle(){
stop_cycle_statut=1;
$('#diap').cycle('pause');
}
function charge_google_map(structure){
if($('#google-map-iframe').length==0){
if(structure==1){
$('#google-map').append('');
}else{
$('#google-map').append('');
}
}else{
document.getElementById('google-map-iframe').contentWindow.reset();
}
}
function kill_loader_ggmap(){
$('#loader-ggmap').remove();
}