init = function() 
{
	var subnav = new YAHOO.util.Motion("subNavigationHolder", { points: { by: [-149,0] } }, 0.4, YAHOO.util.Easing.easeOut);
	subnav.onComplete.subscribe(function(e)
	{
		YAHOO.util.Dom.setStyle("subNavigationHolder", "zIndex", "300");
	});
	subnav.animate();

	var banner = new YAHOO.util.Motion("topBanner", { points: { by: [0,-201] } }, 0.4, YAHOO.util.Easing.easeOut);
	banner.animate();

	var inputFields = document.getElementsByTagName("input");
	for ( i = 0; i < inputFields.length; ++i )
	{
		if ( inputFields[i].type == "text" || inputFields[i].type == "checkbox" )
		{
			YAHOO.util.Event.addListener(inputFields[i], 'focus', function (e) {YAHOO.util.Dom.setStyle(this, "backgroundColor", "#CCE821");});
			YAHOO.util.Event.addListener(inputFields[i], 'blur', function (e) {YAHOO.util.Dom.setStyle(this, "backgroundColor", "#FFFFFF");});
		}
	}

	var selectFields = document.getElementsByTagName("select");
	for ( i = 0; i < selectFields.length; ++i )
	{
		YAHOO.util.Event.addListener(selectFields[i], 'focus', function (e) {YAHOO.util.Dom.setStyle(this, "backgroundColor", "#CCE821");});
		YAHOO.util.Event.addListener(selectFields[i], 'blur', function (e) {YAHOO.util.Dom.setStyle(this, "backgroundColor", "#FFFFFF");});
	}
}
YAHOO.util.Event.addListener(window, 'load', init);

function SendContactFormEN ()
{
	var theForm = document.forms[0];
	if ( theForm.IAm.selectedIndex == 0 ) { alert("\nPlease choose your category."); theForm.IAm.focus(); return; }
	if ( theForm.company.value == "" ) { alert("\nPlease enter your company."); theForm.company.focus(); return; }
	if ( theForm.name.value == "" ) { alert("\nPlease enter your first name."); theForm.name.focus(); return; }
	if ( theForm.surname.value == "" ) { alert("\nPlease enter your surname."); theForm.surname.focus(); return; }
	if ( theForm.country.selectedIndex  == 0 ) { alert("\nPlease choose your country."); theForm.country.focus(); return; }
	
	var emailRegxp = /^([\w]+)(.[\w]+)*@([\w-\d]+)(.[\w]{2,3}){1,2}$/;
	if ( theForm.eMail.value == "" || !emailRegxp.test(theForm.eMail.value)) { alert("\nPlease enter a valid e-mail address."); theForm.eMail.focus(); return; }
	
	if ( theForm.phone.value == "" ) { alert("\nPlease enter your phone number."); theForm.phone.focus(); return; }

	if ( !theForm.Meat.checked && !theForm.Fish.checked && !theForm.elements["Dairy products"].checked && theForm.interestOther.value == "" ) 
		{ alert("\nPlease choose your interest."); return; }

	theForm.submit();
}

function SendContactFormDE ()
{
	var theForm = document.forms[0];
	if ( theForm.IAm.selectedIndex == 0 ) { alert("\nBitte wählen Sie eine Kategorie aus."); theForm.IAm.focus(); return; }
	if ( theForm.company.value == "" ) { alert("\nBitte geben Sie Ihre Firma ein."); theForm.company.focus(); return; }
	if ( theForm.name.value == "" ) { alert("\nBitte geben Sie ihren Vornamen ein."); theForm.name.focus(); return; }
	if ( theForm.surname.value == "" ) { alert("\nBitte geben Sie Ihren Nachnamen ein."); theForm.surname.focus(); return; }
	if ( theForm.country.selectedIndex  == 0 ) { alert("\nBitte wählen Sie ein Land aus."); theForm.country.focus(); return; }
	
	var emailRegxp = /^([\w]+)(.[\w]+)*@([\w-\d]+)(.[\w]{2,3}){1,2}$/;
	if ( theForm.eMail.value == "" || !emailRegxp.test(theForm.eMail.value)) { alert("\nBitte geben Sie eine gültige e-Mail Adresse ein."); theForm.eMail.focus(); return; }
	
	if ( theForm.phone.value == "" ) { alert("\nBitte geben Sie Ihre Telefonnummer an."); theForm.phone.focus(); return; }

	if ( !theForm.Meat.checked && !theForm.Fish.checked && !theForm.elements["Dairy products"].checked && theForm.interestOther.value == "" ) 
		{ alert("\nBitte wählen Sie Ihr Interessengebiet."); return; }

	theForm.submit();
}

function SendContactFormFR ()
{
	var theForm = document.forms[0];
	if ( theForm.IAm.selectedIndex == 0 ) { alert("\nPlease choose your category."); theForm.IAm.focus(); return; }
	if ( theForm.company.value == "" ) { alert("\nPlease enter your company."); theForm.company.focus(); return; }
	if ( theForm.name.value == "" ) { alert("\nPlease enter your first name."); theForm.name.focus(); return; }
	if ( theForm.surname.value == "" ) { alert("\nPlease enter your surname."); theForm.surname.focus(); return; }
	if ( theForm.country.selectedIndex  == 0 ) { alert("\nPlease choose your country."); theForm.country.focus(); return; }
	
	var emailRegxp = /^([\w]+)(.[\w]+)*@([\w-\d]+)(.[\w]{2,3}){1,2}$/;
	if ( theForm.eMail.value == "" || !emailRegxp.test(theForm.eMail.value)) { alert("\nPlease enter a valid e-mail address."); theForm.eMail.focus(); return; }
	
	if ( theForm.phone.value == "" ) { alert("\nPlease enter your phone number."); theForm.phone.focus(); return; }

	if ( !theForm.Meat.checked && !theForm.Fish.checked && !theForm.elements["Dairy products"].checked && theForm.interestOther.value == "" ) 
		{ alert("\nPlease choose your interest."); return; }

	theForm.submit();
}

function openPopup(strUrl, strName, intWidth, intHeight, intLeft, intRight)
{
	focusWindow = window.open(strUrl, strName , 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + intWidth + ',height=' + intHeight + ',left=' + intLeft + ',top=' + intRight + '\'');
}

