<html xmlns:sds=""><!-- #BeginTemplate "/Templates/search_page.dwt" -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>Indexing Schedule</title>
<style>
@media all
{
  sds\:spinbox {behavior:url(spinbox.htc)}
}
</style>
<!-- #EndEditable --> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<link rel="stylesheet" href="search.css"/>
<script language="JavaScript" src="search_errors.js"></script>
<script language="VBScript" src="vb_utils.js"></script>
<script language="JavaScript" src="external_io.js"></script>
<script language="JavaScript" src="ui_utils.js"></script>
<script language="JavaScript" src="math_utils.js"></script>
</head>

<body bgcolor="#FFFFFF" style="background-image:  url(Images/Branding.gif); background-repeat:no-repeat; background-position:center center">
<!-- #BeginEditable "Page%20Script%20Top" -->
<script language="JavaScript" src="indexing_schedule.js"></script>
<script language="JavaScript" src="spinbox.js"></script>

<script language="JavaScript">
// define page scope variables
var schedule_on_off;  // scheduling turned on or off (on/off)
var schedule_option;  // daily scheduling (daily/weekly)

function SetFieldDisplay(on_off, option)
{
  if(on_off == "off")
  {
    document.all.daily_schedule.style.display = "none";
	document.all.weekly_schedule.style.display = "none";
  }
  else
  {
    if(option == "daily")
    {
      document.all.daily_schedule.style.display = "";
      document.all.weekly_schedule.style.display = "none";
    }
    else
    {
      document.all.daily_schedule.style.display = "none";
      document.all.weekly_schedule.style.display = "";
    }
  }
}

function OnLoadPage()
{
  // load all data displayed in this page
  var values = GetIndexingSchedule();
  var def_values = GetAppValues("Schedule");
  
  SetRadioButton(document.all.schedule_on_off, values["OnOff"]);
  SetListBox(document.all.schedule_option_list, values["Option"]);
  
  if(values["Option"] == "daily")
  {
    SetDateBox(document.all.daily_start_date, values["Daily/StartDate"]);
    SetTimeBox(document.all.daily_start_time, values["Daily/StartTime"]);
    SetSpinBox(document.all.daily_option, values["Daily/Option"]);
	
    SetDateBox(document.all.weekly_start_date, def_values["Weekly/StartDate"]);
    SetTimeBox(document.all.weekly_start_time, def_values["Weekly/StartTime"]);
    SetCheckBox(document.all.monday, def_values["Weekly/Monday"]);
    SetCheckBox(document.all.tuesday, def_values["Weekly/Tuesday"]);
    SetCheckBox(document.all.wednesday, def_values["Weekly/Wednesday"]);
    SetCheckBox(document.all.thursday, def_values["Weekly/Thursday"]);
    SetCheckBox(document.all.friday, def_values["Weekly/Friday"]);
    SetCheckBox(document.all.saturday, def_values["Weekly/Saturday"]);
    SetCheckBox(document.all.sunday, def_values["Weekly/Sunday"]);	
  }
  else if(values["Option"] == "weekly")
  {
    SetDateBox(document.all.daily_start_date, def_values["Daily/StartDate"]);
    SetTimeBox(document.all.daily_start_time, def_values["Daily/StartTime"]);
    SetSpinBox(document.all.daily_option, def_values["Daily/Option"]);
	
    SetDateBox(document.all.weekly_start_date, values["Weekly/StartDate"]);
    SetTimeBox(document.all.weekly_start_time, values["Weekly/StartTime"]);
    SetCheckBox(document.all.monday, values["Weekly/Monday"]);
    SetCheckBox(document.all.tuesday, values["Weekly/Tuesday"]);
    SetCheckBox(document.all.wednesday, values["Weekly/Wednesday"]);
    SetCheckBox(document.all.thursday, values["Weekly/Thursday"]);
    SetCheckBox(document.all.friday, values["Weekly/Friday"]);
    SetCheckBox(document.all.saturday, values["Weekly/Saturday"]);
    SetCheckBox(document.all.sunday, values["Weekly/Sunday"]);
  }

  // set visibility of fieldset areas
  schedule_on_off = values["OnOff"];
  schedule_option = values["Option"];
  SetFieldDisplay(schedule_on_off, schedule_option);
  
  // set up spinning behavior of spinbox
  SetContinuousSpin(document.all.daily_option);
}

function OnSavePage()
{
  var values = new Array();
  
  values["OnOff"] = GetRadioButton(document.all.schedule_on_off);
  values["Option"] = GetListBox(document.all.schedule_option_list);
  
  if(values["Option"] == "daily")
  {
    values["Daily/StartDate"] = GetDateBox(document.all.daily_start_date);
    values["Daily/StartTime"] = GetTimeBox(document.all.daily_start_time);
    values["Daily/Option"] = GetSpinBox(document.all.daily_option);
  }
  else if(values["Option"] == "weekly")
  {
    values["Weekly/StartDate"] = GetDateBox(document.all.weekly_start_date);
    values["Weekly/StartTime"] = GetTimeBox(document.all.weekly_start_time);
    values["Weekly/Monday"] = GetCheckBox(document.all.monday);
    values["Weekly/Tuesday"] = GetCheckBox(document.all.tuesday);
    values["Weekly/Wednesday"] = GetCheckBox(document.all.wednesday);
    values["Weekly/Thursday"] = GetCheckBox(document.all.thursday);
    values["Weekly/Friday"] = GetCheckBox(document.all.friday);
    values["Weekly/Saturday"] = GetCheckBox(document.all.saturday);
    values["Weekly/Sunday"] = GetCheckBox(document.all.sunday);
	
    if(!IsDayOfWeekSelected(values))
	{
      alert(/*IDS_E_NO_DAYOFTHEWEEK*/"Bisogna selezionare al meno un 'Giorno della settimana'.\n");
	  return;
	}
  }
  
  if(!SetIndexingSchedule(values))
    alert(/*IDS_E_INDEXING_NOT_SAVED*/"I dati dell'indicizzazione non vengono salvati.\n");	
  window.location = "default.htm";
}

// is at least one of days of week selected
function IsDayOfWeekSelected(values)
{
  if(values["Weekly/Monday"] == "true")
    return true;
  if(values["Weekly/Tuesday"] == "true")
    return true;
  if(values["Weekly/Wednesday"] == "true")
    return true;
  if(values["Weekly/Thursday"] == "true")
    return true;
  if(values["Weekly/Friday"] == "true")
    return true;
  if(values["Weekly/Saturday"] == "true")
    return true;
  if(values["Weekly/Sunday"] == "true")
    return true;

  return false;
}

function OnClickScheduleOnOff()
{
  schedule_on_off = GetRadioButton(document.all.schedule_on_off);
  SetFieldDisplay(schedule_on_off, schedule_option);
}

function OnChangeScheduleOption()
{
  // toggle the flag
  if(schedule_option == "daily")
    schedule_option = "weekly";
  else
    schedule_option = "daily";

  // set up visibility depending on Daily or Weekly option is selected
  SetFieldDisplay(schedule_on_off, schedule_option);
}
</script>

<script language="JavaScript" for="window" event="onload()">
OnLoadPage();
</script>

<script language="JavaScript" for="schedule_on_off" event="onclick()">
OnClickScheduleOnOff();
</script>

<script language="JavaScript" for="schedule_option_list" event="onchange()">
OnChangeScheduleOption();
</script>

<script language="JavaScript" for="save_button" event="onclick()">
OnSavePage();
</script>

<script language="JavaScript" for="cancel_button" event="onclick()">
window.location = "default.htm";
</script>
<!-- #EndEditable --> 

<!-- #BeginEditable "Top%20Area" --><!-- #EndEditable -->

<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#CCCCCC"  vspace="0" hspace="0" height="24">
  <tr> 
    <td width="6%">
	  <a id="home_link" href="default.htm">
	    <img src="Images/search_home.bmp" border="0"		  title="Ritorna alla Ricerca Pagina Iniziale" width="20" height="20"		  style="position:relative; top:2;" loc="title:id=IDS_BACK_TO_SEARCH_HOME"/> 
      </a>
	</td>
    <td> 
      <div id="page_title_area" align="center">
	  <!-- #BeginEditable "Title" --><b><loc id="IDS_INDEXING_SCHEDULE">Orari d'indicizzazione</loc></b><!-- #EndEditable -->
	  </div>
    </td>
    <td width="180"> 
      <div id="page_link_area" align="right">
	  <!-- #BeginEditable "Links" -->
	  <a href="index_databases.htm"><loc id="IDS_INDEX_DATABASES">Databasi Indice</loc></a><!-- #EndEditable -->
	  </div>
    </td>
  </tr>
</table>
<!-- #BeginEditable "Work%20Area" -->
<blockquote> 
  <input type="radio" name="schedule_on_off" value="on"/>
  <loc id="IDS_RADIO_PERFORM_INDEXING">Effettuare indicizzazione</loc> 
  <select name="schedule_option_list" size="1">
    <option value="daily"><loc id="IDS_ITEM_DAILY">Quotidiano</loc></option>
    <option value="weekly"><loc id="IDS_ITEM_WEEKLY">Settimanalmente</loc></option>
  </select><br/>
  <input type="radio" name="schedule_on_off" value="off"/>
  <loc id="IDS_RADIO_SCHEDULE_OFF">Orari disattivati</loc>
</blockquote>

<div id="daily_schedule">
<blockquote>
  <fieldset><legend>&#160;<loc id="IDS_GROUP_DAILY_SCHEDULE">Orario quotidiano</loc></legend> 
  <blockquote> 
    <p><loc id="IDS_EDIT_START_DATE">Data d'avvio:</loc><br/>
      <object id="daily_start_date" class="date_entry" classid="clsid:D58612F4-2E23-4810-852F-745FBAA95D7A">
        <param name="DTFLAG" value="1"/>
      </object>
    </p>
    <p><loc id="IDS_EDIT_START_TIME">Ora di inzio:</loc><br/>
 	  <object id="daily_start_time" class="time_entry" classid="clsid:D58612F4-2E23-4810-852F-745FBAA95D7A">
        <param name="DTFLAG" value="2"/>
      </object>
    </p>
    <p><loc id="IDS_EDIT_PERFORM_INDEXING">Effettuare l'indicizzazione:</loc>
	<br/> <loc id="IDS_EDIT_EVERY"> Tutti </loc> <sds:spinbox id="daily_option" minvalue="1" maxvalue="7" size="2" /> <loc id="IDS_EDIT_DAYS"> Giorno (giorni) </loc>
    </p>
  </blockquote>
  </fieldset>
</blockquote>
</div>

<div id="weekly_schedule"> 
  <blockquote> <fieldset><legend>&#160;<loc id="IDS_GROUP_WEEKLY_SCHEDULE">Orario settimanale</loc></legend> 
    <blockquote> 
      <p><loc id="IDS_EDIT_START_DATE">Data d'avvio:</loc><br/>
        <object id="weekly_start_date" class="date_entry" classid="clsid:D58612F4-2E23-4810-852F-745FBAA95D7A">
          <param name="DTFLAG" value="1"/>
        </object>
      </p>
      <p><loc id="IDS_EDIT_START_TIME">Ora di inzio:</loc><br/>
        <object id="weekly_start_time" class="time_entry" classid="clsid:D58612F4-2E23-4810-852F-745FBAA95D7A">
          <param name="DTFLAG" value="2"/>
        </object>
      </p>
      <loc id="IDS_EDIT_DAYSOFTHEWEEK">Giorno (giorni) della settimana:      </loc>
      <table width="59%" border="0">
        <tr>
          <td width="49%"> 
            <input type="checkbox" name="monday" value="checkbox"/>
            <loc id="IDS_EDIT_MONDAY">Luned</loc></td>
          <td width="51%"> 
            <input type="checkbox" name="saturday" value="checkbox"/>
            <loc id="IDS_EDIT_SATURDAY">Sabato</loc></td>
        </tr>
        <tr>
          <td width="49%" height="23"> 
            <input type="checkbox" name="tuesday" value="checkbox"/>
            <loc id="IDS_EDIT_TUESDAY">Marted</loc></td>
          <td width="51%" height="23"> 
            <input type="checkbox" name="sunday" value="checkbox"/>
            <loc id="IDS_EDIT_SUNDAY">Domenica</loc></td>
        </tr>
        <tr>
          <td width="49%"> 
            <input type="checkbox" name="wednesday" value="checkbox"/>
            <loc id="IDS_EDIT_WEDNESDAY">Mercoled</loc></td>
          <td width="51%"> </td>
        </tr>
        <tr>
          <td width="49%"> 
            <input type="checkbox" name="thursday" value="checkbox"/>
            <loc id="IDS_EDIT_THURSDAY">Gioved</loc></td>
          <td width="51%"> </td>
        </tr>
        <tr>
          <td width="49%" height="2"> 
            <input type="checkbox" name="friday" value="checkbox"/>
            <loc id="IDS_EDIT_FRIDAY">Venerd</loc> </td>
          <td width="51%" height="2"> </td>
        </tr>
      </table>
    </blockquote>
    </fieldset></blockquote>
</div>

<span id="save_cancel_area">
<hr/>
<table width="100%" border="0" cellspacing="5" cellpadding="5">
  <tr> 
    <td width="47%"> 
      <div align="right"> 
        <input type="button" name="save_button" value="Salva" loc="value:id=IDS_BUTTON_SAVE"/>
      </div>
    </td>
	<td width="6%">
	</td>
    <td width="47%"> 
      <div align="left"> 
        <input type="button" name="cancel_button" value="Annulla" loc="value:id=IDS_BUTTON_CANCEL"/>
      </div>
    </td>
  </tr>
</table>
</span>
<!-- #EndEditable -->

<!-- #BeginEditable "Page%20Script%20Bottom" --><!-- #EndEditable --> 
</body>
<!-- #EndTemplate --></html>
