//Jumpmenu

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


//Open popup window


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


// Checks the forms for correct input

function checkformcontact ( form )
{
	
         if (form.initialen.value == "") {
        alert( "Vul a.u.b. uw initialen in" );
        form.initialen.focus();
        return false ;
    }
	
         if (form.naam.value == "") {
        alert( "Vul a.u.b. uw naam in" );
        form.naam.focus();
        return false ;
    }

         if (form.adres.value == "") {
        alert( "Vul a.u.b. uw adr4es in" );
        form.adres.focus();
        return false ;
    }
	
	         if (form.postcode.value == "") {
        alert( "Vul a.u.b. uw postcode in" );
        form.postcode.focus();
        return false ;
    }
	
		         if (form.woonplaats.value == "") {
        alert( "Vul a.u.b. uw woonplaats in" );
        form.woonplaats.focus();
        return false ;
    }
			       if (form.telefoonnummer.value == "") {
        alert( "Vul a.u.b. uw telefoonnummer in" );
        form.telefoonnummer.focus();
        return false ;
    }
		
 
	return true ;
}


//Current date in form script
//By Lee Hinder (lee.hinder@ntlworld.com)
//Visit http://javascriptkit.com for this script and more

//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 == "Apr" || WhichMonth == "Jun" || WhichMonth == "Sep" || WhichMonth == "Nov") DaysInMonth = 30;

	if (WhichMonth == "Feb" && (WhichYear/4) != Math.floor(WhichYear/4))	DaysInMonth = 28;

	if (WhichMonth == "Feb" && (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.boekingsform." + Which + "Day");
	MonthObject = eval("document.boekingsform." + Which + "Month");
	YearObject = eval("document.boekingsform." + 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.boekingsform." + Which + "Day");
	MonthObject = eval("document.boekingsform." + Which + "Month");
	YearObject = eval("document.boekingsform." + 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;
}

// Clears the standard text in input boxes and texfields

function alterNate(elm){
	if (!elm.base) elm.base = elm.value
	if (elm.value == elm.base) elm.value = "";
	else if (elm.value == "") elm.value = elm.base;
}



