//UPDATED 5/6/2009 To allow FireFox Browers to Print Details
//
// aimsPrint.js
/*
*  JavaScript template file for ArcIMS HTML Viewer
*		dependent on aimsXML.js, ArcIMSparam.js, aimsCommon.js, aimsMap.js,
*		aimsLayers.js, aimsDHTML.js
*		aimsClick.js, aimsNavigation.js,
*		aimsLegend.js
*/

aimsPrintPresent=true;

var printTitle = titleList[4];
var printMapURL="";
var printOVURL="";
var printLegURL="";

var legVis2=false;

/*
***************************************************************************************

Print functions 

***************************************************************************************
*/




// create web page for printing
	// first get Map
function printIt() {
	showRetrieveMap();
	printTitle="OPIS";
	var tempWidth = iWidth;
	var tempHeight = iHeight;
	iWidth=370;
	iHeight=690;
	//legVis2=legendVisible;
	//if (aimsLegendPresent) legendVisible=true;
	var theString = writeXML();
	iWidth=tempWidth;
	iHeight = tempHeight;
	//legendVisible = legVis2;
	sendToServer(imsURL,theString,101);
	tempWidth=null;
	tempHeight=null;
	theString=null;
}
// second, get OVMap
function getPrintOV() {
	var tempWidth = i2Width;
	var tempHeight = i2Height;
	i2Width=190;
	i2Height=100;
	var tempDraw=drawOVExtentBox;
	drawOVExtentBox=true;
	var theString = writeOVXML();
	drawOVExtentBox=tempDraw;
	i2Width=tempWidth;
	i2Height = tempHeight;
	sendToServer(imsOVURL,theString,102);
	tempWidth=null;
	tempHeight=null;
	theString=null;
}


// third, write the web page
function writePrintPage() {
	var Win1 = open("","PrintPage");
	//Win1.document.open();
	Win1.document.writeln('<html><meta http-equiv="Content-Type" content="text/html; charset=' + charSet + '">');
	Win1.document.writeln('<meta http-equiv="imagetoolbar" content="false">');
	Win1.document.writeln('<head><title>' + titleList[5] + '</title>');
	Win1.document.writeln('</head>');
	Win1.document.writeln('<body BGCOLOR="White" TEXT="Black" LEFTMARGIN=0 TOPMARGIN=0>');
	Win1.document.writeln('<FONT FACE="Arial"><B>');
	Win1.document.writeln('<TABLE WIDTH="650" BORDER="2" CELLSPACING="0" CELLPADDING="0" NOWRAP>');
	Win1.document.writeln('	<TR>');
	Win1.document.writeln('		<TD WIDTH="370" ALIGN="CENTER" VALIGN="TOP"><IMG SRC="http://'+hostName+'/website/opis/graphics/printbanner.gif" HSPACE=0 VSPACE=0 BORDER=0 ALT=""></TD>');
	Win1.document.writeln('		<TD ALIGN="CENTER" VALIGN="TOP" HEIGHT="100"><IMG SRC="' + printOVURL + '" WIDTH=190 HEIGHT=100 HSPACE=0 VSPACE=0 BORDER=0 ALT=""></TD>');
	Win1.document.writeln('	</TR>');
	Win1.document.writeln('	<TR>');
	Win1.document.write('		<TD WIDTH="370" HEIGHT="400"><IMG SRC="' + printMapURL + '" WIDTH=370 HEIGHT=690 HSPACE=0 VSPACE=0 BORDER=0 ALT=""></TD>');
	// Added the following to grab the html table from the query results and put it on the print page
	// mikedixon@concordengineering.com
	     if(parent.TextFrame.printdata) {
	        Win1.document.writeln('<TD>'+ parent.TextFrame.document.getElementById("ResultTable").innerHTML +'</TD>');
	     }   
	     else {
	     	Win1.document.writeln('		<TD HEIGHT="150" ALIGN="CENTER">No Attribute Data Requested </TD>');
	     }	
	// end 
	Win1.document.writeln('	</TR>');
	Win1.document.writeln('	<TR>');
	Win1.document.writeln('		<TD WIDTH="370" ALIGN="center" VALIGN="middle"><font size="0" face="Arial"><P><U>Disclaimer</U>:   This tax record is prepared for the inventory of real property within Pitt County and is compiled from recorded deeds, plats, tax maps, surveys, and other public records. Users of this data are hereby notified that the aforementioned public primary information sources should be consulted for verification. Pitt County assumes no legal responsibility for the information contained herein. </P><P>Copyright © 2010, Pitt County, North Carolina.</font></P>      </TD>');
	Win1.document.writeln('		<TD ALIGN="CENTER"><FONT FACE="Arial" COLOR="Red" SIZE="2"><B><U>PLEASE NOTE:</U></B></FONT><BR><FONT SIZE = "2" FACE="Arial">'+parent.timeframe.stamp+'</FONT><BR></TD>');
	Win1.document.writeln('	</TR>');
	Win1.document.writeln('</TABLE>');
	Win1.document.writeln('</B></FONT>');
	Win1.document.close();
	Win1=null;
	hideRetrieveMap();
}





