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

jQuery.fn.popAlpiModUtilizzo = function(style_params, other_params){
	jQuery(this).click(function(e){
	
	   setOpacity('#containerOpacity');
	
		var file = jQuery(this).attr('href');
		var x = e.pageX;
		var y = e.pageY;
		var style = {
			'position': 'absolute',
			'top': y - 50 + 'px',
			'left': x - 520 + 'px',
			'background-color': '#fff',
			'color': '#000',
			'border': 'none',
			'cursor': 'pointer'
		}
		var config = {
			'closeOnClick': true,
			'id': 'poaltoModUtilizzo'
		}
		jQuery.extend(style, style_params);
		jQuery.extend(config, other_params);
		jQuery('#' + config.id).remove();
		jQuery('<div id="' + config.id + '"></div>')
			.css(style)
			.load(file)
			.appendTo('body')
			.click(function(){
				if (config.closeOnClick) {
				}
			});
		jQuery('#poaltoModUtilizzo').bgiframe();

		return false;
	});
	
};

