// 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( "" ), 1,
	String( "index.html" ), 1,
	String( "fh.html" ), 2,
	String( "worldwide_op.html" ), 3,
	String( "letter.html" ), 4,
	String( "financial_review.html" ), 5,
	String( "operating_review.html?id=1" ), 6,	
	String( "op_rev_exploration_production.html?id=1" ), 6,
	String( "op_rev_project_development.html?id=1" ), 6,
	String( "op_rev_refining_marketing.html?id=1" ), 6,
	String( "op_rev_lukoil.html?id=1" ), 6,
	String( "op_rev_midstream.html?id=1" ), 6,
	String( "op_rev_chemicals.html?id=1" ), 6,
	String( "op_rev_emerging_businesses.html?id=1" ), 6,
	String( "op_rev_commercial.html?id=1" ), 6,
	String( "corporate_staffs.html?id=2" ), 7,	
	String( "corp_staff_legal.html?id=2" ), 7,
	String( "corp_staff_global_systems_services.html?id=2" ), 7,
	String( "corp_staff_health_safety_environment.html?id=2" ), 7,
	String( "corp_staff_human_resources.html?id=2" ), 7,
	String( "corp_staff_planning_strategy_corp_affairs.html?id=2" ), 7,
	String( "financial_results.html?id=3" ), 8,
	String( "financial_results_1.html?id=3" ), 8,
	String( "financial_results_2.html?id=3" ), 8,
	String( "financial_results_3.html?id=3" ), 8,
	String( "financial_results_4.html?id=3" ), 8,
	String( "financial_results_5.html?id=3" ), 8,
	String( "financial_results_6.html?id=3" ), 8,
	String( "fin_selected_financial_data.html?id=3" ), 8,
	String( "fin_reports_management.html?id=3" ), 8,
	String( "fin_reports_accounting.html?id=3" ), 8,
	String( "fin_consolidated_statements.html?id=3" ), 8,
	String( "fin_consolidated_statements_2.html?id=3" ), 8,
	String( "fin_consolidated_statements_3.html?id=3" ), 8,
	String( "fin_consolidated_statements_4.html?id=3" ), 8,
	String( "fin_note_1.html?id=3" ), 8,
	String( "fin_note_2.html?id=3" ), 8,
	String( "fin_note_3.html?id=3" ), 8,
	String( "fin_note_4.html?id=3" ), 8,
	String( "fin_note_5.html?id=3" ), 8,
	String( "fin_note_6.html?id=3" ), 8,
	String( "fin_note_7.html?id=3" ), 8,
	String( "fin_note_8.html?id=3" ), 8,
	String( "fin_note_9.html?id=3" ), 8,
	String( "fin_note_10.html?id=3" ), 8,
	String( "fin_note_11.html?id=3" ), 8,
	String( "fin_note_12.html?id=3" ), 8,
	String( "fin_note_13.html?id=3" ), 8,
	String( "fin_note_14.html?id=3" ), 8,
	String( "fin_note_15.html?id=3" ), 8,
	String( "fin_note_16.html?id=3" ), 8,
	String( "fin_note_17.html?id=3" ), 8,
	String( "fin_note_18.html?id=3" ), 8,
	String( "fin_note_19.html?id=3" ), 8,
	String( "fin_note_20.html?id=3" ), 8,
	String( "fin_note_21.html?id=3" ), 8,
	String( "fin_note_22.html?id=3" ), 8,
	String( "fin_note_23.html?id=3" ), 8,
	String( "fin_note_24.html?id=3" ), 8,
	String( "fin_note_25.html?id=3" ), 8,
	String( "fin_note_26.html?id=3" ), 8,
	String( "fin_note_27.html?id=3" ), 8,
	String( "fin_note_28.html?id=3" ), 8,
	String( "fin_note_29.html?id=3" ), 8,
	String( "fin_note_30.html?id=3" ), 8,
	String( "fin_oil_gas_ops.html?id=3" ), 8,
	String( "fin_oil_gas_ops_2.html?id=3" ), 8,
	String( "fin_oil_gas_ops_3.html?id=3" ), 8,
	String( "fin_oil_gas_ops_4.html?id=3" ), 8,
	String( "fin_oil_gas_ops_5.html?id=3" ), 8,
	String( "fin_oil_gas_ops_6.html?id=3" ), 8,
	String( "fin_oil_gas_ops_7.html?id=3" ), 8,
	String( "fin_5_year_review.html?id=3" ), 8,
	String( "fin_5_year_op_review.html?id=3" ), 8,
	String( "leadership.html" ), 9,
	String( "leadership_officers.html" ), 9,
	String( "glossary.html" ), 10,
	String( "stockholder_info.html" ), 11,
	String( "about.html" ), 0,
	String( "index.html" ), 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 == "") {
		//prevPage = gPageMap[i-1];		// 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;
	} else {
	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/img_next_red.png";
	menu_over_next = new Image; 	menu_over_next.src = "images/img_next_black.png";
	
	menu_previous = new Image; 		menu_previous.src = "images/img_prev_red.png";
	menu_over_previous = new Image; 	menu_over_previous.src = "images/img_prev_black.png";
	
	footer_next = new Image; 		footer_next.src = "images/img_next_red.png";
	footer_over_next = new Image; 	footer_over_next.src = "images/img_next_black.png";
	
	footer_previous = new Image; 		footer_previous.src = "images/img_prev_red.png";
	footer_over_previous = new Image; 	footer_over_previous.src = "images/img_prev_black.png";
	
		
	footer_backtop = new Image; 		footer_backtop.src = "images/footerbackup_norm.gif";
	footer_over_backtop = new Image; 	footer_over_backtop.src = "images/footerbackup_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" );
	}
}


	// 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="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td width="595" rowspan="3" align="left" valign="top"><a href="index.html"><img src="images/conocophillipslogo_web2.png" alt="ConocoPhillips" width="300" height="80" border="0" /></a></td><td colspan="5" align="center"><img src="images/2007AR.png" alt="2007 Annual Report" width="152" height="28" /></td></tr><tr><td width="25">&nbsp;</td><td width="20" class="pageNumbers"><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/img_prev.png" width="20" height="15" border="0" alt="[Previous]"></a></td><td width="45" align="center" valign="middle" class="navtool">' + thisPage + ' of ' + totalPages + '</td><td width="20"><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/img_next.png" width="20" height="15" border="0" alt="[Next]"></a></td><td width="35">&nbsp;</td></tr><tr><td width="25"><img src="images/spacer.gif" alt="ConocoPhillips 2007 Annnual Report" width="25" height="10" /></td><td width="20"><img src="images/spacer.gif" alt="ConocoPhillips 2007 Annnual Report" width="20" height="10" /></td><td width="45"><img src="images/spacer.gif" alt="ConocoPhillips 2007 Annnual Report" width="45" height="10" /></td><td width="20"><img src="images/spacer.gif" alt="ConocoPhillips 2007 Annnual Report" width="20" height="10" /></td><td width="25"><img src="images/spacer.gif" alt="ConocoPhillips 2007 Annnual Report" width="25" height="10" /></td></tr></table>' );



}

	// write the footer
	
function writeFooter() {
	
document.write( '<table width="168" border="0" cellpadding="0" cellspacing="0" background="images/menu_background.jpg"><tr><td width="168"><table width="168" border="0" cellspacing="0" cellpadding="0"><tr><td width="68"><img src="images/spacer.gif" width="520" height="21" /></td><td width="15" align="right" valign="bottom"><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/img_prev_red.png" width="20" height="15" border="0" alt="[Previous]"></a></td><td width="50" align="center" valign="bottom" class="pages">' + thisPage + ' of ' + totalPages + '</td><td width="15" align="left" valign="bottom"><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/img_next_red.png" width="20" height="15" border="0" alt="[Next]"></a></td><td width="20"><img src="images/spacer.gif" width="20" height="21" /></td></tr><tr><td width="68"><img src="images/spacer.gif" width="68" height="10" /></td><td width="15"><img src="images/spacer.gif" width="15" height="10" /></td><td width="50"><img src="images/spacer.gif" width="50" height="10" /></td><td width="15"><img src="images/spacer.gif" width="15" height="10" /></td><td width="20"><img src="images/spacer.gif" width="20" height="10" /></td></tr></table></td></tr></table>' );
}


// end of 'header.js'