//************************
// Portfolio Constructor *
//************************
function Portfolio(url, output)
{
	// set id's
	this.obj_output		= document.getElementById(output);
	this.icon_loading	= document.getElementById('icon_loading');
	
	// settings
	this.url			= url;
	
	// set strings
	this.show_class		= 'show';
	this.hide_class		= 'hide';
}

//*********************************
// Function initialize portfolio *
//*********************************
Portfolio.prototype.init = function()
{
	
}

//***********************
// Function show loader *
//***********************
Portfolio.prototype.showLoader = function()
{
	this.icon_loading.className	= this.show_class;
}

//***********************
// Function hide loader *
//***********************
Portfolio.prototype.hideLoader = function()
{
	this.icon_loading.className	= this.hide_class;
}

//***************************
// Function request content *
//***************************
Portfolio.prototype.load = function(params)
{
	// set vars
	var url		= this.url;
	
	// show loader
	this.showLoader();
	
	// set vars
	var myConn	= new XHConn();
	var _this	= this;
	
	if (!myConn) alert("XMLHTTP not available. Please try a newer/better browser.");
	
	// return result when done
	var fnWhenDone = function (oXML)
	{
		// put response in the wrapper as plain text
		_this.obj_output.innerHTML = oXML.responseText;
		
		// hide loader
		_this.hideLoader();
	}
	
	// make the connection
	myConn.connect(url, 'POST', params, fnWhenDone);
}
