﻿if(typeof sIFR == "function"){
     /*sIFR.replaceElement(named({sSelector:"h3 span", sFlashSrc:"http://www.sbsstudios.com/wpblog/wp-content/themes/ChesapeakeBayBeachClubNEW_NOV08/swf/baskerville.swf", nPaddingTop:"0", nPaddingBottom:"0", nPaddingLeft:"0", sColor:"#3b180d", sWmode:"transparent"}));
     sIFR.replaceElement(named({sSelector:"h2 span", sFlashSrc:"http://www.sbsstudios.com/wpblog/wp-content/themes/ChesapeakeBayBeachClubNEW_NOV08/swf/valeria.swf", nPaddingTop:"0", nPaddingBottom:"0", nPaddingLeft:"0", sColor:"#005473", sWmode:"transparent"}));
     
     sIFR.replaceElement(named({sSelector:"h2 span", sFlashSrc:"http://www.sbsstudios.com/wpblog/wp-content/themes/ChesapeakeBayBeachClub/swf/scriptina.swf", nPaddingTop:"0", nPaddingBottom:"0", nPaddingLeft:"0", sColor:"#5E2053", sWmode:"transparent"}));  */
     
     sIFR.replaceElement(named({sSelector:"#content h1", sFlashSrc:"http://vsites.vizergy.com/vsitefiles/templates/67/flash/h1.swf", nPaddingTop:"0", nPaddingBottom:"20", nPaddingLeft:"0", sColor:"#0c5fab", sWmode:"transparent"}));    
/*   sIFR.replaceElement(named({sSelector:"h1 span", sFlashSrc:"http://www.sbsstudios.com/wpblog/wp-content/themes/ChesapeakeBayBeachClub/swf/scriptina.swf", nPaddingTop:"0", nPaddingBottom:"0", nPaddingLeft:"0", sColor:"#5E2053", sWmode:"transparent"}));  */
     
};


// DATE FORM STUFF
function initMaritime() {

          var dt = new Date();



     var yr = dt.getFullYear();

     var curYr = dt.getFullYear();

     var mo = dt.getMonth();

     var da = dt.getDate();



     var daysInCurrent = getDaysInMonth(mo, yr);



     if (da + advancedDay > daysInCurrent)

     {    da = ((da+advancedDay) % daysInCurrent);

          if (mo == 11)

          {    mo = 0;

               yr++;     }

          else

          {    mo++;     }    }

     else

     {    da = da + advancedDay;   }

     da--;

     yr-=curYr;

     document.getElementById('month').selectedIndex = mo;

     document.getElementById('day').selectedIndex = da;

     document.getElementById('year').selectedIndex = yr;

     return;}



// SYNXIS stuff

function gotoBooking() {

     var month = document.getElementById('month').value;         

          //alert (month);

     var day = document.getElementById('day').value;        

          //alert (day);

     var year = document.getElementById('year').value;      

          //alert (year);

     var nights = document.getElementById('nights').value;

     nights = parseInt(nights);

     var adults = document.getElementById('adults').value;  

     var kids = document.getElementById('kids').value;
     
     var rooms = document.getElementById('rooms').value;
     
     var promo = document.getElementById('promo').value;
     
     var monthtmp = parseInt(month) + 1;

     var arrive = (monthtmp)  + "/" + day + "/" + year; 

     var departday = day+nights;

     var depart = new Date(year, month, day);

     depart.setDate(depart.getDate() + nights);

     //alert (depart);

     tempdy = depart.getDate();

     ///tempdy = padZero(tempdy);

     tempmo = depart.getMonth();

     tempmo += 1;

     ///tempmo = padZero(tempmo);

     tempyr = depart.getFullYear();

     

     var departtmp = tempmo + "/" + tempdy + "/" + tempyr;

     //alert (departtmp);

     

     

     

     var url = "https://gds.secure-res.com/gc/rez.aspx?Hotel=23658&Chain=6063&start=1&" 

     url += "depart=" + departtmp;

     url += "&arrive=" + arrive;

     url += "&child=" + kids;

     url += "&adult=" + adults;
     
     url += "&rooms=" + rooms;
     
     url += "&promo=" + promo;

      

     window.open(url, '_self', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=1050,height=800');

     return false;

}