/* Display the main graphical logo */
function MainLogo()
{
  var root = arguments[0];

  document.write("<div id=\"top\">");
  document.write("  <a href=\"" + root + "\"><img id=\"titlebar\" src=\"" + root + "/images/fglogosm.jpg\" alt=\"\"></a>");
  document.write("</div>");
}


/* Display the google site search form */
function SiteSearchGoogle()

{
  document.write("<form action=\"http://www.br.flightgear.org/search.html\" id=\"cse-search-box\">");
  document.write("<div>");
  document.write("<input type=\"hidden\" name=\"cx\" value=\"partner-pub-4152680871892282:9313753669\" />");
  document.write("<input type=\"hidden\" name=\"cof\" value=\"FORID:10\" />");
  document.write("<input type=\"hidden\" name=\"ie\" value=\"ISO-8859-1\" />");
  document.write("<input type=\"text\" name=\"q\" size=\"24\" />");
  document.write("<p>");
  document.write("<input type=\"submit\" name=\"sa\" value=\"Pesquisar\" />");
  document.write("</p>");
  document.write("</div>");
  document.write("</form>");
  document.write("<script type=\"text/javascript\" src=\"http://www.google.com.br/cse/brand?form=cse-search-box&lang=pt\"></script>");
  document.write("<br />");
  document.write("<br />");
}


/* Display the main menu */
function MainMenu()
{
  var root = arguments[0];

  document.write("<h3>Principal</h3>");
  document.write("<a href=\"" + root + "/index.shtml\">Inicial</a><br>");
  document.write("<a href=\"" + root + "/introduction.html\">Introdu&ccedil;&atilde;o</a><br>");
  document.write("<a href=\"" + root + "/features.html\">Caracter&iacute;sticas</a><br>");
  document.write("<a href=\"" + root + "/Gallery-v1.0/\">Galeria de Imagens</a><br>");
  document.write("<a href=\"" + root + "/Downloads/\">Downloads</a><br>");
  document.write("<a href=\"http://cdrom.flightgear.org\">CD e DVD do FlightGear</a><br>");
  document.write("<h3>Suporte</h3>");
  document.write("<a href=\"" + root + "/version.html\">Mudan&ccedil;as nas Vers&otilde;es</a><br>");
  document.write("<a href=\"" + root + "/hardwarereq.html\">Exig&ecirc;ncias de Hardware</a><br>");
  document.write("<a href=\"" + root + "/docs.html\">Documenta&ccedil;&atilde;o</a><br>");
  document.write("<a href=\"" + root + "/places.html\">Lugares para Voar</a><br>");
  document.write("<a href=\"" + root + "/mail.html\">Listas, F&oacute;rums, e IRC</a><br>");
  document.write("<a href=\"" + root + "/Docs/FAQ.shtml\">Dúvidas (FAQ)</a><br>");
  document.write("<h3>Links</h3>");
  document.write("<a href=\"" + root + "/links.html\">Websites Relacionados</a><br>");
  document.write("<a href=\"" + root + "/Projects/\">Projetos Relacionados</a><br>");
  document.write("<h3>Contribua</h3>");
  document.write("<a href=\"" + root + "/contributing.html\">Contribui&ccedil;&otilde;es</a><br>");
  document.write("<a href=\"" + root + "/cvs.html\">Recursos CVS</a><br>");
  document.write("<a href=\"" + root + "/goals.html\">Lista de Metas</a><br>");
  document.write("<a href=\"" + root + "/thanks.shtml\">Colaboradores</a><br>");
  document.write("<a href=\"" + root + "/design.html\">Propostas de Design</a><br>");
  document.write("<a href=\"" + root + "/events.html\">Eventos</a><br><br><br>");
  document.write("<a href=\"http://www.orkut.com/Community.aspx?cmm=5105481\" target=\"_blank\"><img border=\"0\" src=\"" + root + "/images/orkut.gif\" alt=\"Comunidade FlightGear no Orkut\"></a><br>");
}


function BottomMenu()
{
  var root = arguments[0];

  document.write("<a href=\"/\">Inicial</a> | ");
  document.write("<a href=\"" + root + "/Downloads/\">Downloads</a> | ");
  document.write("<a href=\"" + root + "/Gallery-v2.4/index.shtml\">Imagens</a> | ");
  document.write("<a href=\"" + root + "/docs.html\">Documenta&ccedil;&atilde;o</a>");
}


// Array.shuffle( deep ) - Randomly interchange elements
Array.prototype.fgshuffle = function( b ) {
 var i = this.length, j, t;
 while( i ) {
  j = Math.floor( ( i-- ) * Math.random() );
  t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];
  this[i] = this[j];
  this[j] = t;
 }
 return this;
};

function RandomFrontImages()
{
  var base = arguments[0];

var picts = [
			 	'fgfs-screen-072.jpg',
				'fgfs-screen-076.jpg',
				'fgfs-screen-082.jpg',
				'fgfs-screen-084.jpg',
				'fgfs-screen-085.jpg',
				'fgfs-screen-086.jpg',
				'fgfs-screen-088.jpg',
				'fgfs-screen-088a.jpg',
				'fgfs-screen-089.jpg',
				'fgfs-screen-094.jpg',
				'fgfs-screen-095.jpg',
				'fgfs-screen-101.jpg',
				'fgfs-screen-103.jpg',
				'fgfs-screen-114-2.jpg',
				'fgfs-screen-118.jpg',
				'fgfs-screen-120.jpg',
				'fgfs-screen-123.jpg',
				'fgfs-screen-128.jpg',
				'fgfs-screen-132.jpg',
				'fgfs-screen-136.jpg',
				'fgfs-screen-142.jpg',
				'fgfs-screen-142a.jpg',
				'fgfs-screen-146.jpg',
				'fgfs-screen-150.jpg',
				'fgfs-screen-151.jpg',
				'fgfs-screen-153.jpg',
				'fgfs-screen-162.jpg',
				'fgfs-screen-165.jpg',
				'fgfs-screen-167.jpg',
				'fgfs-screen-177.jpg',
				'fgfs-screen-183.jpg',
				'fgfs-screen-184.jpg',
				'fgfs-screen-186.jpg',
				'fgfs-screen-196.jpg',
				'fgfs-screen-204.jpg',
				'fgfs-screen-213.jpg',
				'fgfs-screen-228.jpg',
				'fgfs-screen-229.jpg',
				'fgfs-screen-234.jpg',
				'fgfs-screen-239.jpg',
				'fgfs-screen-241.jpg',
				'fgfs-screen-250.jpg',
				'fgfs-screen-252.jpg',
				'fgfs-screen-260.jpg',
				'fgfs-screen-263.jpg',
				'fgfs-screen-312.jpg',
				'fgfs-screen-323.jpg',
				'fgfs-screen-337.jpg',
				'fgfs-screen-359.jpg',
				'picture-0001.jpg',
				'picture-0002.jpg',
				'picture-0003.jpg',
				'picture-0004.jpg',
				'picture-0005.jpg',
				'picture-0006.jpg',
				'picture-0007.jpg',
				'picture-0008.jpg',
				'picture-0009.jpg',
				'picture-0010.jpg',
				'picture-0011.jpg',
				'picture-0013.jpg',
				'picture-0014.jpg',
				'picture-0015.jpg',
				'rjgg_night02.jpg',
				'zds5a.jpg'
              ];


 picts.fgshuffle();

  document.write("<A HREF=\"/Gallery-v2.4/Original/" + picts[0] + "\"><IMG CLASS=\"mainscreen\" WIDTH=\"240\" SRC=\"/Gallery-v2.4/Original/" + picts[0] + "\" ALT=\"" + picts[0] + "\"></A>");
  document.write("<A HREF=\"/Gallery-v2.4/Original/" + picts[1] + "\"><IMG CLASS=\"mainscreen\" WIDTH=\"240\" SRC=\"/Gallery-v2.4/Original/" + picts[1] + "\" ALT=\"" + picts[1] + "\"></A>");
  document.write("<A HREF=\"/Gallery-v2.4/Original/" + picts[2] + "\"><IMG CLASS=\"mainscreen\" WIDTH=\"240\" SRC=\"/Gallery-v2.4/Original/" + picts[2] + "\" ALT=\"" + picts[2] + "\"></A>");
}



function RandomURLS()
{
  // Contacts
  // ftp://ftp.kingmont.com/flightsims/flightgear/ - Jim Brennan jjb
  //   at kingmont dt com
  // http://flight.frozenwebhost.com/ - Steve support at
  //   frozenwebhost dt com

  var base = arguments[0];

  var sites = [	
				'ftp://flightgear.wo0t.de/flightgear-ftp/ftp/',
				'http://ftp.igh.cnrs.fr/pub/flightgear/ftp/',
				'http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/',
				'ftp://ftp.kingmont.com/flightsims/flightgear/',
				'ftp://ftp.de.flightgear.org/pub/fgfs/',
				'http://ftp.linux.kiev.ua/pub/fgfs/'
	
              ];

  // requested not to be in the round robin, but is a full mirror
  // 'ftp://ftp.is.co.za/pub/games/flightgear/'

  sites.fgshuffle();

  document.write("<a href=\"" + sites[0] + base + "\">[Link 1]</a> ");
  document.write("<a href=\"" + sites[1] + base + "\">[Link 2]</a> ");
  document.write("<a href=\"" + sites[2] + base + "\">[Link 3]</a>");
}

