// JavaScript Document

addEvent(window,"load",function() {
	var elm = document.getElementsByTagName('a');
	for (var i=0;i<elm.length;i++) {
		if (elm[i].getAttribute('className') == 'popup' || elm[i].getAttribute('class') == 'popup') {
			elm[i].onclick = function () {
//			return winOpen(this.href)
				return winOpen(this.href, this.rel)
			}
		}
	}
});

function addEvent(elm,listener,fn){
	try{
		elm.addEventListener(listener,fn,false);
	}catch(e){
		elm.attachEvent("on"+listener,fn);
	}
}

function winOpen(url,rel) {
	var w = 680;
	var h = 600;

	var rel = rel.split(',');
		if (rel[0]) w = rel[0];
		if (rel[1]) h = rel[1];
	window.open(url, 'popup','width='+ w +',height='+ h +',toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=yes').focus();
	return false;
};



addEvent(window,"load",function() {
	var elm2 = document.getElementsByTagName('area');
	for (var i=0;i<elm2.length;i++) {
		if (elm2[i].getAttribute('className') == 'popup' || elm2[i].getAttribute('class') == 'popup') {
			elm2[i].onclick = function () {
			return winOpen2(this.href)
			}
		}
	}
});

function winOpen2(url) {
	window.open(url, 'popup','width=600,height=680,toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=yes').focus();
	return false;
};

