function addEvent(obj, evType, fn) 
{ 
	if (obj.addEventListener) 
	{ 
		obj.addEventListener(evType, fn, true); 	
		return true; 
	} 
	else if (obj.attachEvent) 
	{ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	} 
	else 
	{ 
		return false; 
	} 
}

function kulso_link() 
{
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");

	for (var i=0; i<anchors.length; i++) 
	{
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "kulso")
		{
		    anchor.target = "_blank";
	
		}
	}
}


function regisztracio_teszt()
{
	var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
	var nevfilter=/^[0-9a-z]/;
	document.regisztracio.regisztracio_nev.style.border = "2px solid #FFCB63"
	document.regisztracio.regisztracio_email.style.border = "2px solid #FFCB63"
	document.regisztracio.regisztracio_jelszo_1.style.border = "2px solid #FFCB63"
	document.regisztracio.regisztracio_jelszo_2.style.border = "2px solid #FFCB63"
	document.regisztracio.szam.style.border = "2px solid #FFCB63"
		
	if (!nevfilter.test(document.regisztracio.regisztracio_nev.value))
	{ 
		document.regisztracio.regisztracio_nev.style.border = "2px solid red"
		document.regisztracio.regisztracio_nev.focus()
		return false
	}

	if (!emailfilter.test(document.regisztracio.regisztracio_email.value))
	{ 
		document.regisztracio.regisztracio_email.style.border = "2px solid red"
		document.regisztracio.regisztracio_email.focus()
		return false
	}

	if (document.regisztracio.regisztracio_jelszo_1.value == "") 
	{
		document.regisztracio.regisztracio_jelszo_1.style.border = "2px solid red"
		document.regisztracio.regisztracio_jelszo_1.focus()
		return false
	}

	if (document.regisztracio.regisztracio_jelszo_2.value == "") 
	{
		document.regisztracio.regisztracio_jelszo_2.style.border = "2px solid red"
		document.regisztracio.regisztracio_jelszo_2.focus()
		return false; 
        }

	if (document.regisztracio.regisztracio_jelszo_2.value != document.regisztracio.regisztracio_jelszo_1.value) 
	{
		document.regisztracio.regisztracio_jelszo_2.style.border = "2px solid red"
		document.regisztracio.regisztracio_jelszo_2.focus()
		alert("A két jelszó nem egyezik!")
		return false; 
     }

	 if (document.regisztracio.szam.value == "") 
	{
		document.regisztracio.szam.style.border = "2px solid red"
		document.regisztracio.szam.focus()
		return false
	}
}

addEvent(window, 'load', kulso_link);



