﻿function win() {

var newWin;

newWin=window.open("http://segway.com/build/main.htm","VIDEO","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=1000,height=620,left=50,top=50");
return;

}

function winFoto(url) { //v2.0
	window.open(url,'FOTO','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=440,height=520,left=150,top=150')
}

function winMap(url) { //v2.0
	window.open(url,'TOUR','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=690,height=370,left=150,top=150')
}

//set todays date
Now = new Date();
NowDay = Now.getDate();
NowMonth = Now.getMonth();
NowYear = Now.getYear();
if (NowYear < 2000) NowYear += 1900; //for Netscape

//function for returning how many days there are in a month including leap years
function DaysInMonth(WhichMonth, WhichYear)
{
  var DaysInMonth = 31;
  if (WhichMonth == "Abril" || WhichMonth == "Junio" || WhichMonth == "Septiembre" || WhichMonth == "Noviembre") DaysInMonth = 30;
  if (WhichMonth == "Febrero" && (WhichYear/4) != Math.floor(WhichYear/4))	DaysInMonth = 28;
  if (WhichMonth == "Febrero" && (WhichYear/4) == Math.floor(WhichYear/4))	DaysInMonth = 29;
  return DaysInMonth;
}

//function to change the available days in a months
function ChangeOptionDays(Which)
{
  DaysObject = eval("document.Form1." + Which + "Day");
  MonthObject = eval("document.Form1." + Which + "Month");
  YearObject = eval("document.Form1." + Which + "Year");

  Month = MonthObject[MonthObject.selectedIndex].text;
  Year = YearObject[YearObject.selectedIndex].text;

  DaysForThisSelection = DaysInMonth(Month, Year);
  CurrentDaysInSelection = DaysObject.length;
  if (CurrentDaysInSelection > DaysForThisSelection)
  {
    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
    {
      DaysObject.options[DaysObject.options.length - 1] = null
    }
  }
  if (DaysForThisSelection > CurrentDaysInSelection)
  {
    for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
    {
      NewOption = new Option(DaysObject.options.length + 1);
      DaysObject.add(NewOption);
    }
  }
    if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
}

//function to set options to today
function SetToToday(Which)
{
  DaysObject = eval("document.Form1." + Which + "Day");
  MonthObject = eval("document.Form1." + Which + "Month");
  YearObject = eval("document.Form1." + Which + "Year");

  YearObject[0].selected = true;
  MonthObject[NowMonth].selected = true;

  ChangeOptionDays(Which);

  DaysObject[NowDay+1].selected = true;
}

//function to write option years plus x
function WriteYearOptions(YearsAhead)
{
  line = "";
  for (i=0; i<YearsAhead; i++)
  {
    line += "<OPTION>";
    line += NowYear + i;
  }
  return line;
}
//  End -->

<!-- hide this script tag's contents from old browsers
function grupoform(form) {

       if (form.PERSONAS.value < 6 || form.PERSONAS.value > 15) {
        alert("Grupos minimo de 6 personas y maximo de 15 personas");
				form.PERSONAS.value="6";
			 }	
       return;
}

//-->
