cLinks = {
	externalRel: "external",
	popupRel: "popup",
	init:function(){
		aLinks = document.getElementsByTagName("a");
		for(var i=0; i<aLinks.length; i++){
			if(aLinks[i].getAttribute("rel") == cLinks.externalRel){
				aLinks[i].setAttribute("target","_blank");
			}
			else if(new RegExp(cLinks.popupRel).test(aLinks[i].getAttribute("rel"))){
				addEvent(aLinks[i],"click",cLinks.openPopup);
				aLinks[i].onclick = function(){return false;};
			}
		}
		
	},
	openPopup:function(e){
		var oClicked = getSource(e);
		var sProps   = cLinks.popupProps(cLinks.popupRel,oClicked.getAttribute("rel"));
		var sTarget  = cLinks.popupProps(cLinks.popupRel,oClicked.getAttribute("rel"));
		var sHref    = oClicked.getAttribute("href");
		var oWin     = window.open(sHref,sTarget,sProps);
		oWin.focus();
		//alert(oClicked.getAttribute("href"));
		//alert(oClicked.getAttribute("rel"));
		//cLinks.popupProps(cLinks.popupRel,oClicked.getAttribute("rel"));
		//cLinks.popupProps(cLinks.popupRel,oClicked.getAttribute("rel"));
	},
	popupProps:function(strRel,str){
		str = str.substring(strRel.length+1,str.length);
		str = str.substring(str.indexOf(",")+1,str.length);
		return str;
	},
	popupTarget:function(strRel,str){
		str = str.substring(strRel.length+1,str.length);
		str = str.substring(0,str.indexOf(","));
		return str;
	}

}
addEvent(window,"load",cLinks.init);