// JavaScript Documentfunction startList() {	if (document.all&&document.getElementById) {		navRoot = document.getElementById("categories");		for (i=0; i<navRoot.childNodes.length; i++) {			node = navRoot.childNodes[i];			if (node.nodeName=="LI") {				node.onmouseover=function() {					this.className+=" over";				}				node.onmouseout=function() {					this.className=this.className.replace(" over", "");				}			}		}/*		extraRoot = document.getElementById("extra");		for (i=0; i<extraRoot.childNodes.length; i++) {			node = extraRoot.childNodes[i];			if (node.nodeName=="LI") {				node.onmouseover=function() {					this.className+=" over";				}				node.onmouseout=function() {					this.className=this.className.replace(" over", "");				}			}		}*/	}}function MM_openBrWindow(theURL,winName,features) { //v2.0  newwind = window.open(theURL,winName,features);  newwind.focus();}


function echeck(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("Ervenytelen e-mail cim!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Ervenytelen e-mail cim!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Ervenytelen e-mail cim!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Ervenytelen e-mail cim!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Ervenytelen e-mail cim!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Ervenytelen e-mail cim!")
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    alert("Ervenytelen e-mail cim!")
		    return false
		 }

 		 return true
	}

function ValidateForm(){
	var emailID=document.reg.m

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Az e-mail cim kitoltese kotelezo!")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 
function validate(form_id,email) {
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var address = document.forms[form_id].elements[email].value;
	if(reg.test(address) == false) {
		alert('Ervenytelen e-mail cim!');
		return false;
	}
}
