function array(){var i;this.length=array.arguments.length;for(var i=0;i<this.length;i++)this[i+1]=array.arguments[i]}
//--------------------------------
var Filext = '.html';
var Tlang  = new array ('f','e');
var Pref   = new array ('salons','trade-shows');
var mnToId = new array (1,2,3,5,7,8,10,11,12);
var IdTomn = new array (1,2,3,2,4,2,5,6,0,7,8,9,4,4);
var Tchoice0     = new Array ('','salons-professionnels-noms','salons-professionnels-themes','salons-professionnels-dates','salons-professionnels-lieux','salons-professionnels-organisateurs','salons-professionnels-mots-cles');
var Tchoice1     = new Array ('','trade-shows-names',         'trade-shows-topics',          'trade-shows-dates',          'trade-shows-places',         'trade-shows-organizers',             'trade-shows-keywords');
var CMonthTitle0 = new Array ('','janvier','fevrier', 'mars', 'avril','mai','juin','juillet','aout',  'septembre','octobre','novembre','decembre');
var CMonthTitle1 = new Array ('','january','february','march','april','may','june','july',   'august','september','october','november','december');
var IconsFolder;
//--------------------------------
var PageId = 0;
var InitOk = 0;
var Org    = 0;
var CleanZoneTitle = '';
var DefaultZone = new Array ('asie-pacifique', 'asia-pacific');
var Country = 0;
var CleanCountryTitle = '';
var ton  = new Array;
var toff = new Array;
var searchstr = "";
window.defaultStatus = 'EventsEye - Trade Shows Worldwide';

//--------------------------------
function WebLink (ws) {
  window.open(ws,"","menubar=yes,toolbar=yes,scrollbars=yes,location=yes,resizable=yes,width=520,height=500")
  }
function Init (choice) {
  //alert ('Init'+' Lang='+Lang +' choice='+choice+' FairInit='+FairInit);
  if (navigator.appName == 'Netscape') { IconsFolder = '../i/' } else { IconsFolder = '../i/' }
  for (var n=1; n<=6; n++) {
    if (Lang == 0) {Tchoice = Tchoice0[n]} else {Tchoice = Tchoice1[n]}
    ton [n] = new Image; ton [n].src = IconsFolder+Tchoice+'-a'+Lang+'.gif';
    toff[n] = new Image; toff[n].src = IconsFolder+Tchoice+'-i'+Lang+'.gif'
    }
  InitOk = 1;
  if (typeof(eval(choice)) != 'undefined') {
    window.main.location.replace(FileInMain(choice))
    }
  else {
    var target = location.search;
    if (target) {
      target = target.substr(1);
      if (target.charAt(0) != '/') {
        target = "/fairs/" + target;
        }
      window.main.location.replace(target)
      }
    }
  }
function SwitchOn (i) {
  if (InitOk == 1) {
    if (i<=6) {
      target = eval ('logochoice.document.button'+i);
      if (target) target.src = ton[i].src
      }
    }
  }
function SwitchOff (i) {
 if (PageId != mnToId[i] && InitOk == 1) {
    if (i<=6) {
      target = eval ('logochoice.document.button'+i);
      if (target) target.src = toff[i].src
      }
    }
  }
function SwitchOffAll () {
  if (InitOk == 1) {
    for (var i=1; i<=6 ;i++) {
      target = eval ('logochoice.document.button'+i);
      if (target) target.src = toff[i].src
      }
    }
  }
function FileInMain (pid) {
  if (Lang==0) CleanMonthTitle = CMonthTitle0[Month]; else CleanMonthTitle = CMonthTitle1[Month];
  if      (pid==0)  return 'Welc'+Lang+Filext;
  else if (pid==1)  if (Lang==0) return 'liste_salons_professionnels_'+FairInit+Filext
                    else         return 'trade_fairs_list_'+FairInit+Filext
  else if (pid==2)  return 'gt'+Lang+'_'+Pref[Lang+1]+Filext
  else if (pid==3)  return 'd'+Lang+'_'+Pref[Lang+1]+'_'+CleanMonthTitle+'_'+Year+Filext
  else if (pid==4)  return 'dst'+Lang+'_'+Pref[Lang+1]+'_'+CleanMonthTitle+'_'+Year+'_'+CleanStTitle+Filext
  else if (pid==5)  return 'z'+Lang+'_'+Pref[Lang+1]+'_'+DefaultZone[Lang]+Filext
  else if (pid==7)  if (Lang==0) return '../organisateurs-salons/'+'Salons-Organisateurs_'+OrgInit+Filext
		                else         return '../fairs-organizers/'+'Trade-Shows-Organizers_'+OrgInit+Filext
  else if (pid==8)  return 'mk'+Lang+Filext
  else if (pid==9)  return 'WhatsNew'+Lang+Filext
  else if (pid==10) return 'ContactInfo'+Lang+Filext
  else if (pid==11) return 'ReLinks'+Lang+Filext
  else if (pid==12) return 'Partners'+Lang+Filext
  else if (pid==13) return 'zd'+Lang+'_'+Pref[Lang+1]+'_'+CleanZoneTitle+'_'+CleanMonthTitle+'_'+Year+Filext
  else if (pid==14) return 'cd'+Lang+'_'+Pref[Lang+1]+'_'+CleanCountryTitle+'_'+CleanMonthTitle+'_'+Year+Filext
  }
function MenuContext (pid) {
  if (pid==0||pid==2||pid==5||pid==6||pid==8||pid==9||pid==10||pid==11||pid==12) return 'blank'+Filext
  else if (pid==1)  return 'mf'+Lang+Filext
  else if (pid==3)  return 'md'+Lang+'_'+Year+Filext
  else if (pid==4)  return 'md'+Lang+'_'+Year+'_'+CleanStTitle+Filext
  else if (pid==7)  return '../fairs/'+'mo'+Lang+Filext
  else if (pid==13) return 'mz'+Lang+'_'+Year+'_'+Zone+Filext
  else if (pid==14) return 'mc'+Lang+'_'+Year+'_'+Country+Filext
  }
function LogoChoice (pid) {
  return 'LogoChoice'+Lang+Filext
  }
function Refer (lg,pid,yr,mo,sttitle,init,ident,identtitle) {
  if (pid!=null) PageId = pid;
  if (yr!=null)  Year = yr
  if (mo!=null)  Month = mo
  if (sttitle!=null)  CleanStTitle = sttitle
  if (init!=null)  if (PageId==1)  FairInit = init;  else if (PageId==7) OrgInit = init;
  if (ident!=null) if (PageId==13) Zone = ident; else if (PageId==14) Country = ident;
  if (identtitle!=null) if (PageId==13) CleanZoneTitle = identtitle; else if (PageId==14) CleanCountryTitle = identtitle;
  if (PageId==7) if (ident==null) Org = 0; else Org = 1;
  if (lg==Lang) {
    if (context) if (context.document) if (context.document.param) if (context.document.param.id) {
      ContextIdent = context.document.param.id.value;
      if (PageId==14) if (context.document.param.cleancountrytitle) CleanCountryTitle = context.document.param.cleancountrytitle.value;
      if (ContextIdent==1 || ContextIdent==3 || ContextIdent==4 || ContextIdent==7 || ContextIdent==13 || ContextIdent==14) { context.Init() }
      if ((PageId == 0 && ContextIdent == 0) /* Welcome */
      ||  (PageId == 1 && ContextIdent == 1) /* by name */
      ||  (PageId == 2 && ContextIdent == 0) /* by theme */
      ||  (PageId == 3 && ContextIdent == 3) /* by date */
      ||  (PageId == 4 && ContextIdent == 4) /* by date & theme */
      ||  (PageId == 5 && ContextIdent == 0) /* by location */
      ||  (PageId == 6 && ContextIdent == 0) /* By location & theme */
      ||  (PageId == 7 && ContextIdent == 7) /* By organizer alpha*/
      ||  (PageId == 8 && ContextIdent == 0) /* By keywords */
      ||  (PageId == 9 && ContextIdent == 0) /* Detail File */
      ||  (PageId == 10 && ContextIdent == 0) /* Contact Info */
      ||  (PageId == 11 && ContextIdent == 0) /* Related Links */
      ||  (PageId == 12 && ContextIdent == 0) /* Partners */
      ||  (PageId == 13 && ContextIdent == 13) /* by zone & date */
      ||  (PageId == 14 && ContextIdent == 14)) {} /* by zone & date */
      else context.document.location.replace(MenuContext(PageId))
      if      (PageId == 3 && ContextIdent == 3 && Year != context.document.param.year.value) context.document.location.replace(MenuContext(PageId));
      else if (PageId == 4 && ContextIdent == 4 && Year != context.document.param.year.value) context.document.location.replace(MenuContext(PageId));
      else if (PageId == 13 && ContextIdent == 13 && (Year != context.document.param.year.value || Zone != context.document.param.zone.value)) context.document.location.replace(MenuContext(PageId));
      else if (PageId == 14 && ContextIdent == 14 && (Year != context.document.param.year.value || Country != context.document.param.country.value || CleanCountryTitle != context.document.param.cleancountrytitle.value)) context.document.location.replace(MenuContext(PageId));
      }
    }
  else {
    Lang = lg;
    Init();
    context.document.location.replace(MenuContext(PageId));
    logochoice.document.location.replace(LogoChoice(PageId));
    }
  SwitchOffAll();
  if (PageId!=0) SwitchOn(IdTomn[PageId])
  }
function ContextRefer (pid,mo,yr,sttitle,loc,loctitle) {
  //alert ('refer context '+pid+'-'+PageId);
  if (pid!=null) {
    if (pid==0 && PageId==0) { return }
    if (pid==0 && PageId==1) pid=1
    if (pid==0 && PageId==2) { pid=2; return }
    if (pid==13 && PageId==13 && yr==Year) { return }
    if (pid==14 && PageId==14 && yr==Year) { return }
    if (pid==7 && PageId==7 && Org!=0) { return }
    if (pid==0 && PageId==7) pid=7
    if (pid==0 && PageId==8) pid=8
    if (pid==0 && PageId==9) pid=9
    if (pid==0 && PageId==10) pid=10
    if (pid==0 && PageId==11) pid=11
    if (pid==0 && PageId==12) pid=12
    if ((PageId==2 || PageId==4 || PageId==5) && pid==0) {} else PageId = pid
    }
  if (mo!=null) Month = mo
  if (yr!=null) Year  = yr
  if (sttitle!=null) CleanStTitle = sttitle
  if (PageId!=5 && PageId!=6 && PageId!=9 && PageId!=8 && PageId!=10 && PageId!=11 && PageId!=12) {
    if (loc!=null) if (pid==13) Zone = loc; else if (pid==14) { Country = loc; CleanCountryTitle = loctitle }
    if (top.main) {
      if      (PageId==3 && main.document.param && PageId == main.document.param.id.value && Year == main.document.param.year.value) {}
      else if (PageId==4 && main.document.param && Year == main.document.param.year.value && Month == main.document.param.month.value) {}
      else if (PageId==13 && main.document.param && Year == main.document.param.year.value && Zone == main.document.param.zone.value) {}
      else if (PageId==14 && main.document.param && Year == main.document.param.year.value && Country == main.document.param.country.value) {}
      else     main.document.location.replace(FileInMain(PageId))
      }
    }
  }