function JsPrinter(autoSplit,autoPrint){var autoSplilt,autoPrint;if(!autoSplit){this.autoSplilt=0}else{this.autoSplilt=Math.max(eval(autoSplit),0)}if(!autoPrint){this.autoPrint=0}else{this.autoPrint=Math.max(eval(autoSplit),0)}if(this.autoSplilt==1){this.__splitPage()}if(this.autoPrint==1){this.print()}return true}JsPrinter.prototype.__tag="JsPrintSplit";JsPrinter.prototype.isIE=document.all?1:0;JsPrinter.prototype.isNs4=document.layers?1:0;JsPrinter.prototype.isDom=document.getElementById?1:0;JsPrinter.prototype.isMac=navigator.platform=="MacPPC";JsPrinter.prototype.isMo5=document.getElementById&&!document.all?1:0;JsPrinter.prototype.isWebBrowser=false;JsPrinter.prototype.totalPage=0;JsPrinter.prototype.WebBrowser=null;JsPrinter.prototype.print=function(){window.print()};JsPrinter.prototype.prview=function(){if(this.isWebBrowser==false){this.__getWebBrowser()}if(this.isMo5==1||this.isWebBrowser==0){alert("WebBrowser not support print View");return false}this.WebBrowser.ExecWB(7,1)};JsPrinter.prototype.setPrint=function(){if(this.isWebBrowser==false){this.__getWebBrowser()}if(this.isMo5==1||this.isWebBrowser==0){alert("WebBrowser not support this function");return false}this.WebBrowser.ExecWB(8,1)};JsPrinter.prototype.splitPage=function(){this.__splitPage()};JsPrinter.prototype.unSplitPage=function(){this.__splitPage(false)};JsPrinter.prototype.setTag=function(A){this.__tag=A};JsPrinter.prototype.__getWebBrowser=function(){this.WebBrowser=document.getElementById("WebBrowser");this.isWebBrowser=this.WebBrowser?1:0};JsPrinter.prototype.__splitPage=function(A){if(!A){var C="always"}else{var C="avoid"}var D=document.getElementsByTagName("div");for(var B=0;B<D.length;B++){if(D[B].id==this.__tag){D[B].style.pageBreakBefore="always";this.totalPage++}}};var JsPrinter=new JsPrinter(1);
