InfoStation = function() {
	return {
		init : function() {

			var pageRules = {
				'div#infostation-portlets' : function(element) {
                    if(NYWine.ajaxType > 0)
                    {
					    $(element).getElementsBySelector('a').each(function(aEle) {
					    
					        if($(aEle).rel != "")
					        {
    						    Event.stopObserving(aEle, 'click', InfoStation.showInfoStation);
	    					    Event.observe(aEle, 'click', InfoStation.showInfoStation);
						    }
					    });
					}
				}
			};

			Behaviour.register(pageRules);
		},
		
		showInfoStation: function(evt) {
		    Event.stop(evt);
		    
		    var aEle = Event.element(evt);		    
		   
            Modalbox.show($(aEle).href, { 
			            title: $(aEle).rel,
			            width: 974,
			            height: (NYWine.getViewHeight())
			    });
            
		    
		}
	};
}();

Event.observe(window, 'load', function() {
	InfoStation.init();

	Behaviour.apply();
});
