// JavaScript Document
if (parent.location.href == self.location.href) {
    if (window.location.href.replace)
        window.location.replace('/index/');
    else
        // causes problems with back button, but works
        window.location.href = '/index/';
} 


function updateform(){
	// check if there is already something selected
	if (document.forms[0].Day1.selectedIndex > 0 || document.forms[0].Month1.selectedIndex > 0) {
		return 0
	} 

	var dt = new Date() 

	// set day, month, year to today's real values
	var Day = dt.getDate()
	var Month = dt.getMonth() + 1 
	var Year = dt.getFullYear()

	// set day1, month1, year1 to a real date about 1 month later
	var Day1 = Day
	var Month1 = Month + 1
	var Year1 = Year
	if(Day1 > 28) {
		Day1 = 28
	}
	if(Month1 > 12) {
		Month1 = Month1 - 12
		Year1 = Year1 + 1
	}

	// set day2, month2, year2 to a real date about 5 month later
	var Day2 = Day
	var Month2 = Month + 5
	var Year2 = Year
	if(Day2 > 28) {
		Day2 = 28
	}
	if(Month2 > 12) {
		Month2 = Month2 - 12
		Year2 = Year2 + 1
	}

	// set select-indices
	document.forms[0].Day1.selectedIndex = Day1 - 1
	document.forms[0].Day2.selectedIndex = Day2 - 1
	document.forms[0].Month1.selectedIndex = Month1 - 1 
	document.forms[0].Month2.selectedIndex = Month2 - 1
	document.forms[0].Year1.selectedIndex = Year1 - 2007
	document.forms[0].Year2.selectedIndex = Year2 - 2007
}


function submitform()
{
if (document.cruiseform.nshp.value=='Any'){
	document.cruiseform.Area.value='Anywhere'
	document.cruiseform.action='http://www.brandedcruise.com/cruise-specialist/CruisesQuickQuery.asp?client=ginn'	
}	
document.cruiseform.submit();
}
