// Nuova interfaccia diretta External, supportata da IE7, Firefox, Opera,...
function wizardCallback(new_dir)
  {
  thisform = document.getElementById('form1');

  switch(new_dir)
    {
    case "O":
      thisform.gradi_sud.value = "-90";
      document.getElementById('id_attuale').innerHTML = 'Tetto orientato a ovest';
      break;
    case "SO":
      thisform.gradi_sud.value = "-45";
      document.getElementById('id_attuale').innerHTML = 'Tetto orientato a sud ovest';
      break;
    case "S":
      thisform.gradi_sud.value = "0";
      document.getElementById('id_attuale').innerHTML = 'Tetto orientato a sud';
      break;
    case "SE":
      thisform.gradi_sud.value = "45";
      document.getElementById('id_attuale').innerHTML = 'Tetto orientato a sud est';
      break;
    case "E":
      thisform.gradi_sud.value = "90";
      document.getElementById('id_attuale').innerHTML = 'Tetto orientato a est';
      break;
    }
  }

// Interfaccia FSCommand di Firefox, Opera
function wizard_DoFSCommand(command, new_dir)
  {
  if (command == "wizardCallback")
    wizardCallback(new_dir);
  }

// Hook per FSCommand for Internet Explorer
//(in 6.x è l'unico modo, dal 7 funziona anche la chiamata diretta tramite interfaccia external, ma se si usa FSCommand, bisogna passare per di qua!)
// Ricordarsi che quello prima di _FSCommand è l'ID dell'oggetto FLASH
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1) {
        document.write('<SCRIPT LANGUAGE=VBScript\> \n');
        document.write('on error resume next \n');
        document.write('Sub wizard_FSCommand(ByVal command, ByVal args)\n');
        document.write('  call wizard_DoFSCommand(command, args)\n');
        document.write('end sub\n');
        document.write('</SCRIPT\> \n');
}