function update_details(target, content, title_target, title)
{
	if (title)
	{
		document.getElementById(title_target).style.display = 'block';
		document.getElementById(title_target).innerHTML = '<span>' + title + '</span>';
	}
	
	if (target && content)
	{
		
		document.getElementById(target).innerHTML = content;
	}
}

function nClose(target)
{
	if (target)
	{	
		document.getElementById(target).style.display = 'none';
	}
}

function pretext(target, action, vtext)
{
	if (target && vtext && action)
	{
		vobj = document.getElementById(target);
		ctext = vobj.value; // current value of the object
	
		if (action == "focus")
		{ //function was triggered by the obj gaining focus
			if (ctext == vtext)
			{ // if the obj contains the pretext, remove it
				vobj.value = '';
				vobj.className = '';
			}
		}
		
		if (action == "blur")
		{ //function was triggered by the obj losing focus
			if (ctext == "")
			{ // if the obj is blank, reset the pretext
				vobj.value = vtext;
				vobj.className = 'pretext';
			}
		}
	}
}

function showhide(e, d)
{
	var obj = document.getElementById(e);
	if (d == null)
	{
		var d = 'block';
	}
	if (obj)
	{
		if (obj.style.display == 'none')
		{
			obj.style.display = d;
		}
		else
		{
			obj.style.display = 'none';
		}
	}
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

