

function externalLinks() {
  if (!document.getElementsByTagName) return; 
  var anchors = document.getElementsByTagName("a"); 
  for (var i=0; i<anchors.length; i++) { 
    var anchor = anchors[i]; 
    if (anchor.getAttribute("href") && 
    anchor.getAttribute("rel") == "external") 
    anchor.target = "_blank";
  } 
} 
window.onload = externalLinks;



function setSection(section_given) {
	var section = document.getElementById(section_given);
	section.attributes.id.value = "current";
	// check if its a about biocase page. then highlight what_is_biocase as well
	if (section_given.length > 14 && section_given.substr(0,14) == "whats_biocase_"){
	    var what = document.getElementById('whats_biocase');
	    what.attributes.id.value = "current";
		if (section_given.length > 23 && section_given.substr(0,23) == "whats_biocase_unit_net_"){
			var what = document.getElementById('whats_biocase_unit_net');
			what.attributes.id.value = "current";
		}
		if (section_given.length > 23 && section_given.substr(0,23) == "whats_biocase_meta_net_"){
			var what = document.getElementById('whats_biocase_meta_net');
			what.attributes.id.value = "current";
		}
	}

	// check if its a products page. then highlight products as well
	if (section_given.length > 9 && section_given.substr(0,9) == "products_"){
	    var products = document.getElementById('products');
	    products.attributes.id.value = "current";
		if (section_given.length > 17 && section_given.substr(0,17) == "products_portals_"){
			var products = document.getElementById('products_portals');
			products.attributes.id.value = "current";
		}
		if (section_given.length > 22 && section_given.substr(0,22) == "products_geo_services_"){
			var products = document.getElementById('products_geo_services');
			products.attributes.id.value = "current";
		}
	}
}

