
  function closeGallery(){
  document.getElementById("gallery").style.display="none";
  document.getElementById("overlay").style.display="none"; 	  
  }
  
  function adjustOverlay(){
  document.getElementById("overlay").style.width=document.body.clientWidth+"px";
  document.getElementById("overlay").style.height=document.body.clientHeight+"px";
  document.getElementById("overlay").style.top=0+document.body.scrollTop+"px";
  document.getElementById("overlay").style.left=0+document.body.scrollLeft+"px";
  }
  
  
  
  function showGallery(w,h,content) {	  
  document.getElementById("gallery").style.width=w+"px";
  document.getElementById("gallery").style.height=h+"px";
  var x=(document.body.clientWidth-w)/2;
  if (x<0) {document.getElementById("gallery").style.left=0;}
  else {document.getElementById("gallery").style.left=x+"px";}
  var y=(document.body.clientHeight-h)/2;
  if (y<0) {document.getElementById("gallery").style.top=0;}
  else {document.getElementById("gallery").style.top=y+"px";}
  document.getElementById("gallery").style.display="block";
  document.getElementById("overlay").style.display="block";
  document.getElementById("gallery").innerHTML=galleryContent[content];
  if (navigator.appName == "Microsoft Internet Explorer")
    {adjustOverlay();
	document.getElementById("gallery").style.top=y+document.body.scrollTop+"px";
	}	
  }
  
  function adjustGallery(){
  document.getElementById("gallery").style.left=((document.body.clientWidth-parseInt(document.getElementById("gallery").style.width))/2)+"px";
  document.getElementById("gallery").style.top=((document.body.clientHeight-parseInt(document.getElementById("gallery").style.height))/2)+"px";
  }
  
  
  window.onkeyup = function closeGalleryEsc(event) {
  if (event.keyCode==27) {closeGallery();}
  }
  

 if (navigator.appName == "Microsoft Internet Explorer")
  {window.onscroll=adjustOverlay;
  window.onresize=adjustOverlay;
}
  else {window.onresize=window.onscroll=adjustGallery;}
  
 function preloadPicture() { 
 picture = new Image();
 picture.src="img/menu_img/menu_bg1.gif";
 }
 
 preloadPicture();
 
 function highlightLink(obj){
 document.getElementById(obj).style.color="#FF0000"; 	 
 }
 
 function highlightLink2(obj) {
 document.getElementById(obj).style.color="#000000";
 }
 
 function changeMenuBg(obj) {
 document.getElementById(obj).style.background="url(img/menu_img/menu_bg1.gif)";
 }
 function changeMenuBg1(obj) {
 document.getElementById(obj).style.background="url(img/menu_img/menu_bg.gif)";
 }
 
 function changeMenuText(obj) {
 document.getElementById(obj).style.color="#41484D";
 }
 function changeMenuText1(obj) {
 document.getElementById(obj).style.color="#FFFFFF";
 }
 
	 
