function verifyForm() {
			if(document.getElementById("serie").value=="" ) 
	{alert('Seria facturii e camp obligatoriu');
		document.getElementById("serie").focus();
	return false;}
	if(document.getElementById("numar").value=="")
	{alert('Numarul facturii e camp obligatoriu');
		document.getElementById("numar").focus();
	return false;}	
	
	if(document.getElementById("data").value=="" ) 
	{ alert('Data facturii e camp obligatoriu');
	return false;}
	if(document.getElementById("denumire_c").value=="")
	{alert('Denumirea clientului e camp obligatoriu');
	
	document.getElementById("denumire_c").focus();
	return false;}	

		if(document.getElementById("sediul_c").value=="" ) 
	{alert('Seciul clientului e camp obligatoriu');
		document.getElementById("sediul_c").focus();
	return false;}
	if(document.getElementById("cui_c").value=="")
	
	{alert('Codul de inregistrare al clientului e camp obligatoriu');
	   document.getElementById("cui_c").focus();
	return false;}	
	
	
	document.getElementById("form1").submit(); return true;


}






function verifySerie(obj) {

var strValidChars = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";

var strChar;

var strString = obj.value;

var result = true;


   for (i = 0; i < strString.length && result == true; i++)

      {

      strChar = strString.charAt(i);

      if (strValidChars.indexOf(strChar) == -1)

         {

         result = false;

         }

      }

return result;
}












//

function verifyGeneral(obj, strValidChars){

//var strValidChars = "0123456789.-/";

var strChar;

var strString = obj.value;

var result = true;



 //  if (strString.length == 0) return false;



   //  test strString consists of valid characters listed above

   for (i = 0; i < strString.length && result == true; i++)

      {

      strChar = strString.charAt(i);

      if (strValidChars.indexOf(strChar) == -1)

         {

         result = false;

         }

      }

      

if (result == false){

alert("Campul "+obj.name+" accepta doar "+strValidChars+"!");

obj.value = "";

return false;

}
else return true;
}





function verifyNumeric(obj){

var strValidChars = "0123456789.-";

var strChar;

var strString = obj.value;

var result = true;



 //  if (strString.length == 0) return false;



   //  test strString consists of valid characters listed above

   for (i = 0; i < strString.length && result == true; i++)

      {

      strChar = strString.charAt(i);

      if (strValidChars.indexOf(strChar) == -1)

         {

         result = false;

         }

      }

      



if (result == false){

//selectTab(currentlySelectedTab);

alert("Campul "+obj.name+" este numeric!");

obj.value = "";

//setTimeout( 'setFocusDelayed("'+obj.id+'")', 100 );

return false;

}
else return true;
}



function verifyNumericStrict(obj){

var strValidChars = "0123456789.-";

var strChar;

var strString = obj.value;

var result = true;



 //  if (strString.length == 0) return false;



   //  test strString consists of valid characters listed above

   for (i = 0; i < strString.length && result == true; i++)

      {

      strChar = strString.charAt(i);

      if (strValidChars.indexOf(strChar) == -1)

         {

         result = false;

         }

      }

      



if (result == false){

//selectTab(currentlySelectedTab);

alert("Campul "+obj.name+" este numeric!");

obj.value = "";

//setTimeout( 'setFocusDelayed("'+obj.id+'")', 100 );

return false;

}
else return true;
}


function verifyString(obj){

var strValidChars = " QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";

var strChar;

var strString = obj.value;

var result = true;



 //  if (strString.length == 0) return false;



   //  test strString consists of valid characters listed above

   for (i = 0; i < strString.length && result == true; i++)

      {

      strChar = strString.charAt(i);

      if (strValidChars.indexOf(strChar) == -1)

         {

         result = false;

         }

      }

      



if (result == false){

//selectTab(currentlySelectedTab);

alert("Campul "+obj.name+" este literal!");

obj.value = "";

//setTimeout( 'setFocusDelayed("'+obj.id+'")', 100 );

return false;

}
else return true;
}








String.prototype.trim = function() {

 // skip leading and trailing whitespace

 // and return everything in between

  var x=this;

  x=x.replace(/^\s*(.*)/, "$1");

  x=x.replace(/(.*?)\s*$/, "$1");

  return x;

}



function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57 ) && charCode!=46)
            return false;

         return true;

      }

function handleEnter (field, event) {
        var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
        if (keyCode == 13) {
            var i;
            for (i = 0; i < field.form.elements.length; i++)
                if (field == field.form.elements[i])
                break;
            i = (i + 1) % field.form.elements.length;
            field.form.elements[i].focus();
			event.handled = true;
            return false;
        } 
        else
        return true;
    }

