// set the checkboxes to their default-value at first page load and 
// to their selected values later.
function setCheckBoxes(){

	//alert(document.vFire.VarActiveCell.value);

	// get the checkbox-values.
   if(document.vFire.SearchGroup[0].checked){
		document.vFire.SearchGroup.value = 'all';
		document.vFire.SearchGroup[0].checked = true;
		document.vFire.SearchGroup[1].checked = false;
   }else if(document.vFire.SearchGroup[1].checked){
	   document.vFire.SearchGroup.value = 'notall';
	   document.vFire.SearchGroup[0].checked = false;
		document.vFire.SearchGroup[1].checked = true;
   }else{
	   // default value.
	   document.vFire.SearchGroup.value = 'all';
	   document.vFire.SearchGroup[0].checked = true;
		document.vFire.SearchGroup[1].checked = false;
   }


    if(document.vFire.SearchType[0].checked){
		document.vFire.SearchType.value = 'thema';
		 document.vFire.SearchType[0].checked = true;
		document.vFire.SearchType[1].checked = false;
   }else if (document.vFire.SearchType[1].checked){
	   document.vFire.SearchType.value = 'searchword';
	    document.vFire.SearchType[0].checked = false;
		document.vFire.SearchType[1].checked = true;
   }else{
	   // default value.
	   document.vFire.SearchType.value = 'thema';
	    document.vFire.SearchType[0].checked = true;
		document.vFire.SearchType[1].checked = false;
   }

	
  
}


// set the default values after a reset.
function goInitSystem(){
	
   // Beim Reset muss Active Celle löschen damit sie mit dem aktuellen
   // Monat wieder initialisiert wird.
   document.vFire.VarActiveCell.value = 0;

   document.vFire.EventLocality.value = "alle";
   document.vFire.EventRegion.value = "alle";

	// the field disappears when searchword is selected.
   if(document.vFire.EventTopicName != null){
	document.vFire.EventTopicName.value = "alle";
   }
   
   // the field disappears when thema is selected.
   if(document.vFire.VarSearchWord != null){
	document.vFire.VarSearchWord.value = "";
   }

   // the default values.
   document.vFire.SearchGroup[0].checked = true;
   document.vFire.SearchGroup.value = "all";

   document.vFire.SearchType[0].checked = true;
   document.vFire.SearchType.value = "thema";
}


// submit the form.
function goServer() {	

	//alert(document.vFire.VarActiveCell.value);
	document.vFire.submit();
}


// reset the environment.
function goReset() {

	//alert("reset");
   goInitSystem();

   document.vFire.submit();

}
