jQuery.jPrintArea = function(el) {

	var iframe = document.createElement('IFRAME');
	var doc = null;

	$(iframe).attr('style','position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
	document.body.appendChild(iframe);

	doc=iframe.contentWindow.document;

	// get the stylesheet for the print
	var links = window.document.getElementsByTagName('link');
	var stylesheetURL;

	for (var i=0;i<links.length;i++) {
		if (links[i].rel.toLowerCase()=='stylesheet' && links[i].media.toLowerCase()=='print') {
			stylesheetURL = links[i].href;			
		}
	}

	// set the stylesheet
	doc.write('<link type="text/css" rel="stylesheet" href="'+stylesheetURL+'" media="print"></link>');
	doc.write('<div class="'+$(el).attr("class")+'">'+$(el).html()+'</div>');
	doc.close();

	iframe.contentWindow.focus();
	iframe.contentWindow.print();

	alert('Printing...');

	document.body.removeChild(iframe);
}