function oninit(){
  //lienFormSejour();
  $("impt_mail_menu").onkeypress = function(evt){enterNews(evt);};
  if($("flash_vivre-sud")) diapo_vivreSud();
  refreshCal();
}

function enterNews(event){
  if(!event) var event = window.event;
  if(event && event.keyCode==13) envoiMailByAjaxByForm('formNewsletter','div_inscNewsletter',false);
}

function refreshCal(){
  if ($("calendrierMoteurGite")) setCalendrierGeneral("gites26","1","","G","calendrierMoteurGite",clicCalendJs,"date_deb","","","nbj","1","");
}

function clicCalendJs(evt,jour,mois,annee,etat){
  $("date_deb").value=jour+"/"+mois+"/"+annee;
  afficheEffaceCalendJsMenu("calendrierMoteurGite");
}

function afficheEffaceCalendJsMenu(nomDiv){
  if($(nomDiv).showing==true){
    Effect.BlindUp(nomDiv);       
    $(nomDiv).showing=false;
  }
  else{
    Effect.BlindDown(nomDiv);       
    $(nomDiv).showing=true;
  }
}

function lienFormSejour(){
  if($("a_formulairePreResa")) $("a_formulairePreResa").href= "/formulaire-pre-reservation.php?titre="+$("sp_titreIdeeSejour").innerHTML;
}

function afficheForm(form,check){
  $('form_gr').style.display = 'none';
  $('form_ch').style.display = 'none';
  $('form_gegs').style.display = 'none';
  $('form_ca').style.display = 'none';
  
  $(form).style.display = 'block';
  $(check).checked='checked';
}

function afficheInfoBulle(div){
	$(div).style.display="block";
	//$(div).style.left = (parseInt(event.x)+ 5) + "px";
	//$(div).style.top = (parseInt(event.y)- ($(div).scrollHeight + 5)) + "px"; 
}

function masqueInfoBulle(div){
	$(div).style.display="none";
}

function verifDateMoteur(champ, form){
  if(($(champ).value == "")||($(champ).value == "Saisir une date")){
    $(champ).value = 'Saisir une date';
    $(champ).style.color = '#cf1111';
    $(champ).style.fontWeight = 'bold';
  }
  else{
    $(form).submit();
  }
}

function initChampDate(champ){
  $(champ).value = '';
  $(champ).style.color = '';
  $(champ).style.fontWeight = '';
}

function roll_village(lid){
 $(lid).style.background = "#f9f1eb";
}
function roll_theme(lid){
 $(lid).style.background = "#efebff";
}

function rollout_village(lid){
 $(lid).style.background = "#FFFFFF";
}

var bookmarkurl="http://www.gites-de-france-drome.com";
var bookmarktitle="Vacances chez l'habitant dans la Drome, en gites et chambres d'hotes";
function addbookmark(){
 if ( navigator.appName != 'Microsoft Internet Explorer' ){
 window.sidebar.addPanel(bookmarktitle,bookmarkurl,"");
 } else {
 window.external.AddFavorite(bookmarkurl,bookmarktitle);
 }
}

function rollover(id,src){
 var reg = new RegExp(".gif", "g");
 table = src.split(reg);
 $(id).src = table[0]+"_over.gif";
}

function rollout(id,src){
 var reg = new RegExp("_over.gif", "g");
 table = src.split(reg);
 $(id).src = table[0]+".gif";
}

function afficheChalets(){
  document.location.href='/liste?ACC=G&EPI=<1&UNIVERS=partir&CRITINIT';
}

function favoris() {
  if ( navigator.appName != 'Microsoft Internet Explorer' )
  { window.sidebar.addPanel(document.title,"http://www.gites-de-france-drome.com/",""); }
  else { window.external.AddFavorite("http://www.gites-de-france-drome.com/",document.title); } 
}

function changeDistCamp(){
  $("inpt_dist").name = "DIST_"+$("ca_loisirs").value;
  $("inpt_dist").value="1";
}

function diapo_vivreSud(){
  var so = new SWFObject("/config_v3/26/G.v3/GDFv4.FRANCAIS/librairie/flash/diaporama_vivre-sud.swf", "GDF26", "378", "263", "8", "", true);
	so.addParam("wmode", "transparent");
	so.write("flash_vivre-sud");
}