/* Styleswitcher */

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function checkForPassword(){
	document.getElementsByName("reg_check")[1].checked=true;	
}

function showGroup(){
	document.getElementById("group").style.display="block";	
	document.getElementById("group2").style.display="block";	
	document.getElementById("group3").style.display="block";	
}

function hideGroup(){
	document.getElementById("group").style.display="none";	
	document.getElementById("group2").style.display="none";	
	document.getElementById("group3").style.display="none";	
}
function showNewEvent(value){
	var ar = document.formEventliste.selectevents.options;
	var last = ar.length;
	document.formEventliste.selectevents.options[last-1].selected="selected";
	document.formEventliste.submit();
}

function showNewComp(value){
	var ar = document.formCompliste.selectCompetition.options;
	var last = ar.length;
	document.formCompliste.selectCompetition.options[last-1].selected="selected";
	document.formCompliste.submit();
}


