var sfBrik = {

  // Attributes
  _settings : new Array(),

  // Initial actions
  init : function() {
    var t = this;
  },
  
  /**
   * Initial actions when DOM is ready
   */
  initOnDomReady : function() {
    var t = this;
    // Active and display full size images from the medialibrary in the CMS
    /*jQuery('.slot_inner_content img').css({'cursor':'pointer'}).click(function(){
      var src = jQuery(this).attr('src');
      var title = jQuery(this).attr('alt');
      var pos1 = src.lastIndexOf('/thumbs/');
      var pos2 = src.lastIndexOf('/', src.length-pos1);
      var new_src = src.substr(0, pos1);
      new_src += '/files'+src.substr(pos2, src.length);
      var new_img = document.createElement('img');
      jQuery(new_img)
        .attr('src',new_src)
        .attr('width',new_img.width)
        .attr('height',new_img.height)
        .attr('alt',title);
      jQuery(new_img).dialog({
        dialogClass: 'sfBrikDialog',
        height: jQuery(new_img).height(),
        modal: true,
        title: title,
        width: jQuery(new_img).width(),
        close: function(){
          jQuery(this).dialog('destroy').remove();
        }
      });
    });*/
  },
  
  // Get or Set a variable
  val : function(k,v){
    var t = this;
    if (!v){
      return t._settings[k];
    }
    else {
      return t._settings[k] = v;
    }
  },

  // Return a count of the settings
  countSettings : function(e){
    var t = this, i = 0;
    for (k in t._settings){
      i++;
    }
    return i;
  },

  // Return an alert with all the settings
  getSettings : function(e){
    var t = this, a = 'ALL SETTINGS :\n';
    for (k in t._settings){
      a += '- '+k+' = '+t._settings[k]+'\n';
    }
    alert(a);
  },

  // Create or load a dialog box
  dialog: function(a){
    // String a : ID or class of the element to display
    var t = this, z;

    if(a){
      z = jQuery('<div class="sfBrikCMS-dialog"></div>').appendTo('body');
    }
    else{
      z = jQuery(a);
    }
    
  }
}

// Init now
sfBrik.init();
// OnLoad
jQuery(document).ready(function(){
  sfBrik.initOnDomReady();
});


/* OLD */
function popupOnLoad()
{
  var i_w = jQuery("#popup_image").width;
  var i_h = jQuery("#popup_image").height;
  jQuery("#popup_container").css({
    'height' : i_h+"px",
    'width' : i_w+"px"
  });
  window.resizeTo(i_w+15,i_h+45);
}

function isReal(myVar) {
  if ((typeof(myVar) != 'undefined') && (myVar != null))
    return true;
  else
    return false;
}

// clock
var clock_time_id = null;
var hour = null;
var minute = null;
var seconde = null;

// headlineNavigation
var block_mainNavigation = null;
var block_navigation = null;
var block_class_control = null;
var block_class_target = null;

// userInfo
var block_userInfo = null;

// fontSize
var fontSize = null;
var fontSizeList = null;

