    // Create a jquery plugin that prints the given element.
            jQuery.fn.hardyprint = function(){

            if (this.size() > 1){
            this.eq( 0 ).print();
            return;
            } else if (!this.size()){
            return;
            }

            // ASSERT: At this point, we know that the current jQuery
            // collection (as defined by THIS), contains only one
            // printable element.

            // Create a random name for the print frame.
            var frm_name = ("printer-" + (new Date()).getTime());

            // Create an iFrame with the new name.
            jQuery( "<iframe name='" + frm_name+ "'>" )
            .css( "width", "1px" )
            .css( "height", "1px" )
            .css( "position", "absolute" )
            .css( "left", "-9999px" )
            .appendTo( jQuery( "body" ) )
            ;

            // Get a FRAMES reference to the new frame.
            var obj_frame = window.frames[frm_name];
            //console.log(obj_frame);
            // Get a reference to the DOM in the new frame.
            var obj_doc = obj_frame.document;

            // Grab all the style tags and copy to the new
            // document so that we capture look and feel of
            // the current document.

            // Create a temp document DIV to hold the style tags.
            // This is the only way I could find to get the style
            // tags into IE.
            //var jStyleDiv = jQuery('#printable').html();
            
            var jStyleDiv = jQuery( "<div>" ).append(
            jQuery( "style" ).clone()
            );

            // Write the HTML for the document. In this, we will
            // write out the HTML of the current element.
            obj_doc.open();
            obj_doc.write( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" );
            obj_doc.write( "<html>" );
            obj_doc.write( "<body>" );
            obj_doc.write( "<head>" );
            obj_doc.write( "<title>" );
            obj_doc.write( document.title );
            obj_doc.write( "</title>" );
            obj_doc.write( jStyleDiv);
            obj_doc.write( "</head>" );
            obj_doc.write( this.html() );
            obj_doc.write( "</body>" );
            obj_doc.write( "</html>" );
            obj_doc.close();

            // Print the document.
            obj_frame.focus();
            obj_frame.print();

            // Have the frame remove itself in about a minute so that
            // we don't build up too many of these frames.
            setTimeout(
            function(){
            jFrame.remove();
            },
            (60 * 1000)
            );
            };
