//Jquery print function
var jqprintpage={
	
	gAutoPrint:true,
	
	init:function(conf){
		
		$(document).ready(function(){
								   
				$("#printimage").click( function() {
						jqprintpage.printPage();	
				});
								   
		});
	},
	
	printPage:function() {
		if (document.getElementById != null)
		{
			var html = '<html>\n<head>\n';
			
			html += $("head").html();
			
				
			html += '\n</he' + 'ad>\n<body style="margin:15px">\n';
			
			
			if ($("#printcontent").html() != null) {
				html += $("#printcontent").html();
			} else {
				if ($("#innercontent").html() != null) {
					html += $("#innercontent").html();
				}
			}
												
			html += '\n</bo' + 'dy>\n</ht' + 'ml>';
			
			var printWin = window.open("","printSpecial");
			if ($.browser.msie==true) {
			  printWin.document.open();	
			}
				printWin.document.write(html);
			if ($.browser.msie==true) {
				printWin.document.close();
			}
			if (jqprintpage.gAutoPrint) {
				printWin.print();
			}
		}
		
	}
}

jqprintpage.init();

