var marqueewidth="920px"
var marqueeheight="25px"
var marqueespeed=2
var marqueebgcolor="none"
var pauseit=1
var iH=""
var marqueecontent=""
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
var actualwidth=''
var cross_marquee, ns_marquee

var playerid



function DisplayLegend(objLegend, Title)
{
	document.getElementById(objLegend).innerHTML = Title;
}

function ShowDetail(League, GameNr, xmlName, SIId)
{
	window.location = "default.aspx?SIId=" + SIId + "&Gamedetail=" + GameNr + "&League=" + League + "&xmlName=" + xmlName + "&SIId=" + SIId;
}


function showAJAXload(ico,obj)  {

    gif = "imgs/ajaxload" + ico + ".gif";
    document.getElementById(obj).innerHTML="<img src='" + gif + "' alt='loading' style='vertcal-align:center;' />";
}

function ShowDetail(League, GameNr, xmlName)
{	window.open("http://www.eishockey.org/default.aspx?SIId=1&Gamedetail=" + GameNr + "&League=" + League + "&xmlName=" + xmlName );}

function showPlayer(id) {
    if (playerid != id)
    {    
        // if(document.getElementById('p' + playerid)) {document.getElementById('p' + playerid).style.display='none';}
        // Effect.toggle('p'+ + id);
        // playerid = id;
        
        if(document.getElementById('p' + playerid)) {document.getElementById('p' + playerid).style.display='none';}
            document.getElementById('p'+ + id).style.display='block';;
        playerid = id;
    }
}    






function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
}
lefttime=setInterval("scrollmarquee()",20)
}
//window.onload=populate

function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"

}
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
}
}

if (iedom||document.layers){

 iH = ('<table border="0" cellspacing="0" cellpadding="0"><td>')

        if (iedom){
        iH = iH + ('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
        iH = iH + ('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
        iH = iH + ('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
        iH = iH + ('</div></div>')
        }
        else if (document.layers){
        iH = iH + ('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
        iH = iH + ('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
        iH = iH + ('</ilayer>')
        }

    iH = iH + ('</td></table>')
    //document.getElementById('lblNewsticker').innerHTML = iH;
   

}


function newsTicker() {
    document.write(iH);
    }
    
    
    
    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: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			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.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
