// JavaScript Document

// Functions for advanced search page

// Toggle Plant fields
function setPlantState() {
	if (document.form1.bPlant.checked) {
		document.form1.sBloomColorId.disabled = false;
		document.form1.sBloomPeriodId.disabled = false;
	} else {
		document.form1.sBloomColorId.value = "";
		document.form1.sBloomPeriodId.value = "";
		document.form1.sBloomColorId.disabled = true;
		document.form1.sBloomPeriodId.disabled = true;
	}
}

// Toggle animal fields
function setAnimalState() {
	if (document.form1.bAnimal.checked) {
		document.form1.sLakeCountyResidencyId.disabled = false;
	} else {
		document.form1.sLakeCountyResidencyId.value = "";
		document.form1.sLakeCountyResidencyId.disabled = true;
	}
}

// Open window
function openWin(mypage,myname,w,h,features) {
	if (screen.width) {
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
	} else {
		winl = 0;
		wint = 0; 
	}
	if (winl < 0) {
		winl = 0;
	}
	if (wint < 0) {
		wint = 0;
	}
	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += features;
	win = window.open(mypage,myname,settings);
	win.window.focus();
}