function openWin( windowURL, windowName, windowFeatures ) { 
	return window.open( windowURL, windowName, windowFeatures ) ; 
} 


function showpopup(imgid, description, rating, name, dummy1, dummy2) {

	document.getElementById('popupdiv').style.visibility = 'visible';
	// titel
	document.getElementById("thumbname").innerHTML = "<strong>&nbsp;" + name + "</strong>";
	// plaatje
	document.getElementById("thumbimg").src = 'thumb/' + imgid + '.gif';
	document.getElementById("thumbdescr").innerHTML = description;

}


// Als een plaatje niet gevonden kan worden krijg je een "not found" plaatje
function thumberror() {
	document.getElementById('thumbimg').src = 'nopic.gif' ;
	// image laden ;-)
}

function hidepopup() {
	var ds = document.getElementById('popupdiv').style;
	ds.visibility = 'hidden'; 
	document.getElementById("thumbimg").src = 'loading.gif';
	// opruimen. Anders kun je zomaar een scrollbar hebben / houden...
	ds.left = '-500px';
	ds.top  = '-500px';
	// UPDATE: helaas gaat dit voor IE niet op ;-)
}

// Muis bewegen over het scherm en popupje mee nemen.
function mouseMove(x, y) {
	var ds = document.getElementById('popupdiv').style;

	if (ds.visibility == 'visible') {

		// buiten het scherm check

		if ((x + parseInt(ds.width)) > document.body.clientWidth - 300) {
			ds.left = (x - parseInt(ds.width) - 15) + 'px';
		} else {
			ds.left = (x  + 15) + 'px';
		}
		
		if (document.all) {
			// voor IE en z'n wonky-ness
			if ((y + parseInt(ds.height)) > document.body.clientHeight) {
				ds.top  = (y - parseInt(ds.height) - 10 + document.body.scrollTop) + 'px';

			} else {
				ds.top  = (y + 5 + document.body.scrollTop) + 'px';
			}
		
		} else {
			// voor echte browsers
			if ((y + parseInt(ds.height)) > document.body.clientHeight + document.body.scrollTop) {
				ds.top  = (y - parseInt(ds.height) - 10) + 'px';
			} else {
				ds.top  = (y + 5) + 'px';
			}
		}

	}
}
