//********************
// Popup Constructor *
//********************
function Popup(header,text,popup_node)
{
	// get id's
	//this.page_filter	= document.getElementById('page_filter');
	this.popup_warning	= !popup_node ? $('popup_warning') : $(popup_node);
	
	// get tags
	//this.popup_warning_header	= this.popup_warning.getElementsByTagName('h1')[0];
	this.popup_warning_text		= this.popup_warning.getElement('p');
	
	// set text
	this.warning_header	= header ? header : null;
	this.warning_text	= text ? text : null;
	
	this.location	= null;
	this.formObj	= null;
	
	// initialize object
	this.init();
}

//****************************
// Function initialize popup *
//****************************
Popup.prototype.init = function()
{
	//this.popup_warning_header.innerHTML	= this.warning_header;
	if (this.warning_text)
	{
		this.popup_warning_text.set('html', this.warning_text);
	}
}

//**********************
// Function show popup *
//**********************
Popup.prototype.show = function(location, formObj)
{
	this.location = location;
	
	if (formObj)
	{
		this.formObj = formObj;
	}
	
	this.popup_warning.removeClass('hide');
}

//**********************
// Function hide popup *
//**********************
Popup.prototype.hide = function()
{
	this.popup_warning.addClass('hide');
}

//************************
// Function action popup *
//************************
Popup.prototype.action = function()
{
	// post request
	if (this.formObj)
	{
		popupLoading(this.formObj);
		//document.getElementById(this.formObj).submit();
	}
	
	// get request
	else if (this.location)
	{
		document.location = this.location;
	}
}
