
/* CVS ID: $Id: functions.js,v 1.10 2005/10/31 14:07:34 giezeman Exp $ */

// START OF TAB FUNCTIONS
function writeMenuStart() {
    document.writeln('<TABLE VALIGN="BOTTOM" CLASS="tabshead"  cellSpacing=0 cellPadding=0 ');
    document.writeln('border=0 hspace="0" vspace="0" ');
    document.writeln('  STYLE="margin: 0px; top-margin: 0px">');
    document.writeln('  <TBODY>');
    document.writeln('    <TR VALIGN="TOP"><TD colspan=3><IMG src="img/pixel.gif" height="4"></TD></TR>');
    document.writeln('    <TR VALIGN="BOTTOM"> ');
}

function writeMenuSelected(link, str, icon) {
    document.writeln('<TD VALIGN="CENTER" CLASS="selecttab" HEIGHT="20px">');
	document.writeln('<div style=\"white-space:nowrap;float:left\">');
    document.writeln(' <A href="'+link+'" >');
    document.writeln('  <IMG width="11" height="20" src="img/lcorner_sel.gif">');
    document.writeln('  <IMG width="12" height="11" src="img/'+icon+'_icon_sel.gif">');
    document.writeln(str+'<IMG width="5" height="20" src="img/rcorner_sel.gif"></A></div></TD>');
}

var backcnt = 0;

function writeMenuBack(link, str, icon) {
    document.writeln('<TD VALIGN="CENTER" CLASS="backtab" HEIGHT="20px">');
	document.writeln('<div style=\"white-space:nowrap;float:left\">');
    document.writeln('  <A href="'+link+'" ');
    document.writeln(' onMouseOver="backicon'+backcnt+'.src = \'img/'+icon+'_icon_high.gif\';"');
    document.writeln(' onMouseOut="backicon'+backcnt+'.src = \'img/'+icon+'_icon_back.gif\';">');
    document.writeln('  <IMG width="11" height="20" src="img/lcorner_back.gif">');
    document.writeln('  <IMG width="12" height="11" id="backicon'+backcnt+'" src="img/'+icon+'_icon_back.gif">');
    document.writeln(str+'<IMG  width="5" height="20" src="img/rcorner_back.gif"></A></div></TD>');
    backcnt++;
}

function writeMenu(link, str, icon, selected) {
	if (selected)
      writeMenuSelected(selected, str, icon);
   	else
      writeMenuBack(link, str, icon);
}

function writeMenuEnd() {
    document.writeln('    </TR>\n  </TBODY>\n</TABLE>');
}

function writeSubMenuStart() {
    document.writeln('<TABLE VALIGN="TOP" cellSpacing=0 cellPadding=0 ');
    document.writeln('  width="99%" border=0 hspace="0" vspace="0"');
    document.writeln('  STYLE="margin: 0px; top-margin: 0px">');
    document.writeln('  <TBODY>');
    document.writeln('    <TR VALIGN="TOP">');
    document.writeln('      <TD VALIGN="TOP" bgColor=#4a588e><div style=\"white-space:nowrap;float:left\">&nbsp;&nbsp;&nbsp');
}

function writeSubMenu(link, str, first) {
    if (!first) 
      document.write('&nbsp;&nbsp;&nbsp;&nbsp;');
    document.writeln('<A class=menuLevel2 href="'+link+'"');
    document.write('target="infoframe">'+str+'</A>');
}

function writeSubMenuEnd() {
    document.writeln('  </td></div>  \n  </TR>\n</TBODY>\n</TABLE>');
}

function writeSubMenuStart() {
    document.writeln('<TABLE VALIGN="TOP" cellSpacing=0 cellPadding=0 ');
    document.writeln('  width="99%" border=0 hspace="0" vspace="0"');
    document.writeln('  STYLE="margin: 0px; top-margin: 0px">');
    document.writeln('  <TBODY>');
    document.writeln('    <TR VALIGN="TOP">');
    document.writeln('      <TD VALIGN="TOP" bgColor=#4a588e><div style=\"white-space:nowrap;float:left\">&nbsp;&nbsp;&nbsp');
}

function writeSubMenu(link, str, first) {
    if (!first) 
      document.write('&nbsp;&nbsp;&nbsp;&nbsp;');
    document.writeln('<A class=menuLevel2 href="'+link+'"');
    document.write('>'+str+'</A>');
}


// END OF TAB FUNCTIONS

var cur_lyr;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) {
	  lyr.css.visibility = "visible";
      lyr.style.visibility = "visible"; 
  }
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) {
	  lyr.css.visibility = "hidden";
	  lyr.style.visibility = "hidden";   
  }
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

function waitPreloadPage() { //DOM
	if (document.getElementById){
			document.getElementById('prepage').style.visibility='hidden';
		}else{
			if (document.layers){ //NS4
			document.prepage.visibility = 'hidden';
			}
		else { //IE4
			document.all.prepage.style.visibility = 'hidden';
		}
	}
}

