
navHover = function() {
    var lis = document.getElementById("navigation").getElementsByTagName("LI");
    for (var i=0; i<lis.length; i++) {
        lis[i].onmouseover=function() {
            this.className+=" iehover";
        }
        lis[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" iehover\\b"), "");
        }
    }
}

if (window.attachEvent) window.attachEvent("onload", navHover);

function open_in_new_window() {
	// Change "_blank" to something like "new_window" to load all links in the same new window
	var new_window = window.open(this.getAttribute('href'), '_blank');
	new_window.focus();
	return false;
}

function get_new_window_links() {
	// Check that the browser is DOM compliant
	if (document.getElementById) {
	  var site_home = document.getElementById('home_page').toString();
	  var last_slash_index = site_home.lastIndexOf('/');
	  site_home = site_home.substring(0, last_slash_index);
		var link;
		var links = document.getElementsByTagName('a');
		for (var i = 0; i < links.length; i++) {
		 link = links[i];
		 full_link_address = link.toString();
		 if (full_link_address.match(site_home) == null
		       && link.getAttribute("href") != "http://www.scandinaviancs.com"
		       && !(/in_same_window/.test(link.getAttribute("class")))) {
       link.onclick = open_in_new_window;
     }
		}
	}
}

window.onload = get_new_window_links;

