var Quickview = Class.create();
Quickview.prototype = {
	initialize: function(config) {
		this.config = config;
	},
	createButton: function(){
		//var cls = this.config.class;
		var button = '<a class="quick-link" href="javascript:;"><span>' + this.config.title + '</span></a>';	
		return  button;
	},  
	show: function(name) {
		var button = this.createButton();
		$$(name+' li.item a.product-image').each(function(el){
			new Insertion.After(el, ''+button+'');
			Event.observe(el.next(), 'click', function(event) {
				var url = $('baseurl').value+'quickview/ajax/popup/';
				$('quickview-loader').show();
				new Ajax.Request(url, {
				  method: 'post',
				  parameters : {'pro_id':el.readAttribute('id')},
				  onSuccess: function(transport) {
					$('quickview-loader').hide();
					$('popup').update(transport.responseText);
					$('popup').innerHTML;
					$('popup').show();
					$('popup-overlay').show();
				  }
				});
			});
			Event.observe(el.up(), 'mouseover', function(event) {
				el.next().down().show();
			});
			Event.observe(el.up(), 'mouseout', function(event) {
				el.next().down().hide();
			});
		});
	}
};
function closePopup(){
	$('popup').update(' ');
	$('popup').innerHTML;
	$('popup').hide();
	$('popup-overlay').hide();
}

