function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 var forms = document.getElementsByTagName("form"); 
 forms[0].onsubmit = "return checkEmail(this)";
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;

function popdpl(dpl,or) {
	var url = "diploma.php?dpl="+dpl;
	var feat = 'width=565,height=400';
	if (or =="p")
		feat = 'width=400,height=565';
  window.open(url,'Diploma',feat);
}

function poprez(op, rez) {
	var url = "rez.php?op="+op+"&amp;rez="+rez;
	var feat = 'width=405,height=520';
    window.open(url,'rezultate',feat);
}

function checkEmail(myForm) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){
		return (true)
	}

	alert("Adresa de email este invalida\nVa rugam introduceti o adresa valida!")
	return (false)
}
