function eingaben_ueberpruefen(){
 if (document.Form.eingabe.value.length != 5){
  alert("Bitte geben Sie den Code ein!");
  document.Form.eingabe.focus();
  return false;
 }
 else
 return true;
}


function RND(){
 Zufall = Math.round(Math.random()*11+1);
 document.Form.code.value=Zufall;
 return Zufall;
}


function new_freecap()
{
	// loads new freeCap image
	if(document.getElementById)
	{
		// extract image name from image source (i.e. cut off ?randomness)
		thesrc = document.getElementById("freecap").src;
		thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
		// add ?(random) to prevent browser/isp caching
		document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000);
	} else {
		alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
	}
}

var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes";win=window.open(mypage,myname,settings);
win.focus();}


function openWindow() {
  popupWin = window.open('http://localhost/charlesvinothek/module/umfrage.html', '898968996', 'width=830,height=800,left=100,top=100,menubar=no,status=yes,scrollbars,resizable,toolbar=no,hotkeys,location=no')
}
