
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}
	function popUp(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=780,height=507,left = 100,top = 90.5');");
	}
	
	
	var aIds = Array( 'pg_f0c3a917c8' );
function ChangePage( to_hide, to_show )
{
   var tbl_hide = document.getElementById( aIds[to_hide] );
   var tbl_show = document.getElementById( aIds[to_show] );

   if ( typeof(tbl_hide)=='object' && tbl_hide!=null )
    if ( typeof(tbl_show)=='object' && tbl_show!=null )
    {
       tbl_hide.style.display = 'none';
       tbl_show.style.display = '';
    }
}
function CheckLeapYear( id )
{
   var aDaysNum = Array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
   var id_cut   = id.substr( 6, id.length-6 );
   var day_sel   = document.getElementById( 'fld_d_' + id_cut );
   var month_sel = document.getElementById( 'fld_m_' + id_cut );
   var year_sel  = document.getElementById( 'fld_y_' + id_cut );

   if ( typeof(day_sel)=='object' && day_sel!=null )
    if ( typeof(month_sel)=='object' && month_sel!=null )
     if ( typeof(year_sel)=='object' && year_sel!=null )
     {
        if ( month_sel.selectedIndex==1 )
        {
          if ( year_sel.value % 400==0 || (year_sel.value % 100!=0 && year_sel.value % 4==0) ) aDaysNum[1] = 29;
        }
        var day_sel_ix = day_sel.selectedIndex;
        day_sel.options.length = 0;

        for ( i=1; i<=aDaysNum[month_sel.selectedIndex]; i++ )
        {
           if ( document.createElement )
           {
              var newOpt = document.createElement( "OPTION" );
              newOpt.text = i;
              newOpt.value = i;
              ( day_sel.options.add ) ? day_sel.options.add(newOpt) : day_sel.add(newOpt, null);
           }
           else
           {
              day_sel.options[i-1] = new Option( i, i, false, false );
           }
        }
        if ( day_sel.options.length < (day_sel_ix+1) )
           day_sel.selectedIndex = day_sel.options.length-1;
        else day_sel.selectedIndex = day_sel_ix;
     }
}
function NumbersOnly( old_res, id, field_title )
{
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
      {
         var re = /^[0-9]+$/;
         if (el.value.search(re) == -1 )
         {
            alert( '"' + field_title + '" must be a number' );
            return 1;
         }
      }
   }
   return 0;
}
function LettersOnly( old_res, id, field_title )
{
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
      {
         var re = /^[a-zA-Z\s]+$/;
         if (el.value.search(re) == -1 )
         {
            alert( '"' + field_title + '" must contain letters only' );
            return 1;
         }
      }
   }
   return 0;
}
function FromToChars( old_res, id, field_title, from, to )
{
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
        if ( el.value.length < from || el.value.length > to )
        {
           alert( 'Field "'+field_title+'" length should be between '+from+' and '+to+' chars' );
           return 1;
        }
   }
   return 0;
}
function Email( old_res, id, field_title )
{ // test
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
      {
         var re = /^[a-zA-Z0-9_\.\-]+@([a-zA-Z0-9][a-zA-Z0-9-]+\.)+[a-zA-Z]{2,4}$/;

         if (el.value.search(re) != -1 )  return 0;
         else
         {
            alert( '"'+field_title+'" must be email' );
            return 1;
         }
      }
   }
   return 0;
}

function NotEmpty( old_res, id, field_title )
{
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
        if ( el.value=='' )
        {
           alert( 'You should fill "' + field_title + '"' );
           return 1;
        }
   }
   return 0;
}

function CheckPagef0c3a917c8()
{
   var nResult = 0;
   nResult += NumbersOnly( nResult, 'fld_aabbcba3e5','Number of Days' );
   nResult += LettersOnly( nResult, 'fld_a1eee7a7ff','First Name' );
   nResult += LettersOnly( nResult, 'fld_7bcdd3f336','Last Name' );
   nResult += FromToChars( nResult, 'fld_bf17f75514','City',0,20 );
   nResult += FromToChars( nResult, 'fld_4ad9140621','State/Province',0,20 );
   nResult += FromToChars( nResult, 'fld_7ce21e2ca9','Zip Code',0,10 );
   nResult += FromToChars( nResult, 'fld_96d1be6a1d','Work',0,15 );
   nResult += FromToChars( nResult, 'fld_de9e10e6f4','Home',0,15 );
   nResult += Email( nResult, 'fld_322a8ad6fe','Email Address' );
   nResult += FromToChars( nResult, 'fld_cb4836fad0','Questions:',0,125 );

   if ( nResult == 0 )
   {
      if (1)
      {
         var el = document.getElementById( 'frm_2596e875e9' );
         if ( typeof(el)=='object' && el != null ) el.submit();
      }
      else ChangePage( 0, 1 );
   }
}

function CheckPage2f9713cc56()
{
   var nResult = 0;
   nResult += NumbersOnly( nResult, 'fld_945e899e5f','No. of People' );
   nResult += NotEmpty( nResult, 'fld_2bac6855d9','Pick-up Hour' );
   nResult += Email( nResult, 'fld_b4139ce8d5','E-mail' );
   nResult += Email( nResult, 'fld_2cd4fc2878','Reenter e-mail' );

   if ( nResult == 0 )
   {
      if (1)
      {
         var el = document.getElementById( 'frm_4e0c8078f6' );
         if ( typeof(el)=='object' && el != null ) el.submit();
      }
      else ChangePage( 0, 1 );
   }
}

function CheckPage9dcdd7e6c8()
{
   var nResult = 0;
   nResult += NumbersOnly( nResult, 'fld_0aa619453e','No. of People' );
   nResult += NotEmpty( nResult, 'fld_85a07379eb','Pick-up Hour' );
   nResult += Email( nResult, 'fld_e66eb39f30','E-mail' );
   nResult += Email( nResult, 'fld_ef6d396d72','Reenter e-mail' );

   if ( nResult == 0 )
   {
      if (1)
      {
         var el = document.getElementById( 'frm_0c8adc0830' );
         if ( typeof(el)=='object' && el != null ) el.submit();
      }
      else ChangePage( 0, 1 );
   }
}
function CheckPage79ed7f9683()
{
   var nResult = 0;
   nResult += NotEmpty( nResult, 'fld_1c58e14a5f','Pick-up Hour' );
   nResult += Email( nResult, 'fld_34fed36397','E-mail' );
   nResult += Email( nResult, 'fld_9e58d405d2','Reenter e-mail' );

   if ( nResult == 0 )
   {
      if (1)
      {
         var el = document.getElementById( 'frm_6e746de839' );
         if ( typeof(el)=='object' && el != null ) el.submit();
      }
      else ChangePage( 0, 1 );
   }
}
