

// --------------------------------------------------------
// set up globals

//timers
var timerL1 = null;
var aWait = 10;

//TIMING holds property of visible nav layer
var whichLayershowing1 = null;


// --------------------------------------------------------
// init main
function re_init() {
	
	LL_init();//set global vars
	preL();//preload images
}



//---------------------------------------------------------
//      Roll Functions


function menu (wlayer, wimg, active, firstLayer){

	if (active){
		
		//roll image
		if (!LL_NN){
			roll(wimg, true);
		}else{
			//NN 4* code for images in layers
			if (firstLayer){
			document.layers.nav.document.images[wimg].src = eval(wimg + '_o.src');//roll image NN
			}else{
			document.layers[wlayer].document.images[wimg].src = eval(wimg + '_o.src');//roll image NN
			}
		}
		
		//kill other layers
		if (whichLayershowing1){
		LL_hideLayer(whichLayershowing1);
		}
		
		LL_showLayer(wlayer);
		clearTimeout(timerL1);	timerL1 = null;
		whichLayershowing1 = wlayer;
	}
	else{
	
		//roll image
		if (!LL_NN){
			roll(wimg);//roll image
		}else{
			//NN 4* code for images in layers
			if (firstLayer){
			document.layers.nav.document.images[wimg].src = eval(wimg + '.src');//roll image NN
			}else{
			document.layers[wlayer].document.images[wimg].src = eval(wimg + '.src');//roll image NN
			}
		}
		
		
		timerL1 = setTimeout('LL_hideLayer(\''+ wlayer +'\');',aWait);
	}

}


function tip (){

}


//roll image function
var sfx;
function roll(name,aOn){
	if (document.images) {  
		sfx = (!aOn) ? '': '_o';
		document.images[name].src=eval(name + sfx + ".src");
	}
}

//create newImage
function newImage(src) {
        var anImg = new Image;
        anImg.src = src;
        return anImg;
}





//-------------------------------

var myWin = null;
function gen_popup(theUrl,theTitle,theDim) {
	if ((! myWin) || (myWin.closed)) {
		if (! theDim) {
			theDim = 'width=300,height=205,scrollbars=yes,resizable=no,menubar=yes';
		}
		myWin = window.open(theUrl,theTitle,theDim);
		myWin.opener = window;
	} else {
		myWin.location = theUrl;
		myWin.focus();
		myWin.opener = window;
	}
}


