/////////////////////////////////////////////////////////////////////

function doDisclaimer(values, formName)
{
	var disclaimer='Thank you for reaching out to contact Choate. Before you send your message, we wanted to make sure you are aware of the following. Please do not send any confidential information in response to this link. Sending an e-mail to Choate does not give rise to an attorney-client relationship, and will not be deemed to disqualify Choate from undertaking any engagement for a current or future client.  Before any attorney-client engagement may be formed, Choate will need to check for possible conflicts of interest, you will need to consider whether you wish to retain Choate as counsel, and we will need to consider whether we wish to accept the potential engagement. In the meantime, Choate reserves the right to represent parties with interests adverse to you.';

	alert(disclaimer);
	doSubmit(values, formName);
}

/////////////////////////////////////////////////////////////////////

function emailDisclaimer()
{
	var disclaimer='Thank you for reaching out to contact Choate. Before you send your message, we wanted to make sure you are aware of the following. Please do not send any confidential information in response to this link. Sending an e-mail to Choate does not give rise to an attorney-client relationship, and will not be deemed to disqualify Choate from undertaking any engagement for a current or future client.  Before any attorney-client engagement may be formed, Choate will need to check for possible conflicts of interest, you will need to consider whether you wish to retain Choate as counsel, and we will need to consider whether we wish to accept the potential engagement. In the meantime, Choate reserves the right to represent parties with interests adverse to you.';

	alert(disclaimer);
//	var URL = 'http://www.google.com';
//	getURL(URL);
	return true;
}


/////////////////////////////////////////////////////////////////////

function doSubmit(values, formName)
{
	var fieldID;
	var fieldValue;
	var item;

	for(var i=0;values.length>i;i++)
	{
		fieldID=values[i]['id'];
		fieldValue=values[i]['value'];
		item = document.getElementById(fieldID);

		if(item.value==fieldValue)
			item.value='';
	}
	var form;
	if(document.forms[formName])
		form=document.forms[formName];
	else
		form=document.getElementById(formName);

	form.submit();
	return false;
}

/////////////////////////////////////////////////////////////////////

function resetForm(values)
{
	var fieldID;
	var fieldValue;
	var item;

	for(var i=0;values.length>i;i++)
	{
		fieldID=values[i]['id'];
		fieldValue=values[i]['value'];
		item = document.getElementById(fieldID);
		var isSelect=false;

		if(item.tagName.toLowerCase()=='select')
			isSelect=true;

		if(isSelect)
		{
			var options = item.getElementsByTagName('option');

			for(var n=0;options.length>n;n++)
			{
				if(options[n].value==fieldValue || options[n].value=='')
				{
					options[n].selected=true;
				}
				else
					options[n].selected=false;
			}
		}
		else
			item.value=fieldValue;	
	}

	return false;
}

/////////////////////////////////////////////////////////////////////

function isString(a) {
    return typeof a == 'string';
}

function isUndefined(a) {
    return typeof a == 'undefined';
} 

/////////////////////////////////////////////////////////////////////

function textField(t, text)
{
	if(t.value==text)
		t.value='';
	else if(t.value=='')
		t.value=text;
}

/////////////////////////////////////////////////////////////////////

function displayBlock(id)
{
	if(document.getElementById(id)!=null && document.getElementById(id)!='undefined')
	{
		var ul = document.getElementById(id);
		if(ul.style.display=='none' || ul.style.display=='')
			ul.style.display='block';
		else if(ul.style.display=='block')
			ul.style.display='none';
	}
}

/////////////////////////////////////////////////////////////////////

function addClass(t, classValue)
{
	var item;
	
	if(isString(t))
		item = document.getElementById(t);
	else
		item = t;

	var itemClass = item.className;

	if(itemClass.length>0)
	{
		if(itemClass.search(classValue)>-1)
			item.className = itemClass.replace(classValue, '');
		else
			item.className+=' '+classValue;
	}
	else
		item.className=classValue;
}

/////////////////////////////////////////////////////////////////////

function replaceClass(t, classValue)
{
	var item;
	
	if(isString(t))
		item = document.getElementById(t);
	else
		item = t;

	item.className=classValue;
}

/////////////////////////////////////////////////////////////////////
/*
function doSubmit(values, formName)
{
	alert('HERE');
	var fieldID;
	var fieldValue;
	var item;

	for(var i=0;values.length>i;i++)
	{
		fieldID=values[i]['id'];
		fieldValue=values[i]['value'];
		item = document.getElementById(fieldID);

		if(item.value==fieldValue)
			item.value='';
	}
	var form;
	if(document.forms[formName])
		form=document.forms[formName];
	else
		form=document.getElementById(formName);

	form.submit();
	return false;
}

/////////////////////////////////////////////////////////////////////
*/
