// Overlib variables
var ol_fullhtml= 1;
var win= 0;

pl('/images/right.png');
pl('/images/down.png');
pl('/literature/images/czsm.png');
pl('/literature/images/nnsm.png');
pl('/literature/images/ensm.png');
pl('/literature/images/desm.png');

function pl (name) { //Pre-cache an image
	var img= new Image();
	img.src= name;
}

function showNav(title,text) {
    text= '<div><h4 style="margin:0px;padding:5px;text-align:center">'
		+title+'</h4><p style="font-size:10px">'+text+'</p></div>';
	overlib(text,OFFSETX,100);
}

function wopen(url,x,y) { // Open window
    var w= x;
    var h= y;
	if (win!=0)
		win.close();
    win= window.open(url,"","top=0,left=0,toolbar=no,statusbar=no,width=" + w +",height=" +h);
	win.focus();
}

function show_div(id,state)
{
	alert(id);
    var item= document.getElementById(id);
	if (state=='1') {
		item.style.display= 'block';
	} else {
		item.style.display= 'none';
	}
}

var sel_item= null;

// Select a div (exclusive)
function select_div(id)
{
	if (sel_item!=null) {
		// Hide previously selected
		sel_item.style.display= 'none';
	}
	// Display new selection
    sel_item= document.getElementById(id);
	sel_item.style.display= 'block';
}

function toggle_expand(id)
{
	var iid= 'img' + id;
	var img=  document.getElementById(iid);
    var item= document.getElementById(id);
	if (img.src.match('right')) {
		item.style.display= 'block';
		img.src= '/images/down.png';
	} else {
		item.style.display= 'none';
		img.src= '/images/right.png';
	}
}


function fgShow() 
{
	// For use with onLoad();
    var item= document.getElementById('main');
	item.style.opacity= '1.0';
	sel_item= document.getElementById('doc');
}

