function checkuser(theForm) {
 
while (theForm.course.options[theForm.course.selectedIndex].value == 'empty') {
 	alert("Please select your course");
 	return(false);
 }
 
while (theForm.title.options[theForm.title.selectedIndex].value == 'empty') {
 	alert("Please select your title");
 	return(false);
 }
while (theForm.lastname.value == '' || theForm.firstname.value == '') {
 	alert("You forgot to type your name");
 	return(false);
 }
while (theForm.status.options[theForm.status.selectedIndex].value == 'empty') {
 	alert("Please select your status");
 	return(false);
 } 
while (theForm.institution.options[theForm.institution.selectedIndex].value == 'empty') {
 	alert("Please select your institution");
 	return(false);
 }
while (theForm.bday.value == '') {
 	alert("Please enter your birthdate");
 	return(false);
 }
while (theForm.city.options[theForm.city.selectedIndex].value == 'empty') {
 	alert("Please select your city");
 	return(false);
 } 
 while (theForm.email.value == '') {
 	alert("You forgot to type your email");
 	return(false);
 }
 
//var year = parseInt(theForm.year.value);
//while (year < 1900 || year > 1999) {
// 	theForm.year.value = prompt("Please enter a valid year:","19");
// 	year = parseInt(theForm.year.value);
// }
 
var other = 0;
while (other < 3)
 { 
  while (theForm.status.options[theForm.status.selectedIndex].value == '?')
  {
  	theForm.status.options[theForm.status.selectedIndex].value = prompt("Please enter your status:","?");
  	theForm.status.options[theForm.status.selectedIndex].text = theForm.status.options[theForm.status.selectedIndex].value;
  }
  other++;
  
  while (theForm.institution.options[theForm.institution.selectedIndex].value == '?')
  {
  	theForm.institution.options[theForm.institution.selectedIndex].value = prompt("Please enter your institution:","?");
  	theForm.institution.options[theForm.institution.selectedIndex].text = theForm.institution.options[theForm.institution.selectedIndex].value;
  } 
  other++;
  
  while (theForm.city.options[theForm.city.selectedIndex].value == '?')
  {
  	theForm.city.options[theForm.city.selectedIndex].value = prompt("Please enter your City:","?");
  	theForm.city.options[theForm.city.selectedIndex].text = theForm.city.options[theForm.city.selectedIndex].value;
  }
  other++;
}
// end other? 

var course = theForm.course.options[theForm.course.selectedIndex].value;

if (!(course == "bs11-10")) {
while (!(theForm.housing[0].checked || theForm.housing[1].checked))
{
	if (confirm("Do you need housing?")) {
		theForm.housing[0].value = "T";
		theForm.housing[0].checked = true;
		while (theForm.Atime.options[theForm.Atime.selectedIndex].value == 'empty' || theForm.Dtime.options[theForm.Dtime.selectedIndex].value == 'empty') {
 			alert("Please select your Arrival and Departure times");
 			return(false);
 		}
	}
	else { 
		theForm.housing[1].value = "F";
		theForm.housing[1].checked = true;
	}
}
}

// if Yeast required
if (course == "bs11-10") {

while (!(theForm.poster[0].checked || theForm.poster[1].checked))
{
	alert("Please tell us if you present a poster");
	return(false);
}	
while (!(theForm.talk[0].checked || theForm.talk[1].checked))
{
	alert("Please tell us if you present a talk");
	return(false);
}	
while (!(theForm.dinner_conf[0].checked || theForm.dinner_conf[1].checked))
{
	alert("Please tell us if you will attend the dinner");
	return(false);
}
while (theForm.session.options[theForm.session.selectedIndex].value == 'empty') {
 	alert("Please select your session");
 	return(false);
 } 
while (theForm.title_conf.value == '') {
 	alert("Please enter your title");
 	return(false);
 }
while (theForm.authors.value == '') {
 	alert("Please enter the authors");
 	return(false);
 }
while (theForm.abstract.value == '') {
 	alert("Please enter your abstract");
 	return(false);
 }
}
 
//while (theForm.letter.value == '') {
//	alert("Please upload your Letter of motivation");
//	return(false);
//}
//} 

//if (course == "j3") {
//if (theForm.housing[0].value == "T") {
//	alert("Warning, the participants are expected to book their accommodation themselves. See links below");
//	}
//while (!((theForm.L310[0].checked || theForm.L310[1].checked) && (theForm.L410[0].checked || theForm.L410[1].checked) && (theForm.vegy[0].checked || theForm.vegy[1].checked)))
//{
//	alert("Please select the meal reservation");
//	return(false);
//}
//}
// while (!(theForm.account[0].checked || theForm.account[1].checked))
//{
//	if (confirm("Do you have an account on gcg.ch.embnet.org ?")) {
//		theForm.account[0].value = "T";
//		theForm.account[0].checked = true;
// 	}
//	else { 
//		theForm.account[1].value = "F";
//		theForm.account[1].checked = true;
//	}
//}


 //end of checkuser



 // if Villars/Ollon
//if (course == "j1-10") {
	//while ((theForm.choice1D.options[theForm.choice1D.selectedIndex].value == 'empty') || (theForm.choice2D.options[theForm.choice2D.selectedIndex].value == 'empty') || (theForm.choice3D.options[theForm.choice3D.selectedIndex].value == 'empty') || (theForm.choice1N.options[theForm.choice1N.selectedIndex].value == 'empty') || (theForm.choice2N.options[theForm.choice2N.selectedIndex].value == 'empty') || (theForm.choice3N.options[theForm.choice3N.selectedIndex].value == 'empty'))
//		{
//			alert("Please select your preferred sessions");
//			return(false);
//		}
//	}

if (course == "bs12-10" || course == "bs13-10") {
	while (!((theForm.dinner[0].checked || theForm.dinner[1].checked) && (theForm.vegeterian[0].checked || theForm.vegeterian[1].checked)))
	{
			alert("Please fill in the special form");
			return(false);
		}
	}
	return(true);
}


 
 
function cours(theCourse) {

if (theCourse.options[theCourse.selectedIndex].value == 'bs12-10' || theCourse.options[theCourse.selectedIndex].value == 'bs13-10' || theCourse.options[theCourse.selectedIndex].value == 'EMBnet1-08') {
	special_Housing.open();
	special_Villars.close();
	special_EMBnet.open();
	special_Yeast.close();
	}
//else if (theCourse.options[theCourse.selectedIndex].value == 'j1-10') {
//	special_Housing.open();
//	special_EMBnet.close();
//	special_Villars.open();
//	special_Aging.close();
//	}
else if (theCourse.options[theCourse.selectedIndex].value == 'bs11-10') {
	special_Housing.close();
	special_EMBnet.close();
	special_Villars.close();
	special_Yeast.open();
	}
else {
	special_Housing.open();
	special_EMBnet.close();
	special_Villars.close();
	special_Yeast.close();
}	
if (theCourse.options[theCourse.selectedIndex].value == 'bs12-10') {
	document.location = "http://www.isb-sib.ch/edu/Registration/SIBcourses.php?code=bs12-10";
	}
if (theCourse.options[theCourse.selectedIndex].value == 'bs13-10') {
	document.location = "http://www.isb-sib.ch/edu/Registration/SIBcourses.php?code=bs13-10";
	}	
if (theCourse.options[theCourse.selectedIndex].value == 'pb33-10') {
	document.location = "http://www.enfc2010.ch/";
	}
if (theCourse.options[theCourse.selectedIndex].value == 'ab23-10') {
	document.location = "http://www.3eme-cycle.ch/biologie/pages/entry.php?code=ab23-10";
	}
}
//
// JavaScript Document