var DHTML = (document.getElementById || document.all || document.layers);

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}


function openPopup(PopupTarget, PopupWindowName, PWidth, PHeight) {
	win = window.open(PopupTarget,target=PopupWindowName,'resizable=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,width='+ PWidth+',height='+PHeight+', top=100, left=100');
	return win;
}

var gAutoPrint = true; // Flag for whether or not to automatically call the print function

/* http://javascript.about.com/library/scripts/blprintready.htm */

function printSpecial()
{
	if (!DHTML) {
		alert("Beklager - denne feature kræver en nyere browser.");
		return;
	}

	var html = '<HTML>\n<HEAD>\n';
	html += '<title>Resultater fra Events4U</title>\n';
	html += '<meta name=\"Description\" content=\"Results published at www.events4u.dk\">\n';
	html += '<link rel="STYLESHEET" type="text/css" href="/ressources/print.css">\n';
	html += '\n</HE' + 'AD>\n<BODY>\n';
	
	var printReadyElem = document.getElementById("printready");
//	var printReadyElem = new getObj('printready');
	if (printReadyElem != null)
	{
			html += printReadyElem.innerHTML;
	}
	else
	{
		alert("Print-side kan ikke findes i HTML");
		return;
	}
	html += '<br>\n<strong>Resultater fra www.Events4U.dk</strong>\n';
	html += '\n</BO' + 'DY>\n</HT' + 'ML>';
	var printWin = openPopup("", "Print", 700, 600) 
	printWin.document.open();
	printWin.document.write(html);
	printWin.document.close();
	if (window.focus) printWin.focus();

	if (gAutoPrint)
		printWin.print();
}

