var newimagewindow = false;

	function changeLang(){
		var lang =  document.getElementById("lang");
		var url = window.location.href;
		if(url.indexOf("?") != -1){
			var str = url.indexOf("lang=");
			if(str != -1){
				var suburl = url.substring(0,str);
			} else {
				var suburl = url+"&";
			}
			window.location.href=suburl+"lang="+lang.value;
		} else {
			window.location.href=url+"?lang="+lang.value;
		}
	}
	
function openImageNewWin(url,hoogte,breedte,titel){
	try{
		var debre = 100;
		var dehoo = 100;
		newimagewindow = false;
		if(screen.availWidth){
			debre = screen.availWidth/2-(breedte/2);
		}
		if(screen.availHeight){
			dehoo = screen.availHeight/2-(hoogte/2);
		}
		var arguments = 'width='+breedte+',height='+hoogte+',left='+debre+',top='+dehoo+',resizable=yes';
		newimagewindow = window.open(url,titel,arguments);
	} catch(err) {
		txt="There was an error on this page.\n\n"
		txt+="Error description: " + err.description + "\n\n"
		txt+="Click OK to continue.\n\n"
  		alert(txt)
	}
}


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 gotoUrl(url){
	try{
		window.open(url);
	} catch(err) {
		txt="There was an error on this page.\n\n"
		txt+="Error description: " + err.description + "\n\n"
		txt+="Click OK to continue.\n\n"
  		alert(txt)
	}
}

