function search(stringVal)
{
	if(stringVal.length > 0)
	{
		var loc = "";
		loc = "http://www.google.com/search?hl=en&q=" + stringVal + "&btnG=Google+Search";
		loc = loc.replace(/ /, "%20");
		var newwindow = window.open(loc,'','');
		if(window.focus) 
		{
			newwindow.focus()
		}
	}
}

function setFocus()
{
	document.f.q.focus();
}

function checkKey(e)
{
	if(e.keyCode == 13)
	{
		search(document.f.q.value);
	}
}

function checkEmail(strng)
{
	var error = 0;
	if (strng == "")
	{
		error = 1;
	}
	var emailFilter = /^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(strng)))
	{
		error = 1;
	}
	else
	{
		var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;
		if (strng.match(illegalChars))
		{
			error = 1;
		}
	}
	return error; 
}

// non-empty textbox
function isEmpty(strng)
{
	var error = 0;
	if (strng.length == 0)
	{
		error = 1;
	}
	return error;
}

var limit = 400;
var disclaimer = '<P><span id="ID_disclaim" class="minitext"><font size=-3 color="black">*LEGAL DISCLAIMER REGARDING SUBMISSION INQUIRIES THROUGH THIS MEDIUM<br><font size=-1>Although we are appreciative of your interest in making an inquiry with Burman &amp; Robinson, please be aware that inquiries and/or contacts forwarded to the Firm by use of the above Contact Inquiry do not represent an offer and/or agreement, express or implied, by the Firm or any attorney employed by the Firm (a) to provide legal services and/or representation in any form or manner to the Sender relating to the subject matter or content contained in the Message; and/or (b) to respond in any matter to the Sender.  We appreciate your understanding.</font></font></span></P>';
var copyrt = '<center><br><div id="COPYRIGHT">&copy;Copyright 2006, Burman &amp; Robinson Attorneys at Law, All Rights Reserved.</div></center>';
var imgMap = '<img name="BRLogo" src="./Images/BRLogo.gif" width="760" height="118" border="0" usemap="#m_BRLogo" alt=""><map name="m_BRLogo"><area shape="poly" coords="9,86,129,86,129,118,9,118,9,86" href="./" alt="" ><area shape="poly" coords="132,86,252,86,252,118,132,118,132,86" href="./Profiles.html" alt="" ><area shape="poly" coords="256,86,376,86,376,118,256,118,256,86" href="./Practice.html" alt="" ><area shape="poly" coords="381,86,501,86,501,118,381,118,381,86" href="./Location.html" alt="" ><area shape="poly" coords="505,86,625,86,625,118,505,118,505,86" href="./Contact.html" alt="" ><area shape="poly" coords="630,86,750,86,750,118,630,118,630,86" href="./Links.html" alt="" ></map>';
var thrownOver = -1;

function stripped()
{
	return '*LEGAL DISCLAIMER REGARDING SUBMISSION INQUIRIES THROUGH THIS MEDIUM: Although we are appreciative of your interest in making an inquiry with Burman &amp; Robinson, please be aware that inquiries and/or contacts forwarded to the Firm by use of the above Contact Inquiry does not represent an offer and/or agreement, expressly or impliedly, by the Firm or any attorney employed by the Firm (a) to provide legal services and/or representation in any form or manner to the Sender relating to the subject matter or content contained in the Message; and/or (b) to respond in any matter to the Sender.  We appreciate your understanding.';
}

function checkForm()
{
	var obj = null;
	var errFree = true;
	var nam = document.contact.ID_name.value;
	var em = document.contact.ID_email.value;
	var sub = document.contact.ID_subject.value;
	var mesg = document.contact.ID_mesg.value;
	if(isEmpty(nam) > 0)
	{
		changeSpan('Name:', 'ID_tname', 'red');
		errFree = false;
	}
	else
	{
		changeSpan('Name:', 'ID_tname', 'black');
	}
	if(isEmpty(em) > 0)
	{
		changeSpan('E-Mail:', 'ID_temail', 'red');
		errFree = false;
	}
	else if(checkEmail(em) > 0)
	{
		changeSpan('E-Mail:', 'ID_temail', 'red');
		errFree = false;
	}
	else
	{
		changeSpan('E-Mail:', 'ID_temail', 'black');
	}
	if(isEmpty(sub) > 0)
	{
		changeSpan('Subject:', 'ID_tsubject', 'red');
		errFree = false;
	}
	else
	{
		changeSpan('Subject:', 'ID_tsubject', 'black');
	}
	if(isEmpty(mesg) > 0)
	{
		changeSpan('Inquiry*:', 'ID_tinquiry', 'red');
		errFree = false;
	}
	else
	{
		changeSpan('Inquiry*:', 'ID_tinquiry', 'black');
	}
	if(errFree == false)
	{
		sendAlert('Illegal values in form, please correct highlighted fields.');
		return false;
	}
	return true;
}

function changeSpan(title, focus, color)
{
	var titObj = getObject(focus);
	var updateVal = '<span id="' + focus + '" class="minitext"><font color="' + color + '"><NOBR><b>' + title + '</b></NOBR></font></span>';
	titObj.innerHTML = updateVal;
}

function getObject(obj)
{
	var theObj;
	if(document.all)
	{
		if(typeof obj == "string")
		{
			return document.all(obj);
		}
		else
		{
			return obj.style;
		}
	}
	if(document.getElementById)
	{
		if(typeof obj == "string")
		{
			return document.getElementById(obj);
		}
		else
		{
			return obj.style;
		}
	}
	return null;
}

function update(inpu, targ, updatval, chars)
{
	var entradaObj = getObject(inpu);
	var salidaObj = getObject(targ);
	var longitud = chars - entradaObj.value.length;
	var stanStr = " Characters Remaining."
	if(longitud < 0)
	{
		longitud = 0;
		updatval = '<span class="disable"><font size=-1 color="red">&nbsp;' + longitud + stanStr + '&nbsp;</font></span>';
		entradaObj.value = entradaObj.value.substr(0, chars);
		if(thrownOver < 0)
		{
			thrownOver = 1;
			sendAlert('Please limit message to ' + limit + ' characters.  Thank you!');
		}
  	}
  	else
  	{
  		updatval = '<span class="disable"><font size=-1 color="black">&nbsp;' + longitud + stanStr + '&nbsp;</font></span>';
  		thrownOver = -1;
  	}
  	salidaObj.innerHTML = updatval;
}

function sendAlert(val)
{
	alert(val);
}