var ns=(document.layers)?1:0;
function lib_bwcheck(){
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()
var px = bw.ns4||window.opera?"":"px";
	xRight=0;
	xLeft=0;
	yTop=0;
	yBottom=0;

//Opera 5 resize fix.
if(navigator.userAgent.indexOf('Opera')>-1 && document.getElementById){ 
	scrX= innerWidth; scrY= innerHeight;
	document.onmousemove= function(){
		if(scrX<innerWidth-10 || scrY<innerHeight-10 || scrX>innerWidth+10 || scrY>innerHeight+10){
			scrX = innerWidth;
			scrY = innerHeight;
			menuinit();
		}
	};
}
function getMenu(id, nest){
	if(bw.ns4) nest=(!nest)?"document":'document.'+nest+'.document';
	else nest="document";
	if (document.layers) return eval(nest+".layers[id]");
	else if (document.all) return document.all[id];
	else return document.getElementById(id);
}
function getFoTop(id, nest){
	if (bw.ns4) return getMenu(id, nest).top;
	else if (bw.opera5) return getMenu(id, nest).style.pixelTop;
	else return getMenu(id, nest).offsetTop;
}
function getFoLeft(id, nest){
	if (bw.ns4) return getMenu(id, nest).left;
	else if (bw.opera5) return getMenu(id, nest).style.pixelLeft;
	else return getMenu(id, nest).offsetLeft;
}
function getAlHeight(id, nest){
	if (bw.ns4) return getMenu(id,nest).clip.height;
	else if (bw.opera5) return getMenu(id,nest).style.pixelHeight;
	else return getMenu(id,nest).offsetHeight;
}
function getAlWidth(id, nest){
	if (bw.ns4) return getMenu(id,nest).clip.width;
	else if (bw.opera5) return getMenu(id,nest).style.pixelWidth;
	else return getMenu(id,nest).offsetWidth;
}
function setFoTop(id, nest, num){
	if (bw.ns4) getMenu(id, nest).top = num+px;
	else getMenu(id, nest).style.top = num+px;
}

function setFoHeight(id, num, w){
	if (bw.opera5) getMenu(id).style.pixelHeight = num+px;
	else if (bw.ns4) getMenu(id).clip.bottom = num+px;
	else getMenu(id).style.clip="rect(0,"+w+","+num+",0)";
}
function setWidth(id, nest, num, h){
	if (bw.opera5) getMenu(id, nest).style.pixelWidth = num+px;
	else if (bw.ns4){ getMenu(id, nest).clip.right=num+px;
	getMenu(id, nest).clip.bottom = h+px;}
	else {getMenu(id, nest).style.clip="rect(0,"+num+","+h+",0)";
		getMenu(id, nest).style.width=num;}
}
function setFoLeft(id, nest, num){
	if (bw.ns4) getMenu(id, nest).left = num+px;
	else getMenu(id, nest).style.left = num+px;
}
function setVisible(id, bVisible){
	if (bw.ns4) getMenu(id).visibility=bVisible;
	else getMenu(id).style.visibility=bVisible;
	}
function MenuItem (id, text, url) {
	this.id = id;
	this.text = text;
	this.url = url;
}
function menuBarInit(){
    submenus=new Array();
    for(i=0;i<3 ;i++)
    {
    	submenus[i]=new getMenu('submenu'+i);
    }
        	
    if (bw.ie) w_width=document.body.offsetWidth
    else w_width=window.innerWidth;	
    saveInnerWidth=w_width;	
    window.onresize = resize;

    if (bw.ie4 || bw.ie5){document.body.onmousemove=updateIt;}
    else {
    window.captureEvents(Event.MOUSEMOVE);
    window.onmousemove=updateIt;
    }
}
/** menu objects to pass to the top and bottom navigation areas **/
	title2=new MenuItem("","","");
	title3=new MenuItem(""," ","");
	title4=new MenuItem("","<div id='maintxt'>","");
	prevMenu=new MenuItem("begin","","");
	nextMenu=new MenuItem("end","","");
	mid= new Array();
    var currMenu;

/***************************************************************** 
draw the menus on three levels
******************************************************************/
function drawMenu(mCurr, mItem, itMax){

/** get the id of all outline levels **/
for (i=0; i<mCurr.length; i++){
	mid[i]=mCurr.substr(0,i+1)}

txtlev2="<table width='145' border='0' cellspacing='0' cellpadding='2' align='right'>"
txtlev2+="<td width='10' bgcolor='#FFFFFF'><font color='#FFFFFF' size='1'>.</font></td>"
txtlev2+="<td width='6' bgcolor='#3366cc'><font color='#3366cc' size='1'>.</font></td>"
txtlev2+="<td width='128' bgcolor='#3366cc' class='related'>RELATED LINKS</td></tr>"
txtlev3=""
txtlev4=""
lenlev3=0
lenlev4=0
mItemLast=0
for (i=0; i<itMax+1; i++){

switch (mItem[i].id.length){
case 2:
	if (mItem[i].text.length>0){
        //txtlev2+="<tr background='../images/grey-extra.gif'>"
		txtlev2+="<td width='10' bgcolor='#FFFFFF'><font color='#FFFFFF' size='1'>.</font></td>"
        txtlev2+="<td valign='top' bgcolor='#eeeeee' class='extramenu'><div id='menu"+mItem[i].id.toString()+"' class='clmenus'> </div>"+ mItem[i].text.substr(0, mItem[i].text.indexOf(" "))+"</td>"
        txtlev2+="<td width='129' valign='top' bgcolor='#eeeeee' class='extramenu'><a ('" + mItem[i].id.toString()+ "') "  
        txtlev2+="class='extramenu' href="+ mItem[i].url+">" + mItem[i].text.substr(mItem[i].text.indexOf(" ")+1)+"</a></td></tr>"
        if ((i<itMax && mItem[i+1].id.length == 2) || i==itMax){
           if (txtlev3.substr(txtlev3.length-6)!="</div>" && txtlev3!=""){ 
               txtlev3+="</table></div>"} 
    	    txtlev3+="<div id='submenu"+mItem[i].id.substr(0,2) +"' class='clsubmenus'><table border='0' cellpadding='0' cellspacing='0' width='155' bgcolor='eeeeee'>"
		    txtlev3+="<tr><td><IMG alt ='' border=0 height=0 src='../images/s.gif' width=1></td></tr></table></div>"
        mItemLast=mItem[i].id
        }
    }
	break;
case 3:
        if (mItem[i-1].id.length==2){
        if (mItemLast!=0 && txtlev3.substr(txtlev3.length-6)!="</div>"){txtlev3+="</table></div>"}
    	txtlev3+="<div id='submenu"+mItem[i].id.substr(0,2)+"' class='clsubmenus'><table border='0' cellpadding='1' cellspacing='0' width='165' bgcolor='6699ff'>"
        }
       mItemLast=mItem[i].id
    break;


}}

//txtlev2+="<tr background='../images/grey-extra.gif'>"
txtlev2+="<td width='10' height='2'></td>"
txtlev2+="<td colspan='2' valign='top' bgcolor='#eeeeee'><img border='0' height='2' src='../images/nix.gif' width='4'></td></tr>"
txtlev2+="<tr><td colspan='2'><img height='5' src='../images/nix.gif' width='20'></td></tr>"
//txtlev2+="<tr background='../images/midblue.gif'>"
txtlev2+="<td width='10' bgcolor='#FFFFFF'><font color='#FFFFFF' size='1'>.</font></td>"
txtlev2+="<td width='6' bgcolor='#3366cc'><font color='#3366cc' size='1'>.</font></td>"
txtlev2+="<td width='129' bgcolor='#3366cc' class='related'>MORE...</td></tr>"
//txtlev2+="<tr background='../images/grey-extra.gif'>"
txtlev2+="<td width='10' bgcolor='#FFFFFF'><font color='#FFFFFF' size='1'>.</font></td>"
txtlev2+="<td width='6' valign='top' bgcolor='#eeeeee' class='extramenu'>•</td>"
txtlev2+="<td width='129' bgcolor='#eeeeee'><a class='extramenu' href='javascript:showPDF()'>Print this module (pdf)</a></td></tr>"
//txtlev2+="<tr background='../images/grey-extra.gif'>"
txtlev2+="<td width='10' height='2'></td>"
txtlev2+="<td colspan='2' valign='top' bgcolor='#eeeeee'><img border='0' height='2' src='../images/nix.gif' width='4'></td></tr></table>"

if(!bExer){
    document.writeln(txtlev2);}
if (txtlev3.substr(txtlev3.length-6)!="</div>"){
txtlev3+="</table></div>"}
document.writeln(txtlev3)

/** The fourth level is shown for the text on the outline level 4 **/

if (mCurr.length>=3){
txtlev4="<div id='submenu3' class='clsubmenus'><table border='0' cellpadding='3' cellspacing='0' width='270' bgColor='#6699ff'>"+txtlev4
}
else {txtlev4="<div id='submenu3' class='clSub4'>"+txtlev4}
if (mCurr.length>=3){
txtlev4+="</table>"}
txtlev4+="</div>"
document.writeln(txtlev4);	
}
/**************************************************************************/
/* set the titles of different levels, using the id of the current page   */ 
/*                                                                        */
/**************************************************************************/
var title1=""


function settitles(m, mItem, itMax) {
    for (i=0; i<m.length; i++){
    	mid[i]=m.substr(0,i+1)}

    for (i=0; i<itMax+1; i++){

    if (mItem[i].id==mid[1]){
    	title2=mItem[i]
    	currMenu=i}

    if (mItem[i].id==mid[2]){
    	title3=mItem[i]
    	currMenu=i}
    }
    /** get the menu item for the previous and next page, if the subtitle is on the
    same page go to the next, step back by two pages if necessary**/

    if (currMenu!=0){

    	if (mItem[currMenu-1].url!=mItem[currMenu].url){
    		prevMenu=mItem[currMenu-1]}
    	else if (currMenu > 2){
    	    if (currMenu!=1 && mItem[currMenu-2].url!=mItem[currMenu].url){
    	    prevMenu=mItem[currMenu-2]}
    	    else {
                prevMenu=mItem[currMenu-3]}
    	}
        if (currMenu!=itMax){
        	if (mItem[currMenu+1].url!=mItem[currMenu].url){
        	nextMenu=mItem[currMenu+1]}
        	else if (currMenu!=itMax-1){nextMenu=mItem[currMenu+2]}
        }

    }
    else {
        	nextMenu=mItem[currMenu+1]
    }
    for (i=0; i<4; i++){
			if (mChapters[i].id==mid[0]){title1=mChapters[i].text}
    }

}

function hideAll(){
    for (i=0; i<4; i++){
    setVisible('submenu'+i, 'hidden');}
    for (k=1; k<=mItemLast.substr(1,1); k++)
    { 
        setVisible('submenu'+mItemLast.substr(0,1)+k, 'hidden');
    }
	xRight=0;
	xLeft=0;
	yTop=0;
	yBottom=0;

}


/**************************************************************************/
/* generates the bottom of the page and retrieves the title and           */ 
/* link of the previous and next pages                                     */
/**************************************************************************/
function setbottom(){
    var dayArray = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    var monthArray = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
    var lastUpdate = new Date(document.lastModified);
    var thisDay=dayArray[lastUpdate.getDay()];
    var thisDate=lastUpdate.getDate() < 10 ? '0'+lastUpdate.getDate() : lastUpdate.getDate();
    var thisMonth=monthArray[lastUpdate.getMonth()];
    var thisMonthNum=lastUpdate.getMonth()+1 < 10 ? '0'+ (lastUpdate.getMonth()+1) : lastUpdate.getMonth()+1;
    var thisFullYear=String(lastUpdate.getFullYear());
    var thisYear= thisFullYear.charAt(2) + thisFullYear.charAt(3);
    txtbottom="<tr><td bgcolor='#eeeeee' class='smalltext' align='middle' valign='center' background='../images/bg2.gif'>"
    txtbottom+="<div align='center'>Produced for the Nuclear Installation Safety Division of the IAEA, <br>"
    txtbottom+="updated on "+ thisDate + ' ' + thisMonth + ' ' + thisFullYear+ "</div></td></tr>"
    txtbottom+="<tr><td><img height='15' src='../images/nix.gif' width='455'><br>"
    txtbottom+="<a href='#top' target='_self'><img border='0' height='11' src='../images/back_top.gif' width='457'></a></td></tr>"
    txtbottom+="<tr><td align='center' valign='top'>"
	tbott="<table align='center' border='0' cellPadding='5' cellSpacing='0' width='100%'>"
	tbott+="<tr><td align='right' width='215'><a class='smallblue' style='text-decoration:none' href="
	tbott+=prevMenu.url+">"
	tbott+=prevMenu.text
	tbott+="</a></td>"
	tbott+="<td width='197'><img src='../images/s.gif' width='1'></td>"
	tbott+="<td align='left' width='215'><a class='smallblue' style='text-decoration:none' href="
	tbott+=nextMenu.url+">"
	tbott+=nextMenu.text
	tbott+="</a></td></tr><tr>"
	if (prevMenu.id=="begin"){
	
		tbott+="<td align='right' width='33%'>"
		tbott+="<img alt='' border='0' height='28' src='../images/s.gif' width='36'></td>"
	}
	else {
		tbott+="<td align='right' width='33%'><a href="
		tbott+=prevMenu.url+">"
		tbott+="<img alt='Previous' border='0' height='20' src='../images/prev.gif' width='25'></a></td>"
	}
	tbott+="<td width='197'><img src='../images/s.gif' width='1'></td>"
	if (nextMenu.id=="end"){
	
		tbott+="<td align='right' width='33%'>"
		tbott+="<img alt='' border='0' height='28' src='../images/s.gif' width='36'></td>"
	}	
	else {	
		tbott+="<td align='left' width='33%'><a href="
		tbott+=nextMenu.url+">"
		tbott+="<img alt='Next' border='0' height='20' src='../images/next.gif' width='25'></a></td>"
	}
	tbott+="</tr></table>"
    txtbottom+=tbott+"</td></tr></div>"
    document.writeln(txtbottom)
	movegoTop();
	if (bw.ie) w_width=document.body.offsetWidth
	else w_width=window.innerWidth;	
	saveInnerWidth=w_width;	

	window.onresize = resize;
	if (bw.ie){document.body.onmousemove=updateIt;}
	else {
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove=updateIt;}

    highlight();

}
function openSiteMap(){
window.open("../surfmap/sitemap.htm",null, "resizable=no, scrollbars=0, height=484, status=0, width=627, toolbar=no, menubar=no location=no",0)
}
/**************************************************************************/
/* generates the main menus on the top and on the left side of the page   */
/**************************************************************************/
var bExer;
function setmain(strE,strE1){
    current=document.location.href;
    bExer=strE1=="A"
	//strE == "A"
	if (strE != "A")
{
    exerpath=current.substring(0, current.lastIndexOf("/")+1);
}
    txttop="<a name='AB'><img style='position:absolute; top:0; left:0' border='0' height='66' src='../images/bptc_header_high1.jpg' width='625'></a>"
	txttop+="<table width='612' border='0' cellspacing='0' cellpadding='0'>"
    txttop+="<tr><td width='612' colspan=2 height=60> &nbsp;"
    if (strE == "A")
{	txttop+="</td></tr><tr><td colspan=2><img height='22' src='../images/tmtrr.gif' width='612'></td></tr><tr><td align='left' valign='top'>"
}
	if (strE == "B")
{	txttop+="</td></tr><tr><td colspan=2><img height='22' src='../images/tmtrr1.gif' width='612'></td></tr><tr><td align='left' valign='top'>"
}
	if (strE == "C")
{	txttop+="</td></tr><tr><td colspan=2><img height='22' src='../images/tmtrr2.gif' width='612'></td></tr><tr><td align='left' valign='top'>"
}	
	if (strE == "D")
{	txttop+="</td></tr><tr><td colspan=2><img height='22' src='../images/tmtrr3.gif' width='612'></td></tr><tr><td align='left' valign='top'>"
}
	if (strE == "E")
{	txttop+="</td></tr><tr><td colspan=2><img height='22' src='../images/tmtrr4.gif' width='612'></td></tr><tr><td align='left' valign='top'>"
}
    document.writeln(txttop)
	
	txtyellsq="<tr valign='top'><td bgcolor='#3366cc' ><img SRC='../images/nix.gif' height='13' width='15'><td><img height='9' src='../images/yelsquare.gif' width='9'></td>"
    txttop="<table border='0' cellpadding='0' cellspacing='0' width='130' bgcolor='#3366cc'>"
    txttop+="<tr valign='top'><td bgcolor='#3366cc'><img SRC='../images/nix.gif' height='13' width='15'>"
    txttop+="<td valign='top'><img height='13' src='../images/nix.gif' width='9'></td>"
    txttop+="<td><img height='13' src='../images/nix.gif' width='106'></td></tr>"
    if (strE == "A")
{	txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../intro/start_tmtrr.htm'><font color='#ffffff'>Overview</a></font></td></tr>"
    txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../chapter1/characteristics.htm'><font color='#ffffff'>Characteristics</a></font></td></tr>"//txttop+=txtyellsq
    txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../chapter2/physics.htm'><font color='#ffffff'>Physics and Kinetics</a></font></td></tr>"//txttop+=txtyellsq
    txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../chapter3/mainsystem.htm'><font color='#ffffff'>Main Systems</a></font></td></tr>"//txttop+=txtyellsq
    txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../chapter4/inservice.htm'><font color='#ffffff'>In-service Inspections</a></font></td></tr>"//txttop+=txtyellsq
    }	
    if (strE == "B")
{	txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../intro/start_tmtrr.htm'><font color='#ffffff'>Home</a></font></td></tr>"
    txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter1/characteristics11.htm'><font color='#ffffff'>1. Introduction</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter1/characteristics21.htm'><font color='#ffffff'>2. Reactivity coeff.</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter1/characteristics31.htm'><font color='#ffffff'>3. Transient charact.</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter1/characteristics41.htm'><font color='#ffffff'>4. TRIGA safety</a></font></td></tr>"
	txttop+=txtyellsq
	m="../pdf/chapter1_appendix1.pdf"
	txttop+="<td class='whitemenu'>&nbsp;<a href='javascript:showExtras(m)'><font color='#ffffff'>Appendix 1</a></font></td></tr>"
	txttop+=txtyellsq
	n="../pdf/chapter1_appendix2.pdf"
	txttop+="<td class='whitemenu'>&nbsp;<a href='javascript:showExtras(n)'><font color='#ffffff'>Appendix 2</a></font></td></tr>"
	}
    if (strE == "C")
{	txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../intro/start_tmtrr.htm'><font color='#ffffff'>Home</a></font></td></tr>"
    txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter2/physics11.htm'><font color='#ffffff'>1. Reactor Physics</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter2/physics21.htm'><font color='#ffffff'>2. Reactor Kinetics</a></font></td></tr>"
	}
	    if (strE == "D")
{	txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../intro/start_tmtrr.htm'><font color='#ffffff'>Home</a></font></td></tr>"
    txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter3/mainsystem11.htm'><font color='#ffffff'>1. Introduction</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter3/mainsystem21.htm'><font color='#ffffff'>2. Primary system</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter3/mainsystem31.htm'><font color='#ffffff'>3. Secundary system</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter3/mainsystem41.htm'><font color='#ffffff'>4. Auxiliary systems</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter3/mainsystem51.htm'><font color='#ffffff'>5. Reactor protection</a></font></td></tr>"
	}
    if (strE == "E")
{	txttop+=txtyellsq
    txttop+="<td class='whitemenu'>&nbsp;<a onmouseover='hideAll()' href='../intro/start_tmtrr.htm'><font color='#ffffff'>Home</a></font></td></tr>"
    txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter4/inservice1.htm'><font color='#ffffff'>1. Introduction</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter4/inservice21.htm'><font color='#ffffff'>2. Reliability of RR</a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter4/inservice31.htm'><font color='#ffffff'>3. Inspection Equipment </a></font></td></tr>"
	txttop+=txtyellsq
	txttop+="<td class='whitemenu'>&nbsp;<a href='../chapter4/inservice41.htm'><font color='#ffffff'>4. Practicle Examples</a></font></td></tr>"
	txttop+=txtyellsq
	m="../pdf/chapter4_Annex1.pdf"
	txttop+="<td class='whitemenu'>&nbsp;<a href='javascript:showExtras(m)'><font color='#ffffff'>Annex 1</a></font></td></tr>"
	txttop+=txtyellsq
	n="../pdf/chapter4_Annex2.pdf"
	txttop+="<td class='whitemenu'>&nbsp;<a href='javascript:showExtras(n)'><font color='#ffffff'>Annex 2</a></font></td></tr>"
	txttop+=txtyellsq
	o="../pdf/chapter4_Annex3.pdf"
	txttop+="<td class='whitemenu'>&nbsp;<a href='javascript:showExtras(o)'><font color='#ffffff'>Annex 3</a></font></td></tr>"
	

}	
	txttop+="<tr valign='top'><td colspan='3' bgcolor='White' align='center'><img src='../images/corners.gif' width='140'></td></tr></table>"
    document.writeln(txttop)

    txtyellsq="<tr><td bgcolor='#3366cc' colspan='2'><img SRC='../images/s.gif' height='1' width='120'></td></tr><tr><td bgcolor='#3366cc'><img SRC='../images/s.gif' width='1'></td>"
    txttop="<br><table border='0' align='left' valign='top' cellpadding='0' cellspacing='1'>"
    txttop+="<tr><td bgcolor='#3366cc'><img SRC='../images/s.gif' width='1'></td>"
    if (strE1=="A" || current.indexOf("appendix")!= -1 ){
	    txttop+="<td>&nbsp;<A href='javascript:checkCookie()'><font style='text-decoration:none' class='text'>Last visited</font></a></td></tr>"
		txttop+=txtyellsq
    }
     else {
        setCookie('page', current, expdate);        
	    txttop+=""
    }
   txttop+="<tr><td colspan='2'><p>&nbsp;</p>"
    txttop+="<a class='smalltext' href='http://www.iaea.org' target='_blank'><br>International Atomic <br>Energy Agency</a></p>"
    txttop+="<p><a class='smalltext' href='../intro/editorial.htm'>Editorial</a><br>"
    txttop+="<a class='smalltext' href='mailto:NSNItraining@iaea.org'>Contact us</a></p>"
    txttop+="</td></tr></table>"
    txttop+="<div id='goTop' class='goTp'><A href='#AB'><img align='left' alt='top' border='0' height='14' src='../images/up.gif' width='14'><br><font class='smallblue'>top</font></A></div>"

    document.writeln(txttop)
    setvols()
}
/**************************************************************************/
/* generates the titles of chapters in volume 1 and 2                     */ 
/**************************************************************************/
    mChapters= new Array(MenuItem);
function setvols(){
   mChapters[0]=new MenuItem("1", "TRIGA Characteristics","../chapter1/characteristics.htm");
    mChapters[1]=new MenuItem("2", "Physics and Kinetics of TRIGA Reactors","../chapter2/physics.htm");
    mChapters[2]=new MenuItem("3", "TRIGA Reactor Mainsystem","../chapter3/mainsystem.htm");
    mChapters[3]=new MenuItem("4", "Maintenance and In-Service Inspections of TRIGA Reactors","../chapter4/inservice.htm");
    
    

        txtvol="<div id='submenu1' class='clsubmenus'><TABLE border=0 cellPadding=1 cellSpacing=0 bgcolor=#6699ff style='WIDTH: 255px'>"
    
         txtvol+="</TABLE></div>"
    document.writeln(txtvol)

    txtvol="<div id='submenu2' class='clsubmenus'><TABLE border=0 cellPadding=1 cellSpacing=0 bgcolor='#6699ff' style='WIDTH: 255px'>"
    
         txtvol+="</TABLE></div>"
    document.writeln(txtvol)

    txtvol="<div id='submenu0' class='clsubmenus'><TABLE border=0 cellPadding=1 cellSpacing=0 bgcolor='#6699ff' style='WIDTH: 255px'>"
    
         txtvol+="</TABLE></div>"
    document.writeln(txtvol)

}
function movegoTop(){
	var winH=window.innerHeight || document.body.clientHeight;
	if (bw.ie){winY=document.body.scrollTop;}
		else {winY=window.pageYOffset} 
    setFoTop("goTop","",winH-200+winY);
		if (winY>140){
			setVisible("goTop", "visible");}
		else {setVisible("goTop", "hidden");}
    setTimeout("movegoTop()",1);
}
function resize() {	
	if (bw.ie4 || bw.dom) {w_width=document.body.offsetWidth;
    }
		else w_width=window.innerWidth;
   	 if (saveInnerWidth < w_width ||   saveInnerWidth > w_width )
	     { 	saveInnerWidth = w_width;  window.location.reload(); }
}
function updateIt(e){
	if (bw.ie)
	{
		
		var x=window.event.clientX;
		var y=window.event.clientY;
	}
	else
	{
        var x=e.pageX;
		var y=e.pageY;
	}

	if( x>xRight || x<xLeft){hideAll();}
	else if (y>yBottom || y<yTop){hideAll();}
}
function checkCookie()
{
cookievalue=getCookie("page");
if (cookievalue!=null)
{if(confirm("Click OK to go to "+cookievalue)){document.location.href=cookievalue;}}else
alert("Sorry, the system has not bookmarked your page, use the manual navigation")}

function getCookie (name) {
var dcookie = document.cookie; 
var cname = name + "=";
var clen = dcookie.length;
var cbegin = dcookie.indexOf(name);
        while (cbegin < clen) {
        var vbegin = cbegin + cname.length;
                if (dcookie.substring(cbegin, vbegin) == cname) { 
                var vend = dcookie.indexOf (";", vbegin);
                        if (vend == -1) vend = clen;
                return unescape(dcookie.substring(vbegin, vend));
                }
        cbegin = dcookie.indexOf(" ", cbegin) + 1;
                if (cbegin == 0) break;
        }
return null;
}
var expdate = new Date (); expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 31));
function setCookie (name, value, expires) {
        if (!expires) expires = new Date();
document.cookie = name + "=" + escape (value) + 
"; expires=" + expires.toGMTString() +  "; path=/";
}
function showPDF(){
    m="../pdf/chapter"+ mCurr.substr(0,1)+".pdf";
    window.open(m);
}
function showExtras(m){
    window.open(m);
}
function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function highlight()
{
    var q = new Array();
    var st= new String();
    qstr=document.location.search;
    if (qstr.substr(1,1)=="t" ){return;}
    if (qstr!="" ){
    sInd=qstr.indexOf("=");
    hw=qstr.substr(sInd+1);
    q=hw.split("+");
 if (q[0].substr(0,1)=="1"){
        q[0]=q[0].substr(1, q[0].length)
        for (k=0; k < q.length; k++){
            w_ind=q[k].indexOf("*");
                if (w_ind != -1) { q[k]=q[k].substr(0, q[k].length-1)}
            st=st+q[k]+" "}
        st=st.substr(0, st.length-1)
        var mtxt=document.getElementById('maintxt').innerHTML
        replaceIt(mtxt, st);
        }
    else {
        for (k=0; k < q.length; k++){
            w_ind=q[k].indexOf("*");
            if (w_ind != -1) { q[k]=q[k].substr(0, q[k].length-1)}
            st=q[k]
        var mtxt=document.getElementById('maintxt').innerHTML
            replaceIt(mtxt, st);
                    };
               }
    }
}
function replaceIt(mtxt, st){

    var start_ind=mtxt.indexOf(st);
    end_ind=st.length;
    strLine=mtxt.substring(0, start_ind + end_ind);
    strRest=mtxt.substr(start_ind + end_ind);
    s=""

   while (start_ind != -1){

// check if the string is inside a tag
       if (strRest.indexOf(">") > strRest.indexOf("<")){

            srtxt=new RegExp(st.toString(), "gi");
            rptxt="<font class='L3level'>"+st.toUpperCase()+"</font>" ;
            s= s + strLine.replace(srtxt, rptxt);
       }
        else {
            s=s+strLine;
        }

        start_ind=strRest.indexOf(st);
        strLine=strRest.substring(0, start_ind + end_ind);
        strRest=strRest.substr(start_ind + end_ind);
    }
    s=s+strLine+strRest
    document.getElementById('maintxt').innerHTML=s.toString();      
}