function showFrame()
{
   if (document.getElementById)
   {
      document.getElementById("bm_div").style.visibility ='visible';
   }
   else
   {
      if (document.layers)
      {
         document.bm_div.visibility = 'visible';
      }
      else
      {
         document.all.bm_div.style.visibility = 'visible';
      }
   }
}

function hideFrame()
{
   if (document.getElementById)
   {
      document.getElementById("bm_div").style.visibility ='hidden';
   }
   else
   {
      if (document.layers)
      {
         document.bm_div.visibility = 'hidden';
      }
      else
      {
         document.all.bm_div.style.visibility = 'hidden';
      }
   }
}

function center(a, b)
{
   if( self.innerHeight )
   {
      var x = self.innerWidth;
      var y = self.innerHeight;
   }
   else if( document.body )
   {
      var x = document.body.clientWidth;
      var y = document.body.clientHeight;
   }
   else if( document.documentElement.clientWidth && document.documentElement.clientHeight )
   {
      var x = document.documentElement.clientWidth;
      var y = document.documentElement.clientHeight;
   }
   if (document.getElementById)
   {
      var bm_popup = document.getElementById('bm_div');
   }
   else 
   {
      if (document.layers)
      {
         var bm_popup = document.bm_div;
      }
      else 
      {
         var bm_div = document.all.bm_div;
      }
   }
   var surwidth = 426;//fixed as chrome and safari were reading the width and height wrong
   var surheight = 492;
   x = (x-surwidth)/2;
   y = (y-surheight)/2;
   var a1 = x+a;
   var b1 = y+b;
   bm_popup.style.left = a1 + 'px' ;
   bm_popup.style.top = b1 + 'px' ;
}

function bmGetCookie(name) {
   var nameEQ = name + "=";
   var ca = document.cookie.split(';');
   for(var i=0;i < ca.length;i++) {
      var c = ca[i];
      while (c.charAt(0)==' ') c = c.substring(1,c.length);
      if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
   }
   return null;
}

function bmSetCookiePerm(name, val) {
   var value = "true";
   if (val)
      value = val;
   var days = 90;
   var date = new Date();
   date.setTime(date.getTime()+(days*24*60*60*1000));
   var expires = "; expires="+date.toGMTString();
   document.cookie = name+"="+value+expires+"; path=/";
}

