/**
 * Debug Class
 * @author Eugene Song
 */
;(function($) {
    
    /*
    $("#debugContainer").hide().live('click', function() {
        $(this).fadeOut();
    });
    */
	$.fn.debug = function(){
        $(this).wrap('<span class="debug ui-icon ui-icon-wrench"></span>')
        .parents("span.debug")
        .click(function() {
        
            //$("#debugContainer").show().html($(this).html());
            
            $("#debugContainer").dialog('open').html($(this).html());

        });
        
        /*
        .hover(function() {
            var newWindow = window.open('', "debug", "location=0,width=600,height=650,scrollbars=1,resizable=1,toolbar=0,menubar=0");
            newWindow.document.write($(this).html());
            newWindow.document.title = 'Squid Debug Window';
            newWindow.document.close();
        });
        */
	};
    
    /*
	$.fn.debug = function(){
        this.each(function() {
            var container = $(this).before('<span class="debug ui-icon ui-icon-squaresmall-plus"></span>');

            $(this).siblings("span.debug").click(function(){
                $(this).toggleClass("ui-icon-squaresmall-plus").toggleClass("ui-icon-squaresmall-minus");
                $(container).toggle();
            });
        });
	};
	*/
    
})(jQuery);