/*****************************************************************************
 * Environment Globals
 ****************************************************************************/

// Images folder
IMAGES_PATH = '/images';

// All availible views, the first is the default view
var viewsYUI = new Array("doc2","doc","doc3");
var styles = new Array("olive","maroon","brown","dblue");

/*
 * Determine user environment
 */
SCREEN_WIDTH = (screen && typeof(screen.availWidth)=='number') ? screen.availWidth : false;
VIEW_NARROW = (SCREEN_WIDTH ? (SCREEN_WIDTH<1024 ? 1 : 0) : -1);
IE5=NN4=NN6=OPA=false
if(navigator.userAgent.toLowerCase().indexOf("opera")+1)OPA=true
else if(document.all)IE5=true
else if(document.layers)NN4=true
else if(document.getElementById)NN6=true


/*****************************************************************************
 * Setup page
 ****************************************************************************/	

// Set style from cookie
var cookie = readCookie("style");
var title = styles.inArray(cookie) ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title,IMAGES_PATH);

// Specify init functions to handle page load and unload
window.onload = init;
window.onunload = unload;

/*
 * pass load/unload functions to handler
 */

// for Mozilla 
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", init, false);
}