//==================================================================
// globala variabler
//

var nn = (document.layers) ? true:false;
var ie = (document.all)    ? true:false;

//==================================================================
// lagerhantering
//

function hide(myObject){
	if (nn) {
		myObject.visibility = "hide";
	}
	if (ie) {
		myObject.visibility = "hidden";
	}
}
function show(myObject){
	if (nn) {
		myObject.visibility = "show";
	}
	if (ie) {
		myObject.visibility = "visible";
	}
}

function setPos(myObject,top,left) {
	myObject.left = left;
	myObject.top = top;
}

function setText(myObject,text) {
	if (nn) {
		theLayer.document.write(text);
		theLayer.document.close();
	}
	if (ie) {
		document.all["info"].innerHTML = text;
	}
}

function setImage(num,image){
	document.images[num].src=image;
}

//==================================================================
// fönsterhantering
//

var win;

function newWin(url,myW,myH){
	win = window.open(url,"netro","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width="+myW+",height="+myH);
        win.focus();
}

function newWinName(url,myW,myH,name){
	win = window.open(url,name,"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width="+myW+",height="+myH);
        win.focus();
}

function maxOut() {
  if (window.screen) {
    window.moveTo(0,0);
    window.resizeTo(screen.availWidth,screen.availHeight);
  }
}

function confirmLocation(text,url){
    if (confirm(text)){
         this.location = url;
    }
}

function confirmThisLocation(text,url,location){
    if (confirm(text)){
         location = url;
    }
}

function confirmTopLocation(text,url){
    if (confirm(text)){
         top.location = url;
    }
}

// Layers
var theLayer;
var theInfobox;

//
var goodtogo   = false;
var hover      = false;
var run        = false;
var scrollInfo = true;

// counters
var curInfo = 0;
var x;
var y;

// information
var theInfo = new Array;

document.onmousemove = mouseMove
if (nn) {document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)}

function mouseMove(e) {
    if (nn) { x = e.pageX }
    if (nn) { y = e.pageY }
    if (ie) { x = event.x + document.body.scrollLeft }
    if (ie) { y = event.y+document.body.scrollTop }
    if ((hover)&&(goodtogo)) { setPos(theLayer,(y+20),(x+20)); }
}

function init(){
    if (nn) {
        theLayer = document.info;
        theInfobox = document.infobox;
        hide(theLayer);
    }
    if (ie) {
        theLayer = info.style;
        theInfobox = infobox.style;
        hide(theLayer);
    }
    run = true;
    goodtogo = true;
}
function showInfo(title,info) {
    if (goodtogo){
        var print = "<TABLE CLASS=\"tdback\" WIDTH=\"140\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\"><TR><TD><TABLE WIDTH=\"100%\" HEIGHT=\"100%\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"1\"><TR><TD CLASS=\"tdmeny\">"+title+"</TD></TR><TR><TD CLASS=\"tdmain\">"+info+"</TD></TR></TABLE></TD></TR></TABLE>";
        if (nn) {
            theLayer.document.write(print);
            theLayer.document.close();
        }
        if (ie) {
            document.all["info"].innerHTML = print;
        }
        setPos(theLayer,(y+20),(x+20));
        show(theLayer);
        hover = true;
    }
    else{
        return false;
    }
}
function hideInfo(){
    if (goodtogo){
        setPos(theLayer,0,0);
        hide(theLayer);
        hover = false;
    }
    else{
        return false;
    }
}
function hold(){
    scrollInfo = false;
}
function go(){
    scrollInfo = true;
}
window.defaultStatus=" ";
