function checkMappaForm() {
  nrp = nrp.replace(",]", "]");
  document.elenco_posti.nrp.value = nrp;
  document.elenco_posti.submit();
  return true;
}


function Puliscimi(obj, txt_default) {
 if (obj.value == txt_default) {
   obj.value = '';
 }
 return true;
}

function stampa_popup(){
 var testo = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>"+document.title+"</title><link rel=\"stylesheet\" type=\"text/css\" href=\"css_teatri.css\"></head>";
 testo += "<body><center><a href=\"javascript:print();\">Stampa</a><br><br>";
 testo += "<table width=\"100%\" border=\"0\"><tr><td>";
 testo += document.getElementById('stampa').innerHTML+"</td></tr></table>";
 testo += "</body></html>";
 var ident_finestra = window.open("","finestra_stampa","height=400,width=400");
 ident_finestra.document.open();
 ident_finestra.document.write(testo);
 ident_finestra.document.close();
 ident_finestra.print();
 ident_finestra.close(); 
}

// format = 1 : verticale --- format = 2 : orizzontale
function stampa_popup_agenzie(idp, htid, format) {
 if (format == 1) {
   var ident_finestra = window.open('https://www.happyticket.it/agenzia/done_fake_html?print_now=yes&id_prenotazioni='+idp+'&HappyTicketId='+htid,'finestra_stampa','height=400,width=400');
 }
 else if (format == 2) {
   var ident_finestra = window.open('https://www.happyticket.it/agenzia/done_fake_landscape_html?print_now=yes&id_prenotazioni='+idp+'&HappyTicketId='+htid,'finestra_stampa','height=400,width=400');
 }
}


function take(cP) {
 if (cP.src == iF.src) {
   cP.src=iS.src;
   nrp = nrp.replace("]", cP.name + ",]");
 }
 else {
   cP.src = iF.src;
   nrp = nrp.replace("," + cP.name + ",", ",");
   nrp = nrp.replace("[" + cP.name + ",", "[");
 }
 return;
}

function CheckLoginCruscotto() {
  if ((document.login_cruscotto.nickname.value.length == 0) || (document.login_cruscotto.password.value.length == 0))
  {
    alert("EHI!\nDevi digitare il tuo username e la tua password !");
    return false;
  }
  else {
    document.login_cruscotto.submit();
    return false;
  }
}