function land(url) {
window.location = url;
}

function totalService() {
	//Find the foundation Sun Data and populate the local form elements...
	if (calcSun(riseSetCalc, cityLatLong, cityLatLong.dayAns.selectedIndex, cityLatLong.cities.selectedIndex)){ 

	//Set up any derivative information 
	deriveInfo();
	
	//Pass along the form variables to the display page...
	passInfoToParent();
	
	//overwrite the preference cookie on the client's browser
	var nextYear = new Date();
	nextYear.setFullYear(nextYear.getFullYear()+1);
	document.cookie = "PlanetHoursLocation="+escape(cityLatLong.cities[cityLatLong.cities.selectedIndex].value)+"; expires="+nextYear+";" 

	//Change the focus to the main page...atavism from earlier pop and response schema
	//window.focus();
	
	//calculate(); //simple moon info...
	}
}




function partialService() {
	//Find the foundation Sun Data and populate the local form elements only -- but keep the focus local
	//in case the user wants to make several changes before losing the pop-up.
	calcSun(riseSetCalc, cityLatLong, cityLatLong.dayAns.selectedIndex, cityLatLong.cities.selectedIndex);

	//Set up any derivative information 
	deriveInfo();
}

function deriveInfo() {
	riseSetCalc["mDayTotal"].value = ((riseSetCalc["jDayEnd"].value - riseSetCalc["jDayRise"].value)*1440) + (riseSetCalc["nextSunriseMin"].value - riseSetCalc["sunriseMin"].value);
	riseSetCalc["lightMinTotal"].value = ((riseSetCalc["jDaySet"].value - riseSetCalc["jDayRise"].value)*1440) + (riseSetCalc["sunsetMin"].value - riseSetCalc["sunriseMin"].value);
	riseSetCalc["darkMinTotal"].value = ((riseSetCalc["jDayEnd"].value - riseSetCalc["jDaySet"].value)*1440) + (riseSetCalc["nextSunriseMin"].value - riseSetCalc["sunsetMin"].value);
	riseSetCalc["lightHourMin"].value = (riseSetCalc["lightMinTotal"].value / 12);
	riseSetCalc["darkHourMin"].value = (riseSetCalc["darkMinTotal"].value / 12);
	riseSetCalc["eDayTotal"].value = timeStringLong(riseSetCalc["mDayTotal"].value * 1);
	riseSetCalc["eLightTotal"].value = timeStringLong(riseSetCalc["lightMinTotal"].value * 1);
	riseSetCalc["eDarkTotal"].value = timeStringLong(riseSetCalc["darkMinTotal"].value * 1);
	riseSetCalc["eLightHour"].value = timeStringLong(riseSetCalc["lightHourMin"].value * 1);
	riseSetCalc["eDarkHour"].value = timeStringLong(riseSetCalc["darkHourMin"].value * 1);
}

function passInfoToParent() {
	window.form.passFlag.value		= "yes";
	window.form.cities.value 		= cityLatLong.cities[cityLatLong.cities.selectedIndex].value;
	window.form.latDeg.value 		= cityLatLong.latDeg.value;
	window.form.latMin.value 		= cityLatLong.latMin.value; 
	window.form.latSec.value 		= cityLatLong.latSec.value;
	window.form.lonDeg.value 		= cityLatLong.lonDeg.value;
	window.form.lonMin.value 		= cityLatLong.lonMin.value;
	window.form.lonSec.value 		= cityLatLong.lonSec.value;
	window.form.dateInquiry.value 		= riseSetCalc.dateInquiry.value;
	window.form.jDayInquiry.value 		= riseSetCalc.jDayInquiry.value;
	window.form.jDayRise.value 		= riseSetCalc.jDayRise.value;
	window.form.jDaySet.value 		= riseSetCalc.jDaySet.value;
	window.form.jDayEnd.value 		= riseSetCalc.jDayEnd.value;
	window.form.dayNameInquiry.value 	= riseSetCalc.dayNameInquiry.value;
	window.form.dayNameRise.value 		= riseSetCalc.dayNameRise.value;
	window.form.dayNameSet.value 		= riseSetCalc.dayNameSet.value;
	window.form.dayNameEnd.value 		= riseSetCalc.dayNameEnd.value;
	window.form.dateRise.value 		= riseSetCalc.dateRise.value;
	window.form.dateSet.value 		= riseSetCalc.dateSet.value;
	window.form.dateEnd.value 		= riseSetCalc.dateEnd.value;
	window.form.sunrise.value 		= riseSetCalc.sunrise.value;
	window.form.sunset.value 		= riseSetCalc.sunset.value;
	window.form.nextSunrise.value 		= riseSetCalc.nextSunrise.value;
	window.form.sunriseMin.value 		= riseSetCalc.sunriseMin.value;
	window.form.sunsetMin.value 		= riseSetCalc.sunsetMin.value;
	window.form.nextSunriseMin.value		= riseSetCalc.nextSunriseMin.value;
	window.form.lightMinTotal.value 		= riseSetCalc.lightMinTotal.value;
	window.form.lightHourMin.value 		= riseSetCalc.lightHourMin.value;
	window.form.darkMinTotal.value 		= riseSetCalc.darkMinTotal.value;
	window.form.darkHourMin.value 		= riseSetCalc.darkHourMin.value;
	window.form.eDayTotal.value 		= riseSetCalc.eDayTotal.value;
	window.form.eLightTotal.value 		= riseSetCalc.eLightTotal.value;
	window.form.eDarkTotal.value 		= riseSetCalc.eDarkTotal.value;
	window.form.eLightHour.value 		= riseSetCalc.eLightHour.value;
	window.form.eDarkHour.value 		= riseSetCalc.eDarkHour.value;
	window.showInfo();
}
