var RadioClickCounterArray = new Array(12);

function openPopup(url,width,height){	
		x = screen.availWidth/2-width/2;
        y = screen.availHeight/2-height/2;
        var popupWindow = window.open(url,'Popupfenster','width='+width+',height='+height+',left='+x+',top='+y+',screenX='+x+',screenY='+y);
   
}

function clearInput(what){
	
		var eingabe = document.getElementById(what);
		if(eingabe.value == "Benutzername")
			eingabe.value = "";
		else if(eingabe.value == "Passwort")
			eingabe.value = "";
		else if(eingabe.value == "Suchbegriff")
			eingabe.value = "";
}

function fillUsername(){
	var name = document.getElementById("loginName");
	if(name.value == ""){
		name.value = "Benutzername";
	}
}

function fillPassword(){
	var pass = document.getElementById("loginPasswort");
	if(pass.value == ""){
		pass.value="Passwort";
	}
}

function fillSuche(){
	var suchBegriff = document.getElementById("suchAusdruck");
	if(suchBegriff.value == ""){
		suchBegriff.value="Suchbegriff";	
	}
}

function closeWindow(){
	window.close();
}

function initRadioArray(){
	for(var i = 0; i < RadioClickCounterArray.length; i++){
		RadioClickCounterArray[i] = 0;
	}
}

function radioClick(radionumber){
	var radiobutton = document.getElementById("theme"+ radionumber);
	RadioClickCounterArray[radionumber-1]++;
	if(RadioClickCounterArray[radionumber-1] == 2){
		radiobutton.checked = false;
		RadioClickCounterArray[radionumber-1] = 0;	
	}
}