/*
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
}
else {
document.onmousedown = function(){return false}
}
function disableselect(e){
return false
} 
function reEnable(){
return true
} 
document.onselectstart=new Function ("return false") 
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
*/
function uc(x){
	alert("Pagina "+x+" in constructie \nVa fi lansata in curand\nInscrie-te la newsletter pentru a afla noutatile");
}
function backif(){
	if(window.parent.document.getElementById('nume').value == ""){window.parent.document.getElementById('nume').value ='nume';}
	if(window.parent.document.getElementById('telefon').value == ""){window.parent.document.getElementById('telefon').value ='telefon';}
	if(window.parent.document.getElementById('adr').value == ""){window.parent.document.getElementById('adr').value ='email';}
	if(window.parent.document.getElementById('mesaj').value == ""){window.parent.document.getElementById('mesaj').value ='mesaj';}
}
function backif2(id){
	if(document.getElementById(id).value == ""){document.getElementById(id).value = id;}
}
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("Adresa de email este incorecta!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Adresa de email este incorecta!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Adresa de email este incorecta!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Adresa de email este incorecta!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Adresa de email este incorecta!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Adresa de email este incorecta!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Adresa de email este incorecta!")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.form.adresa;
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Va rugam sa introduceti adresa de mail")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	document.form.submit();
	return true
 }