//// Dynamic page header banner generator.// MLB - 11/08/2002//// Indices into format array:var CLEARPIXEL = 0;var BGCOLOR = 1;var LOGO_IMAGE = 2;var LOGO_LINK = 3;var IMAGE_SPACING = 4;var RIGHT_PADDING = 5;// Indices into icon array:var LEFT_IMAGE = 0;var LEFT_LINK = 1;var RIGHT_IMAGE_1 = 2;var RIGHT_LINK_1 = 3;var RIGHT_IMAGE_2 = 4;var RIGHT_LINK_2 = 5;var EXTRA_STUFF = 6;function Header (format, icons){	this.format = format;	this.icons = icons;	this.draw = function (title)	{		this.draw3 (title, null, PAGEWIDTH);	}	this.draw2 = function (title, subtitle)	{		this.draw3 (title, subtitle, PAGEWIDTH);	}	this.draw3 = function (title, subtitle, pagewidth)	{		if (pagewidth > 0) {			this.drawTopMargin(pagewidth);		}			document.write("<table class='header-banner' bgcolor='" + this.format[BGCOLOR] + "' cellpadding='0' cellspacing='0'>");		document.write("<tr><td><img src='" + this.format[CLEARPIXEL] + "' height='3' border='0'></td></tr>");		document.write("<tr>");		document.write("<td><img src='" + this.format[CLEARPIXEL] + "' height='1' width='10' border='0'></td>");				// Logo		if (this.format[LOGO_IMAGE] == null || this.format[LOGO_IMAGE] == "") {			document.write("<td><img src='" + this.format[CLEARPIXEL] + "' border='0'></td>");		} else if (this.format[LOGO_LINK] == null || this.format[LOGO_LINK] == "") {			document.write("<td width='50%'><img src='" + this.format[LOGO_IMAGE] + "' hspace='4' vspace='4' border='0'></td>");		} else {			document.write("<td width='50%'><a href='" + this.format[LOGO_LINK] + "'><img src='" + 				this.format[LOGO_IMAGE] + "' hspace='4' vspace='4' border='0'></a></td>");		}				// Left icon		document.write("<td><img src='" + this.format[CLEARPIXEL] + "' height='1' width='" + this.format[IMAGE_SPACING] + "' border='0'></td>");		if (this.icons == null || this.icons[LEFT_IMAGE] == null || this.icons[LEFT_IMAGE] == "") {			document.write("<td><img src='" + this.format[CLEARPIXEL] + "' border='0'></td>");		} else if (this.icons[LEFT_LINK] == null || this.icons[LEFT_LINK] == "") {			document.write("<td><img src='" + this.icons[LEFT_IMAGE] + "' hspace='4' vspace='4' border='0'></td>");		} else {			document.write("<td><a href='" + this.icons[LEFT_LINK] + "'><img src='" + 				this.icons[LEFT_IMAGE] + "' hspace='4' vspace='4' border='0'></a></td>");		}				// Header text		document.write("<td><img src='" + this.format[CLEARPIXEL] + "' height='1' width='" + this.format[IMAGE_SPACING] + "' border='0'></td>");		header_text = "Mike Benson";	// Default header text		if (title != null && title != "") header_text = title;		document.write("<td nowrap><span class='page-head-text'>" + header_text + "</span></td>");		// Right icon #1		document.write("<td><img src='" + this.format[CLEARPIXEL] + "' height='1' width='" + this.format[IMAGE_SPACING] + "' border='0'></td>");		if (this.icons == null || this.icons[RIGHT_IMAGE_1] == null || this.icons[RIGHT_IMAGE_1] == "") {			document.write("<td><img src='" + this.format[CLEARPIXEL] + "' border='0'></td>");		} else if (this.icons[RIGHT_LINK_1] == null || this.icons[RIGHT_LINK_1] == "") {			document.write("<td><img src='" + this.icons[RIGHT_IMAGE_1] + "' hspace='4' vspace='4' border='0'></td>");		} else {			document.write("<td><a href='" + this.icons[RIGHT_LINK_1] + "'><img src='" + 				this.icons[RIGHT_IMAGE_1] + "' hspace='4' vspace='4' border='0'></a></td>");		}		// Right icon #2		document.write("<td><img src='" + this.format[CLEARPIXEL] + "' height='1' width='" + this.format[IMAGE_SPACING] + "' border='0'></td>");		if (this.icons == null || this.icons[RIGHT_IMAGE_2] == null || this.icons[RIGHT_IMAGE_2] == "") {			document.write("<td><img src='" + this.format[CLEARPIXEL] + "' border='0'></td>");		} else if (this.icons[RIGHT_LINK_2] == null || this.icons[RIGHT_LINK_2] == "") {			document.write("<td><img src='" + this.icons[RIGHT_IMAGE_2] + "' hspace='4' vspace='4' border='0'></td>");		} else {			document.write("<td><a href='" + this.icons[RIGHT_LINK_2] + "'><img src='" + 				this.icons[RIGHT_IMAGE_2] + "' hspace='4' vspace='4' border='0'></a></td>");		}				// Extra stuff		if (this.icons != null && this.icons[EXTRA_STUFF] != null) {			document.write("<td nowrap>" + this.icons[EXTRA_STUFF] + "</td>");		}				// Subtitle (actually, on the right)		if (subtitle != null) {			document.write("<td nowrap><span class='small-head-text'>" + subtitle + "</span></td>");		}				document.write("<td width='50%'><img src='" + this.format[CLEARPIXEL] + "' height='1' width='" + this.format[RIGHT_PADDING] + "' border='0'></td>");		document.write("<td><img src='" + this.format[CLEARPIXEL] + "' height='1' width='10' border='0'></td>");		document.write("</tr>");		document.write("<tr><td><img src='" + this.format[CLEARPIXEL] + "' height='3' border='0'></td></tr>");		document.write("</table>");	}		this.drawTopMargin = function (pagewidth)	{		document.write("<table cellspacing='0' cellpadding='0' border='0' align='center' width='" + pagewidth + "'>");		document.write("<tr><td class='page-background-color' colspan='3'><img src='" + this.format[CLEARPIXEL] + "' width='15' height='15' border='0'></td></tr>");		document.write("<tr><td class='page-background-color'><img src='" + this.format[CLEARPIXEL] + "' width='15' height='15' border='0'></td>");		document.write("<td class='page-inset-color'>");	}}