function loadPopup(popupPage){
  new Ajax.Request(popupPage, {
    onSuccess: function(transport) {
      $('inner-html').update(transport.responseText);
    }
  });
}

function showPopup(popupPage){
  if (!$('popup').visible()){
    loadPopup(popupPage);
    $('overlay').show();
    $('popup').show();
  }
  return false;
}

function hidePopup(){
  if ($('popup').visible()){
    $('popup').hide();
    $('overlay').hide();
  }
}

function openpop(command) {
  switch (command)
  {
    case 'bt_01':
    showPopup('stepsurf.html');
    break;
    case 'bt_02':
    showPopup('stepwork.html');
    break;
    case 'bt_03':
    showPopup('stepcommunicate.html');
    break;
    case 'bt_04':
    showPopup('stepplay.html');
    break;
    case 'bt_05':
    showPopup('stepbuy.html');
    break;
    case 'bt_06':
    showPopup('stepdownload.html');
    break;
    case 'bt_07':
    showPopup('stepprotect.html');
    break;
  }
}

function openCenteredPopup(theURL,winName,width,height,features) {
  var w = screen.width;
  var h = screen.height;

  if(window.screen){
    ratio_x=(width/w)*100;
    ratio_y=(height/width)*100;
    win_x=(screen.width*ratio_x)/100;
    win_y=(win_x*ratio_y)/100;
    x=(screen.width-win_x)/2;
    y=(screen.height-win_y)/2;
  }else{
    x=0;
    y=0;
    win_x=w;
    win_y=y;
  }
  winfeatures=("top="+y+",left="+x+",width="+win_x+",height="+win_y+","+features);
  window.open(theURL,winName,winfeatures);
}
