/**
 * The PopupWindowsElement deals with all jTab tabs in Nemo2
 * 
 * @author Felix Geisendörfer <felix@fg-webdesign.de>
 * @version 1.0
 * @package Nemo2
 */
var JPopupElement = new function() 
{
    // A reference to self in order to not loose scope
    var self = this;
    
    // The Events this class listens to
    this.Events = 
    {
        // This function is triggered when the DOM has loaded an is ready for manipulation
        domReady: function()
        {
            // Call the domUpdated function (context defaults to document)
            self.Events.domUpdated();
        }
        
        // This function is triggered when the DOM was updated and is ready for manipulation
        , domUpdated: function(updateScope)
        {
            // The updateScope defaults to document
            updateScope = updateScope || document;
			
			jQuery('a.jpopup-link', updateScope).unbind('click').bind('click', function()
			{
				var settings = jCake.unescapeJsonAttribute( jQuery(this).attr('rel') );
				jQuery().jPopup(settings);
				return false;
            });
        }
    }    
}

