function preparelinks() {
  var lnks = document.getElementsByTagName("a");
  for (var i=0; i<lnks.length; i++) {
		if ((lnks[i].className.indexOf("newwindow") != -1) || (lnks[i].href.indexOf('mailto') == -1 && lnks[i].href.indexOf('5f10.nl') == -1))  {
      lnks[i].onclick = function() {
        popUp(this.getAttribute("href"),this.className);
        return false;
      }
    } 
    else if (lnks[i].className.indexOf("thumbnail_swap") != -1) {
    	lnks[i].onclick = function() {
    		swapBigImage(this.getAttribute("href"));
        return false;
    	}
    }
    
  }
}
	
function popUp(href,className) {
    carr = className.split(' ');
    if(carr.length == 3) {
    		window.open(href,'','width='+carr[1]+',height='+carr[2]+'');
    } else {
    		window.open(href);
    }
}

function swapBigImage(href) {
	
	if (document.getElementById('big') != null) {
		document.getElementById('big').firstChild.src = href;
	}
}
