// Define all the links for all the sections
var homepageLinks=new Array(
["Compre Seguro de Auto", "/auto/sales/"],
["Efectúe un Pago", "/makepayment/"],
["Reclamos de Autos", "/auto/claims/"],
["Empleo", "http://careers.geico.com"],
["La Tiendita de GEICO", "http://www.geico.com/about/geico-merchandise/"]);

var autoLinks=new Array(
["Compre Seguro de Auto", "/auto/sales/"],
["Administre su Póliza de Auto", "/auto/manage/"],
["Reclamos de Autos", "/auto/claims/"],
["El Auto y la Seguridad", "/auto/safety/"]);

var cycleLinks=new Array(
["Compre Seguro de Motocicleta", "/cycle/sales/"],
["Administre su Póliza de Motocicleta", "/cycle/manage/"],
["Aprenda Acerca del Seguro de Motocicleta", "/cycle/about/"],
["Seguro para su RV", "/cycle/rv"],
["Seguro para un Todo-terreno (ATV)", "/cycle/atv"],
["La Seguridad y las Motocicletas", "/cycle/safety/"]);

var homeLinks=new Array(
["Seguro de Hogar", "/home/home/"],
["Seguro de Inquilino", "/home/renters/"],
["Seguro de Condominio", "/home/condo/"],
["Seguro de Inundación", "/home/flood/"],
["Seguro de Casa Móvil", "/home/mobile/"],
["Seguro en el Extranjero", "/home/overseas/"]);

var lifeLinks=new Array(
["Compre Seguro de Vida", "/life/sales/"],
["Administre su Seguro de Vida", "/life/manage/"],
["Acerca del Seguro de Vida", "/life/about/"]);

umbrellaLinks=new Array(
["Compre Seguro Sombrilla", "/umbrella/sales/"],
["Administre su Póliza Sombrilla", "/umbrella/manage/"],
["Efectúe un Pago para su Póliza Sombrilla", "/umbrella/makepayment/"],
["Acerca del Seguro Sombrilla", "/umbrella/about/"]);

var boatLinks=new Array(
["Compre Seguro de Bote y de PWC", "/boat/sales/"],
["Administre su Póliza de Bote y de PWC", "/boat/manage/"],
["Aprenda Acerca de Seguro de Botes y de PWC", "/boat/about/"]);

var aboutLinks=new Array(
["Un Vistazo a GEICO", "/about/glance/"],
["La Historia de GEICO", "/about/history/"],
["La Solidez Financiera de GEICO", "/about/strength/"]);


// Create a function to find a string in a two dimensional array
function findInArray(arrayRef, stringToFind) {
            for(i=0; i<arrayRef.length; i++)
                        if(arrayRef[i][1]==stringToFind) { return i; }
            return -1;
}

// Figure out the which page the user is on using the URL
var mainSection=document.location.toString().split('/')[3];
var subSection=document.location.toString().split('/')[4];

 
// Figure out which array of links to use and which item should be active, if any
var listRef=mainSection && typeof(window[mainSection+'Links'])!='undefined' ? window[mainSection+'Links'] : homepageLinks;
var selectedItem=subSection ? findInArray(listRef,'/'+mainSection+'/'+subSection+'/') :findInArray(listRef,'/'+mainSection+'/');

// Write out the HTML for the links
document.write("<ul>");
for (i=0; i<listRef.length; i++) {
            // Select the appropriate class for the <li> tag
            var mOver = listRef==homepageLinks && (i==3 || i==4) ? 'onmouseover="showLabel()" onmouseout="hideLabel()"' : '';
            var tag=i==0 ? i==selectedItem ? '<li class="fselected">' : '<li class="first">' : i==selectedItem ? '<li class="selected">' : '<li>';
            document.write(tag+'<a href="'+listRef[i][1]+'" ' + mOver + '>'+listRef[i][0]+'</a></li>');
}

document.write("</ul>");

// $Revision: 1.20 $
// $Name: static20090611 $ 
