defaultStatus ="Svedala Scoutkår"

var message="Copyright © 2004 Svedala Scoutkår"; 

function blured(){
	for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}

function ShowStatuses(){
//	for ( var count = 0 ; count < document.links.length; count++ ) document.links[count].onmouseover = blankStatus;
//	for (a in document.links) document.links[a].onmouseover = blankStatus;
}

function blankStatus(){
	window.status = message;
	return true;
}

if (document.all){
//	document.onmousedown = blured;
//	document.onmouseover = ShowStatuses;
}


function insertQuote(aField, Tag) {
	if (document.selection && document.selection.createRange) {
	    var str = document.selection.createRange().text;
	} else {
	    alert("Sorry, Detta fungerar bara med Internet Explorer.");
	}

  	eval("document.forms[0]." + aField + ".focus()");
	str = "\[" + Tag + "\]" + str + "\[/" + Tag + "\]";

	document.selection.createRange().text = str;
}



function gotoMainFrame(url){
 self.MainFrame.location.href=url;
 self.MainFrame.focus();
}

function changePage (URLObj) {
 if (URLObj != ''){
  parent.hoger.location.href=URLObj;
  parent.hoger.focus();
 }
}


function openmenu(menu){
	self.location.href='?menu='+menu;
}

//######### Menu #########


var menutimer=false;
var currentMenu=false;

function Right(str, num){
     return str.substring(str.length-num);  // pull out right num
}

function GetName(str){
     return str.substring(4,str.length);  // pull out right num
}

function showLayer(sender, Id){
	if (document.all) {
//		document.all[Id].style.visibility = "visible";
		document.all[Id].style.display = '';
	} else if (document.layers){
//		document.layers[Id].visibility = "show";
		document.layers[Id].display = '';
	} else if (document.getElementById){
//		document.getElementById(Id).style.visibility = "visible";
		document.getElementById(Id).style.display = '';
	}
    moveLayerAbs(Id, divLeft(sender), divTop(sender));
}

function hideMenu(Id){
//    topMenu.className = "Menu";
	eval("menutimer=setTimeout(\"hideLayer('"+Id+"')\",100);");	
}

function displayMenu(sender, Id, dimm){

//    if (dimm != null){
//    	dimm.className = "MenuOver";
//    	topMenu = dimm;
//    } else if (topMenu != null){
//    	topMenu.className = "MenuOver";		
//	}
	clearTimeout(menutimer);
	if(currentMenu && currentMenu != Id){ hideLayer(currentMenu); }
    showLayer(sender, Id);
	currentMenu = Id;
}

function hideLayer(Id){


    
	if (document.all) {
//		document.all[Id].style.visibility = "hidden";
		document.all[Id].style.display = 'none';
	} else if (document.layers){
		document.layers[Id].display = 'none';
	} else if (document.getElementById){
		document.getElementById(Id).style.display = 'none';
	}


}

function divHeight(name) {
   if (document.layers) return eval('document.'+name+'.document.height')
   if (document.all) return eval('document.all.'+name+'.offsetHeight')
   return document.getElementById(name).offsetHeight
}

function divTop(name) {
   if (document.layers){
  	x = document.topTabell.document.top; + document.layers['Main'+GetName(name)].ducument.top + document.midTabell.ducument.top;
  	x += document.layers[name].top + 2;
  	return x;
   }
   if (document.all){
    x = document.all.midTabell.offsetTop + document.all.midTabell.offsetHeight;
    x += document.all[name].offsetHeight + 12 + 6;
  	return x;
   }
  	x = document.getElementById('topTabell').offsetTop + document.getElementById('Main'+GetName(name)).offsetTop + document.getElementById('midTabell').offsetTop;
  	x += document.getElementById(name).offsetTop + 2;
  	return x;
}

function divLeft(Id) {
   if (document.layers){
  	x = document.topTabell.document.left + 198;// + document.tabell.ducument.left + 198;
  	x += document.layers[Id].left + 2;
  	return x;
   }
   if (document.all){
//	alert(Id);
//  	x = document.all.midTabell.offsetLeft;
  	x = document.all.topTabell.offsetLeft;
  	x += document.all.MenuTabell.offsetLeft + 162;// + document.all.tabell.offsetLeft + 198;

  	x += document.all[Id].offsetLeft;
//  	y = document.all[Id].offsetLeft + 2;
//	alert(t + ' ' + v + ' ' + l + ' ' + y);
  	return x;
   }
  	x = document.getElementById('topTabell').offsetLeft + 198;// + document.getElementById('tabell').offsetLeft + 198;
  	x += document.getElementById(Id).offsetLeft + 2;
  	return x;
}

function moveLayerAbs(Id,x,y){
//	alert(Id + ' - X: ' + x + ' Y: ' + y);
	if (document.all){
		document.all[Id].style.left = x;
		document.all[Id].style.top = y;
	} else if (document.layers){
		document.layers[Id].left = x;
		document.layers[Id].top = y;
	} else if (document.getElementById){
		document.getElementById(Id).style.left = x+'px';
		document.getElementById(Id).style.top = y+'px';
	}
}



