function fSetFieldOperator(pTabLabel,pTapValue,pField,pOperator){  if(pField.options[pField.selectedIndex].value > 0)
  {    var lvCurrentOp = -1;   for(i=0;i<pTabLabel.length;i++)
    {      if(pField.options[pField.selectedIndex].value == pTabLabel[i])
      {        var lvCurrentOp = i;       break;     }
    }
    if(lvCurrentOp > -1)
    {      var CountOp = pTapValue[pTabLabel[lvCurrentOp]].length; var c = 0; pOperator.options.length=0;     while (c < CountOp)
      {    if(pTapValue[pTabLabel[lvCurrentOp]][c].length > 0)
    {          var op = new Option(pTapValue[pTabLabel[lvCurrentOp]][c],c);     pOperator.options[pOperator.options.length] = op;     }
    c ++; }
    }
    pOperator.selectedIndex = 0; }
  else
  {    pOperator.options.length=0;   var op = new Option(pTapValue[0],0);   pOperator.options[pOperator.options.length] = op;   pOperator.selectedIndex = 0; }}function fInitCalendarLayer(){}
function fShowCalendarLayer(pHTMLCode){var zcb = top.abk('layer_calendar');
if((lvCurrentOpenedField == lvCurrentDateField) && (lvCurrentOpening == 1))
{fHideCalendarLayer();}
else
{zcb.innerHTML = pHTMLCode;zcb.style.top = top.gPosY + (zcb.offsetHeight/2);var lvPosX = top.gPosX;if (gDocWidth<lvPosX+zcb.offsetWidth)
lvPosX = gDocWidth - zcb.offsetWidth- 20;
zcb.style.left = lvPosX-32;fShowHideLayer('layer_calendar', true);}}function fHideCalendarLayer(){fShowHideLayer('layer_calendar', false);}
function fSetFieldSearchDate(){  var zbhs = fSetFieldSearchDate.arguments; var tmpDate = new Array(); if(zbhs[0] < 10) zbhs[0] = '0'+zbhs[0]; if(zbhs[1] < 10) zbhs[1] = '0'+zbhs[1]; 
  if(top.gFormDateFormat.indexOf('/',0) != -1) var separator = '/'; else if(top.gFormDateFormat.indexOf('.',0) != -1)  var separator = '.'; else if(top.gFormDateFormat.indexOf('-',0) != -1)  var separator = '-'; 
  var splitDateFormat = top.gFormDateFormat.split(separator); if(splitDateFormat[0] == 'DD') tmpDate[0] = zbhs[0]; else if(splitDateFormat[1] == 'DD') tmpDate[1] = zbhs[0]; else if(splitDateFormat[2] == 'DD') tmpDate[2] = zbhs[0]; if(splitDateFormat[0] == 'MM') tmpDate[0] = zbhs[1]; else if(splitDateFormat[1] == 'MM') tmpDate[1] = zbhs[1]; else if(splitDateFormat[2] == 'MM') tmpDate[2] = zbhs[1]; if(splitDateFormat[0] == 'YYYY') tmpDate[0] = zbhs[2]; else if(splitDateFormat[1] == 'YYYY') tmpDate[1] = zbhs[2]; else if(splitDateFormat[2] == 'YYYY') tmpDate[2] = zbhs[2]; 
  eval('gCurrentDoc.advanced4.'+zbhs[3]).value = tmpDate[0]+ separator +tmpDate[1]+ separator +tmpDate[2]; fHideCalendarLayer();}
function CheckData(){  zbhs = CheckData.arguments; QueryDate = zbhs[0]; QueryMonth = zbhs[1]; QueryYear = zbhs[2]; lvCurrentDateField = zbhs[3]; lvCurrentOpening = zbhs[4]; gCurrentDoc = zbhs[5]; 
  MonthLength[2] = CheckLeap(QueryYear); 
  if(PreviousQueryDate > QueryDate) QueryDate = PreviousQueryDate; 
  if ((QueryYear * 10000 + QueryMonth * 100 + QueryDate) < 15821220)
  {    QueryDate = 20;   QueryMonth = 12;   QueryYear = 1582; }
  if (MonthLength[QueryMonth] < QueryDate)
  {    PreviousQueryDate = QueryDate;   QueryDate = MonthLength[QueryMonth]; }
  DisplaySchedule();}function CheckLeap(yy){  if ((yy % 100 != 0 && yy % 4 == 0) || (yy % 400 == 0)) return 29; else return 28;}
function DefDateDay(yy,mm,dd){  return Math.floor((Date2Days(yy,mm,dd)-2) % 7) + 1;}
function Date2Days(yy,mm,dd){  if (mm > 2)
  {    var bis = Math.floor(yy/4) - Math.floor(yy/100) + Math.floor(yy/400);   var zy = Math.floor(yy * 365 + bis);   var zm = (mm-1) * 31 - Math.floor(mm * 0.4 + 2.3);   return (zy + zm + dd); }
  else
  {    var bis = Math.floor((yy-1)/4) - Math.floor((yy-1)/100) + Math.floor((yy-1)/400);   var zy = Math.floor(yy * 365 + bis);   return (zy + (mm-1) * 31 + dd); }}function DisplaySchedule(){  HTMLCode = "<table cellspacing=0 cellpadding=1 border=1 class=\bodygeneric\" bordercolor=#666666>"; QueryDay = DefDateDay(QueryYear,QueryMonth,QueryDate); var PreviousMonth = parseInt(QueryMonth) -1; var NextMonth = parseInt(QueryMonth) +1; var PreviousYear = QueryYear; var NextYear = QueryYear; if(PreviousMonth < 1)
  {    PreviousMonth = 12;   PreviousYear = parseInt(QueryYear) -1; }
  if(NextMonth > 12)
  {    NextMonth = 1;   NextYear = parseInt(QueryYear) +1; }
   HTMLCode += "<tr><td colspan=7 align=right class=\"calendarheader\"><a class=\"calendarheader\" href=\"javascript:fHideCalendarLayer()\">X</a></td></tr>"; HTMLCode += "<tr><td align=center class=\"calendarheader\"><a class=\"calendarheader\" href=\"javascript:CheckData('"+ QueryDate +"','"+ PreviousMonth +"','"+ PreviousYear +"','"+ lvCurrentDateField +"',0)\">&lt;&lt;</a></td>"; HTMLCode += "<td colspan=5 align=center class=\"calendarheader\">" + MonthsList[QueryMonth] + " " + QueryYear + "</td>"; HTMLCode += "<td align=center class=\"calendarheader\"><a class=\"calendarheader\" href=\"javascript:CheckData('"+ QueryDate +"','"+ NextMonth +"','"+ NextYear +"','"+ lvCurrentDateField +"',0)\">&gt;&gt;</a></td></tr><tr>"; 
  for (s=1;s<8;s++)
  {    if (QueryDay == s) HTMLCode += "<td class=\"calendarbody\">" + DaysList[s] + "</td>";   else HTMLCode += "<td class=\"calendarbody\">" + DaysList[s] + "</td>"; }
   a = 0; 
  for (i=(1-DefDateDay(QueryYear,QueryMonth,1));i<MonthLength[QueryMonth];i++)
  {    HTMLCode += "<tr align=center>";   for (j=1;j<8;j++)
    {      if ((i+j) <= 0) { HTMLCode += "<td class=\"calendarbody\">&nbsp;</td>";}
      else if ((i+j) == QueryDate) { HTMLCode += "<td class=\"calendarbodyselected\">&nbsp;<a class=\"calendarbodyselected\" href=\"javascript:fSetFieldSearchDate('"+ (i+j) +"','"+ QueryMonth +"','"+ QueryYear +"','"+ lvCurrentDateField +"')\">" + (i+j) + "</a>&nbsp;</td>";}
      else if ((i+j) > MonthLength[QueryMonth]) { HTMLCode += "<td>&nbsp;</td>";}
      else { HTMLCode += "<td class=\"calendarbody\">&nbsp;<a class=\"calendarbody\" href=\"javascript:fSetFieldSearchDate('"+ (i+j) +"','"+ QueryMonth +"','"+ QueryYear +"','"+ lvCurrentDateField +"')\">" + (i+j) + "</a>&nbsp;</td>";}
    }
       HTMLCode += "</tr>";   a++;   i = i + 6; }
   HTMLCode += "</table>"; 
  fShowCalendarLayer(HTMLCode); 
}
function fCheckForm4(pForm, pLanguage){var lvSaisieOK = 1;var lvHasDate, lvValueDate = 0;var lvIdx, lvChecked=0,lvChoice=0,lvCountObj = 0;
lvCountObj = pForm.elements.length;for(lvIdx=0;lvIdx<lvCountObj;lvIdx++)
{if (pForm.elements[lvIdx].type=="checkbox")
{if ((pForm.elements[lvIdx].checked)&&(pForm.elements[lvIdx].name!='explain')&&(pForm.elements[lvIdx].name!='synonyms'))
{lvChecked++;}}if(pForm.elements[lvIdx].name == 'datestart')
lvHasDate = 1;}
if(lvHasDate == 1)
{if ((pForm.datestart.value.length>0)||(pForm.dateend.value.length>0))
{if (fCheckDate4(pForm.datestart.value,top.gFormDateFormat) == 0)
{  if (pLanguage==1) 
  alert("La date de début de recherche n'est pas valide. Le format est "+ top.gFormDateFormat +".");else if (pLanguage==3) 
  alert("Das Anfangsdatum der Suche ist nicht gültig. Das Format lautet "+ top.gFormDateFormat +".");else if (pLanguage==5) 
  alert("Il valore data di inizio non è valido. Il formato della data è "+ top.gFormDateFormat +".");else if (pLanguage==6) 
  alert("El valor de fecha inicial no es válido. El formato de fecha es "+ top.gFormDateFormat +".");else
  alert("The Start date value is not valid. The date format is "+ top.gFormDateFormat +".");lvSaisieOK = 0;}
if (fCheckDate4(pForm.dateend.value,top.gFormDateFormat) == 0)
{  if (pLanguage==1) 
  alert("La date de fin de recherche n'est pas valide. Le format est "+ top.gFormDateFormat +".");else if (pLanguage==3) 
  alert("Das Enddatum für die Suche ist nicht gültig. Das Format lautet "+ top.gFormDateFormat +".");else if (pLanguage==5) 
  alert("Il valore data finale non è valido. Il formato della data è "+ top.gFormDateFormat +".");else if (pLanguage==6) 
  alert("El valor de fecha final no es válido. El formato de fecha es "+ top.gFormDateFormat +".");else
  alert("The End date value is not valid. The date format is "+ top.gFormDateFormat +".");lvSaisieOK = 0;}
if(fCompareDate4(pForm.datestart.value,pForm.dateend.value,top.gFormDateFormat) == 0)
{  if (pLanguage==1) 
  alert("La date de fin doit être plus récente que la date de début.");else
  alert("The End date value must be more recent than the Start date value.");lvSaisieOK = 0;}}}
if (lvSaisieOK == 1)
{if (lvHasDate==1) 
{if ((pForm.datestart.value=="")&&(pForm.dateend.value==""))
{lvValueDate = 0;}
else
{lvValueDate = 1;}}if ((pForm.userrequest.value=="")&&(lvChecked==0)&&(lvValueDate==0))
{  if (pLanguage==1) 
 alert("Vous devez renseigner au moins une valeur pour effectuer une recherche.");else if (pLanguage==3) 
  alert("Sie müssen mindestens einen Wert angeben, um die Suche durchführen zu können.");else if (pLanguage==5) 
  alert("Devi inserire almeno un valore per eseguire una ricerca.");else if (pLanguage==6) 
  alert("Debe introducir al menos un valor para llevar a cabo la búsqueda.");else
 alert("You must enter at least one value to perform a search.");pForm.userrequest.focus();lvSaisieOK = 0;}
else
{lvSaisieOK = 1;}}if (lvSaisieOK == 0)
{return(false);}
else
{return(true);}}function fCheckDate4(pDate,pFormat){  if(pDate.length > 0)
  {    var separator = '';   var tmpDate = new Array();   var tmpArray = new Array();   tmpDate["DD"] = 0;   tmpDate["MM"] = 0;   tmpDate["YYYY"] = 0;      if(pFormat.indexOf('/',0) != -1) var separator = '/';   else if(pFormat.indexOf('.',0) != -1)  var separator = '.';   else if(pFormat.indexOf('-',0) != -1)  var separator = '-';      if(separator.length < 1) return 0;   var splitDate = pDate.split(separator);   if(splitDate.length == 3)
    {      var splitFormat = pFormat.split(separator);     for(i=0;i<3;i++)
      {        if(splitDate[i].length != splitFormat[i].length) return 0;       if(isNaN(splitDate[i])) return 0;       if(splitDate[i].substring(0,1) == 0) tmpDate[splitFormat[i]] = splitDate[i].substring(1);       else tmpDate[splitFormat[i]] = splitDate[i];     }
      if((tmpDate["MM"] > 12)||(tmpDate["MM"] < 1))  return 0;     if(MonthLength[tmpDate["MM"]] < tmpDate["DD"]) return 0;     return 1;   }
    else
      return 0; }
  else
    return 1;}
function fCompareDate4(pStart,pEnd,pFormat){  if((pStart.length > 0) && (pEnd.length > 0))
  {    var tmpStartDate = new Array();   var tmpEndDate = new Array();   var separator = '';   if(pFormat.indexOf('/',0) != -1) var separator = '/';   else if(pFormat.indexOf('.',0) != -1)  var separator = '.';   else if(pFormat.indexOf('-',0) != -1)  var separator = '-';   var splitStartDate = pStart.split(separator);   var splitEndDate = pEnd.split(separator);   var splitFormat = pFormat.split(separator);   for(i=0;i<3;i++) tmpStartDate[splitFormat[i]] = splitStartDate[i];   for(i=0;i<3;i++) tmpEndDate[splitFormat[i]] = splitEndDate[i];   if(tmpEndDate["YYYY"] < tmpStartDate["YYYY"]) return 0;   if((tmpEndDate["MM"] < tmpStartDate["MM"]) && (tmpEndDate["YYYY"] <= tmpStartDate["YYYY"])) return 0;   if((tmpEndDate["DD"] < tmpStartDate["DD"]) && (tmpEndDate["MM"] <= tmpStartDate["MM"]) && (tmpEndDate["YYYY"] <= tmpStartDate["YYYY"])) return 0;   return 1; }
  else
    return 1;}
if(top.gLanguageCode == 'fr'){  var DaysList = new Array("", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"); var MonthsList = new Array("", "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");}
else
{  var DaysList = new Array("", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); var MonthsList = new Array("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");}
var MonthLength = new Array("",31,29,31,30,31,30,31,31,30,31,30,31);
var lvCurrentDateField = "";var lvCurrentOpenedField = "";var lvCurrentOpening = 0;var PreviousQueryDate = 0;var HTMLCode = "";
var QueryDate = 0;var QueryMonth = 0;var QueryYear = 0;var QueryDay = 0;var FirstDay = 0;var WeekRef = 0;var WeekOne = 0;
var Today = new Date();var TodaysYear = Today.getYear();var TodaysMonth = Today.getMonth() + 1;var TodaysDate = Today.getDate();var TodaysDay = Today.getDay() + 1;if (TodaysYear < 2000) TodaysYear += 1900;
var gCurrentDoc = null;