function replace_menu_button(objImg){
	var arr = objImg.name.split("_");
	if(arr.length == 2){
		objImg.src = "images/" + arr[0] + ".jpg";
		objImg.name = arr[0];
		} else {
		objImg.src = "images/" + objImg.name + "_black.jpg";
		objImg.name = objImg.name + "_black";
	}
	return;
}

function load_picture(objAnchor){
	
	//Get picture name
	var objImg = objAnchor.firstChild;
	var picNameStartPos = objImg.src.lastIndexOf("/") + 1;
	var pictureName = objImg.src.substr( picNameStartPos, objImg.src.length - picNameStartPos );
	
	var objDiv = document.getElementById("picture");
	var objDivShader = document.getElementById("shader");
	var objPicture = document.getElementById("large_picture");

	objDiv.style.visibility = "visible";
	objDivShader.style.visibility = "visible";
	
	//Load picture	
	var pic = new Image();	
	pic.onload = function(){
		//Set correct width/height on picture DIV
		
		objDiv.style.width = pic.width + "px";
		objDiv.style.height = pic.height + "px";
		objDiv.style.marginLeft = "-" + ( Math.round(pic.width/2) ) + "px"; 
		objDiv.style.marginTop = "-" + ( Math.round(pic.height/2) ) + "px";
		
		//Show picture
		objPicture.src = pic.src;
	}
	
	pic.src = "images/pics/" + pictureName;
	
}


function hide_picture(){
	document.getElementById("picture").style.visibility = "hidden";
	document.getElementById("shader").style.visibility = "hidden";
}


function get_window_width(){ 
	var viewportwidth;
	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	 if (typeof window.innerWidth != 'undefined')
	 {
		  viewportwidth = window.innerWidth;
	 }
	 
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

	 else if (typeof document.documentElement != 'undefined'
		 && typeof document.documentElement.clientWidth !=
		 'undefined' && document.documentElement.clientWidth != 0)
	 {
		   viewportwidth = document.documentElement.clientWidth;
	 }
	 
	 // older versions of IE
	 
	 else
	 {
		   viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
	 }
	 
	 return viewportwidth;
 }
 
 function get_window_height(){ 
	var viewportheight;
	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	 if (typeof window.innerWidth != 'undefined')
	 {
		  viewportheight = window.innerHeight;
	 }
	 
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

	 else if (typeof document.documentElement != 'undefined'
		 && typeof document.documentElement.clientWidth !=
		 'undefined' && document.documentElement.clientWidth != 0)
	 {
		   viewportheight = document.documentElement.clientHeight;
	 }
	 
	 // older versions of IE
	 
	 else
	 {
		   viewportheight = document.getElementsByTagName('body')[0].clientHeight;
	 }
	 
	 return viewportheight;
 }
 