
ContentUtils.prototype = new BaseObj();
ContentUtils.prototype.constructor = ContentUtils;
ContentUtils.prototype.baseClass = BaseObj.prototype.constructor;
ContentUtils.prototype.ShowHideColumnWithImage = ShowHideColumnWithImage;
ContentUtils.prototype.ShowHideColumn = ShowHideColumn;
ContentUtils.prototype.SetColumn1 = SetColumn1;
ContentUtils.prototype.GetColumn1 = GetColumn1;
ContentUtils.prototype.SetColumn2 = SetColumn2;
ContentUtils.prototype.GetColumn2 = GetColumn2;
ContentUtils.prototype.SetImage = SetImage;
ContentUtils.prototype.GetImage = GetImage;

function ContentUtils(col1, col2)
{
	this._column1 = document.getElementById(col1);
	this._column2 = document.getElementById(col2);
	this._CheckObjNull = CheckObjNull;
}

function ContentUtils(col1, col2, img)
{
	this._column1 = document.getElementById(col1);
	this._column2 = document.getElementById(col2);
	this._img = document.getElementById(img);
	this._CheckObjNull = _CheckObjNull;
}

function SetColumn1(col1)
{
	this._column1 = document.getElementById(col1);
}

function GetColumn1()
{
	return this._column1;
}

function SetColumn2(col2)
{
	this._column2 = document.getElementById(col2);
}

function GetColumn2()
{
	return this._column2;
}


function SetImage(img)
{
	this._img = img;
}

function GetImage()
{
	return this._img;
}

// Show and hide content function with image path (image path must specificed
// specified imgpath1 and imgpath2
function ShowHideColumnWithImage(ColumnText, ImgPath1, ImgPath2)
{
	try
	{		
		this._CheckObjNull(this._column1);
		this._CheckObjNull(this._column2);
		this._CheckObjNull(this._img);
		
		if (this._column1.style.display == 'none')
		{
			this._column1.style.display = '';
			this._column2.innerHTML = 'Hide ' + ColumnText;		
			this._img.src=ImgPath2;
		} else {
			this._column1.style.display = 'none';
			this._column2.innerHTML = 'Show ' + ColumnText;			
			this._img.src=ImgPath1;
		}
	}
	catch (e)
	{
		window.status = "Cannot show or hide column - script.js";
		throw e;
	}
}


function ShowHideColumn(ColumnText)
{
	try
	{
		this._CheckObjNull(this._column1);
		this._CheckObjNull(this._column2);

		if (this._column1.style.display == 'none')
		{
			this._column1.style.display = '';
			this._column2.innerHTML = 'Hide ' + ColumnText;	
		} else {
			this._column1.style.display = 'none';
			this._column2.innerHTML = 'Show ' + ColumnText;	
		}
	}
	catch (e)
	{
		window.status = "Cannot show column - script.js";
		throw e;
	}
}

function _CheckObjNull(objname)
{
	if (objname == null)
	{
		throw new Error("this object does not exist - " & objname);
	}
}
