function SprawdzMail(str) 
	{

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Podano błędny adres e-mail")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Podano błędny adres e-mail")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Podano błędny adres e-mail")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Podano błędny adres e-mail")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Podano błędny adres e-mail")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Podano błędny adres e-mail")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Podano błędny adres e-mail")
		    return false
		 }

 		 return true					
	}

function SprawdzEMail()
	{
	var emailID=document.forms["MAIL"].email
	
	if ((emailID.value==null)||(emailID.value==""))
		{
		alert("Podano błędny adres e-mail")
		emailID.focus()
		return false
		}
	if (SprawdzMail(emailID.value)==false)
		{
		emailID.value=""
		emailID.focus()
		return false
		}
	return true
 	}

function SprawdzPrenumerate()
	{ 	
	if (document.forms["pren"].imienazwisko.value=="")
		{ 
		document.forms["pren"].imienazwisko.focus();
		alert("Nie podano Imienia i Nazwiska"); return false;
		};
	if (document.forms["pren"].adres.value=="")
		{ 
		document.forms["pren"].adres.focus();
		alert("Nie podano Adresu"); return false;
		};
	if (document.forms["pren"].email.value=="")
		{ 
		document.forms["pren"].email.focus();
		alert("Nie podano e-maila"); return false;
		};
	if (document.forms["pren"].numeru.value=="")
		{ 
		document.forms["pren"].numeru.focus();
		alert("Nie podano informacji dotyczacej numeru"); return false;
		};

	var emailID=document.forms["pren"].email
	
	if ((emailID.value==null)||(emailID.value==""))
		{
		alert("Podano błędny adres e-mail")
		emailID.focus()
		return false
		}
	if (SprawdzMail(emailID.value)==false)
		{
		emailID.value=""
		emailID.focus()
		return false
		}

	return true; 
	} 


function SprawdzKomentarz()
	{
	if (document.forms["komentarze"].tresc.value=="")
		{ 
		document.forms["komentarze"].tresc.focus();
		alert("Nie podano tresci komentarza");
                return false;
		}
	if (document.forms["komentarze"].autor.value=="")
		{ 
		document.forms["komentarze"].autor.focus();
		alert("Nie podano autora");
		return false;
		}
        return true;
        }
