function goback() {
    history.go(-1);
}



/******** ajax ********/
var xmlHttp

function AbonareNews(stri,uri,uri2){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	} 

	var url=uri+uri2+"/inscriere/"+stri
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("NewsSubscribe").
		innerHTML=xmlHttp.responseText;
	} 
} 

function GetXmlHttpObject(){ 
	var objXMLHttp=null
	if (window.XMLHttpRequest){
		objXMLHttp=new XMLHttpRequest()
	}else if (window.ActiveXObject){
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}

/*************************/

// JavaScript Document
  function numeralsOnly(evt) {
	evt = (document.forms[0].telefon.value) ? evt : event; 
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));         
    var str = evt.srcElement.value; 
    if (charCode < 48 || charCode > 57)
      return false;
    return true;
  }

function hasLetters(edit){
    var str= edit.value; 
    var charCode;
    for(i= 0; i< str.length; i++)
    {
      charCode= str.charCodeAt(i);
		  if (charCode < 48 || charCode > 57)
		{
			edit.value= '';
			return false;
		  }
    }
    return true;
  }			

function validate_email(field)
{
	var str = Trim(field.value);
	if (window.RegExp) {
		var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
		var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
		var reg1 = new RegExp(reg1str);
		var reg2 = new RegExp(reg2str);
		if (!reg1.test(str) && reg2.test(str)) {
			return true;
		}
		//alert(alert_str);
		field.focus();
		field.select();
		return false;
	} else {
		if(str.indexOf("@") >= 0)
		{
			return true;
		}
		//alert(alert_str);
		field.focus();
		field.select();
		return false;
	}
}

function Trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length-1);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}
function ck_text(field, zval, str)
{
	if (Trim(field.value) == zval) 
	{
		if (str!="")
		{
			alert(str);
			field.focus();
		}
		return false;
	} else 
		return true;
}


function verificaContact()
{
	var i=1;
	
	if(document.contact.nume.value=="")
	{
	mes="Nu ati introdus Numele";
	document.contact.nume.focus();
	i=0;
	}
	
		
		
	if (document.contact.procent.options[0].selected)	
	{
		mes="Nu ati ales Optiunea !";
		document.contact.procent.options[1].selected=true;
		i=0;
	}
	
	if(document.forms[0].telefon.value.length <= 7)
	{
		mes="Nr de Telefon nu este valid";
		document.forms[0].telefon.focus();
		document.forms[0].telefon.select();
		i=0;
	}
	
		if(document.contact.telefon.value=="")
		{
		mes="Nu ati introdus Telefon";
		document.contact.telefon.focus();
		i=0;
		}
		
		 if (!validate_email(document.contact.email))
		{
			mes= "Adresa de E-mail este invalida!";
			i=0;
			document.contact.email.focus();
		}
		
	  if(i==0)
	  {
	  alert(mes);
	  }
	  else
	  {
	  document.contact.flag.value=1;
	  document.contact.submit();
	  }
		
}

function verificaConferinta()
{
	var i=1;
	
	if(document.forms[0].nume.value=="")
	{
	mes="Nu ati introdus Numele";
	document.forms[0].nume.focus();
	document.forms[0].nume.select();
	i=0;
	}
	
		
		
	if(document.forms[0].telefon.value.length <= 7)
	{
		mes="Nr de Telefon nu este valid";
		document.forms[0].telefon.focus();
		document.forms[0].telefon.select();
		i=0;
	}
/*		
	if(document.forms[0].program[0].checked==false && document.forms[0].program[1].checked==false && document.forms[0].program[2].checked==false)
	{
		mes="Nu ati ales Programul";
		document.forms[0].program[0].checked=true;
		i=0;
	}
*/	
	if(document.forms[0].program1.checked==false && document.forms[0].program2.checked==false && document.forms[0].program3.checked==false)
	{
		mes="Nu ati ales Programul";
		document.forms[0].program1.checked=true;
		i=0;
	}
	
	if(document.forms[0].sunt[0].checked==false && document.forms[0].sunt[1].checked==false && document.forms[0].sunt[2].checked==false && document.forms[0].sunt[3].checked==false)
	{
		mes="Nu ati selectat Participant";
		document.forms[0].sunt[1].checked=true;
		i=0;
	}
	
		if(document.forms[0].telefon.value=="")
		{
		mes="Nu ati introdus Telefon";
		document.forms[0].telefon.focus();
		document.forms[0].telefon.select();
		i=0;
		}
		
		 if (!validate_email(document.forms[0].email))
		{
			mes= "Adresa de E-mail este invalida!";
			i=0;
			document.forms[0].email.focus();
		}
		
	  if(i==0)
	  {
	  alert(mes);
	  }
	  else
	  {
	  document.forms[0].flag.value=1;
	  document.forms[0].submit();
	  }
	
}


function resetContact()
{
	if (document.contact.procent.options[0].selected==true)	
	{
		document.contact.procent.options[0].selected=false;
	}
	
	if(document.contact.nume.value!="")
	{
		document.contact.nume.value="";
	}
	
	if(document.contact.prenume.value!="")
	{
		document.contact.prenume.value="";
	}
	
	if(document.contact.adresa.value!="")
	{
		document.contact.adresa.value="";
	}
	if(document.contact.telefon.value!="")
	{
		document.contact.telefon.value="";
	}
	if(document.contact.email.value!="")
	{
		document.contact.email.value="";
	}
	if(document.contact.observatii.value!="")
	{
		document.contact.observatii.value="";
	}
}

function resetConferinta()
{
	
	if(document.forms[0].nume.value!="")
	{
		document.forms[0].nume.value="";
	}
	
	if(document.forms[0].prenume.value!="")
	{
		document.forms[0].prenume.value="";
	}
	
	if(document.forms[0].adresa.value!="")
	{
		document.forms[0].adresa.value="";
	}
	if(document.forms[0].telefon.value!="")
	{
		document.forms[0].telefon.value="";
	}
	if(document.forms[0].email.value!="")
	{
		document.forms[0].email.value="";
	}
	if(document.forms[0].oras.value!="")
	{
		document.forms[0].oras.value="";
	}
	
	if (document.forms[0].program1.checked==true)	
	{
		document.forms[0].program1.checked=false;
	}
	
	if (document.forms[0].program2.checked==true)	
	{
		document.forms[0].program2.checked=false;
	}
	
	if (document.forms[0].program3.checked==true)	
	{
		document.forms[0].program3.checked=false;
	}
	
	if (document.forms[0].sunt.checked==true)	
	{
		document.forms[0].sunt.checked=false;
	}
}

function PopupPic(sPicURL) { 
     window.open( "eltek.htm?"+sPicURL, "poza", "resizable=no,scrollbars=no,HEIGHT=50,WIDTH=200,left=30,top=30"); 
}
  
function PopupPic2(sPicURL) { 
     window.open( "petreceri.htm?"+sPicURL, "poza", "resizable=no,scrollbars=no,HEIGHT=50,WIDTH=200,left=30,top=30"); 
  }
  
  // JavaScript Document
// flash.js
function flash(s) { document.writeln(s); }  
