function actuSelectArrivee()
{
  if (document.reservation.PREAGRETOUR.selectedIndex == 0)
  {
    var index = document.reservation.PREAGDEPART.selectedIndex;
    document.reservation.PREAGRETOUR.selectedIndex = index;
  }
}

function reservation_onSubmit()
{
  var s = '';
  for (var i = 0; i < document.forms.reservation.elements.length; i++)
  {
    switch (document.forms.reservation.elements[i].tagName)
    {
      case 'INPUT':
      case 'TEXTAREA':
      case 'HTMLAREA':
        s += document.forms.reservation.elements[i].name + '=' + document.forms.reservation.elements[i].value + '&';
      break;
      case 'SELECT':
        s += document.forms.reservation.elements[i].name + '=' + document.forms.reservation.elements[i].options[document.forms.reservation.elements[i].options.selectedIndex].value + '&';
      break;
    }
  }
  
  largeurPopup = 720;
  hauteurPopup = 480;
  scrollExist = 0;
  toolbarExist = 0;
  menubarExist = 0;
  resizableExist = 0;

  xPositionPopup = Math.round((screen.availWidth / 2) - (largeurPopup / 2));
  yPositionPopup = Math.round((screen.availHeight / 2) - (hauteurPopup / 2));

  location = 'reservation.php?' + s;
  
}

function pop_hiver()
{
  var largeurPopup = 433;
  var hauteurPopup = 380;
  var xPositionPopup = 0; //Math.round((screen.availWidth / 2) - (largeurPopup / 2));
  var yPositionPopup = 0; //Math.round((screen.availHeight / 2) - (hauteurPopup / 2));
  var iAleatoire = 0;
  iAleatoire = Math.round(Math.random()*100)+1; 
    
    /*On multiplie par 100 pour avoir un nombre compris entre 0 et 99 (à cause de Math.floor())
    et on ajoute un (1) pour faire entre 1 et 100, puis on regarde si le nbombre est pair !*/
  // if ((iAleatoire%2) != 1)
  {window.open("popup/offre_week_end.html", "offre_week_end", "top=" + yPositionPopup + ",left=" + xPositionPopup + "resizable=no,scrollbars=no,width=" + largeurPopup + ", height=" + hauteurPopup);}
//  else
//  {window.open("/offre_hiver.asp", "offre_week_end", "top=" + yPositionPopup + ",left=" + xPositionPopup + "resizable=no,scrollbars=no,width=" + largeurPopup + ", height=" + hauteurPopup);}
  
}

function popupMiniSite() 
{
    /*
    windowURL = "/popup/popupMiniSite.asp";
    windowTitle = "popupMiniSite";
    largeurPopup = 720;
    hauteurPopup = 480;
    scrollExist = 0;
    toolbarExist = 0;
    menubarExist = 0;
    resizableExist = 0;

    xPositionPopup = Math.round((screen.availWidth / 2) - (largeurPopup / 2));
    yPositionPopup = Math.round((screen.availHeight / 2) - (hauteurPopup / 2));

    window.open(windowURL, windowTitle,"top=" + yPositionPopup + ",left=" + xPositionPopup + ",width=" + largeurPopup + ",height=" + hauteurPopup + ",scrollbars=" + scrollExist + ",toolbar=" + toolbarExist + ",menubar=" +  menubarExist + ",resizable=" + resizableExist + ",alwaysRaised=yes");
    */

    location = 'reservation/prepay4e9d.html?IATANB=CIT00001';

}

function popupMiniSiteTennis() {
    windowURL = "popup/popupMiniSiteTennis.html";
    windowTitle = "popupMiniSite";
    largeurPopup = 720;
    hauteurPopup = 480;
    scrollExist = 1;
    toolbarExist = 0;
    menubarExist = 0;
    resizableExist = 0;

    xPositionPopup = Math.round((screen.availWidth / 2) - (largeurPopup / 2));
    yPositionPopup = Math.round((screen.availHeight / 2) - (hauteurPopup / 2));

    window.open(windowURL, windowTitle,"top=" + yPositionPopup + ",left=" + xPositionPopup + ",width=" + largeurPopup + ",height=" + hauteurPopup + ",scrollbars=" + scrollExist + ",toolbar=" + toolbarExist + ",menubar=" +  menubarExist + ",resizable=" + resizableExist + ",alwaysRaised=yes");
  }

function contact()
{
    window.open('contact/contact.html','','scrollbars,width=460,height=320')
}
function faq()
{
    window.open('popup/faq.html','','scrollbars,width=460,height=320')
}
function mentions()
{
    window.open('popup/mentions_legales.html','','scrollbars="no",width=460,height=320')
}
function newsletter()
{
    window.open('popup/newsletter.html','','scrollbars=no,width=460,height=320')
}
function popup_condition_fidelite()
{
    window.open('popup/fidelite_condition.html','','scrollbars,width=470,height=470')
}


function openMaporama(ville) {
  url = "http://www.maporama.com/affiliates/resacar_citer/share/Searcharound.asp?VN=DBAFFILIATEID&VV=%7B2D31D39B-ABDD-4E8D-944A-FDF324052C19%7D&_XgoGCAdrCommand=run&COUNTRYCODE=FR&_XgoGCAddress=&Zip=&_XgoGCTownName=" + ville + "&SEARCH_AROUND.x=Show+map";
  window.open(url, 'maporama','resizable=no,scrollbars=1,width=430,height=570');
}
function openMaporama2(ville,cp) {
  url = "http://www.maporama.com/affiliates/resacar_citer/share/Searcharound.asp?VN=DBAFFILIATEID&VV=%7B2D31D39B-ABDD-4E8D-944A-FDF324052C19%7D&_XgoGCAdrCommand=run&COUNTRYCODE=FR&_XgoGCAddress=&Zip=" + cp + "&_XgoGCTownName=" + ville + "&SEARCH_AROUND.x=Show+map";
  window.open(url, 'maporama','resizable=no,scrollbars=1,width=430,height=570');
}

function openMaporama3(ville,cp,adresse)
{
  url = "http://www.maporama.com/affiliates/resacar_citer/share/Searcharound.asp?VN=DBAFFILIATEID&VV=%7B2D31D39B-ABDD-4E8D-944A-FDF324052C19%7D&_XgoGCAdrCommand=run&COUNTRYCODE=FR&_XgoGCAddress="+adresse+"&Zip=" + cp + "&_XgoGCTownName=" + ville + "&SEARCH_AROUND.x=Show+map";
  window.open(url, 'maporama','resizable=no,scrollbars=1,width=430,height=570');
}