// Define all links for the main tabs
var globalLinks=new Array(
["Seguro de<br />Auto", "/auto/"],
["Seguro de Motocicleta RV y ATV", "/cycle/"],
["Seguro de Hogar, Condo e Inquilino", "/home/"],
["Seguro de<br />Vida", "/life/"],
["Seguro Sombrilla", "/umbrella/"],
["Seguro de<br /> Bote y de<br /> PWC", "/boat/"],
["Empleo<br /><strong>(En Inglés)</strong>", "http://careers.geico.com"],
["Aprenda Acerca de GEICO", "/about/"]);

// 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 selectedItem=mainSection ? findInArray(globalLinks,'/'+mainSection+'/') : -1;

// Write out the HTML for the links
document.write("<ul id='mainnav'>");
for (i=0; i<globalLinks.length; i++) {
	var tag='<li>';
	if(i==selectedItem) {
		if(i==0) { tag = '<li id="selected" class="first">'; }
		else if(i==globalLinks.length-1) { tag = '<li id="selected" class="orange">'; }
		else { tag = '<li id="selected">'; }
	} else if (i==0) {
		tag = '<li class="first">';
	} else if(i==globalLinks.length-2) {
		tag = '<li class="blue">';
	} else if(i==globalLinks.length-1) {
		tag = '<li class="orange">';
	}
	
	document.write(tag+'<a href="'+globalLinks[i][1]+'"><span>'+globalLinks[i][0]+'</span></a></li>');
}
document.write("</ul>");

// $Revision: 1.8 $
// $Name: static20080131 $