function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

//This function will change the tabbing system so that they link to the right pages, etc.
function chooseURL (nav5, scrn)
{
	var nav5;
	var scrn;

	//UPDATES
	if (scrn == "updates" && nav5 == "trial")
	{
		var scrn = "trial";
		toggleLayer("moreinfo_trial"); 
		toggleLayer("moreinfo_updates"); //off
	}
	else if (scrn == "updates" && nav5 == "old")
	{
		var scrn = "old";
		toggleLayer("moreinfo_old"); 
		toggleLayer("moreinfo_updates"); //off
	}
	//TRIAL
	else if (scrn == "trial" && nav5== "updates")
	{
		var scrn = "updates";
		toggleLayer("moreinfo_updates");
		toggleLayer("moreinfo_trial"); //off
	}
	else if (scrn == "trial" && nav5== "old")
	{
		var scrn = "old";
		toggleLayer("moreinfo_old"); 
		toggleLayer("moreinfo_trial"); //off
	}
	//OLD 
	else if (scrn == "old" && nav5== "updates")
	{
		var scrn = "updates";
		toggleLayer("moreinfo_updates");
		toggleLayer("moreinfo_old"); //off
	}
	else if (scrn == "old" && nav5== "trial")
	{
		var scrn = "old";
		toggleLayer("moreinfo_trial"); 
		toggleLayer("moreinfo_old"); //off
	}
}

//This function will make all of the tabs in the downloads page
function makeTabs(tabs) 
{
	if (tabs == "updates")
	{
		document.write ("<div id = 'moreinfo_updates'  style = 'display: block;' class = 's12'>");
		document.write ("<div class = 's12b' id = 'blackback2'>");
		document.write ("<span class = 'tabs' valign = 'bottom'><a href='javascript:chooseURL(\"updates\", \"updates\");' title='Click here to see updates, patches, etc.' class = 's12_grey'>&nbsp;Latest Version</a></span>&nbsp;");
		document.write ("<a href='javascript:chooseURL(\"trial\", \"updates\");' title='Click here to see trial versions of the software' class = 's12_grey'>&nbsp;&nbsp;Trial Version&nbsp;&nbsp;</a>&nbsp;");
		document.write ("<a href='javascript:chooseURL(\"old\", \"updates\");' title='Click here to see old updates, patches, etc.' class = 's12_grey'>&nbsp;&nbsp;&nbsp;Old Versions&nbsp;&nbsp;</a>");
		document.write ("</div>");
	}
	else if (tabs == "trial")
	{
		document.write ("<div id = 'moreinfo_trial'  style = 'display: none;' class = 's12'>");
		document.write ("<div class = 's12b' id = 'blackback2'>");
		document.write ("<a href='javascript:chooseURL(\"updates\", \"trial\");' title='Click here to see updates, patches, etc.' class = 's12_grey'>&nbsp;&nbsp;Latest Version</a>&nbsp;");
		document.write ("<span class = 'tabs' valign = 'bottom'><a href='javascript:chooseURL(\"trial\", \"trial\");' title='Click here to see trial versions of the software' class = 's12_grey'>&nbsp;&nbsp;Trial Version&nbsp;&nbsp;</a></span>&nbsp;");
		document.write ("<a href='javascript:chooseURL(\"old\", \"trial\");' title='Click here to see old updates, patches, etc.' class = 's12_grey'>&nbsp;&nbsp;Old Versions&nbsp;&nbsp;</a>");
		document.write ("</div>");
	}
	else if (tabs == "oldversions")
	{
		document.write ("<div id = 'moreinfo_old'  style = 'display: none;' class = 's12'>");
		document.write ("<div class = 's12b' id = 'blackback2'>");
		document.write ("<a href='javascript:chooseURL(\"updates\", \"old\");' title='Click here to see updates, patches, etc.' class = 's12_grey'>&nbsp;&nbsp;Latest Version</a>&nbsp;");
		document.write ("<a href='javascript:chooseURL(\"trial\", \"old\");' title='Click here to see trial versions of the software' class = 's12_grey'>&nbsp;&nbsp;&nbsp;Trial Version&nbsp;&nbsp;</a>&nbsp;");
		document.write ("<span class = 'tabs' valign = 'bottom'><a href='javascript:chooseURL(\"old\", \"old\");' title='Click here to see old updates, patches, etc.' class = 's12_grey'>&nbsp;&nbsp;Old Versions&nbsp;&nbsp;</a></span>");
		document.write ("</div>");
	}
}

function toggleBubble(whichLayer)
{
	var elmt, vsbl;
	if (document.getElementById){					// For standard modern browsers
		elmt = document.getElementById(whichLayer);
	}
	else if(document.all){							// For old MSIE browsers
		elmt = document.all[whichLayer];
	}
	else if(document.layers){						// For old Nestscape based browsers
		elmt = document.layers[whichLayer];
}  
	vsbl = elmt.style;
	//This is the code that will actually make the box appear/disappear
	vsbl.display = (vsbl.display == '' || vsbl.display == 'block')?'none':'block';
}


function move (whichLayer, myEvent) {
	if(document.getElementById) {					// For standard modern browsers
		elmt = document.getElementById(whichLayer);
	}
	else if(document.all){							// For old MSIE browsers
		elmt = document.all[whichLayer];
	}
	else if(document.layers) {						// For old Nestscape based browsers
		elmt = document.layers[whichLayer];
	}  

	vsbl = elmt.style;

	//This is the code that makes the box follow the mouse, wherever it goes
	vsbl.left = myEvent.clientX + 10;
	vsbl.top = myEvent.clientY + 2;
}

