 // Create a jquery plugin that prints the given element.
 jQuery.fn.print = function(){
 // NOTE: We are trimming the jQuery collection down to the
 // first element in the collection.
 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 strFrameName = ("printer-" + (new Date()).getTime());
  
 // Create an iFrame with the new name.
 var jFrame = $( "<iframe name='" + strFrameName + "'>" );
  
 // Hide the frame (sort of) and attach to the body.
 jFrame
 .css( "width", "1px" )
 .css( "height", "1px" )
 .css( "position", "absolute" )
 .css( "left", "-9999px" )
 .appendTo( $( "body:first" ) )
 ;
  
 // Get a FRAMES reference to the new frame.
 var objFrame = window.frames[ strFrameName ];
  
 // Get a reference to the DOM in the new frame.
 var objDoc = objFrame.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 = $( "<div>" ).append(
 $( "style" ).clone()
 );
  
 // Write the HTML for the document. In this, we will
 // write out the HTML of the current element.
 objDoc.open();
 objDoc.write( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" );
 objDoc.write( "<html>" );
 objDoc.write( "<body>" );
 objDoc.write( "<head>" );
 objDoc.write( "<title>" );
 objDoc.write( document.title );
 objDoc.write( "</title>" );
 objDoc.write( "<style>" );
 objDoc.write( "body { font-family: Arial, Helvetica, sans-serif; color:#646464; }" );
 objDoc.write( ".koloms { overflow: hidden; margin-bottom: 15px; font-size: 12px; line-height: 18px; }" );
 objDoc.write( ".koloms div { border-bottom: 1px solid #EEE; padding: 0px 0px 10px 0px; margin: 0px 15px 10px 0px; }" );
 objDoc.write( ".koloms div h4{ text-transform: uppercase; margin: 0px 0px 5px 0px; }" );
 objDoc.write( ".koloms div h5{ font-weight: bold; margin: 0px 0px 5px 0px; }" );
 objDoc.write( ".koloms div table { width: 100%; }" );
 objDoc.write( ".koloms div td.label { font-style: italic; width: 200px; }" );
 objDoc.write( ".koloms div td { padding: 0px 2px 0px 0px; }" );
 objDoc.write( ".koloms div#mainimage { float: left; width: 250px; border-bottom: 0px solid #EEE; padding: 0px; margin: 0px 0px 5px 0px; }" );
 objDoc.write( ".koloms div#mainimage img { width: 250px;  }" );
 objDoc.write( ".koloms div.general { width: 330px; border-bottom: 0px solid #EEE; float: right; }" );
 objDoc.write( ".koloms div.general td.label { width: 120px; }" );
 objDoc.write( ".koloms .galleryimg { width: 250px; margin: 0px 2px 5px 0px; }" );
 objDoc.write( ".clearer { clear: both; }" );
 objDoc.write( "</style>" );
 objDoc.write( jStyleDiv.html() );
 objDoc.write( "</head>" );
 objDoc.write( "<body>" ); 
 objDoc.write( '<table style="font-size: 12px; font-family: arial;" cellspacing=5><tr><td rowspan=6><img width=217 height=60px hspace=20 src="http://www.sqzi-websites.nl/huizinga-snijder/wp-content/themes/huizinga-en-snijder/images/huizinga-en-snijder.png" /></td></tr><tr><td width=150><strong>Correspondentieadres:</strong></td><td><strong>Kantoor:</strong></td></tr><tr><td>Postbus 3040</td><td>Boelewerf 44</td></tr><tr><td>2980 DA Ridderkerk</td><td>2987 VE Ridderkerk</td></tr><tr><td>Tel: +31 180 - 487 508</td><td>E-mail: info@huizinga-snijder.nl</td></tr><tr><td>Fax: +31 180 - 487 504</td><td>Internet: www.huizinga-snijder.nl</td></tr></table>' ); 
 objDoc.write( this.html() );
 objDoc.write( "</body>" );
 objDoc.write( "</html>" );
 objDoc.close();
  
 // Print the document.
 objFrame.focus();
 objFrame.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)
 );
 }

