function openvenster(href) { 
	var win = window.open(href, 'Kalveropfoknieuws', 'height=650, width=600, top=20, left=10, scrollbars=1'); 
	win.focus(); 

	return false; 
} 

function popRayon(url) {
  window.open([url],'window','channelmode=0,directories=0,fullscreen=0,height=500,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,width=300')
}

function brochurepopup(img,width,height) {
 window.open("/config/imgviewer.asp?img="+img, "","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+width+", height="+height, false);
}

// Browser safe opacity handling function
function setOpacity( value ) {
 document.getElementById("styled_popup").style.opacity = value / 10;
 document.getElementById("styled_popup").style.filter = "alpha(opacity=' + value * 10 + ')";
}

function fadeInMyPopup() {
 for( var i = 0 ; i <= 100 ; i++ )
   setTimeout( 'setOpacity(' + (i / 10) + ')' , 3 * i );
}

function fadeOutMyPopup() {
 for( var i = 0 ; i <= 100 ; i++ ) {
   setTimeout( 'setOpacity(' + (10 - i / 10) + ')' , 3 * i );
 }

 setTimeout('closeMyPopup()', 400 );
}

function closeMyPopup() {
 document.getElementById("body").style.backgroundColor = "#58595B";
 document.getElementById("container").style.opacity = 1;
 document.getElementById("container").style.filter = "alpha(opacity=100)";

 document.getElementById("styled_popup").style.display = "none"
}

function fireMyPopup() {
 setOpacity( 0 );
 document.getElementById("styled_popup").style.display = "block";
 
 document.getElementById("body").style.backgroundColor = "#353535";
 document.getElementById("container").style.opacity = 0.15;
 document.getElementById("container").style.filter = "alpha(opacity=15)";

 fadeInMyPopup();
}
