text: (function(e){function t(e,t){t&&e.append(t.jquery?t.clone():t)}function n(t,n,a){var i=n.clone();a.removeScripts&&i.find("script").remove(),a.printContainer?t.append(e("<div/>").html(i).html()):i.each(function(){t.append(e(this).html())})}var a;e.fn.printThis=function(i){a=e.extend({},e.fn.printThis.defaults,i);var o=this instanceof jQuery?this:e(this),r="printThis-"+(new Date).getTime();if(window.location.hostname!==document.domain&&navigator.userAgent.match(/msie/i)){var s='javascript:document.write("<head><script>document.domain=\\"'+document.domain+'\\";</script></head><body></body>")',c=document.createElement("iframe");c.name="printIframe",c.id=r,c.className="MSIE",document.body.appendChild(c),c.src=s}else{var d=e("<iframe id='"+r+"' name='printIframe' />");d.appendTo("body")}var l=e("#"+r);a.debug||l.css({position:"absolute",width:"0px",height:"0px",left:"-600px",top:"-600px"}),setTimeout(function(){function i(e,t){var n,a;n=e.get(0),n=n.contentWindow||n.contentDocument||n,a=n.document||n.contentDocument||n,a.open(),a.write(t),a.close()}a.doctypeString&&i(l,a.doctypeString);var r,s=l.contents(),c=s.find("head"),d=s.find("body"),p=e("base");r=a.base===!0&&p.length>0?p.attr("href"):"string"==typeof a.base?a.base:document.location.protocol+"//"+document.location.host,c.append('<base href="'+r+'">'),a.importCSS&&e("link[rel=stylesheet]").each(function(){var t=e(this).attr("href");if(t){var n=e(this).attr("media")||"all";c.append("<link type='text/css' rel='stylesheet' href='"+t+"' media='"+n+"'>")}}),a.importStyle&&e("style").each(function(){e(this).clone().appendTo(c)}),a.pageTitle&&c.append("<title>"+a.pageTitle+"</title>"),a.loadCSS&&(e.isArray(a.loadCSS)?jQuery.each(a.loadCSS,function(e,t){c.append("<link type='text/css' rel='stylesheet' href='"+this+"'>")}):c.append("<link type='text/css' rel='stylesheet' href='"+a.loadCSS+"'>"));var h=a.copyTagClasses;if(h&&(h=h===!0?"bh":h,h.indexOf("b")!==-1&&d.addClass(e("body")[0].className),h.indexOf("h")!==-1&&s.find("html").addClass(e("html")[0].className)),t(d,a.header),a.canvas){var m=0;o.find("canvas").each(function(){e(this).attr("data-printthis",m++)})}if(n(d,o,a),a.canvas&&d.find("canvas").each(function(){var t=e(this).data("printthis"),n=e('[data-printthis="'+t+'"]');this.getContext("2d").drawImage(n[0],0,0),n.removeData("printthis")}),a.formValues){var f=o.find("input");f.length&&f.each(function(){var t=e(this),n=e(this).attr("name"),a=t.is(":checkbox")||t.is(":radio"),i=s.find('input[name="'+n+'"]'),o=t.val();a?t.is(":checked")&&(t.is(":checkbox")?i.attr("checked","checked"):t.is(":radio")&&s.find('input[name="'+n+'"][value="'+o+'"]').attr("checked","checked")):i.val(o)});var u=o.find("select");u.length&&u.each(function(){var t=e(this),n=e(this).attr("name"),a=t.val();s.find('select[name="'+n+'"]').val(a)});var v=o.find("textarea");v.length&&v.each(function(){var t=e(this),n=e(this).attr("name"),a=t.val();s.find('textarea[name="'+n+'"]').val(a)})}a.removeInline&&(e.isFunction(e.removeAttr)?s.find("body *").removeAttr("style"):s.find("body *").attr("style","")),t(d,a.footer),setTimeout(function(){l.hasClass("MSIE")?(window.frames.printIframe.focus(),c.append("<script>  window.print(); </script>")):document.queryCommandSupported("print")?l[0].contentWindow.document.execCommand("print",!1,null):(l[0].contentWindow.focus(),l[0].contentWindow.print()),a.debug||setTimeout(function(){l.remove()},1e3)},a.printDelay)},333)},e.fn.printThis.defaults={debug:!1,importCSS:!0,importStyle:!1,printContainer:!0,loadCSS:"",pageTitle:"",removeInline:!1,printDelay:333,header:null,footer:null,formValues:!0,canvas:!1,base:!1,doctypeString:"<!DOCTYPE html>",removeScripts:!1,copyTagClasses:!1}})(jQuery);