//HOVER EFFEKT PÅ LAGER
function hover(id){
	document.getElementById(id).style.opacity = 0.8;//FF
	document.getElementById(id).style.filter='alpha(opacity=80)';//IE
}
function hoverOut(id){
	document.getElementById(id).style.opacity = 1.0;//FF
	document.getElementById(id).style.filter='alpha(opacity=100)';//IE
}

//ÖPPNAR NYTT FÖNSTER
var new_win_i = 0;
function openWindow(url, width, height){
	new_win_i++;
	var attr = "directories=no,location=no,menubar=no,scrollbars=yes,status=no,resizable=yes,toolbar=no,width="+width+",height="+height;
	setHighlightWindow = window.open(url, "newWindow"+new_win_i, attr);
}

function addEvent(obj, evType, fn) {
	if (obj.addEventListener) {
		obj.addEventListener(evType, fn, true);
		return true;
	} else if (obj.attachEvent) {
		var r = obj.attachEvent("on"+evType, fn); 
		return r;
	} else {
		return false;
	}
}

function getlinks() {
	var links = document.getElementsByTagName('A');
	for (var i = 0; i < links.length; i++) {
		if (links[i].className == 'new'){
			links[i].onclick = linkinfo;
		}
	}
}

function linkinfo(oLnk) {
	window.open(this);
	return false;
}

addEvent(window, 'load', getlinks);



function openBrWindow(theURL,winName,features) { 
	window.open(theURL,winName,features);
	return false;
}

//UNDERMENY
function show_submenu(id){
	document.getElementById(id).style.display = "block";
}
function hide_submenu(id){
	document.getElementById(id).style.display = "none";
}

//MAX ANTAL TECKEN I ETT SKRIVFÄLT
function max_chars(id){
	var str = document.getElementById(id).value;
	if(str.length>100){
		document.getElementById(id).value = str.substring(0,100);
	}
}

