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

jQuery.fn.popAlpiButton = function(style_params, other_params){
	jQuery(this).mouseover(function(e){
		var file = jQuery(this).attr('helppiccolo');
		var x = e.pageX;
		var y = e.pageY;
		var style = {
			'position': 'absolute',
			'top': y - 90 + 'px',
			'left': x - 350 + 'px',
			'background-color': '#fff',
			'color': '#000',
			'border': '1px solid #999',
			'padding': '10px',
			'cursor': 'pointer'
		}
		var config = {
			//'closeOnClick': true,
			'id': 'poalto'
		}
		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(this).remove();
			//	}
			//});
		jQuery('#poalto').bgiframe();
		return false;
	});
	
	jQuery(this).mouseout(function(e){
		jQuery('#poalto').remove();
		return false;
	});	
};


