function isValidEmail(email) 
{
	 if (!isPoint(email))
			return false;
	 
	 //var TestEmail = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
	 var TestEmail = /^[^.][a-zA-Z0-9.\-\_]+@([a-zA-Z0-9.\-\_]+\.)+[a-zA-Z0-9.]{2,4}$/;
   var Wynik = email.match(TestEmail);

   if (Wynik == null)
   {      
      return false;
   }
	 return true;
}

function isPoint(email)
{
	len = email.length;
	for (i = 1; i < len; i++)
	{
		if (email[i] == '.' && email[i-1] == '.')
			return false;
	}
	return true;
}

function showErr(txt,element)
{              
    document.getElementById(element).innerHTML = txt;
    return false;
}

function clearMsg(element,class_name)
{   
   collection = document.getElementsByTagName(element);
   len = collection.length;
	 for (i=0; i<len; i++)
	 {
      if (collection[i].className == class_name)
      {
        elem = collection[i].id;
        elem = elem.toString();                        
        document.getElementById(elem).innerHTML = '';
      }
   }
}

function noneMsg(element,class_name)
{   
   collection = document.getElementsByTagName(element);
   len = collection.length;
	 for (i=0; i<len; i++)
	 {
      if (collection[i].className == class_name)
      {
        elem = collection[i].id;
        elem = elem.toString(); 
				document.getElementById(elem).innerHTML = '';
        document.getElementById(elem).style.display = 'none';
      }
   }
}

function chkDate(y,m,d)
{
		chk = new Date(y,m,32);
		x = 32 - chk.getDate();								
		if (d <= x)
			return false;
		return true;
}