﻿// JScript File

var pp;

//Generating Pop-up Print Preview page
function getPrint(title_area, print_area)
{	
    var PrintHeadline = '<div style="margin-left:10px"><img src="/images/new/rn_top_logo.gif" alt="" /></div>';
	//Creating new page
	
	if ( pp != null )
	    pp.close();
	    
	pp = window.open('','PrintPreview','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=yes,resizable=yes');
	
	pp.focus();
	//Adding HTML opening tag with <HEAD> </HEAD> portion 
	pp.document.writeln('<HTML><HEAD><title>Print Preview</title><LINK href=/Style/style.css  type="text/css" rel="stylesheet">')
	pp.document.writeln('<LINK href=/Style/common.css  type="text/css" rel="stylesheet" media="print"><base target="_self"></HEAD>')
	//Adding Body Tag
	pp.document.writeln('<body style="text-align:left; margin:0px"><style media="print">a.button {display:none}</style><style>P {margin-bottom: 10px}</style>');
	//Adding form Tag
	pp.document.writeln('<form  method="post">');
	//Creating two buttons Print and Close within a table
	var toolBar = '<div style="margin-top:10px; margin-bottom:10px; float:right;"><a class="button" href="" onclick="location.reload(true);window.print();return false;"><img src="/images/btn_print.gif"></a><a class="button" href="" onclick="window.close();return false;"><img src="/images/btn_close.gif"></a></div></form><br>';
	//Writing print area of the calling page
	pp.document.writeln(PrintHeadline + toolBar + '<div style="margin-left:10px"><br><h2>' + document.getElementById(title_area).innerHTML + "</h2><div>" + document.getElementById(print_area).innerHTML + "</div></div>");
	//Ending Tag of </form>, </body> and </HTML>
	pp.document.writeln('</body></HTML>');
	
	// pp.document.close();
}		
