function checkVote(intMax)
{
	var strAlert = "";
	var strIDListe = "";
	var intIDCount = 0;
	var bolSend = false;
	for(var i=0; i < document.forms[0].length; i++)
	{
		if(document.forms[0].elements[i].checked)
		{	
			strAlert += document.forms[0].elements[i].value+"\n";
			strIDListe += document.forms[0].elements[i].value+",";
			intIDCount++;
		}
	}
	//strIDListe
	if(intIDCount == 0)
		alert("Bitte wählen Sie bis zu "+intMax+" Figuren aus.");
	else if (intIDCount > intMax)
		alert("Sie haben " +(intIDCount-intMax)+ " Figur(en) zu viel gewählt!\nBitte ändern Sie Ihre Auswahl.");
	else if (intIDCount > 0 && intIDCount < intMax)
	{
		bolDelete = confirm("Sie haben " +(intMax-intIDCount)+ " Figur(en) zu wenig gewählt!\nSie können noch weitere Figuren wählen.");
		if(bolDelete)
			exit;
		else
			bolSend = true;
	}
	else
		bolSend = true;
	//alert(intIDCount+"\n\n" + strAlert + strIDListe);
	//alert(bolSend);
	if(bolSend)
	{
		document.forms[0].gewaehlt.value = strIDListe;
		//alert(document.forms[0].gewaehlt.value);
		document.forms[0].submit();
	}
}

function showPicture(pic, w, h)
{
	var strPath = "pictures/"+pic;
	windowPic = window.open(strPath, "pic", "width="+(w+20)+",height="+(h+20)+",left=100,top=200");
	windowPic.document.write("<html><head><title>2008 Saga Fans' Choice Poll</title></head>");
	windowPic.document.write("<body marginwidth=\"0\" marginheight=\"0\" topmargin=\"0\" leftmargin=\"0\" onBlur=\"self.close();\">");
	windowPic.document.write("<img src=\""+strPath+"\" width=\""+(w+20)+"\" height=\""+(h+20)+"\">");
	windowPic.document.write("</body></html>");
	windowPic.document.close();
	windowPic.document.focus();
}
