/****************************************\
* Author: Gabriel Guzman	               *
* Date: 20-08-2008                       *
* Email: gabo@13deseptiembre.com.ar      *
* CVT Argentina                          *
\****************************************/
/**
 * Parameters:
 * @url:
 *	   String
 *     Ex.: url: 'simplePopup.so?action=drawPopup'
 */
function MyPopup(){
	
	/* Read configuration parameters */
	this.configure = function(options){
		this.url = options.url;
		this.op1 = options.op1;
		this.op2 = options.op2;
		this.op3 = options.op3;
	}

	/* Create the loading skeleton */
	this.draw = function(){
		return '<div type="login-popup"><div class="login-popup-loading-icon"></div>';
	}

	
	/* Load the real body of the popup */
	this.load = function(){
		
		$.ajax({
			async: true,
			url: this.url,
			//data: {id: this.id},
			data: "op1="+this.op1+"&op2="+this.op2+"&op3="+this.op3,
			success: function(data){
				$('div[type="login-popup"]:last').html(data);				
			},
			error: function(error){
				//
			}
		});
	}	
}
