/* print context knopje */

// code om compatibel te blijven met andere js
resizeFunct = window.onresize;
scrollFunct = window.onscroll;
mousemoveFunct = window.onmousemove;
onloadFunc = window.onload;

function resize2() {
	resizeFunct(); 
	positionPrintIcon();
}

function scroll2() {
	scrollFunct();
	positionPrintIcon();
}

function mousemove2() {
	mousemoveFunct();
	positionPrintIcon();
}

function onload2() {
	onloadFunc();
	window.scrollTo(0,1);
	window.scrollTo(0,0);
	positionPrintIcon();
}


function writePrintIcon() {
	//preload images 
	printImg = 	new Image(); printImg.src = "/img/icon_print.gif"; 
	printImgF = new Image(); printImgF.src = "/img/icon_print_f.gif";
		
	
		
		var strTmp = '' +
					'<div id="iconprint" style="margin-top: -1px; margin-left: 5px; position: absolute; z-index: 100; visibility: hidden ">' +
					'	<a title="Print deze pagina" href="#" onclick="print(); return false;"><img class="iconStylePrint" src="/images/print2.gif" vspace="1" border="0"></a><br>' +
					'	<a title="Stuur deze pagina door" href="mailto:?subject=Uw subject&Body='+location.href+'" return false;"><img class="iconStyleMailTop" src="/images/mail2.gif" vspace="1" border="0"></a>' +
					'</div>';
					
					
	document.write(strTmp);
	
	window.onresize = resize2;
	if (document.all) {
		window.onscroll = scroll2;
		window.onmousemove = mousemove2;	
		if (isMac && isIE5plus) {
			window.onload = onload2;
			window.onmousemove = mousemove2;	
		}
	} else {
		window.onmousemove = mousemove2;	
		window.onload = onload2;
	}
	
	positionPrintIcon();
}

function positionPrintIcon() {
	document.getElementById("iconprint").style.visibility = "visible";
	var isIE6 = ( agent.indexOf("MSIE 6") != -1 );
	var extraIndent = (isIE6)? 10 : 0;
	if (document.all) {
		if (isMac && isIE5plus) document.body.style.visibility = 'hidden';
		if (document.documentElement && document.documentElement.scrollTop) {
			document.all.iconprint.style.top = (document.documentElement.scrollTop + 192) + "px";
		} else {
			document.all.iconprint.style.top = (document.body.scrollTop + 192) + "px";
		}
		document.all.iconprint.style.left = ( 755 + extraIndent) + "px";
		if (isMac && isIE5plus) document.body.style.visibility = 'visible';
	} else {
		document.getElementById("iconprint").style.top = (window.scrollY + 192) + "px";
		document.getElementById("iconprint").style.left = (755) + "px";  
		
	}
}

writePrintIcon();