// rollover functions for left menu
function hoverOn(element)
{
	var link = document.getElementById('' + element.id+'link');
	
	if(document.all)	//	internet explorer
		setText(link,"#FFFFFF");	
	else
		setClassName(link,"level1linkactive");
		
	setBackground(element,"#407020");
}

function hoverOff(element)
{
	var link = document.getElementById('' + element.id+'link');
	
	if(document.all)	//	internet explorer
		setText(link,"");
	else
		setClassName(link,"level1link");
		
	setBackground(element,"");
	
}	

function setBackground(element,color) {
	element.style.backgroundColor = color;
}

function setText(element, color) {
	element.style.color = color;
}

function setClassName(element, classname) {
	element.className = classname;
}

function openUrl(link) {
	window.location.href = link;

}

function changeURL(link1, link2) {

	parent.menu.location.href = link1;
	parent.edit.location.href = link2;
	
}

function CheckBrowser() {

	if(document.layers) {
		alert("Det finns inte stöd för din webbläsare");
		return false;
	}
	else
		return true;

}

function SetRegion()
{
	// Replacing whitespaces with %20, to be able to support NN4
	
	var selected;
	selected = document.form1.Region.options[document.form1.Region.selectedIndex].value;
	selected = selected.replace(/ /g,'%20');

	window.location.href = "/varlden/adresser.asp?Region=" + selected;
}

function OpenWindow(url, width, height)
{
	window.open(url,'popup','width=' + width + ',height=' + height + ',left=10,top=10,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,status=yes,location=yes,directories=no');
}
