<!--
/* Javascript functions for generating the page title and navigation bar
 * for pages on the Bomberos Coahuila Sureste Saltillo web site.
 */
var darkredColor='#8b0000';
var whiteColor='#ffffff';
function generateBomberosTitlePanel(language){
  // Generate 10-pixel-high bar
  document.writeln('<tr><td><table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFEE88"><tr>');
  generateSpacerCell('10', '1');
  document.writeln('</tr><tr>');
  // Generate title bar:
  generateSpacerCell('1', '20');
  //   Generate left side emblem
  document.writeln('<td valign="center">');
  document.writeln('<img src="images/emblem_bcs150x150.gif" height="150" width="150" border="0">');
  document.writeln('</td>');
  generateSpacerCell('1', '60');
  //   Generate "Bomberos" banner image
  document.writeln('<td width="400" align="center" valign="center">');
  if(language=='english'){
    document.writeln('<img src="images/bomberos_cs_s150x400.gif" alt="Bomberos Coahuila Sureste Saltillo"'
                     +' height="150" width="400" border="0">');
  }else if(language=='espaņol'){
    document.writeln('<img src="images/bomberos_c_s150x250.gif" alt="Bomberos Coahuila Sureste Saltillo"'
                     +' height="150" width="250" border="0">');
  }
  document.writeln('</td>');
  //   Color the right side of the title bar
  document.writeln('<td width="100%"><img src="images/transparent1x1.gif" width="1" border="0"></td>');
  // Generate 5-pixel-high bar
  document.writeln('</tr><tr>');
  generateSpacerCell('10', '1');
  document.writeln('</tr></table></td></tr>');
}
function generateNavigationBar(language, otherLanguagePage){
  document.writeln('<tr><td><table border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="'+darkredColor+'">');
  document.writeln('<tr><td align="center"><table cellpadding="5" cellspacing="3" bgcolor="'+darkredColor+'"><tr>');
  if(language=='english'){
    generateNavigationCell('index_en.html',        'Home');
    generateNavigationCell('friends.html',      'Friends');
    generateNavigationCell('stations.html',     'Stations');
    generateNavigationCell('training.html',     'Training');
    generateNavigationCell('apparatus.html',    'Firefighters');
    generateNavigationCell('action.html',       'Action');
    generateNavigationCell('memorial.html',     'Memorial');
    generateSpacerCell('1','15');
    generateNavigationCell('contacts.html',     'Contacts',
	                       'Use this form to send a message to the'
						   +' Austin Texas Friends of Bomberos de Coahuila Sureste.');
    generateSpacerCell('1','5');
	if(null != otherLanguagePage){
      generateNavigationCell(otherLanguagePage, 'Espaņol', 'View this page en Espaņol.');
	}else{
      generateNavigationCell('index_sp.html', 'Espaņol', 'View this web site en Espaņol.');
	}
  }else if(language=='espaņol'){
    generateNavigationCell('index_sp.html',     'Hogar');
    generateNavigationCell('amigos.html',       'Amigos');
    generateNavigationCell('estaciones.html',   'Estaciones');
    generateNavigationCell('capacitacion.html', 'Capacitacion');
    generateNavigationCell('camiones.html',     'Bomberos');
    generateNavigationCell('accion.html',       'Accion');
    generateNavigationCell('monumento.html',    'Monumento');
    generateSpacerCell('1','15');
    generateNavigationCell('contactos.html',    'Contactos',
	                       'Use esta forma para mandar mensajes al grupo de'
						   +' Austin Texas, Amigos de los Bomberos de Coahuila Sureste.');
    generateSpacerCell('1','5');
	if(null != otherLanguagePage){
      generateNavigationCell(otherLanguagePage, 'English', 'View this page in English.');
	}else{
      generateNavigationCell('index_en.html', 'English', 'View this web site in English.');
	}
  }
  document.writeln('</tr></table></td></tr>');
  document.writeln('</table></td></tr>');
}
// Generate one table cell containing a link in the navigation bar.
//  In browsers that support the DOM model, visually "arm" the link
//  by changing the background and text colors when the mouse hovers
//  over the link and "disarm" the link by restoring the original colors
//  when the mouse leaves the link.
function generateNavigationCell(target, label, title){
  var cellname=target+'_cell';
  var textname=target+'_text';
  var armNavCellCall="armNavigationCell('"+target+"');";
  var disarmNavCellCall="disarmNavigationCell('"+target+"');";
  var titleAttribute='';
  if(title){
    titleAttribute=' title="'+title+'"';
  }
  var urlParts=document.URL.split('/');
  var fileName=urlParts[urlParts.length-1];
  var targetParts=target.split('/');
  var targetFileName=targetParts[targetParts.length-1];
  if(targetFileName==fileName){
    document.writeln('<td bgColor="'+whiteColor+'">');
	document.writeln(' <b><font face="arial,helvetica,sans-serif" color="purple">'+label+'</font></b>');
  }else{
    document.writeln('<td id="'+cellname+'" bgColor="'+darkredColor+'"'+titleAttribute
                   +' onMouseOver="'+armNavCellCall+'" onMouseOut="'+disarmNavCellCall+'" onClick="'+disarmNavCellCall+'">');
    document.writeln(' <b><a href="'+target+'">'
                   +'<font id="'+textname+'" face="arial,helvetica,sans-serif" color="'+whiteColor+'">'
				   +label+'</font></a></b>');
  }
  document.writeln('</td>');
}
// Visually arm a navigation link by changing text and background colors
//  if the browser supports the DOM model.
function armNavigationCell(target){
  var cellname=target+'_cell';
  var textname=target+'_text';
  document.getElementById(cellname).setAttribute('bgColor',whiteColor);
  document.getElementById(textname).setAttribute('color','purple');
}
// Visually disarm a navigation link by setting original text and background colors.
function disarmNavigationCell(target){
  var cellname=target+'_cell';
  var textname=target+'_text';
  document.getElementById(cellname).setAttribute('bgColor',darkredColor);
  document.getElementById(textname).setAttribute('color',whiteColor);
}
// Generate a table cell for layout control
function generateSpacerCell(height, width){
  document.writeln('<td><img src="images/transparent1x1.gif" height="'+height+'" width="'+width+'"></td>'); 
}
// Open a document in a new window
function showdoc(docfile,height,width){
  open(docfile,"docwindow","menubar,location,status,scrollbars,resizable,height="+height+",width="+width);
  if(navigator.appName != "Microsoft Internet Explorer") w.window.focus();
}
//-->

