<!--
// ==============================================================================
// File Name           : preferences.htm 
// Description         : Preferences Search area
// Author(s)           : Baskaran V
// Date created        : 2009.01.05
// Last reviewed by    : 
// Last date of review : 
// Copyright           : (c) 2008, Sharp Software Development India Pvt Ltd., All rights reserved.
//                       All rights are reserved. Reproduction or transmission in whole or in part, in
//                       any form or by an means, electronic, mechanical or otherwise, is prohibited
//                       without the prior written consent of the copyright owner.

// ==============================================================================

-->

<html xmlns:sds="">
<head>
	<title>Preferences</title>
	<style>
		@media all
		{
			  sds\:spinbox {behavior:url(spinbox.htc)}
			  sds\:checklist {behavior:url(checklist.htc)}
		}
	</style>
	<link href="style.css" rel="stylesheet" type="text/css" />
	<!-- <script defer type="text/javascript" src="pngfix.js"></script> -->
	<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>
	<script type="text/javascript" src="Themes.js"></script>
	<script language="javascript" type="text/javascript">
	function Pageloading()
	{
	  try{
		  document.all.load_none.style.display = "none";
		  document.all.loadview.style.display = "inline";
		 }
	  catch(e){}	  
	}
	
	</script>
</head>

<body leftmargin="0" topmargin="0" class="Centerbg">
<script language="JavaScript" src="search_index.js"></script>
<script language="JavaScript" src="spinbox.js"></script>
<script language="JavaScript" src="preferences.js"></script>

<script language="JavaScript">
function OnAllIndexesButtonClick()
{
  SelectAllCheckListItems(document.all.index_list);
}

function OnAllFieldsButtonClick()
{
  SelectAllCheckListItems(document.all.field_list);
  
  // gray out fields not selectable for this view option
  // (currently only abstract field is not selectable
  // in summary option)
  SetFieldEnableStates(document.all.field_list,
    GetRadioButton(document.all.results_view_option));
}

function OnResultsViewRadioClick()
{
  var option = GetRadioButton(document.all.results_view_option);
  SetFieldEnableStates(document.all.field_list, option);
}

function OnFieldListClick()
{
  var doc_name = ToLocField("Document Name");
  var el = event.srcElement;
  
  if(el.id == doc_name)
  {
    /*alert("'Document Name' field can not be turned off.\n" +
	      "Will resume original setting.");*/
	alert(/*IDS_E_DOC_TURNED_OFF1*/"Non  possibile spegnere il campo 'Nome Documento'.\n" +
	      /*IDS_E_DOC_TURNED_OFF2*/"Ritorna alle impostazioni originali.");
  
    var values = new Array();
    values[doc_name] = "true";
    SetCheckListSelections(document.all.field_list, values);
  }
}

function OnLoadPage()
{
  Pageloading();
  SetCheckListItems(document.all.index_list, GetIndexNames());
  SelectCheckListItems(document.all.index_list, GetSelectedIndexNames()); 
  SetCheckList(document.all.field_list, ToLocFields(GetAppValues("Preferences/Fields")));
  
  var values = GetAppValues("Preferences");
  SetRadioButton(document.all.stemming_option, values["StemmingOption"]);
  SetCheckBox(document.all.favorites_display, values["FavoritesDisplay"]);
  SetCheckBox(document.all.index_display, values["IndexDisplay"]);
  
  //-- DisplayTrayIcon
  SetCheckBox(document.all.index_trayicon, values["DisplayTrayIcon"]);
  //-- end of the DisplayTrayIcon
  
  SetSpinBox(document.all.num_of_matches, values["NumOfMatches"]);
  SetRadioButton(document.all.results_view_option, values["ResultsViewOption"]);
  
  // if no index exists, gray out All Button
  // in Indexes to be Searched area
  if(GetNumOfIndexes() == 0)
    document.all.all_indexes_button.disabled = true;

  SetFieldEnableStates(document.all.field_list, values["ResultsViewOption"]);
  
  // set up spinning behavior of spinbox
  SetContinuousSpin(document.all.num_of_matches);
}

function OnSavePage()
{
  var values = new Array();
  values["StemmingOption"] = GetRadioButton(document.all.stemming_option);
  values["FavoritesDisplay"] = GetCheckBox(document.all.favorites_display);
  values["IndexDisplay"] = GetCheckBox(document.all.index_display);
  
  //-- DisplayTrayIcon
  values["DisplayTrayIcon"] = GetCheckBox(document.all.index_trayicon);
  //-- end of the DisplayTrayIcon
  
  values["NumOfMatches"] = GetSpinBox(document.all.num_of_matches);
  values["ResultsViewOption"] = GetRadioButton(document.all.results_view_option);
  SetAppValues("Preferences", values);

  SetIndexSelections(GetCheckList(document.all.index_list));
  SetAppValues("Preferences/Fields", ToPrefFields(GetCheckList(document.all.field_list)));
}

function SetFieldEnableStates(check_list, view_option)
{
  var abs_field = ToLocField("Abstract");
  
  if(view_option == "summary")
  {
    var values = new Array();
	values[abs_field] = "false";	
    SetCheckListEnableStates(check_list, values);
	SetCheckListSelections(check_list, values);
  }
  else if(view_option == "detail")
  {
    var values = new Array();
	values[abs_field] = "true";	
    SetCheckListEnableStates(check_list, values);	
	//SetCheckListSelections(check_list, values);
  }
  else
    alert("SetFieldEnableStates : invalid view option specified.");
}
</script>

<script language="JavaScript" for="all_indexes_button" event="onclick()">
OnAllIndexesButtonClick();
</script>

<script language="JavaScript" for="all_fields_button" event="onclick()">
OnAllFieldsButtonClick();
</script>

<script language="JavaScript" for="results_view_option" event="onclick()">
OnResultsViewRadioClick();
</script>

<script language="JavaScript" for="field_list" event="onclick()">
OnFieldListClick();
</script>

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

<script language="JavaScript" for="save_button" event="onclick()">
OnSavePage();
//window.location = "default.htm";
GoToPage('default');
</script>

<script language="JavaScript" for="cancel_button" event="onclick()">
//window.location = "default.htm";
GoToPage('default');
</script>
<div style="display:inline" id="load_none" align="center" ><img src="Images/loading.gif" />&nbsp;&nbsp.... </div>
<div style="display:none" id="loadview">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="53" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="Default_top" height="53">
  <tr> 
    <td width="6%" align="center">
	  <a id="home_link" onClick="GoToPage('default')" class="Normaltext">
	    <img src="Images/search_home.png" border="0"  title="Ritorna alla Ricerca Pagina Iniziale" width="32" height="32" style="position:relative; top:2;" loc="title:id=IDS_BACK_TO_SEARCH_HOME"/> 
      </a>
	</td>
    <td> 
      <div id="page_title_area" align="center">
	  <b> <loc id="IDS_EDIT_PREFERENCES">Preferenze</loc> </b>
	  </div>
    </td>
    <td width="180"> 
      <div id="page_link_area" align="right">
	  </div>
    </td>
  </tr>
</table></td>
  </tr>
  <tr>
      <td class="bgcolor_3" height="1" align="left" valign="top"></td>
  </tr>
  <tr>
    <td height="5" align="left" valign="top"></td>
  </tr>
  <tr>
    <td height="46" align="left" valign="top"><blockquote> 
  <blockquote>
    <b><loc id="IDS_EDIT_SEARCH_OPTIONS">Ricerca Opzioni</loc></b><br/><br/>
    <fieldset><legend><loc id="IDS_GROUP_FIND_MATCHES">Trova corrispondenze basate su</loc></legend> 
      <table width="100%" border="0" cellspacing="5" cellpadding="5">
        <tr> 
          <td width="50%"> 
            <div align="left"> 
              <input type="radio" name="stemming_option" value="off"/>
              <loc id="IDS_EXACT_WORD">Parole esatte</loc></div>
          </td>
          <td width="50%"> 
            <input type="radio" name="stemming_option" value="on"/>
            <loc id="IDS_VARIATION_OF_WORD_ENDINGS">Variazioni della parte finale delle parole</loc></td>
        </tr>
      </table>
    </fieldset> <br/>
    <fieldset><legend><loc id="IDS_GROUP_SEARCHED_INDEXES">Indici da ricercare</loc></legend>     
    <table width="100%" border="0" cellspacing="5" cellpadding="5">
      <tr> 
        <td width="50%"><sds:checklist id="index_list" height="80" width="200" /></td>
        <td width="50%"> 
          <div align="center"> 
            <input type="button" class="button_style" name="all_indexes_button" value="   Tutto   " loc="value:id=IDS_BUTTON_ALL"/>
          </div>
        </td>
      </tr>
    </table>
    </fieldset>
    <br/>
     <input type="checkbox" name="favorites_display" value="checkbox"/>
	<loc id="IDS_CHECK_DISPLAY_LIST">Visualizza lista di termini di ricerca preferiti nell'area di ricerca.</loc>
	<br/>
    <input type="checkbox" name="index_display" value="checkbox"/>
	<loc id="IDS_CHECK_DISPLAY_INDEXES">Indici del display da localizzare nell'area di ricerca.</loc>
	<br>
	 <input type="checkbox" name="index_trayicon" value="checkbox"/>
	Visualizza l'icona del vassoio di indicizzazione nel vassoio di sistema.
	
	<br/><br/>
    <loc id="IDS_EDIT_RETRIEVE_FIRST">Recupera prima</loc>  <sds:spinbox id="num_of_matches" minvalue="1" maxvalue="1000" size="6" />  <loc id="IDS_EDIT_MACHIES">  corrisponde. </loc> </blockquote>
<br/>
<blockquote>
  <blockquote>
     <b><loc id="IDS_EDIT_RESULT_OPTIONS">Opzioni Display Risultati</loc></b><br/><br/>
    <fieldset><legend><loc id="IDS_GROUP_FIRST_DISPLAY">Primo display dentro</loc></legend> 
      <table width="100%" border="0" cellspacing="5" cellpadding="5">
        <tr> 
          <td width="50%"> 
            <div align="left"> 
              <input type="radio" name="results_view_option" value="summary"/>
              <loc id="IDS_RADIO_SUMMARY_VIEW">            Vista Sommaria</loc></div>
          </td>
          <td width="50%"> 
            <input type="radio" name="results_view_option" value="detail"/>
            <loc id="IDS_RADIO_DETAIL_VIEW">            Vista Dettagliata </loc> </td>
        </tr>
      </table>
      </fieldset> <br/>
       <fieldset><legend><loc id="IDS_GROUP_FIELDS">Campi da visualizzare</loc></legend> 
      <table width="100%" border="0" cellspacing="5" cellpadding="5">
        <tr> 
          <td width="50%">
		    <sds:checklist id="field_list" height="100" width="200" />
          </td>
          <td width="50%"> 
            <div align="center"> 
             <input type="button" class="button_style" name="all_fields_button" value="   Tutto   " loc="value:id=IDS_BUTTON_ALL"/>
            </div>
          </td>
        </tr>
      </table>
    </fieldset></blockquote>
</blockquote>
<hr/>
<table width="100%" border="0" cellspacing="5" cellpadding="5">
  <tr> 
    <td width="47%"> 
      <div align="right"> 
        <input type="button" class="button_style" 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" class="button_style" name="cancel_button" value="Annulla" loc="value:id=IDS_BUTTON_CANCEL"/>
      </div>
    </td>
  </tr>
</table>
</td>
  </tr>
</table>
</div>
</body>
</html>
