function change()
{
document.regForm.submitForm.setAttribute("disabled","true")
}

function CheckRegFormAction() {

		userName = document.regForm.userName.value;
		pass = document.regForm.pass.value;
		pass2 = document.regForm.pass2.value;
		email = document.regForm.email.value;
		email_retype = document.regForm.email_retype.value;
       	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		
	if (userName.length == 0 || userName.length < 4)
		{
		alert('שם המשתמש חייב להכיל יותר מ-4 תווים');
		document.regForm.userName.focus()
		}
	else

	if (pass.length == 0 || pass.length < 4 || pass.length > 15)
		{
		alert('חובה למלא שדה סיסמא');
		document.regForm.pass.focus()
		}
	else
	
		if (pass2.length == 0 || pass2.length < 4 || pass2.length > 15)
		{
		alert('חובה למלא שדה אימות סיסמא');
		document.regForm.pass2.focus()
		}
	else

	if (pass2!=pass)
		{
		alert('אימות סיסמא נכשל. יש לבדוק האם הסיסמאות תואמות');
		document.regForm.pass2.focus()
		}
	else

		if (email.length == 0 || email.length < 9)
		{
		alert('חובה למלא שדה דואר אלקטרוני');
		document.regForm.email.focus()
		}
	else


		if (email.length!=email_retype.length)
		{
		alert('אימות דוא"ל נכשל. יש לבדוק שנית את כתובות הדוא"ל שנרשמו');
		document.regForm.email.focus()
		}
	else
	
		if (email!=email_retype)
		{
		alert('אימות דוא"ל נכשל. יש לבדוק שנית את כתובות הדוא"ל שנרשמו');
		document.regForm.email.focus()
		}
	else
	
	if (!filter.test(email))		{
		alert('כתובת הדוא"ל שרשמת אינה תקינה');
		document.regForm.email.focus()
		}
	else

	if (!filter.test(email_retype))		{
		alert('כתובת הדוא"ל שרשמת באימות דוא"ל אינה תקינה');
		document.regForm.email_retype.focus()
		}
	else

		{
		change()
		document.regForm.submit()
		}
	}
