toggleMenuClass = function(pointer) {
  
  $(pointer).toggleClass('hover');
  
  if ($(pointer).hasClass('hover'))
    pointer.firstChild.onmouseover();
  else
    pointer.firstChild.onmouseout();
  
  return;
  
}

Viewport_FS = {
  
  screenId: "lock-screen-fs",
  
  init: function() {
    
    $("body").append(
        '<div id="' + this.screenId + '"></div>'
        );
    
  },
  
  lock: function() {
    
    $("#" + this.screenId).css(
        {
            width: $(window).width() + "px",
            height: $(window).height() + "px", 
            display: "block"
            }
        );
    
  },
  
  unlock: function() {
    
    $("#" + this.screenId).css(
        "display",
        "none"
        );
    
  },
  
  resize: function() {
	  
    if ($("#" + this.screenId) && $("#" + this.screenId).css("display") == "block")
      this.lock();
    
  }
  
};

Ajaxbox_FS = {
  
  ajaxboxId: "ajaxbox-fs",
  
  init: function() {
    
    $("body").append(
        '<div id="' + this.ajaxboxId + '"></div>'
        );
    
  },
  
  showFile: function(file, width, height, params) {
    
    this.centerBox(width, height);
    
    this.open();
    
    $.post(
        file,
        params,
        function (response) {
          $("#" + Ajaxbox_FS.ajaxboxId).html(response);
        },
        "html"
        );
    
  },
  
  showContent: function(content, width, height) {
    
    this.centerBox(width, height);
    
    this.open();
    
    $("#" + this.ajaxboxId).html(content);
    
  },
  
  centerBox: function(width, height) {
    
    $("#" + this.ajaxboxId).css(
        {
            left: Math.round(($(window).width() - width) / 2) + "px",
            top: Math.round(($(window).height() - height) / 2) + "px",
            width: width + "px"
            }
        );
    
  },
  
  open: function() {
    
    Viewport_FS.lock();
    
    $("#" + this.ajaxboxId).css(
        "display",
        "block"
        );
    
  },
  
  close: function() {
    
    $("#" + this.ajaxboxId).css(
        "display",
        "none"
        );
    
    Viewport_FS.unlock();
    
  }
  
};

$(document).ready(function() {
      
      Viewport_FS.init();
      Ajaxbox_FS.init();
      
    });