//
// Tellabs Annual Report 2006
// Navigation header and footer
//
// Herring Design 2006
//


// true if we're on IE
var isIE = ( navigator.appVersion.indexOf("MSIE") != -1 ) ? true : false; 
    
// true if we're on NS6
var isNS6 = ( document.getElementById ) ? true : false;


	// variable declarations
var thisSection = 0;		// current section number
var thisPage = 0;			// current page number
var totalPages = 0;			// total number of pages
var prevPage = "";			// previous page name, i.e. 'products.htm'
var nextPage = "";			// next page name
url = new String( location.href );	// the URL
var i;						

	// page name --> menu section mappings
	//  note this is also used for the next/previous navigation tool
	//
	// <page name>, <section #>
	//
gPageMap = Array(
	String( "glossary.htm" ), 10,
	String( "cover.htm" ), 1,
	String( "more01.htm" ), 1,
	String( "more02.htm" ), 1,
	String( "more03.htm" ), 1,
	String( "more04.htm" ), 1,
	String( "more05.htm" ), 1,
	String( "grow01.htm" ), 2,
	String( "fh.htm" ), 3,
	String( "letter.htm" ), 4,
	String( "qa.htm" ), 5,
	String( "solutions.htm" ), 6,
	String( "financials1.htm" ), 7,
	String( "financials2.htm" ), 7,
	String( "financials2-1.htm" ), 7,
	String( "financials2-2.htm" ), 7,
	String( "financials3-1.htm" ), 7,
	String( "financials3-2.htm" ), 7,
	String( "financials3-3.htm" ), 7,
	String( "financials3-4.htm" ), 7,
	String( "financials4-1.htm" ), 7,
	String( "financials4-2.htm" ), 7,
	String( "financials4-3.htm" ), 7,
	String( "financials4-4.htm" ), 7,
	String( "financials4-5.htm" ), 7,
	String( "financials4-6.htm" ), 7,
	String( "financials4-7.htm" ), 7,
	String( "financials4-8.htm" ), 7,
	String( "financials4-9.htm" ), 7,
	String( "financials4-10.htm" ), 7,
	String( "financials4-11.htm" ), 7,
	String( "financials4-12.htm" ), 7,
	String( "financials4-13.htm" ), 7,
	String( "financials4-14.htm" ), 7,
	String( "financials4-15.htm" ), 7,
	String( "financials4-16.htm" ), 7,	
	String( "financials4-17.htm" ), 7,
	String( "financials5.htm" ), 7,
	String( "leadership.htm" ), 8,
	String( "leadership2.htm" ), 8,
	String( "investorinfo.htm" ), 9,	
	String( "glossary.htm" ), 10);
// if no cookie, add survey
if (document.cookie.indexOf("AR06Survey=submitted") < 0) {
	gPageMap.push(String( "ar06survey.cfm" ), 0);
}
gPageMap.push(String( "cover.htm" ), 1);
//end of gPageMap[]

	// strip off all but the file name
url = "/" + url.toLowerCase();		// make sure we find at least 1
url = url.substr( url.lastIndexOf( "/" ) +1, url.length - url.lastIndexOf( "/" ) ); 	// strip off all but the file name

	// find the current page in the list and fill-in the variables
for( i = 2; i < gPageMap.length; i += 2 ) {
	if( url == gPageMap[i] ) {
		prevPage = gPageMap[i-2];		// save the previous page name
		nextPage = gPageMap[i+2];		// save the next page name
		thisSection = gPageMap[i+1];	// get the section number
		thisPage = i / 2;
		break;
	}
}
totalPages = (gPageMap.length / 2) -2;	// total number of pages (based on gPageMap[] array)

	// Load Rollovers
if( document.images ) {

	menu_next = new Image; 		menu_next.src = "menu_next.gif";
	menu_over_next = new Image; 	menu_over_next.src = "menu_next_over.gif";
	
	menu_previous = new Image; 		menu_previous.src = "menu_prev.gif";
	menu_over_previous = new Image; 	menu_over_previous.src = "menu_prev_over.gif";

	menu_01 = new Image; 	menu_01.src = "menu_cover.gif";
	menu_over_01 = new Image; 	menu_over_01.src = "menu_cover_over.gif";

	menu_02 = new Image; 	menu_02.src = "menu_grow.gif";
	menu_over_02 = new Image; 	menu_over_02.src = "menu_grow_over.gif";

	menu_03 = new Image; 	menu_03.src = "menu_fh.gif";
	menu_over_03 = new Image; 	menu_over_03.src = "menu_fh_over.gif";

	menu_04 = new Image; 	menu_04.src = "menu_letter.gif";
	menu_over_04 = new Image; 	menu_over_04.src = "menu_letter_over.gif";

	menu_05 = new Image; 	menu_05.src = "menu_qa.gif";
	menu_over_05 = new Image; 	menu_over_05.src = "menu_qa_over.gif";

	menu_06 = new Image; 	menu_06.src = "menu_solutions.gif";
	menu_over_06 = new Image; 	menu_over_06.src = "menu_solutions_over.gif";

	menu_07 = new Image; 	menu_07.src = "menu_fin.gif";
	menu_over_07 = new Image; 	menu_over_07.src = "menu_fin_over.gif";

	menu_08 = new Image; 	menu_08.src = "menu_leader.gif";
	menu_over_08 = new Image; 	menu_over_08.src = "menu_leader_over.gif";

	menu_09 = new Image; 	menu_09.src = "menu_investor.gif";
	menu_over_09 = new Image; 	menu_over_09.src = "menu_investor_over.gif";
	
	menu_10 = new Image; 	menu_10.src = "menu_glossary.gif";
	menu_over_10 = new Image; 	menu_over_10.src = "menu_glossary_over.gif";
	
	
}

	// write the style sheet for the page numbers
document.write( '<style media="screen" type="text/css"><!-- .navtool { color: #000; font-size: 11px; font-family: Arial } .navtoolbacktotop { color: #000; font-size: 11px; font-family: Arial } --></style>' );


	// swap images function
function SwitchImage( imgDocID, ImgObjName ) {
	if( document.images ) {
		document.images[imgDocID].src = eval( ImgObjName + ".src" );
	}
} //SwitchImage


	// write the footer
function writeFooter() {
document.write( '<table width="660" border="0" cellpadding="0" cellspacing="0" background="footerback.jpg"><tr><td width="638"><img src="spacer.gif" width="638" height="20" /></td><td width="20" align="center" valign="middle" class="pagenumber">' + thisPage + '</td><td width="2"><img src="spacer.gif" width="2" height="20" /></td></tr></table>' );
 }//writeFooter()

	// write the header (including the menu)
function writeHeader() {

	document.write( '<a name="top"></a>' );
	
		// write everything up to the section titles	
	
	document.write( '<table width="660" border="0" cellpadding="0" cellspacing="0" background="background.jpg"><tr><td><table width="660" border="0" cellspacing="0" cellpadding="0"><tr><td width="207"><img src="menu_logo.gif" width="207" height="52" /></td><td width="375"><img src="background_fill.gif" width="375" height="52" /></td><td width="78"><table width="78" border="0" cellspacing="0" cellpadding="0" background="background_pnfill.gif"><tr><td width="14"><img src="spacer.gif" width="14" height="18" /></td><td width="45"><img src="spacer.gif" width="45" height="18" /></td><td width="14"><img src="spacer.gif" width="14" height="18" /></td><td width="5"><img src="spacer.gif" width="5" height="18" /></td></tr><tr><td width="14"><a href="' + prevPage + '" onmouseover="SwitchImage( \x27menu_previous\x27, \x27menu_over_previous\x27 ); return true;" onmouseout="SwitchImage( \x27menu_previous\x27, \x27menu_previous\x27 ); return true;"><img name="menu_previous" src="menu_prev.gif" width="14" height="16" border="0" alt="[Previous]"></a></td><td width="45" align="center" valign="bottom" class="pagenumber">' + thisPage + ' of ' + totalPages + '</td><td width="14"><a href="' + nextPage + '" onmouseover="SwitchImage( \x27menu_next\x27, \x27menu_over_next\x27 ); return true;" onmouseout="SwitchImage( \x27menu_next\x27, \x27menu_next\x27 ); return true;"><img name="menu_next" src="menu_next.gif" width="14" height="16" border="0" alt="[Next]"></a></td><td width="5"><img src="spacer.gif" width="5" height="16" /></td></tr><tr><td width="14"><img src="spacer.gif" width="14" height="18" /></td><td width="45"><img src="spacer.gif" width="45" height="18" /></td><td width="14"><img src="spacer.gif" width="14" height="18" /></td><td width="5"><img src="spacer.gif" width="5" height="18" /></td></tr></table></td></tr></table></td></tr></table></td></tr></table>' );


		// begin section titles
	document.write( '</td></tr><tr><td><table width="660" border="0" cellspacing="0" cellpadding="0"><tr>' );

	if( thisSection == 1 )
		document.write( '<td><a href="cover.htm"><img name="menu_01" src="menu_cover_on.gif" width="88" height="21" border="0" alt="[Cover]"></a></td>' );
	else
		document.write( '<td><a href="cover.htm" onmouseover="SwitchImage( \x27menu_01\x27, \x27menu_over_01\x27 ); return true;" onmouseout="SwitchImage( \x27menu_01\x27, \x27menu_01\x27 ); return true;"><img name="menu_01"  src="menu_cover.gif" width="88" height="21" border="0" alt="[Cover]"></a></td>' );

	if( thisSection == 2 )
 	       document.write( '<td><a href="grow01.htm"><img name="menu_02" src="menu_grow_on.gif" width="77" height="21" border="0" alt="[When Networks Grow]"></a></td>' );
	else
	       document.write( '<td><a href="grow01.htm" onmouseover="SwitchImage( \x27menu_02\x27, \x27menu_over_02\x27 ); return true;" onmouseout="SwitchImage( \x27menu_02\x27, \x27menu_02\x27 ); return true;"><img name="menu_02" src="menu_grow.gif" width="77" height="21" border="0" alt="[When Networks Grow]"></a></td>' );

	if( thisSection == 3 )
		document.write( '<td><a href="fh.htm"><img name="menu_03" src="menu_fh_on.gif" width="109" height="21" border="0" alt="[Financial Highlights]"></a></td>' );
	else
		document.write( '<td><a href="fh.htm" onmouseover="SwitchImage( \x27menu_03\x27, \x27menu_over_03\x27 ); return true;" onmouseout="SwitchImage( \x27menu_03\x27, \x27menu_03\x27 ); return true;"><img name="menu_03" src="menu_fh.gif" width="109" height="21" border="0" alt="[Financial Highlights]"></a></td>' );

	if( thisSection == 4 )
		document.write( '<td><a href="letter.htm"><img name="menu_04" src="menu_letter_on.gif" width="42" height="21" border="0" alt="[Letter]"></a></td>' );
	else
      	document.write( '<td><a href="letter.htm" onmouseover="SwitchImage( \x27menu_04\x27, \x27menu_over_04\x27 ); return true;" onmouseout="SwitchImage( \x27menu_04\x27, \x27menu_04\x27 ); return true;"><img name="menu_04" src="menu_letter.gif" width="42" height="21" border="0" alt="[Letter]"></a></td>' );

	if( thisSection == 5 )
       	document.write( '<td><a href="qa.htm"><img name="menu_05" src="menu_qa_on.gif" width="33" height="21" border="0" alt="[Q &amp; A]"></a></td>' );
	else
       	document.write( '<td><a href="qa.htm" onmouseover="SwitchImage( \x27menu_05\x27, \x27menu_over_05\x27 ); return true;" onmouseout="SwitchImage( \x27menu_05\x27, \x27menu_05\x27 ); return true;"><img name="menu_05" src="menu_qa.gif" width="33" height="21" border="0" alt="[Q &amp; A]"></a></td>' );

	if( thisSection == 6 )
		document.write( '<td><a href="solutions.htm"><img name="menu_06" src="menu_solutions_on.gif" width="57" height="21" border="0" alt="[Solutions]"></a></td>' );
	else
		document.write( '<td><a href="solutions.htm" onmouseover="SwitchImage( \x27menu_06\x27, \x27menu_over_06\x27 ); return true;" onmouseout="SwitchImage( \x27menu_06\x27, \x27menu_06\x27 ); return true;"><img name="menu_06" src="menu_solutions.gif" width="57" height="21" border="0" alt="[Solutions]"></a></td>' );

	if( thisSection == 7 )
       	document.write( '<td><a href="financials1.htm"><img name="menu_07" src="menu_fin_on.gif" width="61" height="21" border="0" alt="[Financials]"></a></td>' );
	else
		document.write( '<td><a href="financials1.htm" onmouseover="SwitchImage( \x27menu_07\x27, \x27menu_over_07\x27 ); return true;" onmouseout="SwitchImage( \x27menu_07\x27, \x27menu_07\x27 ); return true;"><img name="menu_07" src="menu_fin.gif" width="61" height="21" border="0" alt="[Financials]"></a></td>' );

	if( thisSection == 8 )
       	document.write( '<td><a href="leadership.htm"><img name="menu_08" src="menu_leader_on.gif" width="65" height="21" border="0" alt="[Leadership] "></a></td>' );
	else
       	document.write( '<td><a href="leadership.htm" onmouseover="SwitchImage( \x27menu_08\x27, \x27menu_over_08\x27 ); return true;" onmouseout="SwitchImage( \x27menu_08\x27, \x27menu_08\x27 ); return true;"><img name="menu_08" src="menu_leader.gif" width="65" height="21" border="0" alt="[Leadership]"></a></td>' );

	if( thisSection == 9 )
       	document.write( '<td><a href="investorinfo.htm"><img name="menu_09" src="menu_investor_on.gif" width="71" height="21" border="0" alt="[Investor Info]"></a></td>' );
	else
       	document.write( '<td><a href="investorinfo.htm" onmouseover="SwitchImage( \x27menu_09\x27, \x27menu_over_09\x27 ); return true;" onmouseout="SwitchImage( \x27menu_09\x27, \x27menu_09\x27 ); return true;"><img name="menu_09" src="menu_investor.gif" width="71" height="21" border="0" alt="[Investor Info]"></a></td>' );

	if( thisSection == 10 )
       	document.write( '<td><a href="glossary.htm"><img name="menu_10" src="menu_glossary_on.gif" width="57" height="21" border="0" alt="[Glossary]"></a></td>' );
	else
       	document.write( '<td><a href="glossary.htm" onmouseover="SwitchImage( \x27menu_10\x27, \x27menu_over_10\x27 ); return true;" onmouseout="SwitchImage( \x27menu_10\x27, \x27menu_10\x27 ); return true;"><img name="menu_10" src="menu_glossary.gif" width="57" height="21" border="0" alt="[Glossary]"></a></td>' );
		
		
		// end section titles, close the table
	document.write( '</tr></table></td></tr></table>' );

} //writeHeader()


// end of 'header.js'
