function setActionAndSend(wert)
{
	formular.action = wert;
	formular.submit();
}

function setActionAndSendForm(action, formName) {
	form	= document.forms[formName];
	form.action	= action;
	form.submit();
}

function keineFunktion()
{
	alert("Keine Funktion!");
}

function submitForm(formName, action, confirmQuestion) 
{
	if (confirmQuestion == null || confirm(confirmQuestion)) 
	{
		var formular = document.forms[formName];
		formular.action = '/ceis/' +  action;
		formular.submit();
	}
}

function showPic(bild) 
{
	var picWindow = window.open("","pic","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,dependent=1, width=500,height=400");
	with(picWindow.document)
	{
		open("text/html");
	    writeln('<html><head><title>Picture</title><body bgcolor="#333333" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
		writeln('<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">');
		writeln('<tr><td align="center" valign="middle">');
		writeln('<table cellspacing="0" cellpadding="5" border="0"><tr><td bgcolor="#ffffff">');
		writeln('<img src="' +bild+ '" border=0>');
		writeln("</td></tr></table></td></tr></table>");
	    writeln("</body></html>");
		close();
	}
	picWindow.focus()
}

function showPdf(pdf) 
{
	var pdfWindow = window.open(pdf,"pic","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,dependent=1, width=500,height=400");
	pdfWindow.focus()
}

function smallPopup() 
{
	var smallWindow = window.open("","smallPopup","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,dependent=0, width=400,height=200");
	smallWindow.focus()
}

function openPopup(link) 
{
	var popWindow = window.open(link,"popup","toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,dependent=1");
	popWindow.focus()
}

function searchSelect()
{
	var optionFields	= "";
	var myForm			= document.forms[0];
	var searchString	= myForm.search.value.toLowerCase();
	var searchLength	= myForm.search.value.length;

	for(i=0; i<myForm.allDancers.length; i++)
	{
		optionFields	= myForm.allDancers.options[i].text.toLowerCase();
		if(optionFields.substr(0, searchLength) == searchString)
		{
			myForm.allDancers.selectedIndex = i;
			break;
		}
	}
}

function searchSelectSelDancer()
{
	var optionFields	= "";
	var myForm			= document.forms[0];
	var searchString	= myForm.search.value.toLowerCase();
	var searchLength	= myForm.search.value.length;

	for(i=0; i<myForm.selDancerGroups.length; i++)
	{
		optionFields	= myForm.selDancerGroups.options[i].text.toLowerCase();
		if(optionFields.substr(0, searchLength) == searchString)
		{
			myForm.selDancerGroups.selectedIndex = i;
			break;
		}
	}
}

function setFocus()
{
 if (document.forms.length > 0)
 {
 var field = document.forms[0];
 for (i = 0; i < field.length; i++)
 {
     if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s"))
     {
     document.forms[0].elements[i].focus();
     break;
     }
 }
 }
}

