

function openHeyPopup(objectLink) {

	window.open(objectLink, "Externer Link",  "width=920,height=700,scrollbars=no");

}

function initHeyPopup()
{
	
	if (!document.getElementsByTagName){ return; }
	var anchors = document.getElementsByTagName("a");

	// loop through all anchor tags
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];

		if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "heypopup")){
			anchor.onclick = function () {openHeyPopup(this); return false;}
		}
	}

}

function addLoadEvent(func)
{	
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}

}

addLoadEvent(initHeyPopup);	// run initLightbox onLoad
