/**
 * Javascript file with all the layer functionality
 * abacho.de might need.
 * To show the layer, this script uses the jQuery plugin jmpopups
 * More information on: http://code.google.com/p/jmpopups/
 *
 * @author Martin Albrecht <martin.albrecht@javacoffee.de>
 * @version 0.1
 */
 
/**
 * Show a layer
 * @param <string> layer The layer URL
 * @param <int> w Width of the layer
 * @param <string> n Name of the layer (important for closing)
 */
function abacho_show_layer(layer, w, n) {
  if( typeof w === 'undefined' || w <= 0 ) {
    w = 300;
  }  
  if( typeof n === 'undefined' || n <= 0 ) {
    n = 'unnamed-layer';
  }

  if( typeof layer !== 'undefined' || layer.length > 0 ) {        
    jQuery.setupJMPopups({
      screenLockerOpacity : "0.8"
    });
    
    jQuery.openPopupLayer({
      name: n,
      width: w,
      url: layer,
      success: function() {
          translator_editor_init();
          jQuery('#econa-trans-openbtn').show();
      },
      beforeClose: function() {
        abacho_close_layer();                          
      }
    });    
    //jQuery('#popupLayerScreenLocker').live('click', function() { alert("HOOKED");return false; });   
  }
  return false;
}


/**
 * Close a layer window
 */
function abacho_close_layer(n) {
  if( typeof n !== 'undefined' && n.length > 0 ) {
  }  
  return false;
}


