/*	apre un div tipo popup
	che si chiude cliccandoci sopra
	- il contenuto è l'href del link
	- accetta anche width e height
*/

jQuery.fn.popAlpiSearchConchiglia = function(style_params, other_params){
	jQuery(this).click(function(e){
		var file = jQuery(this).attr('href');
		var x = e.pageX;
		var y = e.pageY;
		if (x < 370) {
			var xleft = x - 300 + 'px';
		} else {
			var xleft = x - 360 + 'px';
		}	
			
		var style = {
			'position': 'absolute',
			'top': y - 50 + 'px',
			'left': xleft,
			'width': '412px',			
			/*
			'background-image':'url(/ResEBook/img/VGTO/boxConchiglia.jpg)',
			'background-repeat':'no-repeat',
			'background-position': 'center',
			'height': '169px',
			*/			
			'cursor': 'pointer'			
		}
		
		var config = {
			'closeOnClick': true,
			'id': 'poaltoSearchConchiglia'
		}
		jQuery.extend(style, style_params);
		jQuery.extend(config, other_params);
		jQuery('#' + config.id).remove();
		jQuery('#poaltoInfoSmall').remove();
		jQuery('<div id="' + config.id + '"></div>')
			.css(style)
			.load(file)
			.appendTo('body')
			.click(function(){
				if (config.closeOnClick) {
					jQuery(this).remove();
				}
			});
		jQuery('#poaltoSearchConchiglia').bgiframe();
		return false;
	});
	
};


