var imageExtension = ".gif";

var imageDirectory = "../images/topnav/";

var onIdentifier = "_on";

var rolloverIdentifier = "_ro";

var normalIdentifier = "_off";



function initImage( strImageName ) {

	eval( strImageName + normalIdentifier + " = new Image()" );

	eval( strImageName + normalIdentifier + ".src = '" + imageDirectory + strImageName + normalIdentifier + imageExtension + "'" );

	eval( strImageName + rolloverIdentifier + " = new Image()" );

	eval( strImageName + rolloverIdentifier + ".src = '" + imageDirectory + strImageName + rolloverIdentifier + imageExtension + "'" );

	eval( strImageName + onIdentifier + " = new Image()" );

	eval( strImageName + onIdentifier + ".src = '" + imageDirectory + strImageName + onIdentifier + imageExtension + "'" );

} 

function initImageNoRoll( strImageName ) {

	eval( strImageName + normalIdentifier + " = new Image()" );

	eval( strImageName + normalIdentifier + ".src = '" + imageDirectory + strImageName + normalIdentifier + imageExtension + "'" );

	eval( strImageName + onIdentifier + " = new Image()" );

	eval( strImageName + onIdentifier + ".src = '" + imageDirectory + strImageName + onIdentifier + imageExtension + "'" );

}



function swapImage( imageObj, newImageObject ) {		

	imageObj.src = newImageObject.src;

}





function turnOn( imageName ){

	//search for images that start with 'm_'. These are top level sections.

	if( document.images[ imageName ].src.search(/^m_/) != "-1"  || document.images[ imageName ].src.search(/\/m_/) != "-1") {

		rolloverIdentifier = "_ro";

	} else {

		rolloverIdentifier = "_on";

	}



	// swaps the current image rollover depending on the user's current section

	if (currentSection != imageName && currentPage != imageName) {

		swapImage( document.images[ imageName ], eval( imageName + rolloverIdentifier ) );

	} else {	

		swapImage( document.images[ imageName ], eval( imageName + '_on' ) );

	}



}





function turnOff( imageName ){

	if( currentSection != imageName && currentPage != imageName ) {

		swapImage( document.images[ imageName ], eval( imageName + normalIdentifier ) );

	}

}







function setUpPage(){

	if( currentSection != "none" ) {

		turnOn( currentSection );

		

	}

	if( currentPage != "none" ) {

		turnOn( currentPage );

		

	}

}



if ( document.images ) {

// Preload the nav graphics

		initImage( "m_ourwork" );

				initImageNoRoll( "clientlist" );

				initImageNoRoll( "cstudies" );

		initImage( "m_capa" );

				initImageNoRoll( "expertise" );

				initImageNoRoll( "process" );

				initImageNoRoll( "alliances" );

		initImage( "m_comp" );

				initImageNoRoll( "snapshot" );

				initImageNoRoll( "factsheet" );

				initImageNoRoll( "leadership" );

				initImageNoRoll( "careers" );

		initImage( "m_pcenter" );

				initImageNoRoll( "preleases" );

				initImageNoRoll( "awards" );

				initImageNoRoll( "identity" );

				initImageNoRoll( "pcontact" );

		initImage( "m_contact" );



}





// Sized Pop-up Window

function openSizedScreen( url ) {

	var opts = "status=yes,scrollbars=auto,resizable=yes,location=no,width=500,height=500";

	popupWindow = window.open( url, 'sshot', opts );

	popupWindow.focus();

	

}