
// ポップアップ表示クラス
var PopupWindow = Class.create();
PopupWindow.prototype = {
    initialize: function(className,selector,_width,_height) {
		this.width = _width || 550;
		this.height = _height || 650;
        var elements = $$('.' + className + selector);
        for (var i = 0, len = elements.length; i < len; i++) {
            Event.observe(elements[i], 'click', this.addPopupEvent.bindAsEventListener(this));
            Event.observe(elements[i], 'keypress', this.addPopupEvent.bindAsEventListener(this));
        }
    },
    addPopupEvent: function(event) {
        var element = Event.element(event).parentNode;
        var link = element.getAttribute('href');
        window.open(link,'ex','width=' + this.width + ',height=' + this.height + ',scrollbars=1,status=0,resizable=1');
        Event.stop(event);
    }
};

// onload
Event.observe(window, 'load', function () {
    new PopupWindow('ex',' dl dd a');
    new PopupWindow('ex_cat12',' ul li a',650,750);
    new PopupWindow('ex_cat12',' dl dd a',600,750);
}); 
