

function Click(xframe, href_fullwindow, href_frame) {
   if (xframe) {
      top.location.href=href_fullwindow;
       }
      else
       {
      top.location.href=href_frame;
       }
 } 
 


function FullScreenText(xframe, textinframe, textnotinframe) {
   if (xframe) {
	document.write(textinframe);
	}
      else
       {
	document.write(textnotinframe);
       }
 } 




function buttonrow(topbot, doc, btype) {    
	// Get corresponding frame name
	basename=doc.substr(0, doc.length - 5);	
	docnamepl=basename + ".html#" + topbot;	
	frname="index.html?" + doc;



  	document.write("<TR><TD bgcolor=" + Jbuttonbarbgcolor + " width=\"100%\"> <font face=" + Jfontface + ">  ");

  	document.write("<TABLE border=0> ");
  	document.write("<TR ALIGN=\"RIGHT\"> ");

	// Button bars "About JDS" series
	if (btype == "about" ) { mainbuttons(topbot, doc); }

	if ( btype == "pn" || btype == "tr" || btype == "pn_notr" || btype == "tr_nopn" )    
		pn_bn_tr_buttons(topbot, doc, btype);

  	document.write("<TD>&nbsp;&nbsp;</TD> ");

  	document.write("<TD ALIGN=\"RIGHT\" VALIGN=\"MIDDLE\"> ");

  	document.write("<A HREF=\"JavaScript:Click(top.main, '" + docnamepl + "', '" + frname + "')\">  ");
  	document.write("<font size=2 face=" + Jfontface + ">  ");
  	document.write("<SCRIPT> ");
  	document.write("FullScreenText(top.main, 'Full&nbsp;Screen', 'Split&nbsp;Screen') ");
  	document.write("</SCRIPT> ");
  	document.write("</font></a>  ");
  	document.write("</TD></TR></TABLE></TD></TR> ");
	
}


function mainbuttons (topbot, doc) {
	barbuttons ("", topbot, doc, "110", "24", "aboutjds", "main.html", "About the JDS");
	barbuttons ("", topbot, doc, "110", "24", "inv", "inv.html", "Investigations");
	barbuttons ("", topbot, doc, "80", "24", "tribun", "trib.html", "Tribunals");
	barbuttons ("", topbot, doc, "75", "24", "pen", "pen.html", "Penalties");
}


function pn_bn_tr_buttons (topbot, doc, btype) {

	var WordDir="wordfiles/";

	// Assumes doc = abcdef_XX.html  where XX=pn|tr
	// bn for Background Note NOW redundant
	basename=doc.substr(0, doc.length - 8);
	docsub=doc.substr(0, doc.length - 5);
	pn_name="index.html?" + basename + "_pn.html";
	tr_name="index.html?" + basename + "_tr.html";	
	wd_name=WordDir + docsub + ".rtf";


// 	Add a Word doc button for Press Notices on Menu Bar 
//      None for Tribunal Reports 
	if (btype == "pn" || btype == "pn_notr") barbuttons ("", topbot, doc, "120", "24", "word", wd_name ,"Load Word Version of this Document");

//	Now add Press Notice button to standard "tr" documentie NOT tr_nopn
	if (btype == "tr") barbuttons ("_top", topbot, doc, "105", "24", "pressn", pn_name, "Load Press Notice relating to this case");

//	Now add Tribunal Report button to standard "pn" document NOT pn_notr
	if (btype == "pn") barbuttons ("_top", topbot, doc, "120", "24", "tribr", tr_name, "Load Tribunal Report relating to this case");

  }




function barbuttons (target, topbot, doc, width, height, imagename, docref, alt) {
	var ImageDir="images/"
	OutName=ImageDir + imagename + '_1.gif';
	OverName=ImageDir + imagename + '_2.gif';

	if (topbot.substr(0,6) != "inbody") 
		document.write(" <TD width=\"" + width + "\">  ");
	if (doc != docref) {
		document.write(" <A HREF=\"" + docref + "\" ");
		if (target != "") document.write(" target=" + target );
 	          
		document.write(" onMouseOver=\"JavaScript:roll('" + imagename + topbot +"','" + OverName + "');\"  ");
		document.write(" onMouseOut=\"JavaScript:roll('" + imagename + topbot +"','" + OutName + "');\"  ");
		document.write(" onfocus=\"blur();\"> ");
	}
	document.write(" <img src=\"" + OutName + "\"  ");
	document.write(" alt=\"" + alt + "\"  ");
	document.write(" border=0  ");
	document.write(" name=\"" + imagename + topbot +"\" width=\"" + width + "\" height=\"" + height + "\"></a> ");
	if (topbot.substr(0,6) != "inbody") document.write(" </TD> ");

 }





