function printPage(d) 
{
	
	var da = (document.all) ? 1 : 0;
	var pr = (window.print) ? 1 : 0;
	
	if(!pr)
	{
		window.status = "No print";
		return;
	}
	
	var headline = document.getElementById("headline");
	var des = document.getElementById("des");
    var story = document.getElementById("story");
    	
	if(story == null && da) 
		story = document.all.story;

	if(des == null && da) 
		story = document.all.des;

	if(headline == null && da) 
		headline = document.all.headline;

	
	if(story) 
	{
		var sStart = "<html><head>";

		var w = window.open('about:blank','printWin','width=660,height=440,scrollbars=yes');
		var wdoc = w.document;
		wdoc.open();
		wdoc.writeln(  "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">");
		wdoc.writeln(  "</head><body style=\"background-image:none;background-color:white;\">");

		wdoc.writeln(  "<div style=\"direction: "+d+"; margin: 10px\">" );
    	wdoc.writeln(  "<h1>" );
		wdoc.writeln(  headline.innerHTML );
		wdoc.writeln(  "</h1>" );

    	wdoc.writeln(  "<h3>" );
		wdoc.writeln(  des.innerHTML );
		wdoc.writeln(  "</h3>" );

    	wdoc.writeln(  "<p>" );
		wdoc.writeln(  story.innerHTML );
		wdoc.writeln(  "</p>" );

		wdoc.writeln(  "</div>" );
		wdoc.writeln(  "</body></html>");
	
		wdoc.close();
		w.print();
	}
}

