function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

/* Functions to unobtrusively open links in new windows when className is "new-window" */

/* Create the new window */
function openInNewWindow(e) {
	var event;
	if (!e) event = window.event;
	else event = e;
	// Abort if a modifier key is pressed
	if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
		return true;
	}
	else {
		// Change "_blank" to something like "newWindow" to load all links in the same new window
	    var newWindow = window.open(this.getAttribute('href'), '_blank');
		if (newWindow) {
			if (newWindow.focus) {
				newWindow.focus();
			}
			return false;
		}
		return true;
	}
}

/*
Add the openInNewWindow function to the onclick event of links with a class name of "new-window"
*/
function getNewWindowLinks() {
	
	// Check that the browser is DOM compliant
	if (document.getElementById && document.createElement && document.appendChild) {
		// Find all links 
		var links = document.getElementsByTagName('a');
		var link;
		for (var i = 0; i < links.length; i++) {
			link = links[i];
			// Find all links with a class name of "non-html"
			if (/\bnew-window\b/.test(link.className)) {
				// append new window function to onclick & onkeypress events (for accessibility!)
				link.onclick = openInNewWindow;
				link.onkeypress = openInNewWindow;
			}
		}
		objWarningText = null;
	}
}

addLoadEvent(getNewWindowLinks);

/*
GO TO for CONTACT US PAGE
*/

function go_toUrl(){
	if (document.getElementById("selectSites").value != "0"){
		box = document.getElementById("selectSites");
		destination = "contact_us_" + box.options[box.selectedIndex].value + ".html";
		if (destination) location.href = destination;
	}else{
		window.alert("Please select a Country");
	}
}

/*
GO TO for COUNTRY OR OTHER SITE SELECT
*/

function go_toUrlExt(){
	if (document.getElementById("selectSites").value != "0"){
		box = document.getElementById("selectSites");
		destination = box.options[box.selectedIndex].value;
		if (destination) location.href = destination;
	}else{
		window.alert("Please select a Site");
	}
}