if ( document.images ) {
	// define rollover images explicitly
	initImage( "nav_website_logo" );
	initImage( "nav_company" );
	initImage( "nav_solutions" );
	initImage( "nav_services" );
	initImage( "nav_information" );
	initImage( "nav_customers" );
	initImage( "nav_contact" );	
}

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 + "'" );
} 


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function swapImage( imageObj, newImageObject ) {
	if ( document.images ) {
		//alert( newImageObject.src );
		imageObj.src = newImageObject.src;
	}
}

function turnOn( imageName ){
	//alert( "turnOn " + imageName + " " + document.images[ imageName ]);
	var prefix = "";
	if( document.images[ imageName ].src.search(/^nav_/) != "-1" || document.images[ imageName ].src.search(/\/nav_/) != "-1" ) {
		prefix = "nav_";
	}
	swapImage( document.images[ imageName ], eval( prefix + imageName + rolloverIdentifier ) );
}

function turnOff( imageName ){
	var prefix = "";
	if( document.images[ imageName ].src.search(/^nav_/) != "-1" || document.images[ imageName ].src.search(/\/nav_/) != "-1" ) {
		prefix = "nav_";
	}
	if( currentPage != imageName ) {
		swapImage( document.images[ imageName ], eval( prefix + imageName + normalIdentifier ) );
	}
} 
	
function LayerOn(layername){
	if (document.layers){
		document.layers[layername].visibility="visible";
	}
	else if (document.all){
		eval(layername).style.visibility="visible";
	}
}

function LayerOff(layername){
	if (document.layers){
		document.layers[layername].visibility="hidden";
	}
	else if (document.all){
		eval(layername).style.visibility="hidden";
	}
}

function deselectCurrentMenu(){
	if( currentMenu != "none" ){
		//alert( "currentImage " + currentImage );
		deselectMenu( currentImage, currentMenu);
	}	
}

function deselectMenu( imageName, layerName ){
	//alert( imageName );
	turnOff( imageName );
	LayerOff( layerName );
	currentImage = "none";
	currentMenu = "none";
}

function selectMenu( imageName, layerName ){
	deselectCurrentMenu();
	
	turnOn( imageName );
	LayerOn( layerName );
	currentImage = imageName;
	currentMenu = layerName;
}

function LayerImgSwap(layername, imagename){
	if (document.layers){
		document.layers[layername].document.images[imagename].src = eval(imagename+"_on").src;
	}
	else if (document.all){
		document.images[imagename].src = eval(imagename+"_on").src;
	}
}

function LayerImgSwapOff(layername, imagename){
	if (document.layers){
		document.layers[layername].document.images[imagename].src = eval(imagename+"_off").src;
	}
	else if (document.all){
		document.images[imagename].src = eval(imagename+"_off").src;
	}
}

function descOn( imageName ){
	if( currentPage != imageName || subPage ) {
		swapImage(  document.images[ "default_desc" ], eval( "nav1_" + imageName + "_roll" ) );
	}
}

function descOff(){
	swapImage(  document.images[ "default_desc" ], eval( "nav1_default_desc" ) );
}

function displayStatusMsg(msgStr){
    status=msgStr;
    document.MM_returnValue = true;
	return document.MM_returnValue;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function listImages(){
	var cnt=0;
	while( document.images[cnt] ){
		alert( document.images[cnt].name );
		cnt++;
	}
}

// This has nothing to do with navaigation, but I put it here anyways 
// for glossary of terms pop-up windows
function openAWindow( pageToLoad, winName, width, height, center) {  
	xposition=0; yposition=0;

    if ((parseInt(navigator.appVersion) >= 4 ) && (winName=="undefined")){
    xposition=screen.width-400; yposition=screen.height-480;
    }
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=0,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
	}
// for QTVR pop up windows
function QtvrWindow( pageToLoad, winName, width, height, center) {                              
    xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=0,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
	}

window.name = "bratwurst";

//function focusWin(url) {
	//window.focus();
//'http://investor.robertmondavi.com/ireye/ir_site.zhtml?ticker=mond&script=2100&layout=11'
//}

function focusWin( pageToLoad, winName ) {                              
    window.open( pageToLoad, winName );
	window.blur();
	}


