/* Script to validate the Polish version of the send email page */
<!-- ImageReady Preload Script -->

function Validate()
{
	missinginfo = "";
	str = document.mailquestion.sender_email.value;

	if (document.mailquestion.sender_email.value == "")
	{
		missinginfo += "\n     -  Adres Emailowy";
	}
	else
	{
        var at   = "@"
        var dot  = "."
        var lat  = str.indexOf(at)
        var lstr = str.length
        var ldot = str.indexOf(dot)

        if (str.indexOf(at) == -1)
		    missinginfo += "\n     -  Adres Emailowy (Nieprawid³owy)";
        else if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr)
		    missinginfo += "\n     -  Adres Emailowy (Nieprawid³owy)";
        else if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr)
		    missinginfo += "\n     -  Adres Emailowy (Nieprawid³owy)";
        else if (str.indexOf(at, (lat + 1)) != -1)
		    missinginfo += "\n     -  Adres Emailowy (Nieprawid³owy)";
        else if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot)
		    missinginfo += "\n     -  Adres Emailowy (Nieprawid³owy)";
        else if (str.indexOf(dot, (lat + 2)) == -1)
		    missinginfo += "\n     -  Adres Emailowy (Nieprawid³owy)";
        else if (str.indexOf(" ") != -1)
		    missinginfo += "\n     -  Adres Emailowy (Nieprawid³owy)";
    }

	if (document.mailquestion.sender_message.value == "")
	{
		missinginfo += "\n     -  Wiadomo¶æ";
	}

	if (missinginfo != "")
	{
		missinginfo =
			"Nastêpuj±ce informacje musz± byæ wype³nione lub poprawione:\n"
			+ missinginfo
			+ "\nProsimy o wstawienie brakuj±cych lub poprawienie informacji i ponowne wys³anie!";

		alert(missinginfo);

		return false;
	}
	else
		return true;
}

<!-- End Preload Script -->
