function createMainLink (theName,theID,theWidth,theHeight,theLink, theImage, theRolloverImage) {
	if(document.layers) {
      var output = "";
		output += '<td valign="top"';
      if(theImage == null || theImage == "") output += 'class="topNavNetscape"';
		output += '><ilayer id="'+theID+'ButtonParent" visibility="hide"><layer id="'+theID+'Button" width="'+theWidth+'" height="'+theHeight+'">';
		if(theLink != null && theLink != "") output += '<a href="'+theLink+'" target="_blank">';
      if(theImage != null && theImage != "") {
		   output += '<img src="'+theImage+'" width="'+theWidth+'" height="'+theHeight+'" border="0" alt="'+theName+'">';
      } else {
		   output += '<center>'+theName+'</center>';
      }
		if(theLink != null) output += '</a>';
		output += '</layer></ilayer></td>';
      //alert( output );
      document.write( output );
	} else {
      var output = "";
		output += '<td valign="top"';
      if(theImage == null || theImage == "") output += ' class="topNav"';
      output += ' width="'+theWidth+'" height="'+theHeight+'"';
      output += ' id="'+theID+'Button"';
      output += '>';
		if(theLink != null && theLink != "") output += '<a href="'+theLink+'" target="_blank">';
      if(theImage != null && theImage != "") {
		   output += '<img src="'+theImage+'" width="'+theWidth+'" height="'+theHeight+'" border="0" alt="'+theName+'">';
      } else {
		   output += '<center>'+theName+'</center>';
      }
		if(theLink != null) output += '</a>';
		output += '</td>';
      //alert( output );
      document.write( output );
	}
}

function createSubLink (theSubName,theSubID,theSubWidth,theSubHeight,theSubLink,theParentID,theOutColor,theOverColor,prependStyle) {
	var theOutput = "";
	theOutput += '<tr><td><img src="/gfx/spacer.gif" width="1" height="'+theSubHeight+'" alt=""></td>';
	if(document.layers) {
		theOutput += '<td valign="top" class="'+prependStyle+'dropdownNetscape"><ilayer id="'+theSubID+'ButtonParent"><layer id="'+theSubID+'Button" width="'+theSubWidth+'" height="'+theSubHeight+'">';
		if(theSubLink) theOutput += '<a href="'+theSubLink+'" onmouseover="subRollover(\''+theSubID+'Button\',\''+theParentID+'\',\''+theOverColor+'\');" onmouseout="subRollover(\''+theSubID+'Button\',\''+theParentID+'\',\''+theOutColor+'\');">';
		theOutput += "&nbsp; " + theSubName;
		if(theSubLink) theOutput += '</a>';
		theOutput += '</layer></ilayer></td>';
	} else {
		theOutput += '<td valign="top" class="'+prependStyle+'dropdown" width="'+theSubWidth+'" height="'+theSubHeight+'" id="'+theSubID+'Button">';
		if(theSubLink) theOutput += '<a href="'+theSubLink+'" onmouseover="subRollover(\''+theSubID+'Button\',\''+theParentID+'\',\''+theOverColor+'\');" onmouseout="subRollover(\''+theSubID+'Button\',\''+theParentID+'\',\''+theOutColor+'\');">';
		theOutput += "&nbsp; " + theSubName;
		if(theSubLink) theOutput += '</a>';
		theOutput += '</td>';
	}
	theOutput += '</tr>';
	return theOutput;
}

function mainRollover(theRollover,theBackgroundImage) {
	if(ns4) document[theRollover + "Parent"].document[theRollover].background.src = theBackgroundImage;
	else {
		var whichBackground = getReference(theRollover);
		whichBackground.backgroundImage = "url("+theBackgroundImage+")";
	}
}

function subRollover(theRollover,theRolloverParent,theBackgroundColor) {
	if(ns4) document[theRolloverParent].document[theRollover + "Parent"].document[theRollover].bgColor = theBackgroundColor;
	else {
		var whichBackground = getReference(theRollover);
		whichBackground.backgroundColor = theBackgroundColor;
	}
}

// IE3 safe image switching code
var goodBrowser = 0;

if(document.images){
        // enable rollovers
       goodBrowser = 1;
        
        //image preloading stuff
        //put your images that will be used into a comma delimited
        //list on the next line... follow the example =)
        //var preLoad = new Array('/gfx/bIndividualOver.gif','/gfx/bCentersOver.gif','/gfx/bGovernmentOver.gif','/gfx/bEducationalOver.gif','/gfx/bCorporationsOver.gif');

        //don't touch this (it does the pre-loading for you)
       // for(var i = 0; i < preLoad.length;i++){
              //  var k = new Image();
               // k.src = preLoad[i];
       // }
        
}

function flipper(){
        if(goodBrowser == 1){
                for(var i = 0; i < flipper.arguments.length; i += 2){
                document.images[flipper.arguments[i]].src = flipper.arguments[i+1];
                }
        }

}

function popWindow(theURL,theName,theOptions){
        var newWin = window.open(theURL,theName,theOptions);
        newWin.focus();
}
