/*
**************************************************************************
ResortSearchForm.js
JS Functions used on the Resort Search Form
**************************************************************************
*/
/*function Load()
	{
	frm = document.basic;
	//document.getElementById('quicksearch').style.display ='block';
    //document.getElementById('advsearch').style.display ='none';
	}*/

function checkRequests(){
var strRequestMessage;
var intRequestCount;
var intCounter;
	
	/*
		strRequestMessage = "U kunt maximaal 6 wensen aangeven";
		intRequestCount = 0
	for(intCounter =1;intCounter <13;intCounter++)
	{
		strCurrentField = "chkPref" + intCounter; 
		if (document.basic(strCurrentField).checked==true)
			intRequestCount++;
	}
		if (intRequestCount > 6)
		
				alert(strRequestMessage);*/
	}
	
function Warn(url)
	{
	msg = "M\xF6chten Sie diese Buchung annulieren?";
	if (confirm(msg))
		{
		document.location.href = url;
		}
	else
		{
		return false;	
		}
	}

function submitForm()
{  
// Hide the code in first div tag  
//	document.getElementById('formDiv').style.display = 'none';  
// Display code in second div tag  
//	document.getElementById('pleaseWaitDiv').style.display = 'block'; 
var intparty = 	(parseInt(document.basic.adults.value) + parseInt(document.basic.children.value) + parseInt(document.basic.infants.value));
var intpets = 	(parseInt(document.basic.pets.value))
var d = new Date();//Get today's date
var dd = d.getDate();//This is the day
var mm = (d.getMonth() + 1);//This is the month (javascript uses 0 - 11)
var yy = d.getYear();//This is the year
var tyy = document.basic.arrivalYear.value;
var tmm = document.basic.arrivalMonth.value;
var tdd = document.basic.arrivalDate.value;
var startDate = new Date();//Create a new year variable to test minimum number of days a booking can be made.
startDate.setMonth(document.basic.arrivalMonth.value - 1);// Remember Javascript uses 0 - 11
startDate.setDate(document.basic.arrivalDate.value);
startDate.setYear(document.basic.arrivalYear.value);
var ONE_DAY = 1000 * 60 * 60 * 24 ;// Converts milliseconds into days
var dz = ((startDate)-(d));
var dzdiff = (dz/ONE_DAY);
var dzmess = ("Last Minute Angebote k\xF6önnen nicht online gebucht werden.\n"+
	          "Bitte kontaktieren Sie unsere Beraterinnen unter 052 646 01 01.")
if (dd < 10)
	   {
	    dd = "0" + dd;
	   }
if (mm < 10)
	   {
	    mm = "0" + mm;
	   }	
if (intparty >8)
  {alert ("Es sind maximal 8 Personen zugelassen. Bitte passen Sie Ihre Suchkriterien an.");
   return false;
  }
if (document.basic.region.value == 0)
  {alert("Bitte w\xE4hlen Sie ein Land / eine Region.");
  return false;
	}
else
	{
	if ((tyy == yy)&&(tmm < mm))
	   {alert ("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
		return false;	   
	    }
  	else
	if ((tyy == yy)&&(tmm == mm)&&(tdd <= dd))
	   {alert ("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
		return false;
		} 
	 else
	 if ((tyy == yy)&&(tmm >10))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if ((tyy != yy)&&(tmm < 3))
		{
	   alert("Bitte geben Sie ein gültiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if ((tyy != yy)&&(tmm > 10))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if (dzdiff <= 7)
	   {alert (dzmess);
	   return false;
	   }
	else{
	/*document.basic.arrivalDate.value = document.basic.ResortDate.value.substr(0, 2)
    document.basic.arrivalMonth.value = document.basic.ResortDate.value.substr(3, 2)
	document.basic.arrivalYear.value = document.basic.ResortDate.value.substr(6, 4)*/
	document.basic.submit();
		}
	}
}

function submitFormAdv()
{  
// Hide the code in first div tag  
//	document.getElementById('formDiv').style.display = 'none';  
// Display code in second div tag  
//	document.getElementById('pleaseWaitDiv').style.display = 'block'; 
var intparty = 	(parseInt(document.basic.adults.value) + parseInt(document.basic.children.value) + parseInt(document.basic.infants.value));
var intpets = 	(parseInt(document.basic.pets.value))
var d = new Date();//Get today's date
var dd = d.getDate();//This is the day
var mm = (d.getMonth() + 1);//This is the month (javascript uses 0 - 11)
var yy = d.getYear();//This is the year
var tyy = document.basic.arrivalYear.value;
var tmm = document.basic.arrivalMonth.value;
var tdd = document.basic.arrivalDate.value;
var startDate = new Date();//Create a new year variable to test minimum number of days a booking can be made.
startDate.setMonth(document.basic.arrivalMonth.value - 1);// Remember Javascript uses 0 - 11
startDate.setDate(document.basic.arrivalDate.value);
startDate.setYear(document.basic.arrivalYear.value);
var ONE_DAY = 1000 * 60 * 60 * 24 ;// Converts milliseconds into days
var dz = ((startDate)-(d));
var dzdiff = (dz/ONE_DAY);
var dzmess = ("Last Minute Angebote k\xF6nnen nicht online gebucht werden.\n"+
	          "Bitte kontaktieren Sie unsere Beraterinnen unter 052 646 01 01.")
if (dd < 10)
	   {
	    dd = "0" + dd;
	   }
if (mm < 10)
	   {
	    mm = "0" + mm;
	   }	
if (intparty >8)
  {alert ("Es sind maximal 8 Personen zugelassen. Bitte passen Sie Ihre Suchkriterien an.");
   return false;
  }
if (document.basic.region.value == 0)
  {alert("Das folgende Feld haben Sie nicht korrekt ausgef\xFCllt:\n Land/Region");
  return false;
	}
else
	{
	if ((tyy == yy)&&(tmm < mm))
	   {alert ("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
		return false;	   
	    }
  	else
	if ((tyy == yy)&&(tmm == mm)&&(tdd <= dd))
	   {alert ("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
		return false;
		} 
	 else
	 if ((tyy == yy)&&(tmm >10))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ankünfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if ((tyy != yy)&&(tmm < 3))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if ((tyy != yy)&&(tmm > 10))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if (dzdiff <= 7)
	   {alert (dzmess);
	   return false;
	   }
	else{
	/*document.basic.arrivalDate.value = document.basic.ResortDate.value.substr(0, 2)
    document.basic.arrivalMonth.value = document.basic.ResortDate.value.substr(3, 2)
	document.basic.arrivalYear.value = document.basic.ResortDate.value.substr(6, 4)*/
	document.basic.submit();
		}
	}
}

function submitAmendSearch()
{  
// Hide the code in first div tag  
//	document.getElementById('formDiv').style.display = 'none';  
// Display code in second div tag  
//	document.getElementById('pleaseWaitDiv').style.display = 'block'; 
var d = new Date();//Get today's date
var dd = d.getDate();//This is the day
var mm = (d.getMonth() + 1);//This is the month (javascript uses 0 - 11)
var yy = d.getYear();//This is the year
var tyy = document.basic.arrivalYear.value;
var tmm = document.basic.arrivalMonth.value;
var tdd = document.basic.arrivalDate.value;
var startDate = new Date();//Create a new year variable to test minimum number of days a booking can be made.
startDate.setMonth(document.basic.arrivalMonth.value - 1);// Remember Javascript uses 0 - 11
startDate.setDate(document.basic.arrivalDate.value);
startDate.setYear(document.basic.arrivalYear.value);
var ONE_DAY = 1000 * 60 * 60 * 24 ;// Converts milliseconds into days
var dz = ((startDate)-(d));
var dzdiff = (dz/ONE_DAY);
var dzmess = ("Last Minute Angebote k\xF6nnen nicht online gebucht werden.\n"+
	          "Bitte kontaktieren Sie unsere Beraterinnen unter 052 646 01 01.")
if (dd < 10)
	   {
	    dd = "0" + dd;
	   }
if (mm < 10)
	   {
	    mm = "0" + mm;
	   }	
if (document.basic.region.value == 0)
  {alert("Das folgende Feld haben Sie nicht korrekt ausgef\xFCllt:\n Land/Region");
  return false;
	}
else
	{
	if ((tyy == yy)&&(tmm < mm))
	   {alert ("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an.");
		return false;	   
	    }
  	else
	if ((tyy == yy)&&(tmm == mm)&&(tdd <= dd))
	   {alert ("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an.");
		return false;
		} 
	 else
	 if ((tyy == yy)&&(tmm >10))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if ((tyy != yy)&&(tmm < 3))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if ((tyy != yy)&&(tmm > 10))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if (dzdiff <= 7)
	   {alert (dzmess);
	   return false;
	   }
	else
	if (document.basic.nights > 21)
	   {
	   alert ("Online k\xF6nnen Sie maximal 21 N\xE4chte buchen. \nF\xFCr eine l\xE4ngere Reisezeit rufen Sie uns bitte an. Tel. 052 / 646 01 01");
	   }
	else{
	/*document.basic.arrivalDate.value = document.basic.ResortDate.value.substr(0, 2)
    document.basic.arrivalMonth.value = document.basic.ResortDate.value.substr(3, 2)
	document.basic.arrivalYear.value = document.basic.ResortDate.value.substr(6, 4)*/
	document.basic.submit();
		}
	}
}

function submitForm2()
{  
// Hide the code in first div tag  
//	document.getElementById('formDiv').style.display = 'none';  
// Display code in second div tag  

//	document.getElementById('pleaseWaitDiv').style.display = 'block'; 
var intparty = 	(parseInt(document.basic2.adults.value) + parseInt(document.basic2.children.value) + parseInt(document.basic2.infants.value));
var d = new Date();//Get today's date
var dd = d.getDate();//This is the day
var mm = (d.getMonth() + 1);//This is the month (javascript uses 0 - 11)
var yy = d.getYear();//This is the year
var tyy = document.basic2.arrivalYear.value;
var tmm = document.basic2.arrivalMonth.value;
var tdd = document.basic2.arrivalDate.value;
var startDate = new Date();//Create a new year variable to test minimum number of days a booking can be made.
startDate.setMonth(document.basic2.arrivalMonth.value - 1);// Remember Javascript uses 0 - 11
startDate.setDate(document.basic2.arrivalDate.value);
startDate.setYear(document.basic2.arrivalYear.value);
var ONE_DAY = 1000 * 60 * 60 * 24 ;// Converts milliseconds into days
var dz = ((startDate)-(d));
var dzdiff = (dz/ONE_DAY);
var dzmess = ("Last Minute Angebote k\xF6nnen nicht online gebucht werden.\n"+
	          "Bitte kontaktieren Sie unsere Beraterinnen unter 052 646 01 01.")
if (dd < 10)
	   {
	    dd = "0" + dd;
	   }
if (mm < 10)
	   {
	    mm = "0" + mm;
	   }	
if (intparty >8)
  {alert ("Es sind maximal 8 Personen zugelassen. Bitte passen Sie Ihre Suchkriterien an.");
   return false;
  }
if (document.basic2.region.value == 0)
  {alert("Das folgende Feld haben Sie nicht korrekt ausgef\xFCllt:\n Land/Region");
  return false;
	}
else
	{
	if ((tyy == yy)&&(tmm < mm))
	   {alert ("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
		return false;	   
	    }
  	else
	if ((tyy == yy)&&(tmm == mm)&&(tdd <= dd))
	   {alert ("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
		return false;
		} 
	 else
	 if ((tyy == yy)&&(tmm >10))
		{
	   alert("Bitte geben Sie ein g\xFCltiges Ankunftsdatum an (Ank\xFCnfte m\xF6glich vom 15/03/2008 bis zum 15/11/2008)");
       return false;
		}
	else
	if (dzdiff <= 7)
	   {alert (dzmess);
	   return false;
	   }
	else{
	/*document.basic2.arrivalDate.value = document.basic2.ResortDate.value.substr(0, 2)
    document.basic2.arrivalMonth.value = document.basic2.ResortDate.value.substr(3, 2)
	document.basic2.arrivalYear.value = document.basic2.ResortDate.value.substr(6, 4)*/
	document.basic2.submit();
		}
	}
}


function SwapAdvance()
{  
// Hide the code in first div tag
document.getElementById('quicksearch').style.display ='none';
document.getElementById('advsearch').style.display ='block';
/*document.QuickSearchAccomm.traveloption[0].checked = false; //flight
document.QuickSearchAccomm.traveloption[1].checked = true; //accom

}
function divSwapFlt()
{  
// Hide the code in first div tag
document.getElementById('flightaccom').style.display ='block';
document.getElementById('accomonly').style.display ='none';
document.basic2.traveloption[0].checked = true; //flight
document.basic2.traveloption[1].checked = false; //accom
}*/
}
function popurl(url, w, h)
{
	if (w==0)
	{
	  w = 800; //default width
	}
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+ w + ',height=' + h +'');
	self.name = "mainWin";
	sealWin.focus()
}

function SetAccom()
{
var intpets = 	(parseInt(document.basic.pets.value))
if (intpets > 0)
	{alert("Haustiere sind im Caravan nicht zugelassen. Bitte passen Sie Ihre Suchkriterien an.");
	}
}

function SetAccomT()
{
var intparty = 	(parseInt(document.basic.adults.value) + parseInt(document.basic.children.value) + parseInt(document.basic.infants.value));
if (intparty > 6)
	{alert("Im Zelt sind je nach Campingplatz maximal 5-6 Personen erlaubt (s. Platz-Details)");
	}
}


