//class="exit" onclick="window.open(this.href);return false;"
function checkLinks() {
	var alinks,i;
	alinks = document.getElementsByTagName('a');
	for (i=0;i<alinks.length;i++) {
		islink = alinks[i].href;
		if (islink && islink.indexOf(window.location.hostname) == -1 && islink.indexOf('javascript:') == -1) {
				if (alinks[i].childNodes[0].nodeName != 'IMG') { alinks[i].className='exit'; }
				alinks[i].onclick=function() { return openlink(this); };
				
				if (!alinks[i].title) 
					alinks[i].title = 'open ' + alinks[i].href + ' in een nieuw venster';
		}
	}
}
function openlink(o) {
	var o;
	window.open(o.href);return false;
	
}

function checkAjaxLinks() {
	var anchors = document.getElementsByTagName('a');

		// loop through all anchor tags
		for (var i=0; i<anchors.length; i++){
			anchor = anchors[i];
			
			var relAttribute = String(anchor.getAttribute('rel'));
			
			// use the string.match() method to catch 'lightbox' references in the rel attribute
			if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('event'))) {
				this.rel = relAttribute;
				anchor.onclick = function() {
					makeLink(this,this.rel);
					return false;
				 }
			}
		}	
}
function makeLink(alink,rel) {
	alink = String(alink);
	id = (alink.substr(alink.indexOf('=')+1));
	if (rel == 'event') {
		do_getEventDetail(id);
	} else
		do_getEvents(id);


}
window.onload = function () {
	checkLinks();
	checkAjaxLinks();
}