function JB_ShowHide(){
	var a=JB_ShowHide.arguments;
		for(var i=0; i<(a.length-1); i+=2)
			if ((document.all && document.all[a[i]]) != null)
				eval(a[i]+'.style.visibility = "'+a[i+1]+'"');
}

function MouseOver(name, L, T, W, text, cC){
	var results='';
	// for each value, if they haven't specified the value, assume we can take the full field to display
	// at actual presentation time, we will position according to the position of the mouse
	var lPos = (L=="") ? "10"			: L;
	var tPos = (T=="") ? "10"			: T;
	var wPos = (W=="") ? "width:500px;"	: "width:"+W+"px;";
	var clickCode = (cC==null) ? ""		: cC;
	results
		= '<div id="'+name+'Div" style="position:absolute; left:0px; top:0px; z-index:3; visibility:hidden;';
	if (clickCode != "") results += ' cursor:pointer;" onClick="'+clickCode;
	results += '">'
		+ '<table width="100%"><tr><td align="center">'
		+ '<div id="'+name+'" style="'
		+ ((L=="0") ? "" : 'position:absolute; left:'+lPos+'px; top:'+tPos+'px; ')
		+   wPos+' z-index:4; text-align:left; font-family:Arial,sans-serif; text-decoration:none; font-size:11pt; color:#FFFFFF; '
		+	'background-color: #BB2026; layer-background-color: #6699CC; border: 5px solid #CCCCCC; '
		+	'padding: 12px; visibility:hidden;" onMouseOver="JB_ShowHide('+"'"+name+"Div', 'visible', '"+name+"', 'visible')"+'" '
		+	'onMouseOut="JB_ShowHide('+"'"+name+"Div','hidden', '"+name+"','hidden'"+')">'
		+		text+'</div></td></tr></table></div>';
	document.write(results);
}

function moOn(name){
	JB_ShowHide('MO_'+name+'Div','visible', 'MO_'+name,'visible');
}

function moOff(name){
	JB_ShowHide('MO_'+name+'Div','hidden', 'MO_'+name,'hidden');
}

function MouseOverTrigger(name, text){
	var results='';
	results
		= '<a id="trig'+name+'" '
		+    'style="font-family:Arial,sans-serif; text-decoration:none; font-size:10pt; cursor:hand; color:blue; z-index:5;" '
		+    'onMouseOver="JB_ShowHide('+"'"+name+"Div','visible', '"+name+"','visible')"+'" '
		+    'onMouseOut="JB_ShowHide('+"'"+name+"Div','hidden', '"+name+"','hidden')"+'"><b>'+text+'</b></a>';
	/* s=""; for(i in document) s += i + ": " + document[i] + "\n"; alert(s); */
	return(results);
}

function MouseOverLinkTrigger(name, text, link){
	var link = (link=='') ? "#" : link;
	var results='';
	results
		= '<a href="'+link+'" '
		+   ' style="font-family:Arial,sans-serif; text-decoration:underline; font-size:10pt; cursor:hand; color:blue; z-index:5;"'
		+   ' id="trig'+name+'" onMouseOver="JB_ShowHide('+"'"+name+"Div','visible', '"+name+"','visible')"+'" '
		+		'onMouseOut="JB_ShowHide('+"'"+name+"Div','hidden', '"+name+"','hidden')"+'"><b>'+text+'</b></a>';
	return(results);
}

function MouseClick(name, L, T, W, FromPage, text, SubLayer, Is_Hidden, ClickCode, FontSize){
	var results='';
	var PathToPics = "/myImages/";
	if (ClickCode == null) ClickCode = '';
	if (FontSize == null) FontSize = 11;
	var lPos		= (L=="") ? "left:10px;"	: "left:"+L+"px;";
	var tPos		= (T=="") ? "top:10px;"		: "top:"+T+"px;";
	var wPos		= (W=="") ? "width:510px;"	: "width:"+W+"px;";
	var wBarPos		= (W=="") ? "width=447px"	: "width="+W;
	var hQuitPos	= (W=="") ? "left:447px;"	: "left:"+(W-52)+"px;";
	results
		= '<span id="'+name+'Div" style="position:absolute; left:0px; top:0px; z-index:3; visibility:hidden;">'
		+ '<table width="100%"><tr><td align="center">'
		+ '<div id="'+name+'" style="' + ((L=="0") ? "" : 'position:absolute; '+lPos+tPos)
		+		wPos+'z-index:8; background-color: #0000FF; layer-background-color: #6699CC; border: 5px solid #CCCCCC;'
		+		' padding-top:28px; visibility:hidden;">'
		+	'<div id="topbar'+name+'" style="position:relative; left:0px; top:-28px; z-index:9">'
		+		'<img name="topbarI'+name+'" border="0" '+wBarPos+' height="16" '
		+			'src="'+PathToPics+'popUpBar.jpg" >'
		+		'<div id="quitXDim'+name+'" style="position:absolute; '+hQuitPos+' top:1px; z-index:11; cursor:hand">'
		+			'<a onMouseOver="JB_ShowHide('+"'quitXLit"+name+"','visible'"+')">'
		+				'<img name="quitX" border="0" src="'+PathToPics+'barCloseX.gif">'
		+			'</a></div>'
		+		'<div id="quitXLit'+name+'" style="position:absolute; '+hQuitPos+' top:1px; z-index:12; '
		+			'visibility:hidden; cursor:hand">'
		+			'<a onMouseOut="JB_ShowHide('+"'quitXLit"+name+"','hidden'"+')" '
		+				'onClick="MC_On=false;JB_ShowHide('+"'"+name+"Div','hidden', '"+name+"','hidden', 'quitXLit"+name+"','hidden'"+');'
		+					"currMC='';"+ClickCode+'">'
		+			'<img name="quitX" border="0" src="'+PathToPics+'barCloseXRed.gif">'
		+			'</a></div></div>'
		+	'<font style="font-family:Arial,sans-serif; text-decoration:none; font-size:'+FontSize+'pt; color:#000088">'
		+		text+'</font></div></td></tr></table></span>';
	if ( (Is_Hidden == null) || (Is_Hidden == '') ){
		document.write(results);
	}
}

var currMC = '';
var MC_On = false;

function MouseClickTrigger(number, trashNumMC, text, ClickCode, Hide_PopUp, Hide_Text){
	var results='';
	if (ClickCode == null) ClickCode = '';
	if ((Hide_PopUp == null) || (Hide_PopUp == '')) Hide_PopUp = false;
	if (Hide_Text == null) Hide_Text = false;
	if ((text == null) || (text == '')) Hide_Text = true;
	
	var onClickScript = "MC_On=!"+Hide_PopUp + "; if(currMC!=''){JB_ShowHide('MC'+currMC, 'hidden');}";
	if (!Hide_PopUp){
		onClickScript += "currMC="+number+";JB_ShowHide('MC"+number+"Div','visible', 'MC"+number+"','visible');";
	}
	onClickScript += ClickCode;
	
	if (Hide_Text){
		results = onClickScript;
	} else {
		results
			= '<font style="font-family:Arial,sans-serif; text-decoration:none; font-size:10pt; cursor:hand" color="#000099">'
			+	'<a id="trigMC'+number+'" onClick="'+onClickScript+'"><b>'+text+'</b></a></font>';
	}
	return(results);
}
