/**
 * File: nav.js
 * javascript functions for the pages with nav-bars
 */

var webWindow = null;

function openFoodWeb( loc ) {
	//alert('You will lose work from any other open food webs.  Do you want to continue?');
	
	if (confirm ("You will lose work from any other open food webs.  Do you want to continue?")) {
	
		var url = "../foodwebs/" + loc + "web.html";
	  // open the html page--reuse the same window if already open, else open a new one:
		webWindow = window.open( url,
								"webWindow",
								"width=780,height=570,resizable=yes" );
		// bring window to front(in case it was already open but behind other windows)
		t=setTimeout("webWindow.focus()",1);
	}
}


function printFrame( f ) {
    if( (! window.print) || ( navigator.userAgent.indexOf("Mac") != -1 ) ) {
        alert( "This shortcut is not supported by your browser.  "
               + "Click on the area of the text that you want to print and then "
               + "click 'print' under your browser's File menu." )
    }
    else {
        f.focus();
        f.print();
    }
}

function openExternal( loc ) {
	if (confirm("You are leaving the FOSS Populations and Ecosystems multimedia. A reminder - if you do not have an internet connection, you will receive an error message.")) {
		var opts = "resizable=1,scrollbars=1,toolbar=1,status=1,location=1";
	    external_win = window.open( loc,"external_win",opts);
    	// bring window to front(in case it was already open but behind other windows)
    	t=setTimeout("external_win.focus()",1);
	}

}