function validate()
{
var at=document.getElementById("email").value.indexOf("@")
var password = document.getElementById("password1").value
var confirm_password =document.getElementById("confirm_password1").value
var nickname=document.getElementById("costam").value
submitOK="true"

if (nickname.length<3)
 {
 alert("Login musi zawierac wiecej niz 2 znaki");
 document.getElementById("costam").value = '';
 document.getElementById('wrong1').innerHTML = "*"; 
 submitOK="false";
 }
else document.getElementById('wrong1').innerHTML = "";

if ( confirm_password != password || password == "" || password.length < 3)
 {
 if ( password.length < 3 )
 alert("Haslo musi miec powyzej 3 znaków");
 else 
 alert("Oba hasla musza byc identyczne");
 document.getElementById("password1").value = ""
 document.getElementById("confirm_password1").value = ""
 document.getElementById('wrong2').innerHTML = "*";
 submitOK="false"
 }
else document.getElementById('wrong2').innerHTML = "";


if (at==-1) 
 {
 alert("Nie wlasciwy e-mail")
 document.getElementById("email").value = ''
 document.getElementById('wrong3').innerHTML = "*";
 submitOK="false"
 }
else document.getElementById('wrong3').innerHTML = "";
if (submitOK=="false")
 {
 return false
 }
}
