	//var pathPopUp='http://192.168.16.230/wwwPHP/fiordaliso/sito/js/class_popUp/';
	var pathPopUp='http://www.fiordaliso.net/js/class_popUp/';
	
	_fileref=document.createElement("link");
	_fileref.setAttribute("rel", "stylesheet");
	_fileref.setAttribute("type", "text/css");
	_fileref.setAttribute("href", pathPopUp+'style.css');
	$('head').append(this._fileref);
	
	popUp_class = function(parent, closeBtn, id){
		this._id=id;
		
		this._body='<div class="popUp_wrapper" id="'+id+'">';
		this._body+='<div class="popUp">';
		if (closeBtn)
			this._body+='<a href="#" class="popUp_close"><img src="'+pathPopUp+'xsmall.png" /></a>';
		this._body+='<div class="popUp_top"></div>';
		this._body+='<div class="popUp_content"></div>';
		this._body+='<div class="popUp_bottom"></div>';
		this._body+='</div>';
		this._body+='</div>';
		
		$(parent).append(this._body);
	}
	
	popUp_class.prototype =
	{
		
		loading : function(){
			$('.popUp_content').html('<img id="popUp_loader" src="'+pathPopUp+'loader.gif" />');
			$('#'+this._id).fadeIn();
		},
		
		load : function(page, id){
			var idPopUp=this._id;
			
			$('.popUp_content').html('<img id="popUp_loader" src="'+pathPopUp+'loader.gif" />');
			$('#'+this._id).fadeIn();
			$.post(page, { id:id },
				function(data){
					$('#'+idPopUp+' .popUp_content').html(data);
					$(".popUp_close").click(
						function(){
							$('.popUp_wrapper').fadeOut();
							return false;
						}
					);
				}
			);
		},
		
		html : function(data){
			$('#'+this._id).fadeIn();
			$('.popUp_content').html(data);
			$(".popUp_close").click(
				function(){
					$('.popUp_wrapper').fadeOut();
					return false;
				}
			);
		},
		
		close : function(){
			$('.popUp_wrapper').fadeOut();
		}
		
	}
	
	function popUpClose(){
		$('.popUp_wrapper').fadeOut();
	}
	
	$(document).ready(
		function(){
			popUpErrore = new popUp_class('body', 1, 'errorePopUp');
			popUp = new popUp_class('body', 1, 'mappaPopUp');
		}
	);
	
