// JavaScript Document



function Contact_FullName2Short ()
{
	objSource = document.getElementById( "FullName" );
	objDest = document.getElementById( "ShortName" );
	
	if (objDest . value == "")
	{
		 objDest .value = objSource.value;
	}
}




function Contact_HQ2Contact ( formFieldName )
{
	objSource = document.getElementById( "HQ_" + formFieldName );

	destFieldName = "Contact_" + formFieldName;

	if (document.getElementById( destFieldName ) . value == "")
	{
		document.getElementById( destFieldName ).value = objSource.value;
	}

}


function checkForm_Announcer ( lang )
{
	clearFormColors_Announcer();
	check = "ok";

	if (document.getElementById("RulesAccept").checked == false) 				{ check = "false" ; colorAlert_Announcer("RulesAcceptInfo"); }
	//if (document.getElementById("GovIdent").value.length < 3) 					{ check = "false" ; colorAlert_Announcer("GovIdent"); }
	if (document.getElementById("FullName").value.length < 3) 					{ check = "false" ; colorAlert_Announcer("FullName"); }	
	//if (document.getElementById("ShortName").value.length < 2) 					{ check = "false" ; colorAlert_Announcer("ShortName"); }	
	if (document.getElementById("HQ_Street").value.length < 5) 					{ check = "false" ; colorAlert_Announcer("HQ_Street"); }
	if (document.getElementById("HQ_PostalCode").value.length < 4) 			{ check = "false" ; colorAlert_Announcer("HQ_PostalCode"); }
	if (document.getElementById("HQ_City").value.length < 4) 						{ check = "false" ; colorAlert_Announcer("HQ_City"); }
	if (document.getElementById("HQ_Country").value.length < 4) 				{ check = "false" ; colorAlert_Announcer("HQ_Country"); }
	//if (document.getElementById("Contact_Street").value.length < 5) 			{ check = "false" ; colorAlert_Announcer("Contact_Street"); }
	//if (document.getElementById("Contact_PostalCode").value.length < 5) 		{ check = "false" ; colorAlert_Announcer("Contact_PostalCode"); }
	//if (document.getElementById("Contact_City").value.length < 4) 				{ check = "false" ; colorAlert_Announcer("Contact_City"); }
	//if (document.getElementById("Contact_Country").value.length < 4) 			{ check = "false" ; colorAlert_Announcer("Contact_Country"); }
	if (document.getElementById("HQ_EMail").value.length < 5) 					{ check = "false" ; colorAlert_Announcer("HQ_EMail"); }
	if (document.getElementById("PhoneNumbers").value.length < 9) 				{ check = "false" ; colorAlert_Announcer("PhoneNumbers"); }
	if (document.getElementById("Operator_Name").value.length < 6) 			{ check = "false" ; colorAlert_Announcer("Operator_Name"); }
	if (document.getElementById("Operator_EMail").value.length < 5) 			{ check = "false" ; colorAlert_Announcer("Operator_EMail"); }
	if (document.getElementById("Operator_Phone").value.length < 5) 			{ check = "false" ; colorAlert_Announcer("Operator_Phone"); }
	
	// alert(document.getElementById("HQ_EMail").value.length < 5) ;
	
	
	if (check == "false") 
	{
		if (lang == "pl") 		alert ("Formularz nie został wypełniony prawidłowo. Popraw dane w wyróżnionych polach.");
		if (lang == "eng") 	alert ("Red marked fields are required!");
	}
	
	if (check == "ok") { document.formAnnouncer.submit() };
	
	
}



function colorAlert_Announcer( formField )
{
	document.getElementById(formField).style.backgroundColor = "#ffa0a0";
}


function clearFormColors_Announcer()
{
	document.getElementById("RulesAcceptInfo").style.backgroundColor = "#ffffff";
	document.getElementById("GovIdent").style.backgroundColor = "#f0f0f0";
	document.getElementById("FullName").style.backgroundColor = "#f0f0f0";
	document.getElementById("ShortName").style.backgroundColor = "#f0f0f0";
	document.getElementById("HQ_Street").style.backgroundColor = "#f0f0f0";
	document.getElementById("HQ_PostalCode").style.backgroundColor = "#f0f0f0";
	document.getElementById("HQ_City").style.backgroundColor = "#f0f0f0";
	document.getElementById("HQ_Country").style.backgroundColor = "#f0f0f0";
	document.getElementById("HQ_EMail").style.backgroundColor = "#f0f0f0";	
	document.getElementById("Contact_Street").style.backgroundColor = "#f0f0f0";
	document.getElementById("Contact_PostalCode").style.backgroundColor = "#f0f0f0";
	document.getElementById("Contact_City").style.backgroundColor = "#f0f0f0";
	document.getElementById("Contact_Country").style.backgroundColor = "#f0f0f0";
	document.getElementById("PhoneNumbers").style.backgroundColor = "#f0f0f0";
	document.getElementById("Operator_Name").style.backgroundColor = "#f0f0f0";
	document.getElementById("Operator_EMail").style.backgroundColor = "#f0f0f0";
	document.getElementById("Operator_Phone").style.backgroundColor = "#f0f0f0";
}