new function(){
	
	
	// _blank
	function setBlank(windowonload) {
		var r1 = new RegExp ("external(=(\S+))?","i"),
			r2 = new RegExp ("^_+(\S+)$", "i"),
		r3 = new RegExp ("^(blank|self|parent|top)$", "i");
		if (document.getElementsByTagName)
		{
			var anchors = document.getElementsByTagName ('a'),
				affix   = 0,
				count   = anchors.length,
				anchor, target, t;
				while (count > affix)
		              if ((anchor = anchors [affix ++]).getAttribute ('href') || anchor.href)
		                  if (r1.test (anchor.getAttribute ('rel') || anchor.rel || ""))
		                      (target = (target = RegExp.$2)
		                          ? (r2.test (target)
		                              ? (r3.test (t = RegExp.$1)
		                                  ? "_" + t
		                                  : t)
		                              : target)
		                          : "_brank"),
		                      ((anchor.setAttribute)
		                        ? anchor.setAttribute ("target", target)
		                        : (anchor.target = target));
		}
		if (windowonload && windowonload.apply)
		        windowonload.apply (this, arguments);
    }

	//popup
	function setPopup() {
		var node_a = document.getElementsByTagName("a");
			for (var i in node_a) {
				if (node_a[i].className == "popup") {
					node_a[i].onclick = function() {
						return winOpen(this.href)
					};
				}
			}
	};
	
	function addEvent(elm,listener,fn){
		try{
			elm.addEventListener(listener,fn,false);
		}catch(e){
			elm.attachEvent("on"+listener,fn);
		}
	}
	addEvent(window,"load",setBlank);
	addEvent(window,"load",setPopup);
}


function winOpen(url) {
	window.open(url,"popup","width=800,height=650,scrollbars=1,resizable=1,toolbar=yes");
};



