function A(B,C,D) {
  if (D=="GM")   D = "gmail"      ; 
  if (D=="9" ) { D = "neuf"       ; C = "fr" } ;
  if (D=="GM")   D = "gmail"      ; 
  if (D=="HM")   D = "hotmail"    ; 
  if (D=="MC") { D = "microclass" ; if(C=="") C = "org" } ; 
  if (D=="MR") { D = "mail"       ; C = "ru"  } ; 
  if (D=="OF") { D = "orange"     ; C = "fr"  } ; 
  if (D=="TO") { D = "t-online"   ; C = "de"  } ; 
  if (D=="WD") { D = "web"        ; C = "de"  } ; 
  if (D=="WN")   D = "wanadoo"    ;
  if (D=="YH")   D = "yahoo"      ;
  if (D=="YF") { D = "yahoo"      ; C = "fr"  } ; 
  if (C==""  )                      C = "com"   ;
  M=B+String.fromCharCode(2*2*2*2*2*2)+D+String.fromCharCode(3*2*2*2*2-2)+C
}

// 16
function BackGround() {
  parent.window.moveTo(0,0) ; parent.window.resizeTo(screen.availWidth,screen.availHeight) ; 

  InsertPixels = 0 ; 
  ToDay      = new Date() ; 
  Jour       = ToDay.getDate() ;
  Mois       = ToDay.getMonth()+1 ;
  CetteAnnee = ToDay.getFullYear() ;

  JourAnnee  = 100*Mois+Jour ;
  CeJour     = 10000*CetteAnnee+JourAnnee ; Today=CeJour ; 

//  29
  H = "center" ; V = "middle" ; 
  NbBackGrounds = 8 ; 
  if(Mois== 1)   Mois = Mois + NbBackGrounds ; 
  if(Mois== 2)   Mois = Mois + NbBackGrounds ; 
  if(Mois== 3)   Mois = Mois + NbBackGrounds ; 
  if(Mois== 4)   Mois = Mois + NbBackGrounds ; 
  if(Mois== 5)   BackGround="erdre"          ; 
  if(Mois== 6) { BackGround="zuelpich10"     ; V = "bottom" } ; 
  if(Mois== 7) { BackGround="32MC_825"       ; V = "bottom" } ; 
  if(Mois== 8) { BackGround="32MC_831"       ; V = "bottom" } ; 
  if(Mois== 9) { BackGround="32MC_903"       ; V = "bottom" } ; 
  if(Mois==10)   BackGround="meh"            ; 
  if(Mois==11) { BackGround="32MC_917"       ; V = "bottom" } ; 
  if(Mois==12) { BackGround="mc"             ; V = "bottom" } ; 
// 44
  if                      (screen.width>2560)  Size=1 ; 
  if((screen.width<=2560)&(screen.width>1920)) Size=2 ; 
  if((screen.width<=1920)&(screen.width>1600)) Size=3 ; 
  if((screen.width<=1600)&(screen.width>1440)) Size=4 ; 
  if((screen.width<=1440)&(screen.width>1280)) Size=5 ; 
  if((screen.width<=1280)&(screen.width>1024)) Size=6 ; 
  if((screen.width<=1024)&(screen.width> 800)) Size=7 ; 
  if (screen.width<= 800)                      Size=8 ; 
// 53
  document.write("<body style='background-color: #EBEFF2; color: #800000; background-image: URL(http://www.microclass.org/") ; 
  document.write("images/back"+BackGround+"_"+Size+".jpg); background-repeat: no-repeat; background-position: "+V+" "+H)     ; 
  document.write("; background-attachment: fixed; margin-top: 10; margin-left: 10; margin-right:10'>")                       ; 
}
// 58
function Header() {
// Calcul date update
  Browser = navigator.appName
  if (Browser.substr(0,3)=="Mic") {
    Browser = "MSIE"
    annee   = lastmod.substr(6,4);
    mois    = lastmod.substr(0,2);
    jour    = lastmod.substr(3,2);
    lastr   = jour + '/' + mois + '/' + annee 
  } else {
    if (Browser=="Netscape") {
      debut   = lastmod.indexOf(",",0)
      if (lastmod.substr(lastmod.length-3,3)=="GMT") lastmod = lastmod.substr(0,lastmod.length-4)
      lastmod = lastmod.substr(0,lastmod.length-9)
      annee   = lastmod.substr(lastmod.length-4,4)
      lastmod = ">"+lastmod.substr(debut+2,lastmod.length-debut-2)+"<"
      fin     = lastmod.indexOf(" ",0)
      if (fin<4) {
        jour  = lastmod.substr(1,fin-1)
        mois  = lastmod.substr(fin+1,3)
      } else {
        mois  = lastmod.substr(1,3)
        jour  = lastmod.substr(fin+1,2)
      }
      if (mois=="Jan") mois = "01"
      if (mois=="Feb") mois = "02"
      if (mois=="Mar") mois = "03"
      if (mois=="Apr") mois = "04"
      if (mois=="May") mois = "05"
      if (mois=="Jun") mois = "06"
      if (mois=="Jul") mois = "07"
      if (mois=="Aug") mois = "08"
      if (mois=="Sep") mois = "09"
      if (mois=="Oct") mois = "10"
      if (mois=="Nov") mois = "11"
      if (mois=="Dec") mois = "12"
      lastr   = jour + '/' + mois + '/' + annee
    } else { lastr = lastmod }
  }
// 98
// Affichage logo
  document.write("<table border=0 cellpadding=0 cellspacing=0 width='100%'><tr><td align='center' ")
  document.write("style='vertical-align: bottom' width=183 height=183 background='http://www.micro")
  document.write("class.org/images/bluedacronpatch.gif'><p style='color: #EEDDDD; margin-bottom: 30; ")
  document.write("font-size: 10px; font-weight: Bold'><span style='font-size: 18px'><br><br>MICRO ");
  document.write("CLASS<br><br></span>International&nbsp;Micro&nbsp;Cupper Class Association (IMCCA)");
  document.write("<br><a href='http://www.sailing.org' target='_blank' style='color: #FFEE00; ");
  document.write("visited: #DDCC00'>ISAF</a> recognised Class</p></td>");
// 107
// Affichage Titre
  document.write("<td align='center' style='font-size: 24px; color: #DD0000; vertical-align: Middle'><b>"+Title+"<br>");
  document.write("<font color='#0000DD'>"+Titre+"</font></b></td>")
// 111
// Affichage Logo ISAF
  document.write("<td width=183 width=183 style='vertical-align: Middle; text-align: Middle'><a href='http://www.sailing.org' ")
  document.write("target='_blank'><img src='http://www.microclass.org/images/")
  if(CetteAnnee==2008)document.write("isaf.gif' height=183 width=183") ; else document.write("ISAFLogo2009.gif' height=149 width=149")
  document.write(" border=0></a></td></tr>");
// 117
  document.write("</table>")
}
// 120
function Top() {
  if(Browser=="MSIE") {
    document.write("<table cellpadding=0><tr><td class='menu' width=90 height=38><a href='#top' style='font-size: 10px; ")
    document.write("font-weight: Bold'>&uArr; TOP &uarr;</a></td></tr></table>")
  }
}
// 128
function ShowPrint() {
  if(Printable=="YES") {
    document.write("<table cellpadding=0><tr><td class='menu' width=100 height=38><a href='javascript:PrintThisDoc()' ");
    document.write("style='font-size: 10px; font-weight: Bold'>Print</a></td></tr></table>")
  }
}
// 136
function PrintThisDoc() {
  PrintDoc="print.php?page="+Page
  PrintFormat="toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, "
  PrintFormat=PrintFormat+"width=700, height="+screen.height+", left="+(screen.width/2-350)+", top=0" ;
  window.open(PrintDoc, "PrintWindow", PrintFormat);
}
// 144
function MenuItem(Caption,Target) {
  document.write("<tr><td class='menu' height=38 width=90><a href='")
  if(Target.substr(0,1)!=="#") document.write(Root)
  document.write(Target+"'>"+Caption+"</a></td></tr>");
}
// 150
function Menu() {
  if(DisplayMenu=="YES") {
    document.write("<div style='position: fixed; top: 183; left: 10; bottom: auto; right: Auto'>")
    document.write("<table border=0 cellpadding=5 cellspacing=0>")
// 155
    document.write("<tr><td><img src='http://www.microclass.org/images/spacer.gif' width=80 height=10></font></td></tr>");
// 157
    if((screen.height>800)&(Browser!=="MSIE")) MenuItem("&uArr; TOP &uArr;","#top")
    MenuItem("Home","main.html")
    MenuItem("Rules","page.php?page=rules")
    MenuItem("Nations","nations.html")
    MenuItem("History","history.html")
    MenuItem("Calendar","calendarEM"+CetteAnnee+".html")
    MenuItem("Results","results/main.html")
    MenuItem("Gallery","photos.html")
    MenuItem("Forum","forum")
    MenuItem("Links","links.html")
    if((screen.height>800)|(Browser=="MSIE")) MenuItem("&dArr; BOTTOM &dArr;","#bottom")
// 169
//    if(Translate=="YES") Translations() ;  *** does not work propoerly ***
    document.write("</table></div>") 
  }
}
// 173
function ShowFig(Fig,Size) {
  if(screen.width>=1024) {
    document.write("<a href='"+Root+"rules/fig"+Fig+".gif' target='_blank'><img src='"+Root+"rules/fig"+Fig+".gif' ")
    document.write("width="+Size+" border=1 style='float: Right' hspace=7 alt='Click on figure for a full-size copy'></a>")
  }
}
// 180
function MainBody() {
  BodyWidth=1050
  LeftMargin=0
  if(DisplayMenu=="YES") { BodyWidth= 680 ; LeftMargin=110 } ; 
//  if(DisplayMenu=="YES")  BodyWidth= 680 ; 
  if(Title=="Micro Results") BodyWidth=screen.availWidth ; 
  RightMargin=Math.max(0,(screen.availWidth-BodyWidth-LeftMargin)/2)
  LeftMargin=LeftMargin+RightMargin
  document.write("<div style='position: absolute; left: "+LeftMargin+"; right: "+RightMargin+"; top: 210'>")
}
// 191
function Satellite() {
  document.write("<table cellpadding=3 cellspacing=0 align='center' id='FFFF00'><tr><td width=55 style='") ; 
  document.write("vertical-align: middle'><img src='images/satellite2.gif' alt='high definition'><img ") ; 
  document.write("src='images/satellite.gif' alt='low definition'></td><td><p class='TextEB' style='font") ; 
  document.write("-size: 10px'>Click on the satellite icon to show a satellite picture of the spot<br>") ; 
  document.write("<span id='FRA'>Cliquez sur l'icone du satellite pour afficher la photo satellite de ") ; 
  document.write("l'endroit</span></p></td></tr></table>") ; 
}
// 201
function LegendTranslation() {
  document.write("<table cellpadding=3 cellspacing=0 align='center' id='FAFA5A'><tr><td width=55 style='") ; 
  document.write("vertical-align: middle'><img src='images/GBR.gif' width=18 height=9 alt='translate to English'> <img ") ; 
  document.write("src='images/FRA.gif' width=15 height=10 alt='traduire en fran&ccedil;ais'> <img ") ; 
  document.write("src='images/RUS.gif' width=15 height=10 alt='???????? ?? ????????'> <img ") ; 
  document.write("src='images/GER.gif' width=17 height= 9 alt='translate in German'></td><td><p class='TextEB' style='font") ; 
  document.write("-size: 10px'>Click on the small flag to open a translation of the Notice of Race or the Web site<br>") ; 
  document.write("<span id='FRA'>Cliquez sur le petit drapeau pour ouvrir la traduction de l'Avis de Course ou du site Web") ; 
  document.write("</span></p></td></tr></table>") ; 
}

function WM(Subject) {
  A("we"+"bma"+"st"+"er","or"+"g","mic"+"roc"+"lass")
  document.write("<a h"+"re"+"f='"+"ma"+"ilt"+"o:"+M+"?su"+"bje"+"ct="+Subject+"'>w"+"ebm"+"ast"+"er<"+"/a>")
}
// 206
function Footer() {
  A("w"+"ebm"+"as"+"ter","o"+"rg","micr"+"oclas"+"s") ; 
  WM="<a h"+"re"+"f='"+"mai"+"lt"+"o:"+M+"'>"+M+"</a>" ; 
// 210
  document.write("<tr><td colspan=6 align='center'><a name='bottom'></a>") ; 
  if((Browser=="MSIE")|(Printable=="YES")) {
    document.write("<table cellspacing=0 cellpadding=0><tr><td width=140></td><td width=100>")
    Top()
    document.write("</td><td width=200></td><td width=100>")
    ShowPrint()
    document.write("</td><td width=140></td></tr></table>")
  }
// 216
  document.write("<hr width=600 height=1></td></tr>") ;
  document.write("<tr><td colspan=6 align='center'><center><table width=560><tr>") ; 
  document.write("<td style='text-align: left; font-size: 8pt; color: #DD0000'><b>Your Webmaster:<br>") ;
  document.write("<font color='#0000DD'>Votre&nbsp;Webmaster&nbsp;:</font></b></td>") ;
  document.write("<td style='text-align: right; font-size: 8pt; color: #DD0000'><b>") ;
  document.write("<a href='http://www.detroy.org' target='_blank'>Philippe&nbsp;De&nbsp;Troy</a><br>") ;
  document.write("&nbsp;e-mail:&nbsp;"+WM+"</b></font></td><td>") ;
  Skype("phildetroy") ;
  document.write("</td></tr></table></td></tr></table></td></tr></table></div></body></html>")
}
// 230
function FTranslation(Trad) {
  document.write("<tr><td colspan=8><table align='center' width=640 bgcolor='#EEDD88' cellpadding=7 ")
  document.write("cellspacing=0 border=2 bordercolor='#BB0000'><tr><td style='font-color: #BB0000; ")
  document.write("font-weight: Bold; text-align: Center'>Cette traduction a été réalisée par des ")
  document.write("bénévoles, à&nbsp;l'initiative&nbsp;de&nbsp;l'AS&nbsp;Go&minus;Neptune.&nbsp; ")
  document.write("Nous&nbsp;remercions&nbsp;en&nbsp;particulier Laurent&nbsp;Fournier, Denis&nbsp;")
  document.write("Chrétien et&nbsp;Renan&nbsp;Robert, qui&nbsp;ont&nbsp;effectué la&nbsp;plus&nbsp;")
  document.write("grande&nbsp;partie&nbsp;du&nbsp;travail.")
  if(Trad.length>0) {
    document.write("<br>Cette page a &eacute;t&eacute; traduite par ")
    if(Trad=="LF") document.write("Laurent Fournier")
    if(Trad=="RR") document.write("Renan Robert")
    if(Trad=="PDT")document.write("Philippe De Troy")
  }
  document.write("</td></tr></table></td></tr>") 
}
// 247
function NewYear() {
if ((JourAnnee<107)|(JourAnnee>1221)) {
  MicroGold = "<img src='images/logogold.gif'>" ;
  Separator = " &nbsp; "+MicroGold+" "+MicroGold+" "+MicroGold+" &nbsp; "
  NY=1
  document.write("<tr><td align='center' style='background: URL(images/headerred.png) repeat-x top'>");
  InsertPixels=InsertPixels+42 ; 
  document.write("<marquee width='"+Width+"'><p class='SubtitleE' style='color: #FFEE00; text-align: Center'><b>");

  document.write(Separator+"Happy New Year");
  document.write(Separator+"Bonne Ann&eacute;e");
  document.write(Separator+"&#1057; &#1085;&#1086;&#1074;&#1099;&#1084; &#1075;&#1086;&#1076;&#1086;&#1084;");
  document.write(Separator+"Szcz&#281;&#347;liwego Nowego Roku");
  document.write(Separator+"Ein gl&uuml;ckliches Neues Jahr");
  document.write(Separator+"Feliz Ano Novo");
  document.write(Separator+"Laim&#299;gu Jauno gadu");
  document.write(Separator+"Feliz A&ntilde;o Nuevo");
  document.write(Separator+"Gelukkig Nieuwjaar");
  document.write(Separator+"Felice Anno Novo");

  document.write(Separator+"</b></p></marquee></td></tr>") }
}
// 270
function Snow() {
  if ((JourAnnee<116)|(JourAnnee>1215)) {
    snow = true;    
    symbol = " <img src='images/snow3.gif'> " 
    rainsym = " ' "  
    speed=0.01
    angle=10
    range=15
    drops=12

//  if (snow) {
/*
    } else {
      symbol = " ' "
      speed=20
      range=0
      angle=6
    }
*/
    movex = -speed/angle
    movey = speed
    count = 0;
    function moverain() {
      for(move = 0; move < drops; move++) {
        xx[move]+=movex
        yy[move]+=mv[move]
        hmm = Math.round(Math.random()*1)
        if(xx[move] < 0) { xx[move] = maxx+5 }
        if(yy[move] > maxy) {yy[move] = 5}
        drop[move].left = xx[move]
        drop[move].top = yy[move]+document.body.scrollTop
      }
      setTimeout('moverain()','1')
    }
// 305

    if (document.all) {
      drop = new Array()
      xx = new Array()
      yy = new Array()
      mv = new Array()
      ly = "document.all[\'"
      st = "\'].style"
      for(make = 0; make < drops; make++) {
        document.write('<div id="drop'+make+'" class=drop>'+symbol+'</div>')
        drop[make] = eval(ly+'drop'+make+st)
        maxx = document.body.clientWidth-40
        maxy = document.body.clientHeight-40
        xx[make] = Math.random()*maxx;yy[make] = -100-Math.random()*maxy;drop[make].left = xx[make]
        drop[make].top = yy [make]
        mv[make] = (Math.random()*2)+speed/5
        drop[make].fontSize = (Math.random()*10)+30
//        if(snow){ 
          col = 'white'
/*
        } else { 
          col = 'blue'
        }
        drop[make].color = col
*/
      }
      window.onload=moverain
    }
  }
}
// 336
function Skype(Skype) {
/* Skype 'My status' button http://www.skype.com/go/skypebuttons */

document.write("<script language='javascript' src='http://download.skype.com/share/skypebuttons/js/skypeCheck.js'></script>")
document.write("<a href='skype:"+Skype+"?call'>")
document.write("<img src='http://mystatus.skype.com/smallclassic/"+Skype+"' style='border: none;' width=114 height=20 alt='My status' /></a>")
}
// 344
//  *** définition de la fonction dimension des pavillons ***

function SetFlagSize() {
  Size = 45
  if (Nat=="ARG") Size = 60
  if (Nat=="AZE") Size = 60
  if (Nat=="AUS") Size = 60
  if (Nat=="BEL") Size = 35
  if (Nat=="BLR") Size = 60 
  if (Nat=="BRA") Size = 43
  if (Nat=="CAN") Size = 60
  if (Nat=="CRO") Size = 60
  if (Nat=="FIN") Size = 49
  if (Nat=="GBR") Size = 60
  if (Nat=="GER") Size = 50
  if (Nat=="KAZ") Size = 60
  if (Nat=="LAT") Size = 60
  if (Nat=="LUX") Size = 50
  if (Nat=="NOR") Size = 42
  if (Nat=="POL") Size = 48
  if (Nat=="SLO") Size = 60
  if (Nat=="SUI") Size = 30
  if (Nat=="USA") Size = 48
  if (Nat=="YUG") Size = 60

  W = Math.round(Math.sqrt(FlagArea*Size/30))
  H = Math.round(Math.sqrt(FlagArea*30/Size))
}
// 373
function ShowBirthdays() {
  Counted = 0    ; 
  Count   = 0    ; 
  Candles = "&nbsp;&nbsp;&nbsp;<img src='images/birthday.gif'>&nbsp;&nbsp;&nbsp;" ;
  BirthdayList() ; 
  if(Count>0) {
    InsertPixels=InsertPixels+32 ; 
    document.write("<tr><td align='center' style='background: URL(images/headergreen.png) repeat-x top'>");
    document.write("<marquee><p class='SubtitleE' style='color: #FFEE00; text-align: Center;") ;
    document.write("margin-top: 0; margin-bottom: 0'><b>");
//    document.write(Candles) ; 
    Count=0 ; Counted=1 ; 
    BirthdayList()
    document.write("</p></marquee>") ; 
  }
}
// 390
function BirthdayList() { 
  Birthday("Anton"                 ,1129) ; 
  Birthday("Andrey"                ,1209) ; 
  Birthday("Evgenia"               ,1222) ; 
  Birthday("Robert"                , 112) ; 
  Birthday("Marcel"                , 211) ; 
  Birthday("Fr&eacute;d&eacute;ric", 226) ; 
  Birthday("Philippe"              , 226) ; 
  Birthday("Olga"                  , 410) ; 
  Birthday("Yuri"                  , 415) ; 
  Birthday("Tatyana"               , 527) ; 
  Birthday("Hartmut"               , 529) ; 
  Birthday("Gustavo"               , 604) ; 
  Birthday("Dieter"                , 604) ; 
  Birthday("Andris"                , 721) ; 
  Birthday("Tomas"                 , 721) ; 
  Birthday("Zhanna"                , 731) ; 
  Birthday("Francis"               , 805) ; 
  Birthday("Anton"                 , 810) ; 
  Birthday("Gw&eacute;na&euml;lle" , 810) ; 
  Birthday("Mariusz"               , 822) ; 
  Birthday("Mikhail"               , 824) ; 
  Birthday("Blandine"              , 827) ; 
  Birthday("Renaud"                , 906) ; 
  Birthday("Gennady"               , 907) ; 
  Birthday("Alexey"                , 912) ; 
  Birthday("Fabrice"               , 912) ; 
  Birthday("Mikhail"               , 916) ; 
  Birthday("Genek"                 , 924) ; 
  Birthday("Marcin"                ,1020) ; 
  Birthday("Manfred"               ,1023) ; 
  Birthday("Renan"                 ,1112) ; 
  Birthday("Bj&ouml;rn"            ,1112) ; 
  Birthday("Helmut"                ,1120) ; 
}
// 426
function Birthday(Jubilee,BirthDay) {
  if(BirthDay==JourAnnee) {
    Count=Count+1 ;
    if(Counted==1) document.write(Candles+"Happy Birthday "+Jubilee+Candles)
  }
}
// 433
function Translations() {
  FlagArea = 360 ; 
  document.write("<tr><td align='center'>") ; 
  Translation("es","ESP") ; 
  Translation("de","GER") ; 
  Translation("lv","LAT") ; 
  Translation("nl","NED") ; 
  Translation("pl","POL") ; 
  Translation("ru","RUS") ; 
  document.write("</td></tr>") ; 
}
// 451
function Translation(Code,Code3) {
  Nat = Code3 ; 
  SetFlagSize() ; 
  document.write("<a href='javascript: TranslateThisPage("+String.fromCharCode(34)+Code+String.fromCharCode(34)+")'>") ; 
  document.write("<img src='images/"+Nat+".gif' width="+W+" height="+H+" border=1></a> ") ; 
}
// 457
function TranslateThisPage(Lang) {
  SourceURL     = document.URL ; 
  TranslatedURL = "http://translate.google.com/translate?js=y&prev=_t&hl=fr&ie=UTF-8&layout=1&eotf=1&u="+SourceURL+"&sl=en&tl="+Lang ; 
  location.href = TranslatedURL ;
}
