//
// TRW 2005 Annual Report
// Navigation header and footer
//
// Herring Design 2005
//


// 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( "the_road_ahead.htm" ), 0,
	String( "cover.htm" ), 1,
	String( "highlights.htm" ), 2,
	String( "letter.htm" ), 3,
	String( "safety1.htm" ), 4,
	String( "safety2.htm" ), 4,
	String( "safety3.htm" ), 4,	
	String( "glance.htm" ), 5,
	String( "financials.htm" ), 6,	
	String( "leadership.htm" ), 7,
	String( "corpinfo.htm" ), 8,	
	String( "the_road_ahead.htm" ), 0,
	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= "images/menu_next.jpg";
	menu_over_next = new Image; 	menu_over_next.src= "images/menu_next_over.jpg";
	
	menu_previous = new Image; 		menu_previous.src= "images/menu_prev.jpg";
	menu_over_previous = new Image; 	menu_over_previous.src= "images/menu_prev_over.jpg";
	
	footer_next = new Image; 		footer_next.src = "images/footer_next.jpg";
	footer_over_next = new Image; 	footer_over_next.src = "images/footer_next_over.jpg";
	
	footer_previous = new Image; 		footer_previous.src = "images/footer_prev.jpg";
	footer_over_previous = new Image; 	footer_over_previous.src = "images/footer_prev_over.jpg";

	menu_01 = new Image; 	menu_01.src= "images/menu_cover.jpg";
	menu_over_01 = new Image; 	menu_over_01.src= "images/menu_cover_over.jpg";

	menu_02 = new Image; 	menu_02.src= "images/menu_fh.jpg";
	menu_over_02 = new Image; 	menu_over_02.src= "images/menu_fh_over.jpg";

	menu_03 = new Image; 	menu_03.src= "images/menu_letter.jpg";
	menu_over_03 = new Image; 	menu_over_03.src= "images/menu_letter_over.jpg";

	menu_04 = new Image; 	menu_04.src= "images/menu_ss.jpg";
	menu_over_04 = new Image; 	menu_over_04.src= "images/menu_ss_over.jpg";

	menu_05 = new Image; 	menu_05.src= "images/menu_glance.jpg";
	menu_over_05 = new Image; 	menu_over_05.src= "images/menu_glance_over.jpg";

	menu_06 = new Image; 	menu_06.src= "images/menu_fin.jpg";
	menu_over_06 = new Image; 	menu_over_06.src= "images/menu_fin_over.jpg";

	menu_07 = new Image; 	menu_07.src= "images/menu_leader.jpg";
	menu_over_07 = new Image; 	menu_over_07.src= "images/menu_leader_over.jpg";

	menu_08 = new Image; 	menu_08.src= "images/menu_corpinfo.jpg";
	menu_over_08 = new Image; 	menu_over_08.src= "images/menu_corpinfo_over.jpg";
	
}



	// 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="750" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="0"><tr><td width="750"><table width="750" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="3"><img src="images/footer_line.gif" width="750" height="2" /></td></tr><tr><td width="250"><img src="images/spacer.gif" width="250" height="3" /></td><td width="250"><img src="images/spacer.gif" width="250" height="3" /></td><td width="250"><img src="images/spacer.gif" width="250" height="3" /></td></tr><tr><td width="250"  align="left" valign="top"class="navNum2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&copy;TRW Automotive 2006. All Rights Reserved.</td><td width="250" align="center" class="navNum2">TRW Automotive Holdings Corp.</td><td width="250" align="left" valign="top"><table width="250" border="0" cellspacing="0" cellpadding="0"><tr><td width="150" align="right" class="navNum2">2005 Annual Report&nbsp;&nbsp;</td><td width="15"><a href="' + prevPage + '" onmouseover="SwitchImage( \x27footer_previous\x27, \x27footer_over_previous\x27 ); return true;" onmouseout="SwitchImage( \x27footer_previous\x27, \x27footer_previous\x27 ); return true;"><img name="footer_previous" src="images/footer_prev.jpg" width="15" height="15" border="0" alt="[Previous]"></a></td><td width="50" align="center" valign="bottom" class="navNum2">' + thisPage + ' of ' + totalPages + '</td><td width="15"><a href="' + nextPage + '" onmouseover="SwitchImage( \x27footer_next\x27, \x27footer_over_next\x27 ); return true;" onmouseout="SwitchImage( \x27footer_next\x27, \x27footer_next\x27 ); return true;"><img name="footer_next" src="images/footer_next.jpg" width="15" height="15" border="0" alt="[Next]"></a></td><td width="20"><img src="images/spacer.gif" width="20" height="15" /></td></tr></table></td></tr></table></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="750" border="0" cellspacing="0" cellpadding="0"><tr bgcolor="#000"><td align="right" bgcolor="#000"><span class="topnav">Download 2005: </span><a href="pdf/2005_TRW_Nar.pdf" class="smallwhite">Annual Report</a><span class="topnav"> | </span><a href="pdf/2005_TRW_10K.pdf" class="smallwhite">10K</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr><tr><td><table width="750" border="0" cellspacing="0" cellpadding="0"><tr><td width="226"><img src="images/menu_logo.jpg" alt="TRW" width="226" height="59" /></td><td width="297"><img src="images/menu_report.jpg" width="297" height="59" /></td><td width="227"><table width="227" border="0" cellspacing="0" cellpadding="0"><tr><td><img src="images/menu_2005.jpg" alt="TRW 2005 Annual Report" width="227" height="42" /></td></tr><tr><td><table width="227" border="0" cellspacing="0" cellpadding="0" background="images/backgorund.jpg"><tr background="images/backgorund.jpg"><td width="127"><img src="images/spacer.gif" width="127" height="17" /></td><td width="15"><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="images/menu_prev.jpg" width="15" height="15" border="0" alt="[Previous]"></a></td><td width="50" align="center" valign="bottom" class="navNum">' + thisPage + ' of ' + totalPages + '</td><td width="15"><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="images/menu_next.jpg" width="15" height="15" border="0" alt="[Next]"></a></td><td width="20"><img src="images/spacer.gif" width="20" height="15" /></td></tr></table></td></tr></table></td></tr></table></td></tr></table>' );


		// begin section titles
	document.write( '<table width="750" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="8" width="750"><img src="images/menu.jpg" width="750" height="8" border="0" alt="TRW 2005 Annual Report"></td></tr><tr>' );

	if( thisSection == 1 )
		document.write( '<td><a href="cover.htm"><img name="menu_01" src="images/menu_cover_on.jpg" width="51" height="19" 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="images/menu_cover.jpg" width="51" height="19" border="0" alt="[Cover]"></a></td>' );

	if( thisSection == 2 )
 	       document.write( '<td><a href="highlights.htm"><img name="menu_02" src="images/menu_fh_on.jpg" width="150" height="19" border="0" alt="[Financial Highlighs]"></a></td>' );
	else
	       document.write( '<td><a href="highlights.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="images/menu_fh.jpg" width="150" height="19" border="0" alt="[Financial Highlights]"></a></td>' );

	if( thisSection == 3 )
		document.write( '<td><a href="letter.htm"><img name="menu_03" src="images/menu_letter_on.jpg" width="56" height="19" border="0" alt="[Letter]"></a></td>' );
	else
		document.write( '<td><a href="letter.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="images/menu_letter.jpg" width="56" height="19" border="0" alt="[Letter]"></a></td>' );

	if( thisSection == 4 )
		document.write( '<td><a href="safety1.htm"><img name="menu_04" src="images/menu_ss_on.jpg" width="115" height="19" border="0" alt="[Safety Systems]"></a></td>' );
	else
      	document.write( '<td><a href="safety1.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="images/menu_ss.jpg" width="115" height="19" border="0" alt="[Safety Systems]"></a></td>' );

	if( thisSection == 5 )
       	document.write( '<td><a href="glance.htm"><img name="menu_05" src="images/menu_glance_on.jpg" width="92" height="19" border="0" alt="[At A Glance]"></a></td>' );
	else
       	document.write( '<td><a href="glance.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="images/menu_glance.jpg" width="92" height="19" border="0" alt="[At A Glance]"></a></td>' );

	if( thisSection == 6 )
		document.write( '<td><a href="financials.htm"><img name="menu_06" src="images/menu_fin_on.jpg" width="82" height="19" border="0" alt="[Financials]"></a></td>' );
	else
		document.write( '<td><a href="financials.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="images/menu_fin.jpg" width="82" height="19" border="0" alt="[Financials]"></a></td>' );

	if( thisSection == 7 )
       	document.write( '<td><a href="leadership.htm"><img name="menu_07" src="images/menu_leader_on.jpg" width="85" height="19" border="0" alt="[Leadership]"></a></td>' );
	else
		document.write( '<td><a href="leadership.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="images/menu_leader.jpg" width="85" height="19" border="0" alt="[Leadership]"></a></td>' );

	if( thisSection == 8 )
       	document.write( '<td><a href="corpinfo.htm"><img name="menu_08" src="images/menu_corpinfo_on.jpg" width="119" height="19" border="0" alt="[Corporate Info] "></a></td>' );
	else
       	document.write( '<td><a href="corpinfo.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="images/menu_corpinfo.jpg" width="119" height="19" border="0" alt="[Corporate Info]"></a></td>' );

		
		
		// end section titles, close the table
	document.write( '</tr></table>' );

} //writeHeader()


// end of 'header.js'