/**
* Modified for Highslide from http://www.boutell.com/newfaq/creating/printpart.html
*/
if (!hsp) { var hsp = {
	stylesFile : '',
	printCaption : false,
	printHeading : false,
	printLeft : false,
	printRight : false,
	captionWidth : 225}
}

hs.printImage = function (el) {
	var exp = hs.expanders[hs.getWrapperKey(el)];
	link = "about:blank";
	var pw = window.open(link, "_new");
	pw.document.open();
	pw.document.write(exp.getPrintPage());
	pw.document.close();
	return false;
};
hs.Expander.prototype.getPrintPage = function() {
	// We break the closing script tag in half to prevent
	// the HTML parser from seeing it as a part of
	// the *main* page.

	var width = this.x.full;

	htmlString = "<html><head><title>Print Image</title><link href='" + hsp.stylesFile + "' rel='stylesheet' />" +
		"<style type='text/css'>BODY{background-color: #ffffff;background-image: url();}.button{display: none;}.highslide-caption, .highslide-heading{background-color: #ffffff;padding: 0px;}</style>" +
		"<script>function step1(){setTimeout('step2()', 10);};function step2(){window.print();window.close();};</scr" + "ipt></head><body onLoad='step1()'>";
		if (hsp.printHeading) {htmlString += "<div class='highslide-heading' style='display: block; width: " + width + "px;'>" + this.heading.innerHTML + "</div><img src='" + this.content.src + "'/>";
		} else if (hsp.printCaption) {htmlString += "<img src='" + this.content.src + "'/><div class='highslide-caption' style='display: block; width: " + width + "px; padding: 5px;'>" + this.caption.innerHTML + "</div>";
		} else if (hsp.printLeft) {htmlString += "<table cellspacing='5'><tr><td style='vertical-align: top;'><div class='highslide-caption' style='display: block; width: " + hsp.captionWidth + "px;'>" + this.caption.innerHTML + "</div></td><td><img src='" + this.content.src + "'/></td></tr></table>";
		} else if (hsp.printRight) {htmlString += "<table cellspacing='5'><tr><td><img src='" + this.content.src + "'/></td><td style='vertical-align: top;'><div class='highslide-caption' style='display: block; width: " + hsp.captionWidth + "px;'>" + this.caption.innerHTML + "</div></td></tr></table>";
		} else {htmlString += "<img src='" + this.content.src + "'/>";}
		htmlString += "</body></html>";
	return htmlString;
};
