<!--
/***********************************************
* Script for printing a DIVs content
*
* ScriptName  :     divprint 1.0
* Author      :     Gregor Hinsberg
* Date        :     24.08.2005
* Copyright   :     MediactiVa S.L [www.mediactiva.com]
************************************************/

/* The function gets the inner html of a div defined by the
variable "contentDivId" [or as argument], adds the missing 
html doc elements, writes all in the document and triggers 
the printer. The style "mmenu" is added by the print.css which 
hides all tags with the class "mmenu" asigned to for printing. */

var defaultPrintDivId = "cdiv";
var styleSheetUrl_01 = "css/style.css";
var styleSheetUrl_02 = "css/tinymce.css";
var printStyleSheetUrl = "css/print.css";
var logoUrl = "";
var siteitle = "Katharina Hinsberg";
var winFeatures = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=580,height=550';
function printDiv(divId){
	divId = (divId=="")?defaultPrintDivId:divId;
	var d = document;
	if (d.getElementById(divId)!=null){
		var content = d.getElementById(divId).innerHTML;
		var html = '<h'+'tml>\n<h'+'ead> \n';
		html += '<t'+'itle>'+d.title+'</t'+'itle> \n';
		html += '<link href="'+styleSheetUrl_01+'" rel=stylesheet type="text/css" > \n';
		html += '<link href="'+styleSheetUrl_02+'" rel=stylesheet type="text/css" > \n';
		html += '<link href="'+printStyleSheetUrl+'" rel="stylesheet" media="print" type="text/css" /> \n';
		html += '</h'+'ead>\n';
		html += '<div align="right">';
		html += '<a href="javascript:print()" class="mmenu">drucken</a> |  \n';
		html += '<a href="javascript:self.window.close()" class="mmenu">[X]</a>&nbsp;\n';
		html += '</div>';
		html += (logoUrl!="")?'<img src="'+logoUrl+'"><br/><br/> \n':"";
                html += (siteitle!="")?'<span class="site_title">'+siteitle+'</span><br/> \n':"";
		html += '<b'+'ody onLoad="print()" leftmargin="10">'+content+'</body>\n</html> \n';

               // var w = window.open(document.location,document.title, winFeatures);
                var w = window.open('',document.titl, winFeatures);
                if (w){
                    d = w.document;
		    d.open(); d.write(html); d.close();
                } else {
                    // Blocked!!
                }

	} else {
		//alert("Error: No div [\""+divId+"\"] found in document for printing.");
	}

}
//-->