var g = {
	addEvent: function(elm, evType, fn, useCapture){
		if (elm.addEventListener){
			elm.addEventListener(evType, fn, useCapture);
			return true;
		} else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		} else {
			elm['on' + evType] = fn;
		}
	}
}

var popups = {

	links:document.getElementsByTagName("a"),
	
	/** Standard popup window **/
	standard:function(){
		if(!document.getElementsByTagName) return false
			for(var i=0; i<popups.links.length; i++){
				if (popups.links[i].className && (" "+popups.links[i].className+" ").indexOf(" popup ")!=-1 ){
					popups.links[i].onclick=function(){
						window.open(this.href, ""); 
						return false;
				}
			}
		}
	},

	/** Metafaq popup window **/
	map:function(){
		if(!document.getElementsByTagName) return false;
			for(var i=0;i<popups.links.length;i++){
				if(popups.links[i].className&&(" "+popups.links[i].className+" ").indexOf(" map ")!=-1){
					popups.links[i].onclick=function(){
						window.open(this.href,'mypop',"height=305, width=530, status, resizable, scrollbars, toolbar"); 
						return false;
				}
			}
		}
	}
}

g.addEvent(window, 'load', popups.standard, false);
g.addEvent(window, 'load', popups.map, false);