 function reloadit() {

   checkit = self.location.href;

   if(!checkit.match('#'))  {

     window.location.replace(checkit + '#');

     document.location.reload();

     

   }

  }


 


//////////////////////////////////////

/*function valid(reg) {

 var alphaExp = /^[ -0-9a-zA-Z]{2,}$/;
 
 var adrExp = /^[ -0-9a-zA-Z.,]{2,}$/;
 
 var userExp = /^[_-0-9a-zA-Z.]{3,}$/;
 
 var passExp = /^[0-9a-zA-Z]{4,40}$/

 var emailExp=/^([-.a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/;

 var numExp =/^[0-9]{10}$/;


function isNotEmpty(val){

  return ((trim(val)).length>0);

}



function trim(s) {



  while (s.substring(0,1) == ' ') {

    s = s.substring(1,s.length);

  }



  while (s.substring(s.length-1,s.length) == ' ') {

    s = s.substring(0,s.length-1);

  }



  return s;



}

  if (!isNotEmpty.test(reg.nume.value)) {

    reg.nume.style.background='url(images/input_error.png) no-repeat';

	reg.nume.focus();

    return false;

  }

  else { 

   	reg.nume.style.background='url(images/camp2.png) no-repeat'; 

  } 

  

  

  if (!isNotEmpty.test(reg.user.value)) {

     reg.user.style.background='url(images/input_error.png) no-repeat';

	reg.user.focus();

    return false;

  }

  

  else { 

   	reg.user.style.background='url(images/camp2.png) no-repeat'; 

  } 

  



  if (!passExp.test(reg.pass.value)) {

     reg.pass.style.background='url(images/input_error.png) no-repeat';

	reg.pass.focus();

    return false;

  }

  else { 

  	reg.pass.style.background='url(images/camp2.png) no-repeat'; } 

  

   if (!passExp.test(reg.rpass.value)) {

     reg.rpass.style.background='url(images/input_error.png) no-repeat';

	reg.rpass.focus();

    return false;

  }

  else { 

  	reg.rpass.style.background='url(images/camp2.png) no-repeat'; } 

 

  if (reg.pass.value != reg.rpass.value) {

	 alert('Cele doua parole nu sunt identice');

     reg.rpass.style.background='url(images/input_error.png) no-repeat';

	reg.rpass.focus();

    return false;

  }

  else { 

  	reg.rpass.style.background='url(images/camp2.png) no-repeat'; 

} 
 
 if(!isNotEmpty.test(reg.adres.value)){
	 
	  reg.adres.style.background='url(images/input_error.png) no-repeat';

	  reg.adres.focus();

      return false;

 }else{
	 reg.adres.style.background='url(images/camp2.png) no-repeat';
 }
 

 if (!numExp.test(reg.tel.value)) {

    reg.tel.style.background='url(images/input_error.png) no-repeat';

	reg.tel.focus();

    return false;

  }

  else { 

  	reg.tel.style.background='url(images/camp2.png) no-repeat';

  } 

  

   if (!emailExp.test(reg.email.value)) {

 	reg.email.style.background='url(images/input_error.png) no-repeat';

	reg.email.focus();

    return false;

  }

  else { 

 	 reg.email.style.background='url(images/camp2.png) no-repeat'; 

   }

   if (!isNotEmpty(reg.code.value)) {

     reg.code.style.background='url(images/input_error.png) no-repeat';

	reg.code.focus();

    return false;

  }

  else { 

  	reg.code.style.background='url(images/camp2.png) no-repeat'; } 

  

  return true;

}


*/


///////////////////////////////////////

function sendFasr(reget) {

 var alphaExp = /^[ -0-9a-zA-Z!?;,.]+$/;

 var emailExp=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/;

 var numExp =/^[0-9]{10}$/;
 
 
function isNotEmptyN(val){
  return ((trim(val)).length>2);
}
function isNotEmptyC(val){
  return ((trim(val)).length>3);
}
function trim(s) {

  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }

  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }

  return s;

}
  if (!isNotEmptyN(reget.nume.value)) {
    reget.nume.style.background='url(images/input_error.png) no-repeat';
	reget.nume.focus();
    return false;
  }
  else { 
   	reget.nume.style.background='url(images/input_bgk.png) no-repeat'; 
  } 
  
  if (!isNotEmptyN(reget.adres.value)) {
    reget.adres.style.background='url(images/input_error.png) no-repeat';
	reget.adres.focus();
    return false;
  }
  else { 
   	reget.adres.style.background='url(images/input_bgk.png) no-repeat'; 
  } 
  
  
  if (!isNotEmptyN(reget.oras.value)) {
    reget.oras.style.background='url(images/input_error.png) no-repeat';
	reget.oras.focus();
    return false;
  }
  else { 
   	reget.oras.style.background='url(images/input_bgk.png) no-repeat'; 
  } 
  
   if (!isNotEmptyN(reget.judet.value)) {
    reget.judet.style.background='url(images/input_error.png) no-repeat';
	reget.judet.focus();
    return false;
  }
  else { 
   	reget.judet.style.background='url(images/input_bgk.png) no-repeat'; 
  } 
  
  
 
 if (!numExp.test(reget.tel.value)) {
    reget.tel.style.background='url(images/input_error.png) no-repeat';
	reget.tel.focus();
    return false;
  }
  else { 
  	reget.tel.style.background='url(images/input_bgk.png) no-repeat';
  } 
  
   if (!emailExp.test(reget.email.value)) {
 	reget.email.style.background='url(images/input_error.png) no-repeat';
	reget.email.focus();
    return false;
  }
  else { 
 	 reget.email.style.background='url(images/input_bgk.png) no-repeat'; 
   }
   if (!isNotEmptyC(reget.code.value)) {
     reget.code.style.background='url(images/input_error.png) no-repeat';
	reget.code.focus();
    return false;
  }
  else { 
  	reget.code.style.background='url(images/input_bgk.png) no-repeat'; } 
  
  return true;

}

///////////////////////////////////////

function notrics(edit) {

 var alphaExp =  /^[ -0-9a-zA-Z!?;,.]+$/;

 var emailExp=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/;

 var numExp =/^[0-9]{10}$/;
 
 var passExp =/^[0-9a-zA-Z]{4,40}$/

function isNotEmpty(val){

  return ((trim(val)).length>0);

}



function trim(s) {



  while (s.substring(0,1) == ' ') {

    s = s.substring(1,s.length);

  }



  while (s.substring(s.length-1,s.length) == ' ') {

    s = s.substring(0,s.length-1);

  }



  return s;



}

  

 

  if (edit.pass.value != edit.rpass.value) {

	 alert('Cele doua parole nu sunt identice');

     edit.rpass.style.background='url(images/input_error.png) no-repeat';

	edit.rpass.focus();

    return false;

  }

  else { 

  	edit.rpass.style.background='url(images/camp2.png) no-repeat'; 

} 

 

 if (!numExp.test(edit.tel.value)) {

    edit.tel.style.background='url(images/input_error.png) no-repeat';

	edit.tel.focus();

    return false;

  }

  else { 

  	edit.tel.style.background='url(images/camp2.png) no-repeat';

  } 

  

   if (!emailExp.test(edit.email.value)) {

 	edit.email.style.background='url(images/input_error.png) no-repeat';

	edit.email.focus();

    return false;

  }

  else { 

 	 edit.email.style.background='url(images/camp2.png) no-repeat'; 

   }

   

  

  return true;

}

/////////////////////////////

function sendmail(send) {

 var alphaExp = /^[ -0-9a-zA-Z!?;,.]{2,}$/;
 

 var emailExp=/^(.-[a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/;

 var numExp =/^[0-9]{10}$/;
 


function isNotEmpty(val){

  return ((trim(val)).length>3);

}

function isNotEmptys(val){

  return ((trim(val)).length>6);

}

function trim(s) {



  while (s.substring(0,1) == ' ') {

    s = s.substring(1,s.length);

  }



  while (s.substring(s.length-1,s.length) == ' ') {

    s = s.substring(0,s.length-1);

  }



  return s;



}

  
  


  if (!alphaExp.test(send.nume.value)) {

    send.nume.style.background='url(images/input_error.png) no-repeat';

	send.nume.focus();

    return false;

  }

  else { 
 	send.nume.style.background='url(images/camp2.png) no-repeat';
  }

 

   if (!alphaExp.test(send.prenume.value) ) {

     send.prenume.style.background='url(images/input_error.png) no-repeat';

	send.prenume.focus();

    return false;

  }

  else { 

  	send.prenume.style.background='url(images/camp2.png) no-repeat'; } 

  

 if (!emailExp.test(send.email.value)) {

 	send.email.style.background='url(images/input_error.png) no-repeat';

	send.email.focus();

    return false;

  }

  else { 

 	 send.email.style.background='url(images/camp2.png) no-repeat'; 

   }

   if (!numExp.test(send.tel.value)) {

 	send.tel.style.background='url(images/input_error.png) no-repeat';

	send.tel.focus();

    return false;

  }

  else { 

 	 send.tel.style.background='url(images/camp2.png) no-repeat'; 

   } 

   

  if (!alphaExp(send.subiect.value)) {

     send.subiect.style.background='url(images/input_error.png) no-repeat';

	send.subiect.focus();

    return false;

  }

  else { 

  	send.subiect.style.background='url(images/camp2.png) no-repeat'; 
	} 

 

  if (!alphaExp(send.message.value)) {

     send.message.style.background='url(images/text_area_erorr.png) no-repeat';

	send.message.focus();

    return false;

  }

  else { 
  	send.message.style.background='url(images/text_area.png) no-repeat';  
	} 

	

   

  

  return true;

}



 

////////////////////////////////

function validSearch(searche) {

var illegalChars= /[\(\)\<\>\,\;\:\\\"\'\[\]]/ ;	

function isNotEmpty(val){

  return ((trim(val)).length>0);

}



function trim(s) {  while (s.substring(0,1) == ' ') { s = s.substring(1,s.length);  }

  while (s.substring(s.length-1,s.length) == ' ') {    s = s.substring(0,s.length-1);  }

  return s;

} 

 

   if (!isNotEmpty(searche.cauta.value)) {

 	alert('Va rugam sa introduceti un cuvant!');

	searche.cauta.focus();

    return false;

  }

  if (searche.cauta.value.length < 3) {

 	alert('Va rugam sa introduceti un cuvant corspunzator!');

 	searche.cauta.focus();

    return false;

  }

   if (searche.cauta.value.match(illegalChars)) {

        alert('NU sunt admise caractere ilegale!');

		searche.cauta.focus();

 		 return false;

    }  

   

  return true;

} 







///////////////////////////
/*
function logareValid(lockdown) {

 var alphaExp = /^[_-0-9a-zA-Z]{4,20}$/;
 
 var passExp = /^[0-9a-zA-Z]{4,40}$/;

function isNotEmpty(val){

  return ((trim(val)).length>0);

}



function trim(s) {



  while (s.substring(0,1) == ' ') {

    s = s.substring(1,s.length);

  }



  while (s.substring(s.length-1,s.length) == ' ') {

    s = s.substring(0,s.length-1);

  }



  return s;



}

  



if (!alphaExp.test(lockdown.user.value)) {

	lockdown.user.style.background='url(images/input_error.png) no-repeat';

	lockdown.user.focus();

	return false;

}

else { 

	lockdown.user.style.background='url(images/camp2.png) no-repeat';

} 



if (!passExp.test(lockdown.pass.value)) {

	lockdown.pass.style.background='url(images/input_error.png) no-repeat';

	lockdown.pass.focus();

	return false;

}

else { 

	lockdown.pass.style.background='url(images/camp2.png) no-repeat';

} 



return true;

}

 
///////////////////////////

function logareValid2(lockdown2) {

 var alphaExp = /^[0-9a-zA-Z]+$/;

 var emailExp=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/;
 
function isNotEmpty(val){

  return ((trim(val)).length>0);

}



function trim(s) {



  while (s.substring(0,1) == ' ') {

    s = s.substring(1,s.length);

  }



  while (s.substring(s.length-1,s.length) == ' ') {

    s = s.substring(0,s.length-1);

  }



  return s;



}
if (!emailExp.test(lockdown2.email.value)) {

 	lockdown2.email.style.background='url(images/input_error.png) no-repeat';

	lockdown2.email.focus();

    return false;

  }

  else { 

 	lockdown2.email.style.background='url(images/camp2.png) no-repeat'; 

   }

return true;
}

 

 
 */
