////////////////////////////////////////////////////////////////////////////////////
//  original script by:
//  overLIB 2.22  --  Please leave this notice.
//  By Erik Bosrup (erik@bosrup.com)  Last modified 1999-03-31
//  Portions by Dan Steinman, Landon Bradshaw and Gnowknayme.
//  Get the latest version at http://www.bosrup.com/web/overlib/
//
//  modified script by Ray Gurganus
////////////////////////////////////////////////////////////////////////////////////
                                   
////////////////////////////////////////////////////////////////////////////////////
// INSTALLATION
////////////////////////////////////////////////////////////////////////////////////

// Include in header of calling program:
// <SCRIPT LANGUAGE="JavaScript" SRC="overlib.js"></SCRIPT>

// Add to the necessary field(s):
//   onFocus="showtip('message',this);"
//   onBlur="hidetip(this);"

// Add to the necessary field(s) or field label(s):
//   <BR><DIV ID="FIELD_tip" STYLE="position:absolute; visibility:hide;"></DIV>
// where FIELD is the name of the field above.

// Add to the TD tag containing the above DIV tag:
//   id="FIELD_lbl"
// where FIELD is the name of the field above.

////////////////////////////////////////////////////////////////////////////////////
// CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////

// Main background color (the large area)
// Usually a bright color (white, yellow etc)
	if (typeof fcolor == 'undefined') { var fcolor = "#ffffcc";}
	
// Border color and color of caption
// Usually a dark color (black, brown etc)
	if (typeof backcolor == 'undefined') { var backcolor = "#000099";}
	
// Text color
// Usually a dark color
	if (typeof textcolor == 'undefined') { var textcolor = "#000000";}
	
// How thick the border should be in pixels
// 1-3 pixels is typical
	if (typeof border == 'undefined') { var border = "1";}
	
////////////////////////////////////////////////////////////////////////////////////
// END CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

// Microsoft Stupidity Check.
if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
		ie5 = true;
	} else {
		ie5 = false; }
} else {
	ie5 = false;
}

function showtip(text, obj, w) {
    if (ns4) {
		tipfld = eval("document.ids." + obj.name);
    }
    else if (ie4) {
	}
    if (ns4) {
		if(w != 0){
			tipwidth = w;
		}
		else {
	    	tipwidth = 150;
		}
		txt = "<TABLE WIDTH="+tipwidth+" BORDER=0 CELLPADDING="+border+0.8+" CELLSPACING=0 BGCOLOR=silver><tr><td height=6></td></tr><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Arial,Helvetica\" COLOR=\""+textcolor+"\" SIZE=\"small\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
		tipobj = eval("document." + obj.name + "Div");
		tipobj.document.open();
		tipobj.document.write(txt);
		tipobj.document.close();
		tipobj.top = 145;
		tipobj.left = 730;
		tipobj.visibility = "show";
    }
    else if (ie4) {
		tipfld = document.all[obj.name];
		tipwidth = tipfld.clientWidth;
		if(w != 0){
			tipwidth = w;
		}
		else if(tipwidth < 75){
			tipwidth = 75;
		}
		txt = "<TABLE WIDTH="+tipwidth+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Arial,Helvetica\" COLOR=\""+textcolor+"\" SIZE=\"-2\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
		tipobj = document.all[obj.name + "Div"];
		tipobj.innerHTML = txt;
		tipobj.style.visibility = "visible";
	}
}

// Clears popups if appropriate
function hidetip(obj) {
	if (ns4) {
		tipobj = eval("document." + obj.name + "Div");
		tipobj.visibility = "hide"
	}
	else if (ie4) {
		tipobj = document.all[obj.name + "Div"];
    	tipobj.style.visibility = "hidden"
	}
}

function showprop(obj){
	proplist = "";
	for (var i in obj) {
		prop = "obj." + i;
		prop = prop + " : " + eval(prop);
		proplist = proplist + prop + "\n";
	}   
	alert(proplist);
}
function expand(id,imgpath){
	div = document.getElementById(id);
	img = document.getElementById("img"+id);
	if(div.style.display == "none"){
		img.src = imgpath + "foldoutmenu_arrow.gif";
		$("#"+id).show();
	}
	else {
		img.src = imgpath + "foldoutmenu_arrow_open.gif";
		$("#"+id).hide();
	}
}
