/* Author: Tim Sassen            					*/
/* Date Created 27-11-2008 					*/
/* Evaluates which page to direct to and returns correct*/
 /*querystring 							*/
 
var strACTIVITYSUMMARY = "activitycontinents.asp";
var strDESINATIONSUMMARY = "destinationinfo.asp";
var strSMALLSUMMARY = "reisaanbod_new.asp";
var strACTIVITYVARIABLE = "ActivityType";
var strDESINATIONVARIABLE = "DestinationID";
var querystring = null;
var teststring;


function EvaluateRedirectSearchForm(Day,Month,Year,Difference,ActivityType,Destination)
{
	var day = (Day != null && Day != "" && Day.value != "-1") ? Day.value : null ;
	var month = (Month != null && Month != "" && Month.value != "-1") ? Month.value : null ;
	var year = (Year != null && Year != "" && Year.value != "-1") ? Year.value : null ;
	var difference = (Difference != null && Difference != "" && Difference.value != "-1") ? Difference.value : null ;
	var activitytype = (ActivityType != null && ActivityType != "" && ActivityType.value != "-1") ? ActivityType.value : null ;
	var destination = (Destination != null && Destination != "" && Destination.value != "-1") ? Destination.value : null ;

	if(day != null || month!=null || year!=null)
	{
		querystring = strSMALLSUMMARY
	}
	else
	{
		if(activitytype!=null && destination!=null)
		{
			//beide 
			querystring = strDESINATIONSUMMARY+'?'+strDESINATIONVARIABLE+'='+destination+'&'+strACTIVITYVARIABLE+'='+activitytype;
		}
		else
		{
			if(activitytype!=null && destination==null)
			{
				//alleen activitytype
				querystring = strACTIVITYSUMMARY+'?'+strACTIVITYVARIABLE+'='+activitytype;
			}
			if(activitytype==null && destination!=null)
			{
				//alleeen dest
				querystring = strDESINATIONSUMMARY+'?'+strDESINATIONVARIABLE+'='+destination;
			}
			if(activitytype==null && destination==null)
			{
				return null;
			}
		}
	}
	return querystring;
}

function SubmitReisZoeker(form, page, clear)
{
	if(form != null && page != null)
	{
		if(clear != null && clear)
		{
			window.location = page+"?clear=1";
		}else{
			form.action = page;
			form.submit();
		}
	}
}

/*

function EvaluateRedirectSearchForm(Day,Month,Year,Difference,ActivityType,Destination)
{
	var day = (Day != null && Day != "" && Day.value != "-1") ? Day.value : null ;
	var month = (Month != null && Month != "" && Month.value != "-1") ? Month.value : null ;
	var year = (Year != null && Year != "" && Year.value != "-1") ? Year.value : null ;
	var difference = (Difference != null && Difference != "" && Difference.value != "-1") ? Difference.value : null ;
	var ActivityType = (ActivityType != null && ActivityType != "" && ActivityType.value != "-1") ? ActivityType.value : null ;
	var Destination = (Destination != null && Destination != "" && Destination.value != "-1") ? Destination.value : null ;

	//alleen activitytype
	querystring = strSMALLSUMMARY+"?";
	querystring += (day != null) ? ("&day="+day) : "" ;
	querystring += (month != null) ? "&month="+month : "" ;
	querystring += (year != null) ? "&year="+year : "" ;
	querystring += (difference != null) ? "&dif="+difference : "" ;
	querystring += (ActivityType != null) ? "&ActivityType="+ActivityType : "" ;
	querystring += (Destination != null) ? "&Destination="+Destination : "" ;
			
	return querystring;
	//alert( querystring);
}
*/