﻿var gAutoPrint = true; // Tells whether to automatically call the print function

function printSpecial()
{
var divtitlevar =  (document.getElementById)? document.getElementById('divtitle'):document.all('divtitle');
if(divtitlevar)
    divtitlevar.style.display ='block';
    
if (document.getElementById != null)
{
var html = '<HTML><HEAD>';

//if (document.getElementsByTagName != null)
//{
//var headTags = document.getElementsByTagName("head");
//if (headTags.length > 0)
//html += headTags[0].innerHTML;
//}

html += '</HEad><BODY style="margin:0px;" >\n';
html +='<script>function CloseDoc() { window.close(); }</script>';


var printReadyElem = document.getElementById("printReady");

if (printReadyElem != null)
{
html += "<table align='center'cellpadding=0 cellspacing=0 border='0'>";
html += "<tr><td width='640' height='128'>"
html += "<img alt='' src='/Images/print/paper_01.gif' height=90 width='640' align='center' />";
html += "</td></tr>"
html += "<tr><td align='center' height='100%' dir='ltr' width='640'  >"
html += "<div align='center' width='595px'  valign=top>";
html += printReadyElem.innerHTML ;
html += "</div>";
html += "</td></tr>"
html += "<tr><td width='640' height='5'></td></tr>"
html += "<tr><td width='640' height='5' align='center'><input id='Button1' type='button' value='Close' onclick='CloseDoc();'/></td></tr>"
html += "<tr><td width='640' height='5'><img alt='' height=58 src='/Images/print/paper_03.gif' width='640' align='center' /></td></tr>"
html += "</table>";
}
else
{
alert("Could not find the printReady function");
return;
}

html += '\n</BO>\n</HT>';

var printWin = window.open("","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("The print ready feature is only available if you are using an browser. Please update your browswer.");
}
}


