// stclib.js

var gsCSSBrow = "";
var gsCSSVers = "";
var gbCurrentHome = "F";

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

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

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

var BrowserDetect = 
{
    init: function () 
    {
	this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
	this.version = this.searchVersion(navigator.userAgent)
		|| this.searchVersion(navigator.appVersion)
		|| "an unknown version";
	this.OS = this.searchString(this.dataOS) || "an unknown OS";
    },
    searchString: function (data) 
    {
	for (var i=0;i<data.length;i++)	
	{
		var dataString = data[i].string;
		var dataProp = data[i].prop;
		this.versionSearchString = data[i].versionSearch || data[i].identity;
		if (dataString) 
		{
			if (dataString.indexOf(data[i].subString) != -1)
				return data[i].identity;
		}
		else if (dataProp)
			return data[i].identity;
	}
    },
    searchVersion: function (dataString) 
    {
	    var index = dataString.indexOf(this.versionSearchString);
	    if (index == -1) return;
	    return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
    },
    dataBrowser: [
	    {
		    string: navigator.userAgent,
		    subString: "Chrome",
		    identity: "Chrome"
	    },
	    { 	string: navigator.userAgent,
		    subString: "OmniWeb",
		    versionSearch: "OmniWeb/",
		    identity: "OmniWeb"
	    },
	    {
		    string: navigator.vendor,
		    subString: "Apple",
		    identity: "Safari",
		    versionSearch: "Version"
	    },
	    {
		    prop: window.opera,
		    identity: "Opera"
	    },
	    {
		    string: navigator.vendor,
		    subString: "iCab",
		    identity: "iCab"
	    },
	    {
		    string: navigator.vendor,
		    subString: "KDE",
		    identity: "Konqueror"
	    },
	    {
		    string: navigator.userAgent,
		    subString: "Firefox",
		    identity: "Firefox"
	    },
	    {
		    string: navigator.vendor,
		    subString: "Camino",
		    identity: "Camino"
	    },
	    {		// for newer Netscapes (6+)
		    string: navigator.userAgent,
		    subString: "Netscape",
		    identity: "Netscape"
	    },
	    {
		    string: navigator.userAgent,
		    subString: "MSIE",
		    identity: "Explorer",
		    versionSearch: "MSIE"
	    },
	    {
		    string: navigator.userAgent,
		    subString: "Gecko",
		    identity: "Mozilla",
		    versionSearch: "rv"
	    },
	    { 		// for older Netscapes (4-)
		    string: navigator.userAgent,
		    subString: "Mozilla",
		    identity: "Netscape",
		    versionSearch: "Mozilla"
	    }
    ],
    dataOS : [
	    {
		    string: navigator.platform,
		    subString: "Win",
		    identity: "Windows"
	    },
	    {
		    string: navigator.platform,
		    subString: "Mac",
		    identity: "Mac"
	    },
	    {
		       string: navigator.userAgent,
		       subString: "iPhone",
		       identity: "iPhone/iPod"
	},
	    {
		    string: navigator.platform,
		    subString: "Linux",
		    identity: "Linux"
	    }
    ]

};

//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

function initBodyold()
{
    document.write ('<div id="divPop" style="border: 0px solid yellow;"></div> <!-- divPop -->');

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

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

    document.onmousemove = get_mouse;

}

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

// POP-UP MESSAGES: 
// linkPopIn - Link to URL on same site
// linkPopOut - Link to URL on another site (opening new window)
// linkPopLeft - Show message Left justified
// linkPopRight - Show message Right justified
// linkPopOff - Turn off any of these Pop-ups
// linkPopSort - For Sortable headers

function linkPopIn(sMsg,sBg)
{
    var sContent;

    if ((sBg == '') || (sBg == undefined))
    {
	sBg = "#FFFFCC";
    }
    sContent=" <TABLE Border=1 BorderColor=black CellPadding=2 CellSpacing=0 "+ "BgColor="+sBg+"><TD Align=Center Class=PopUp> "+sMsg+"</TD></TABLE>";
    yyy=Yoffset;
     if(ns4){gsPopStyle.document.write(sContent);gsPopStyle.document.close();gsPopStyle.visibility="visible"}
    if(ns6){document.getElementById("divPop").innerHTML=sContent;gsPopStyle.display=''}
    if(ie4){document.all("divPop").innerHTML=sContent;gsPopStyle.display=''}
}

function linkPopOut(sMsg)
{
    var sContent=" <TABLE Border=1 BorderColor=black CellPadding=2 CellSpacing=0 "+ "BgColor=#FFFFCC><TD Align=Center Class=PopUp><B>OPEN NEW WINDOW</B><BR>to<BR>"+sMsg+"</TD></TABLE>";
    yyy=Yoffset;

     if(ns4){gsPopStyle.document.write(sContent);gsPopStyle.document.close();gsPopStyle.visibility="visible"}
    if(ns6){document.getElementById("divPop").innerHTML=sContent;gsPopStyle.display=''}
    if(ie4){document.all("divPop").innerHTML=sContent;gsPopStyle.display=''}
}

function linkPopLeft(sMsg)
{
    var sContent=" <TABLE Border=1 BorderColor=black CellPadding=2 CellSpacing=0 "+ "BgColor=#FFFFCC><TD Align=Left Class=PopUp>"+sMsg+"</TD></TABLE>";
    yyy=Yoffset;

     if(ns4){gsPopStyle.document.write(sContent);gsPopStyle.document.close();gsPopStyle.visibility="visible"}
    if(ns6){document.getElementById("divPop").innerHTML=sContent;gsPopStyle.display=''}
    if(ie4){document.all("divPop").innerHTML=sContent;gsPopStyle.display=''}
}

function linkPopRight(sMsg)
{
    var sContent=" <TABLE Border=1 BorderColor=black CellPadding=2 CellSpacing=0 "+ "BgColor=#FFFFCC><TD Align=Right Class=PopUp>"+sMsg+"</TD></TABLE>";
    yyy=Yoffset;

     if(ns4){gsPopStyle.document.write(sContent);gsPopStyle.document.close();gsPopStyle.visibility="visible"}
    if(ns6){document.getElementById("divPop").innerHTML=sContent;gsPopStyle.display=''}
    if(ie4){document.all("divPop").innerHTML=sContent;gsPopStyle.display=''}
}

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

function linkPopSort(sFg,sBg)
{
    var sMsg = "click on header to<BR>sort by column";
    var sContent="<TABLE Border=1 CellPadding=2 CellSpacing=0 " + "FgColor="+sFg + " BgColor="+sBg+"><TD Align=Center Class=PopUp> "+sMsg+"</FONT></TD></TABLE>";
    yyy=Yoffset;
     if(ns4){gsPopStyle.document.write(sContent);gsPopStyle.document.close();gsPopStyle.visibility="visible"}
    if(ns6){document.getElementById("divPop").innerHTML=sContent;gsPopStyle.display=''}
    if(ie4){document.all("divPop").innerHTML=sContent;gsPopStyle.display=''}
}


/***********************************************
* 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
}


BrowserDetect.init();

////////////////////////////////////////////////////////////////////////////////
// Below you see the objects contained by the object navigator. These variables
// can be read out and give information about the browser and computer of your 
// users. Use this information to add new objects to the browser detect.
//

// navigator.userAgent = Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7
// navigator.vendor = 
// navigator.platform = Win32
// navigator.appCodeName = Mozilla
// navigator.appName = Netscape
// navigator.appVersion = 5.0 (Windows; en-US)
// navigator.language = en-US
// navigator.mimeTypes = [object MimeTypeArray]
// navigator.oscpu = Windows NT 5.0
// navigator.vendorSub = 
// navigator.product = Gecko
// navigator.productSub = 20091221
// navigator.plugins = [object PluginArray]
// navigator.securityPolicy = 
// navigator.cookieEnabled = true
// navigator.onLine = true
// navigator.buildID = 20091221164558
// navigator.javaEnabled = function javaEnabled() {
//     [native code]
// }
// navigator.taintEnabled = function taintEnabled() {
//     [native code]
// }
// navigator.preference = function preference() {
//     [native code]
// }
// navigator.geolocation = [object GeoGeolocation]
// navigator.registerContentHandler = function registerContentHandler() {
//     [native code]
// }
// navigator.registerProtocolHandler = function registerProtocolHandler() {
//     [native code]
// }
// navigator.mozIsLocallyAvailable = function mozIsLocallyAvailable() {
//     [native code]
// }


///////////////////////////////////////////////////////////////////////////////
/* LIBRARY: stc_write.js */
///////////////////////////////////////////////////////////////////////////////

/* stc_write.js */
/* 
 * COPYRIGHT (c) 2005-2010 STC Network Systems (STCLLP.COM)
 *
 */

/* REQUIRES config.js E-MAIL DEFINES */
function STC_writeLine(sSuffix,sPrefix,sArea,sCountry,sDivisor)
{

    var sSegment1 = "";
    var sSegment2 = "";
    var sSegment3 = "";
    var sSegment4 = "";

    if ((sDivisor == null) || (sDivisor.length == 0))
    {
	sDivisor = STC_DIVISOR;
    }
    if ((sCountry != null) && (sCountry.length > 0))
    {
	sSegment1 = "+" + sCountry + " ";
    }

    if ((sArea != null) || (sArea.length > 0))
    {
	sSegment2 = sArea + sDivisor;
    }
    if ((sPrefix != null) || (sPrefix.length > 0))
    {
	sSegment3 = sPrefix + sDivisor;
    }
    if ((sSuffix != null) || (sSuffix.length > 0))
    {
	sSegment4 = sSuffix;
    }
    document.write (sSegment1 + sSegment2 + sSegment3 + sSegment4);
}

function STC_writeName(sName,sDivisor,sPosition,sDescription)
{
    if ((sName == null) || (sName.length == 0))
    {
	document.write ('&nbsp;');
	return;
    }
    sFullName = sName;
    nPos = sName.indexOf(" ");
    if ((sDivisor == null) || (sDivisor.length == 0))
    {
	sDivisor = STC_DIVISOR;
    }
    if (nPos > 0)
    {
	sFullName = sName.substr(0, nPos) +  sDivisor + sName.substr(nPos+1);
    }
    sFullName = sFullName.toLowerCase();
   
    var sPageTitle; 
    var sSendTo;
    var sSubject;
    if (document.getElementsByTagName)
    {
	sPageTitle = document.getElementsByTagName('title')[0];
    }
    if ((sDescription == null) || (sDescription.length == 0))
    {
	sSendTo = sName;
    }
    else
    {
	sSendTo = sDescription;
    }
    document.write ('<A Href="' + STC_COMMAND + sFullName + STC_SYMBOL + gsDomainName);
    if (LOC_EMAIL_NAME != null)
    {
	sSubject = LOC_EMAIL_NAME;
    }
    else
    {
	sSubject = "Web Page";
    }
    document.write ('?subject=' + sSubject + ': ' + sPageTitle.innerHTML + '');
    document.write ('&Body=%0D%0D%5B%20e-mail%20generated%20by%20user%20on%20Web%20Site%2C%20' + LOC_SHORT_NAME + '%20%5D');
    document.write ('">' + sSendTo + '</A>');

    if (sPosition != null) 
    {
	document.write (sPosition);
    }
}

function STC_writeName2(sName,sDivisor,sPosition,sDescription)
{
    sDomain = gsDomainName;
    sFullName = sName;

    if ((sDivisor == null) || (sDivisor.length == 0))
    {
	sDivisor = STC_DIVISOR;
    }

    nPos = sName.indexOf(" ");
    if (nPos > 0)
    {
	sFullName = sName.substr(0, nPos) +  sDivisor + sName.substr(nPos+1);
	if (sDivisor == 'c')
	{
	    sFullName = sName.substr(0, nPos);
	    sDomain = sName.substr(nPos+1) + '.com';
	}
	if (sDivisor == 'n')
	{
	    sFullName = sName.substr(0, nPos);
	    sDomain = sName.substr(nPos+1) + '.net';
	}
	if (sDivisor == 'o')
	{
	    sFullName = sName.substr(0, nPos);
	    sDomain = sName.substr(nPos+1) + '.org';
	}
	if (sDivisor == 'u')
	{
	    sFullName = sName.substr(0, nPos);
	    sDomain = sName.substr(nPos+1) + '.us';
	}
    }
    sFullName = sFullName.toLowerCase();
   
    if (sDescription == null)
    {
	document.write ('<A Href="' + STC_COMMAND + sFullName + STC_SYMBOL + sDomain + '">' + sName + '</A>');
    }
    else
    {
	document.write ('<A Href="' + STC_COMMAND + sFullName + STC_SYMBOL + sDomain + '">' + sDescription + '</A>');
    }
    if (sPosition != null) 
    {
	document.write (sPosition);
    }
}

function STC_writePict(sName, sImage, nHeight, nWidth)
{
    sDomain = gsDomainName;
    sFullName = sName;

    nPos = sName.indexOf(" ");
    if (nPos > 0)
    {
	sFullName = sName.substr(0, nPos) +  STC_DIVISOR + sName.substr(nPos+1);
    }

    sFullName = sFullName.toLowerCase();
    // IF NO SLASH, ASSUME image SUB-DIRECTORY
    if (sImage.indexOf("/") < 0)
    {
	sImage = "/images/" + sImage;
    }

    // IF NO HEIGHT, SKIP IT
    if (nHeight == null)
    {
	sHeight = "";
    }
    else
    {
	sHeight = " Height=" + nHeight;
    }

    // IF NO WIDTH, SKIP IT
    if (nWidth == null)
    {
	sWidth = "";
    }
    else
    {
	sWidth = " Width=" + nWidth;
    }

    document.write ('<A Href="' + STC_COMMAND + sFullName + STC_SYMBOL + sDomain + '"><IMG Src="' + sImage + '"' + sHeight + sWidth + '></A>');
}
////////////////////////////////////////////////////////////////////////////////
/* 
 * {BEG: HTML
 *
    <SCRIPT Type="text/javascript">
  	document.write ('Write to ');
  	STC_writeName ('First Last');
  	document.write (', ');
  	STC_writeName ('Position');
      </SCRIPT>
    <SCRIPT>
	STC_writeLine ('2581', '450', '888', '1'); 
	document.write (" / ");
	STC_writeLine ('9600', '744', '714', '1');
    </SCRIPT>
    <SCRIPT>
	STC_writeLine ('2581', '450', '888', '1'); 
	document.write (" -or- ");
	STC_writeLine ('9600', '744', '714', '', '-');
    </SCRIPT>
 
 *
 * }END HTML
 */


