

var InfoLink = Class.create(
{
	uri: null,
	
	width: null,
	
	height: null,
	
	settings: "location=0,status=0,toolbar=0,menubar=0,resizable=1,",
	
	initialize: function( element )
	{
		this.element = $( element );
		
		this.initOther();
		this.initEvents();
	},
	
	initOther: function()
	{
		this.id = this.element.getAttribute( "id" );
		this.uri = this.element.getAttribute( "href" );
		var tempWidth = this.element.getStyle( "max-width" );
		var tempHeight = this.element.getStyle( "max-height" );
		this.width = tempWidth ? parseInt( tempWidth.replace( "px", "" ) ) : "250";
		this.height = tempHeight ? parseInt( tempHeight.replace( "px", "" ) ) : "350";
	},
	
	initEvents: function()
	{
		this.element.observe( "click", this.handleClick.bind( this ) );
	},
	
	handleClick: function(e)
	{
		Event.stop(e);
		var settings = this.settings + "width=" + this.width + ",height=" + this.height;
		this.element.blur();
		window.open( this.uri, this.id + "_window", settings, true ).focus();
	}
});

document.observe( "dom:loaded", function(){ $$( ".info-link" ).each( function( el ){ new InfoLink( el ) } ) } );