function jsIncludeText(text)
{
    document.write(text);
}

//IncludeText('<script type="text/javascript" src="js/jquery-1.2.2.pack.js"></script>');
//IncludeText('<style type="text/css">div.htmltooltip{position: absolute; z-index: 1000; left: -1000px; top: -1000px; border: 1px solid black; color: black; padding: 3px; width: 100px; }</style>');
//IncludeText('<script type="text/javascript" src="js/htmltooltip.js"></script>');


var jsNewDestination = false;


function IsNewDestination()
{
    return jsNewDestination;
}

function SetNewDestination(val)
{
    jsNewDestination = val;
}


function jsOpenTarget(target,url)
{
    if(jsNewDestination || target==0)
    	window.open("about:blank").location.href = url;
    else
    	target.location.href = url;
}


function ImageButton(url,name,target)
{
    this.name = name;
    var help = name.substring(0,1).toUpperCase() + name.substring(1);
    document.write("<img name=\"ImageButton"+name+"\" style='cursor: pointer; text-align: left; vertical-align: middle' onclick='jsOpenTarget("+target+",\""+url+"\")' onmouseover='"+this.State(2)+"' onmouseout='"+this.State(1)+"' onmouseup='"+this.State(1)+"' onmousedown='"+this.State(3)+"' title='"+help+"' src=\"PICTURES/"+name+"1.png\"></img>");
}


ImageButton.prototype.State = function(mode)
{
    var ret = "this.src=\"PICTURES/" + this.name + mode + ".png\";";
    return ret;
}


function TextButton(url,fullname,target)
{
    var help = url;
    var name = fullname.replace(/\W/g,"");
    document.write("<a name='TextButton"+name+"' style='cursor: pointer; text-align: left; vertical-align: middle; font-family: cursive; font-variant: small-caps; font-weight: bold; padding: 0.5em 1em; outline-color: navy; outline-style: none; outline-width: 2' onclick='jsOpenTarget("+target+",\""+url+"\")' onmouseover='"+this.State(2)+"' onmouseout='"+this.State(1)+"' onmouseup='"+this.State(1)+"' onmousedown='"+this.State(3)+"' title="+url+">"+fullname+"</a>");
}


TextButton.prototype.State = function(mode)
{
    var ret = "this.style.backgroundColor=\"" + (mode==2?"white":"transparent") + "\"; this.style.color=\"" + (mode==2?"navy":"black") + "\"; this.style.outlineStyle=\"" + (mode==2?"solid":"none") + "\"; this.style.fontStyle=\"" + (mode==2?"normal":"normal") + "\";";
    return ret;
}


function ImageThumb(name,title)
{
    if(typeof(title) == "undefined") title = "";
    document.write("<div style='float: left; padding: 15px; text-align: center;'><b>"+title+"</b><br><img style='cursor: pointer;' onclick='jsOpenTarget(self,\""+name+"\")' title='"+title+"' src="+name+" height=200></div>");
}

