// START INIT scripts



// END INIT scripts




// START Misc custom scripts
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function GetObject(obj){
	isNS4 = (document.layers) ? true : false;
	isIE4 = (document.all && !document.getElementById) ? true : false;
	isIE5 = (document.all && document.getElementById) ? true : false;
	isNS6 = (!document.all && document.getElementById) ? true : false;

	if (isNS4){
	   elem = document.layers[obj];
	}
	else if (isIE4) {
	   elem = document.all[obj];
	}
	else if (isIE5 || isNS6) {
	   elem = document.getElementById(obj);
	}

	return elem;
}


//Transition scripts
function transitionPlay(id) {
	// Draws a transition of the component (works on IE5 & up).
        id.style.visibility = "hidden"
		id.filters(0).apply()
		id.style.visibility = "visible"
		id.filters(0).play()
}

function blendIn(id) {
	    id.style.filter = "blendTrans(duration=1)";
		id.style.filter += "progid:DXImageTransform.Microsoft.DropShadow(Color=999999,offX=5,offY=5,positive=true)";
		id.style.visibility="hidden";
    	// Make sure the filter is not playing.
    	if (id.filters.blendTrans.status != 2) {
        	id.filters.blendTrans.apply();
        	id.style.visibility="visible";
        	id.filters.blendTrans.play();
		}
		
		
}

function OpenLiveScore() {
	var width = 364
	var height = 450
	var T = ((window.screen.height/2) - (height/2)); // (screen.height/2) - 115;
	var L = ((window.screen.width/2) - (width/2))-12; // (screen.width/2) - 215;
	window.open('http://212.214.96.196/livescore_basketligan.swf','livescore','top=' + T + ',left=' + L + ',width=' + width + ',height=' + height + ',toolbar=no,directories=no,menubar=no,status=no,location=no,resizable=yes,scrolling=no,scrollbars=no');
  }
// END Misc custom scripts



// START Forms related scripts
// Example code for form element highlighting
var highlightcolor="lightyellow"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
	if (which.style&&intended.test(which.tagName)){
		if (ns6&&eventobj.nodeType==3) {
			eventobj=eventobj.parentNode.parentNode
		return true
		}
	} else {
		return false
	}
}

//Function to highlight form element
function highlight(e){
	eventobj=ns6? e.target : event.srcElement
	if (previous!=''){
		if (checkel(previous)){
			previous.style.backgroundColor=''
			previous=eventobj
			if (checkel(eventobj))
				eventobj.style.backgroundColor=highlightcolor
		}
	} else {
		if (checkel(eventobj)) {
			eventobj.style.backgroundColor=highlightcolor
			previous=eventobj
		}
	}
}
// END Forms related scripts


// Poll related scripts
	// This function makes sure that the user selected a voting option.
	function OneOptionChecked()
	{
		var i;
		
		// Let's iterate through our voting options, returning true if
		// we come across a checked radio box
		for (i = 0; i < document.frmPoll.radPoll.length; i++)
			if (document.frmPoll.radPoll[i].checked) return true;
		
		// If we reach this point, then the user didn't check any voting options
		alert("Du måste välja vad du vill rösta på\ninnan du kan skicka din röst!");
		return false;
	}
// END Poll related scripts


// START 2005 scripts
function openPopWin(side,w,h,scroll)
{
	side = side.replace("#","%23");
	addWin = window.open(side,"add","width=" + w + ",height=" + h + ",scrollbars=" + scroll + ",menubar=0");
	addWin.focus();
}

function Info(side,w,h,scroll)
{
	side = side.replace("#","%23");
	infoWin = window.open(side,"info","width=" + w + ",height=" + h + ",scrollbars=" + scroll + ",menubar=0");
	infoWin.focus();
}

function fixUglyIE()
{
for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}
if (document.all)
{
document.onmousedown = fixUglyIE;
}
// END 2005 Scripts


// START Macromedia Scripts
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// END Macromedia Scripts