function PopUp(pagina,width,height,top,left)
{
	if( width == null ) width = 450;
	if( height == null ) height = 375;
	if( left == undefined ) left = (screen.width/2)-(width/2);
	if( top == undefined ) top = (screen.height/2)-(height/2);
	newwindow = window.open(pagina,"extra","width="+width+",height="+height+",top="+top+",left="+left+",scrollbars=yes,resizable=yes,toolbar=no");
}

function popup(pagina,width,height,top,left) { PopUp(pagina,width,height,top,left); }

function goto_URL(object,sid)
{
	value = object.options[object.selectedIndex].value;
	if (!value) return;
	top.content.location = value+(value.match(/(html?|php?|\/)$/) ? "?" : "&")+sid;
}

function setPointer(theRow, thePointerColor)
{
	if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') 
		return false;

	var row_cells_cnt = theRow.cells.length;
	for (var c = 0; c < row_cells_cnt; c++) 
		theRow.cells[c].bgColor = thePointerColor;

	return true;
}

function mc(i,n)
{
	document.writeln('<span class="menu-category" onclick="window.location.href=\'/showrubriek.php?ID='+i+'\'" onselectstart="return false">'+n+'</span>');
}

function fb(t,w)
{
	if( typeof(w) == 'undefined' ) w = 138;
	document.writeln('<table cellspacing="0" cellpadding="0" border="0">');
	document.writeln('<tr>');
	document.writeln('<td width="8" colspan="2"><img src="/partner/www/images/kakl_lb.gif" width="8" height="8"></td>');
	document.writeln('<td width="'+w+'" bgcolor="#FFFFFF" valign="top"><img src="/partner/www/images/pix_dbl.gif" width="'+w+'" height="1"></td>');
	document.writeln('<td width="8" colspan="2"><img src="/partner/www/images/kakl_rb.gif" width="8" height="8"></td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('<td width="1" bgcolor="#4A8DB3"><img src="/partner/www/images/spacer.gif" width="1" height="1"></td>');
	document.writeln('<td width="7" bgcolor="#FFFFFF"><img src="/partner/www/images/spacer.gif" width="7" height="1"></td>');
	document.writeln('<td width="'+w+'" bgcolor="#FFFFFF" valign="top">');
	document.writeln(t);
	document.writeln('</td>');
	document.writeln('<td width="7" bgcolor="#FFFFFF"><img src="/partner/www/images/spacer.gif" width="7" height="1"></td>');
	document.writeln('<td width="1" bgcolor="#4A8DB3"><img src="/partner/www/images/spacer.gif" width="1" height="1"></td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('<td width="8" colspan="2"><img src="/partner/www/images/kakl_lo.gif" width="8" height="8"></td>');
	document.writeln('<td width="'+w+'" bgcolor="#FFFFFF" valign="bottom"><img src="/partner/www/images/pix_dbl.gif" width="'+w+'" height="1"></td>');
	document.writeln('<td width="8" colspan="2"><img src="/partner/www/images/kakl_ro.gif" width="8" height="8"></td>');
	document.writeln('</tr>');
	document.writeln('</table>');
}

function sl(gi,si,n,sd)
{
	document.writeln('<tr valign="top" height="60"><td width="100" align="center"><a href="/showgallery.php?gebruikerID='+gi+'">'+si+'</a></td><td style="overflow: hidden"><b>'+n+'</b></a><br><a href="/showgallery.php?gebruikerID='+gi+'"><span class="shopurl">'+sd+'</class></a></td></tr>'); 
}

function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];      
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }   
    }
    return (arrReturnElements)
}

function initializeArticleImages()
{
    var articleImages = getElementsByClassName(document.getElementById('article-images'), 'img', 'article-image');
    
    for (i=0; i<articleImages.length; i++) {
        articleImages[i].style.cursor = '-moz-zoom-in';
        articleImages[i].alt = articleImages[i].title = 'Klik voor grote versie';
        articleImages[i].onclick = function() { zoomImage(this); };
    }
}

var zoomedImage = null;

function zoomImage(obj)
{
    var newSrc = obj.src.replace(/100x100/, '400x400');
    newSrc = newSrc.replace(/thumb_/, '');
    
    if (document.getElementById('article-image-zoom').style.display == 'block' &&
        newSrc == zoomedImage) {
        return closeZoomWindow();
    }
    
    var imgObj = document.getElementById('article-image-zoom-img');

    document.getElementById('article-image-zoom').style.display = 'none';
    imgObj.src = 'http://www.qoop.nl/images/spacer.gif';
    imgObj.src = newSrc;
    document.getElementById('article-image-zoom').style.display = 'block';
    
    imgObj.oncontextmenu = copyrightNotice;
    imgObj.onclick = closeZoomWindow;
    
    zoomedImage = newSrc;
}

function closeZoomWindow()
{
    zoomedImage = null;
    document.getElementById('article-image-zoom').style.display = 'none';
}

function copyrightNotice()
{
    alert('Deze afbeelding is auteursrechtelijk beschermd en mag niet\nzonder toestemming van de auteur worden gebruikt.');
    return false;
    
}
