/*function initFrm01(){
  if (document.all) {
    document.all['type1'].checked = true;
  }else{
    document.getElementById('type1').checked = true;
  }
}

function initFrm01b(tipo){
  if (document.all) {
    document.all[tipo].checked = true;
  }else{
    document.getElementById(tipo).checked = true;
  }
  if (tipo=='type1') {
    mostra('spboxret,boxret');testSubmitFrm01();
  }else if (tipo=='type2') {
    nascondi('spboxret,boxret');document.getElementById('rtmc').value='';testSubmitFrm01();
  }
}*/

function nascondi(argomenti){
  var argomento=argomenti.split(",");
  for (i=0; i<argomento.length; i++) {
    if (document.all) {
      document.all[argomento[i]].style.display = "none";
    }else{
      document.getElementById(argomento[i]).style.display = "none";
    }
  }
}

function mostra(argomenti){
  var argomento=argomenti.split(",");
  for (i=0; i<argomento.length; i++) {
    if (document.all) {
      document.all[argomento[i]].style.display = "";
    }else{
      document.getElementById(argomento[i]).style.display = "";
    }
  }
}

function blocca(argomenti){
  var argomento=argomenti.split(",");
  for (i=0; i<argomento.length; i++) {
    if (document.all) {
      document.all[argomento[i]].disabled = true;
      document.all[argomento[i]].className ='campi3';
    }else{
      document.getElementById(argomento[i]).disabled = true;
      document.getElementById(argomento[i]).className ='campi3';
    }
  }
}

function sblocca(argomenti){
  var argomento=argomenti.split(",");
  for (i=0; i<argomento.length; i++) {
    if (document.all) {
      document.all[argomento[i]].disabled = false;
      document.all[argomento[i]].className ='campi';
    }else{
      document.getElementById(argomento[i]).disabled = false;
      document.getElementById(argomento[i]).className ='campi';
    }
  }
}

function bloccaSubmit(argomenti){
  var argomento=argomenti.split(",");
  for (i=0; i<argomento.length; i++) {
    if (document.all) {
      document.all[argomento[i]].disabled = true;
      document.all[argomento[i]].className ='butt2';
    }else{
      document.getElementById(argomento[i]).disabled = true;
      document.getElementById(argomento[i]).className ='butt2';
    }
  }
}

function sbloccaSubmit(argomenti){
  var argomento=argomenti.split(",");
  for (i=0; i<argomento.length; i++) {
    if (document.all) {
      document.all[argomento[i]].disabled = false;
      document.all[argomento[i]].className ='butt';
    }else{
      document.getElementById(argomento[i]).disabled = false;
      document.getElementById(argomento[i]).className ='butt';
    }
  }
}

function resetSelect(argomenti) {
  var argomento=argomenti.split(",");
  for (i=0; i<argomento.length; i++) {
    if (document.all) {
      document.all[argomento[i]].selectedIndex="";
    }else{
      document.getElementById(argomento[i]).selectedIndex="";
    }
  }
}

/*
function resetHidTxt(argomenti){
  var argomento=argomenti.split(",");
  for (i=0; i<argomento.length; i++) {
    if (document.all) {
      document.all[argomento[i]].value="";
    }else{
      document.getElementById(argomento[i]).value="";
    }
  }
}

function specificValue(campo,argomento){
  if (document.all) {
    document.all[campo].value=argomento;
  }else{
    document.getElementById(campo).value=argomento;
  }
}

function specificValueSelect(campo,argomento){
  if (document.all) {
    document.all[campo].options[0].text=argomento;
  }else{
    document.getElementById(campo).options[0].text=argomento;
  }
}
*/

function testSubmit() {
  var ok=false;
 
  var anno=document.getElementById('yrmc').value;
  var mese=document.getElementById('mnmc').value;
  var giorno=document.getElementById('dymc').value;
  var orario=document.getElementById('tmmc').value;

  if (anno=="0") {
    anno="";    
  }

  if (mese=="0") {
    mese="";    
  }

  if (giorno=="0") {
    giorno="";    
  }

  if (orario=="0") {
    orario="";    
  }

  if (anno!="" && mese!="" && giorno!="" && orario!="") {
    ok=true;
  }else{
    ok=false;
  }

  if (ok && (document.getElementById('adult').value!=0 || document.getElementById('child').value!=0 || document.getElementById('student').value!=0)) {
    sbloccaSubmit('checkp');    
  }else{
    bloccaSubmit('checkp');    
  }
}

// serve quando veniamo dalla calendario.asp e abbiamo anno, mese, giorno e orario passati dal form
function testSubmitC() {
  if (document.getElementById('adult').value!=0 || document.getElementById('child').value!=0 || document.getElementById('student').value!=0) {
    sbloccaSubmit('checkp');    
  }else{
    bloccaSubmit('checkp');    
  }
}

/*
function testSubmitFrm02() {
  var ok=false;
  
  var locationx=document.getElementById('lcmc').value;
  var tourx=document.getElementById('trmc').value;
  var deptimeFrm2=document.getElementById('dtmc2').value;

  if (locationx=="0") {
    locationx="";    
  }

  if (tourx=="0") {
    tourx="";    
  }

  if (deptimeFrm2=="0") {
    deptimeFrm2="";    
  }

  if (locationx!="" && tourx!="" && deptimeFrm2!="") {
    ok=true;
  }else{
    ok=false;
  }

  if (ok && (document.getElementById('adultFrm2').value!=0 || document.getElementById('childFrm2').value!=0 || document.getElementById('enfantFrm2').value!=0)) {
    sbloccaSubmit('bookFrm2');
  }else{
    bloccaSubmit('bookFrm2');
  }
}

function testSubmitFrm03() {
  var ok=false;
  
  var category=document.getElementById('typeFrm3').value;
  var locationy=document.getElementById('lhmc').value;
  var services=document.getElementById('sxmc').value;

  if (locationy=="0") {
    locationy="";    
  }

  if (services=="0") {
    services="";    
  }

  if ((category=="1" || category=="2") && locationy!="") {
    ok=true;
  } else if (category=="3" && locationy!="" && services!="") {
    ok=true;
  } else {
    ok=false;
  }

  if (ok) {
    sbloccaSubmit('bookFrm3');
  }else{
    bloccaSubmit('bookFrm3');
  }
}
*/

/*
function azzeraForm() {
  //FORM
  initFrm01();
  resetSelect('country,from,to,deptimeFrm1,rettime,adultFrm1,childFrm1,enfantFrm1');
  resetHidTxt('departFrm1,returnFrm1,cxmc,fmmc,tomc,dtmc,rtmc');
  bloccaSubmit('bookFrm1');
  blocca('from,to,type1,type2,departFrm1,deptimeFrm1,returnFrm1,rettime');
  mostra('spboxret,boxret');
  
  //FORM 2
  resetSelect('locationFrm2,tour,deptimeFrm2,adultFrm2,childFrm2,enfantFrm2');
  resetHidTxt('departFrm2,lcmc,trmc,dtmc2');
  bloccaSubmit('bookFrm2');
  blocca('tour,departFrm2,deptimeFrm2');
  
  //FORM 3
  resetSelect('typeFrm3,locationFrm3,service');
  resetHidTxt('lhmc,sxmc');
  bloccaSubmit('bookFrm3');
  blocca('locationFrm3,service');
}*/

/*function cambiaLingua(nome,valore,pagina) {
  var durata="";
  document.cookie = nome + "=" + valore + durata + "; path=/";
  window.location.href=pagina;
}*/


function testHidden(){
  alert("anno: " + document.getElementById('yrmc').value);
  alert("mese: " + document.getElementById('mnmc').value);
  alert("giorno: " + document.getElementById('dymc').value);
  alert("orario: " + document.getElementById('tmmc').value);
}
/*
function testHidden2(){
  alert("lcmc: " + document.getElementById('lcmc').value);
  alert("trmc: " + document.getElementById('trmc').value);
  alert("dtmc2: " + document.getElementById('dtmc2').value);
}

function testHidden3(){
  alert("lhmc: " + document.getElementById('lhmc').value);
  alert("sxmc: " + document.getElementById('sxmc').value);
}
*/

/*function azzeraReturn(argomento) {
    if (document.all) {
      document.all['return'].value = "returning date";
      //document.all['rettime'].value = "time";
    }else{
      document.getElementById('return').value = "returning date";
      //document.getElementById('rettime').value = "time";
    }
}*/

/*function dataCorrente(argomento) {
  oggix = new Date();
  giornox = oggix.getDay()+1;
  if (giornox < 10) {
    giornox = "0" + giornox + "/";    
  }else{
    giornox = giornox + "/";
  }
  mesex = oggix.getMonth()+1;
  if (mesex < 10) {
    mesex = "0" + mesex + "/";    
  }else{
    mesex = mesex + "/";
  }
  annox= oggix.getYear();
  if (annox < 1900) {
    annox = 1900 + annox;    
  }else{
    annox = annox;
  }
  
  oggi2x = giornox + mesex + annox

  if (document.all) {
    document.all[argomento].value = oggi2x;
  }else{
    document.getElementById(argomento).value = oggi2x;
  }
}*/
