function clearForm()
{
	if(this.value == "Search")
	{
		this.value = "";
	}
	this.onblur = resetForm;
}

function resetForm()
{
	if(this.value == "")
	{
		this.value = "Search";
	} 
	this.onblur = nothing;
}

function nothing()
{

}	

function getElementsByClassName(name, obj)
{
	if(obj == null)
	{
		obj = document;
	}
	
	var col = obj.getElementsByTagName('*');
	var newCol = new Array();

	for(i = 0; i < col.length; i++)
	{	
		if(col[i].className.indexOf(name) > -1)
		{
			newCol.push(col[i]);
		}
	}
	
	return newCol;
}

var currobj;

function foldout(el)
{
	currobj = el;
	currobj.style.display = 'block';
	if(currobj.className.indexOf('opened') > -1)
	{
		doFold( -25, currobj.origheight);
	}
	else
	{
		currobj.style.display = 'block';
		doFold( 25, 0);
	}
	currobj.style.overflow = '';
}

function doFold(change, size)
{
	currobj.style.overflow = 'hidden';
	size += change;
	
	if(size <= currobj.origheight && size > -1)
	{
		currobj.style.height = size + 'px';
		setTimeout('doFold(' + change + ',' + size +')', 50);
	}
	else
	{
		if(change < 0)
		{
			currobj.className = 'closed';
		}
		else
		{
			currobj.className = 'opened';
		}
		currobj.style.height = '';
		currobj.style.display = '';
	}
}

function setOrigHeights(clnm)
{
	els = getElementsByClassName(clnm);
	for(i = 0; i < els.length; i++)
	{
		els[i].origheight = els[i].offsetHeight;
		els[i].className = ' closed';		
	}
}