// start create target blank from class="blank"

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 (/nolink/.exec(links[i].href)) {
			links[i].onclick = linkinfo;
		}
	}
}
function linkinfo() {
	alert('Denna länk är inte aktiv i prototypen.');
	return false;
}
addEvent(window, 'load', getlinks);


function menumouseover() {
//menu IE fix
	var divArr = document.getElementById('nav').document.getElementsByTagName('li');
	for (var i = 0; i < divArr.length; i++) {
		if(divArr[i].className!='sel'){
			divArr[i].onmouseover=function() {
				this.className='sel';
			}
			divArr[i].onmouseout=function() {
				this.className='';
			}
		}
	}

//drop-down IE fix
	navRoot = document.getElementById('dropdown');
	if(navRoot!=null){
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=='LI') {
				node.onmouseover=function() {
					this.className+=' over';
				}
				node.onmouseout=function() {
					this.className=this.className.replace(' over', '');
				}
			}
		}
	}
}
var agt=navigator.userAgent.toLowerCase();
if((agt.indexOf("msie")!=-1)&&(window.attachEvent)){
addEvent(window, 'load', menumouseover);
}

function showregion(){
	iover = false;
	document.getElementById('region-list').style.display = 'block';
}

function hideregion(){
	iover = true;
	window.setTimeout("hidereg();",150); // delay hide
}

function hidereg(){
	if(iover){
	document.getElementById('region-list').style.display = 'none';
	}
}

	function visakommun(url, obj) {
	    if (obj.selectedIndex == 0)
	        {
		top.location.href = url
		    }
		else
		    {
		top.location.href = url + 'kommun/' + obj.options[obj.selectedIndex].text +'/';
		    }
		}

