// stclib.js

//Pop up information box II (Mike McGrath (mike_mcgrath@lineone.net,  http://website.lineone.net/~mike_mcgrath))
//Permission granted to Dynamicdrive.com to include script in archive
//For this and 100's more DHTML scripts, visit http://dynamicdrive.com

Xoffset=-60;    // modify these values to ...
Yoffset= 20;    // change the DispLabel position.

var old,skn,iex=(document.all),yyy=-1000;

var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all
var ie=document.all


if (ns4)
{
    skn=document.dek
}
else if (ns6)
{
    skn=document.getElementById("dek").style
}
else if (ie4)
{
    skn=document.all.dek.style
}

if (ns4)
{
    document.captureEvents(Event.MOUSEMOVE);
}
else
{
    skn.visibility="visible"
    skn.display="none"
}

document.onmousemove = get_mouse;

function DispLabel(msg,bak)
{
    // <FONT Color=black Face=Arial Size=-2> 
    var content=" <TABLE Border=1 BorderColor=black CellPadding=2 CellSpacing=0 "+ "BgColor="+bak+"><TD Align=Center Class=PopUp> "+msg+"</FONT></TD></TABLE>";
    yyy=Yoffset;
     if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
    if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
    if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}

function get_mouse(e)
{
    var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
    skn.left=x+Xoffset;
    var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
    skn.top=y+yyy;
}

function HideLabel()
{
    yyy=-1000;
    if(ns4){skn.visibility="hidden";}
    else if (ns6||ie4)
    skn.display="none"
}


/***********************************************
* Highlight Table Cells Script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//SPECIFY HIGHLIGHT BEHAVIOR. "TD" TO HIGHLIGHT TABLE CELLS, "TR" TO HIGHLIGHT THE ENTIRE ROW:

var highlightbehavior="TD"

function contains_ns6(master,slave) 
{ 
    // CHECK IF SLAVE IS CONTAINED BY MASTEr
    while (slave.parentNode)
    if ((slave = slave.parentNode) == master)
	return true;
	return false;
}

function ChangeTo(e,fsFgColor,fsBgColor)
{
    source=ie? event.srcElement : e.target
    if (source.tagName=="TABLE")
    return

    // while(source.tagName!=highlightbehavior && source.tagName!="HTML")
    while (source.tagName!=highlightbehavior && source.tagName!="HTML" && source.tagName!="TH" && source.tagName!="A")
    {
	source=ns6 ? source.parentNode : source.parentElement
	if (source.style.backgroundColor!=fsBgColor&&source.id!="ignore")
	{
	    source.style.backgroundColor=fsBgColor;
	}
	if (source.style.color!=fsFgColor&&source.id!="ignore")
	{
	    source.style.color=fsFgColor;
	}
    }
}

function ChangeFr(e,fsFgColor,fsBgColor)
{
    if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
    {
	return
    }
    else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
    {
	return
    }
    if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
    {
	source.style.color=fsFgColor;
	source.style.backgroundColor=fsBgColor;
    }
}

function changebg(e,highlightcolor)
{
    source=ie? event.srcElement : e.target
    if (source.tagName=="TABLE")
    return
    // while(source.tagName!=highlightbehavior && source.tagName!="HTML")
    while ((source.tagName!=highlightbehavior && source.tagName!="HTML") && (source.tagName!="TH" && source.tagName!="HTML"))
    source=ns6? source.parentNode : source.parentElement
    if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
    source.style.backgroundColor=highlightcolor
}

function changeback(e,originalcolor)
{
    if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
    return
    else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
    return
    if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
    source.style.backgroundColor=originalcolor
}

/*****************************************
* Dissolving Image Rollover- By Roy Whittle (http://www.javascript-fx.com/)
* Featured on/available at http://www.dynamicdrive.com/
* This notice must stay intact for use
*****************************************/

//Uncomment the next line for fading rollovers instead of dissolving:
//document.write('<STYLE TYPE="text/css">.imgTrans{ filter:blendTrans(duration=0.4) }</STYLE>');

function Rollover(imgName, imgSrc)
{
	onImages[imgName] = new Image();
	onImages[imgName].src = imgSrc;
}

function turnOn(imgName)
{ 
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].apply();
	document.images[imgName].offSrc = document.images[imgName].src;
	document.images[imgName].src    = onImages[imgName].src;
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].play();
}

function turnOff(imgName)
{ 
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].stop();
	document.images[imgName].src = document.images[imgName].offSrc;
}

//Specify name of participating images, plus paths to their onMouseover replacements:

Rollover("jerkin01",  "/images/mtc_jerkin01.jpg");
Rollover("jerkin02", "/images/mtc_jerkin02.jpg");
Rollover("shirt01", "/images/mtc_shirt01.jpg");
Rollover("cloak01", "/images/mtc_cloak01.jpg");
Rollover("store01", "/images/mtc_store01.jpg");
Rollover("gerald01", "/images/mtc_gerald01.jpg");

