
function toggle(objName)
{
	ObjImgName = objName + 'Image';
	objDivName= objName + 'Div';	
	obj = document.getElementById(objDivName);
	objImg = document.getElementById(ObjImgName);
	objImg.src = (obj.style.display=='none')?'../images/Sublinks/Sub_Bullet_minus.jpg':'../images/sublinks/Sub_Bullet_plus.jpg';
	obj.style.display=(obj.style.display=='none')? '' : 'none';
}


//for trimming text from text inputs and textareas
function trimAll(str)
{ 
	return( ("" + str).replace(/^\s+/,'').replace(/\s+$/,'') ); 
}

function showOtherText(cbox)
{
	var cboxName = "";
	cboxName = cbox.name;
	var otherDiv = cboxName + "_otherDiv";
	var otherInput = cboxName + "_otherInput";
	if(cbox.checked)
	{
		document.getElementById(otherDiv).style.display = "block";		
		document.getElementById(otherInput).value = "Please specify...";
		document.getElementById(otherInput).select();
		document.getElementById(otherInput).focus();
	}
	else
	{
		document.getElementById(otherInput).value = "";
		document.getElementById(otherDiv).style.display = "none";
	}
}

function showOtherbyName(cbox,otherName)
{		
	var otherDiv = otherName + "_otherDiv";
	var otherInput = otherName + "_otherInput";
	if(cbox.checked)
	{
		document.getElementById(otherDiv).style.display = "block";		
		document.getElementById(otherInput).value = "Please specify...";
		document.getElementById(otherInput).select();
		document.getElementById(otherInput).focus();
	}
	else
	{
		document.getElementById(otherInput).value = "";
		document.getElementById(otherDiv).style.display = "none";
	}
}

function CheckSearch(clicked)
{	
	if(frmSearch.searchText.value=="")
	{
	    alert('Please enter your search criteria.');
		return false;
	}
	if(clicked)
		document.frmSearch.submit();
	return true;	
}
