// JavaScript Document

var Popup = function(targetId){
	this.width = 100;
	this.height = 200;
	this.targets =document.getElementById(targetId);
}

Popup.prototype = {
	
	multiple:function(){
		
		if(this.targets !== null && this.targets !== undefined){
			var anchors = this.targets.getElementsByTagName('a');

			for(var i = 0; i < anchors.length; ++i){
				
				this.open(anchors.item(i));

			}
		}
	},
	open:function(tg){
		
		var width = this.width;
		var height = this.height;
		
		var op = function(evt){
			window.open(tg.href,null,"width="+width+",height="+height+",scrollbars=yes").focus();
			if(evt.preventDefault) { evt.preventDefault(); }
			return false;
		}

		dom.addListener(tg,"click",op);

	},
	
	close:function(){
		var c = function(){
			window.close();
		}
		dom.addListener(this.targets,"click",c);
	}
}



var open1 = function(){
	var pop = new Popup("list");
	pop.width = 720;
	pop.height = 750;
	pop.multiple();
}
dom.addListener(window,"load",open1);

var open2 = function(){
	var pop = new Popup("list2");
	pop.width = 720;
	pop.height = 700;
	pop.multiple();
}
dom.addListener(window,"load",open2);

var close1 = function(){
	var pop = new Popup("close");
	pop.close();
}

dom.addListener(window,"load",close1);