
// ### Formular Pruefung ### //

function check_form(formular_name,language){
	
	if(language == 'de')
	{
		var message = "Bitte füllen Sie alle mit einem (x) markierten Felder aus!";
	}
	else
	{
		var message = "Please fill in all required fields (x)!"; 
	}
	
	message += "\n";
	
	fields_to_check = document[formular_name].fuses.value.split(',');
	
	var hits = 0;
	var focused = false;
	
	for(x = 0; x < fields_to_check.length; x++)
	{	
		checkValue = document[formular_name][fields_to_check[x]].value;
		
		// E-Mail Adresse pruefen
		if ( checkValue == "" || (fields_to_check[x] == 'E-Mail' && (checkValue.indexOf("@") == -1 || checkValue.indexOf(".") == -1))) // m a i l feld
		{
			if (focused != true) { document[formular_name][fields_to_check[x]].focus(); focused = true; }
			hits++;
		}
	}

	if(hits > 0)
	{
		alert(message);
		return false;
	}
	else
	{
		return true;
	}
}


// ### POPUPs ## //

function popup_legende ()
{
	window.open('../popup/legende-de.html','_blank', 'width=300,height=450,status=no,scrollbars=no,resizable=no');
}

function popup_video ( target )
{
	window.open(target,'_blank', 'width=512,height=379,status=no,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no');
}