String.prototype.trim = function()
{
	return this.replace(/^[\s(&nbsp;)]+/g,'').replace(/[\s(&nbsp;)]+$/g,'');
};

String.prototype.startsWith = function ( s )
{
	return this.indexOf(s) == 0;
};

Array.prototype.inArray = function ( search_phrase )
{
	for( var i = 0; i < this.length; i++ )
	{
		if( search_phrase == this[i] )
		{
			return true;
		}
	}
	return false;
};

function toggle_element(elementId)
{    	
	var obj = document.getElementById(elementId);
	if (obj.style.display == 'block')
		obj.style.display = 'none';
	else
		obj.style.display = 'block';	
};


