var avw = screen.availWidth-10;
var avh = screen.availHeight-30;


function launch(newURL, newName, newFeatures)
{
	var remote = open(newURL, newName, newFeatures);
	return remote;
}

function popuplaunch(theURL)
{
	Remote = launch(theURL, "mrbookhome", "height="+avh+",width="+avw+",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0,title=0,left=0,top=0");
}


var anythingon='0';
var amion='0';

function navover(theid,theidnum,theidtotal)
{
if (anythingon!=theidnum)
	{
//	anythingon='0';
//	navoff('section',theidtotal,'off');
//	document.getElementById('section'+theidnum).className= 'over';
	}
}

function navon(theid,theidnum,theidtotal)
{
if (amion==0)
	{
	navoff('section',theidtotal,'off');
	navoff(theid,theidtotal,'thenavoff');
	anythingon=theidnum;
	document.getElementById('section'+theidnum).className= 'on';
	document.getElementById(theid+theidnum).className= 'thenav';
	amion=1;
	}
else
	{
	navoff('section',theidtotal,'off');
	navoff(theid,theidtotal,'thenav');
	anythingon=0;
	amion=0;
	document.getElementById('section'+theidnum).className= 'off';
// was 'over' not 'off' when function navover was not commented out
	}
}

function navout(theid,theidnum,theidtotal)
{
if (anythingon==0)
	{navoff('section',theidtotal,'off');}
}


function navoff(theid,theidtotal,theclass)
{
//turn all ids to off (from theid1 to theidX X=theidtotal)
var j=1;
while (j<=theidtotal)
	{
	document.getElementById(theid+j).className= theclass;
	j++;
	}
}







var subanythingon='0';
var subamion='0';


function subnavon(theid,theidnum,theidtotal,thesub,thesubtotal)
{
if (subamion==0)
	{
	document.getElementById('section'+theidnum).className= 'off';
	
	subnavoff(thesub,thesubtotal,'thenav');
	subanythingon=theidnum;
	subamion=1;
	}
else
	{
	subnavoff(thesub,thesubtotal,'thenavoff');
	subanythingon=0;
	subamion=0;
	}
}


function subnavoff(theid,theidtotal,theclass)
{
//turn all ids to off (from theid1 to theidX X=theidtotal)
var j=1;
while (j<=theidtotal)
	{
	document.getElementById(theid+j).className= theclass;
	j++;
	}
}

function subcontenton(suboff,subon,backpic,backid)
{
	document.getElementById(suboff).className= 'off';
	document.getElementById(subon).className= 'on';
	if (backpic=='nopic')
	{document.getElementById(backid).style.backgroundImage= 'url(images/blank.gif)';}
	else
	{document.getElementById(backid).style.backgroundImage= 'url(images/'+backpic+')';}
}

function subcontentoff(suboff,backpic,backid,thesub,thesubtotal,theid,theidnum)
{
	document.getElementById(suboff).className= 'off';
	document.getElementById(backid).style.backgroundImage= 'url(images/'+backpic+')';
	subnavoff(thesub,thesubtotal,'thenav');
	document.getElementById(theid+theidnum).className= 'thenav';
}
function subcontentoffb(suboff,backpic,backid,theid,theidnum)
{
	document.getElementById(suboff).className= 'off';
	document.getElementById(backid).style.backgroundImage= 'url(images/'+backpic+')';
	document.getElementById(theid+theidnum).className= 'thenav';
}