var glt;
var gll;

function resize(){
  if ((screen.width >800) && (screen.height > 600)) {

     var x,y;
     if (self.innerHeight) 
     {
	x = self.innerWidth;
	y = self.innerHeight;
     }
     else if (document.documentElement && document.documentElement.clientHeight)
     {
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
     }
     else if (document.body) // other Explorers
     {
	x = document.body.clientWidth;
	y = document.body.clientHeight;
     }
     else if( typeof( window.innerWidth ) == 'number' ) {
        x = window.innerWidth;
        y = window.innerHeight;}

     var dom = document.getElementById("main");
     var dom1 = document.getElementById("mike");

     var mlr = Math.round((x - 756)/2);
     var mtb = Math.round((y - 536)/2);
     
     dom.style.position = 'absolute';
     dom.style.left = mlr +'px';
     dom.style.top = (mtb - 10) + 'px';
     dom.style.margin_top = mtb + 'px';

      glt = mtb;
      gll = mlr;

  }
}


function openWindow(temp){
    dom = document.getElementById(temp);
    if(dom.id == "menu1")
      window.open("http://www.rbg.ca")
    if(dom.id == "menu4")
      window.open("http://www.rbg.ca/pages/events.html")
   }  


function  visible(id){
   idc = "c" + id;
   idt = "t" + id;
   var domc = document.getElementById(idc).style;
   var domt = document.getElementById(idt).style;
   domc.top = glt + 121 + "px";
   domc.left = gll + 313 + "px";
   domt.top = glt + 318 + "px";
   domt.left = gll + 56 + "px";

   document.getElementById("c0").style.visibility = "hidden";
   domc.visibility = "visible";
   domt.visibility = "visible";
   }
   
function hidden(id) {
  idc = "c" + id;
   idt = "t" + id;

  var domc = document.getElementById(idc);
  var domt = document.getElementById(idt);
  domc.style.visibility = "hidden";
  domt.style.visibility = "hidden";
  document.getElementById("c0").style.visibility = "visible";
}