function filterTags(attribute, tag, text) {
	var count
	var re = new RegExp("<" + tag + "(.*?)" + attribute + "=([\"|']?)[0-9]{0,4}%?([\"|']?)","gim");
	
	try {
		count = text.match(re);
		text = text.replace(re,"<" + tag + "$1");
	} catch(er) {
		return false;
	}
	
	return text;
}

function printContent(){
	images = "<img src=/gfx/logo.gif class='logo'>"
	styles = "<LINK href=\"/css/print.css\" type=text/css rel=stylesheet>"
	bodystyle = "<div class=\"contact\"><strong>EuroWaxPack</strong><br />P.O. Box 85612<br>NL-2508 CH The Hague<br>The Netherlands<br>T: +31 70 312 39 29<br>F: +31 70 363 63 48<br>E: mail@eurowaxpack.org</div>"

	str = document.body.innerHTML;
	printarea = str.split('<!-- #print'+'begin# -->')[1];
	printarea = printarea.split('<!-- #print'+'eind# -->')[0];

	printarea = filterTags("width", "td", printarea);
	printarea = filterTags("width", "table", printarea);
	printarea = filterTags("align", "div", printarea);
	
	StrPrint = "<head>"+ styles +"</head><body><div class='printpage'>"+ images + bodystyle + printarea;

	var win = window.open("","Print","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600");
	var doc = win.document;
	doc.open();
	doc.write(StrPrint);
	win.document.close();
	if (doc.getElementById("btnprint") != null) {
		doc.getElementById("btnprint").style.display = "none";
	}
	win.focus();
	win.print();
	//document.write(StrPrint);
	//history.go();
}

