<!--

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// FUNCTION TO SET DISPLAY PROPERTY ON AN OBJECT
function MM_displayLayers() {
var i,p,v,obj,args=MM_displayLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v=='none')?'none':v; }
	//if (checkIt('mac')&&v=='visible') obj.pixelTop = obj.pixelTop ;
    obj.display=v; }
}

function correct_tbl_ht() {
	if (document.getElementById) {
		var height = (document.getElementById('tbl').offsetHeight) - (document.getElementById('left_tbl').offsetHeight);
		if (height > 0) {
			document.getElementById('left_tbl').height = (document.getElementById('tbl').offsetHeight);
		}
	}
}

function showPersonal() 
{
	if (document.layers) // NS4
	{ 	document.PersonalLayer.visibility = "show";
		document.PersonalLayer.zIndex = "5";
		document.BusinessLayer.zIndex = "1";		
	 } 
	else if (document.all) // IE3-4
	{ 	document.all.PersonalLayer.style.visibility = "visible";
		document.all.PersonalLayer.style.zIndex = "5";
		document.all.BusinessLayer.style.zIndex = "1";		
	 }	
	else // NS6, IE4+
	{	document.getElementById("PersonalLayer").style.visibility = "visible";
		document.getElementById("PersonalLayer").style.zIndex = "5";
		document.getElementById("BusinessLayer").style.zIndex = "1";		
	 }

	document.getElementById("BusinessLayer").style.visibility = "hidden";

}

function showBusiness() 
{
	if (document.layers) // NS4
	{ 	document.BusinessLayer.visibility = "show";
		document.BusinessLayer.zIndex = "5";	
		document.PersonalLayer.zIndex = "1";				
	} 
	else if (document.all) // IE3-4
	{ 	document.all.BusinessLayer.style.visibility = "visible";
		document.all.BusinessLayer.style.zIndex = "5";
		document.all.PersonalLayer.style.zIndex = "1";					
	}	
	else //NS6, IE4+
	{	document.getElementById("BusinessLayer").style.visibility = "visible";
		document.getElementById("BusinessLayer").style.zIndex = "5";
		document.getElementById("PersonalLayer").style.zIndex = "1";			
	}

	document.getElementById("PersonalLayer").style.visibility = "hidden";
	


}
//########################################################################
//Operation Type:		Function
//Name			:		VerifyData
//Scope			:		Private
//Input Param	:		None
//Output Param	:		Status::Boolean
//Desc.			:		Validate user registration input fields
//########################################################################
function VerifyData()
{
// Return false if userType = 0.
if (document.frmUser.userType.selectedIndex == 0) 
   {
   alert("\nA user type is required.\n\nPlease select your user type.")
   document.frmUser.userType.focus();
   return false; 
   }
// Return false if e-mail field is blank.
if (document.frmUser.email.value == "") 
   {
   alert("\nAn e-mail address is required.\n\nPlease enter your e-mail address.")
   document.frmUser.email.focus();
   return false; 
   }
// Return false if e-mail field does not contain a '@' and '.' .
if (document.frmUser.email.value.indexOf ('@',0) == -1 || 
    document.frmUser.email.value.indexOf ('.',0) == -1)
   {
   alert("\nYour e-mail address is invalid.\n\nPlease re-enter your e-mail address in the format of \"someone@somedomain.com\" .")
   document.frmUser.email.select();
   document.frmUser.email.focus();
   return false;
   }

if (document.frmUser.LogonName.value == "")
	{
	alert("A username is required.");
	return false
	}
if (document.frmUser.FirstName.value == "")
	{
	alert("A display name is required.");
	return false
	}
if (document.frmUser.Password.value != document.frmUser.VerifyPassword.value)
   {
   alert ("The password you entered does not match the one you entered in the verify password box.");
   return false;
   }
if (document.frmUser.LogonName.value == document.frmUser.Password.value)
   {
   alert ("Your username and password cannot be the same.");
   return false;
   }
if (document.frmUser.PostalCode.value == "" && document.frmUser.Country.value == "USA")
	{
	alert("A postal code is required.");
	return false;
	}else{
		if (validateZipCode(document.frmUser.PostalCode.value) == false && document.frmUser.Country.value == "USA")
			{
			//Invalid zip code
			alert("You have entered an invalide postal code.  Please verify your entry and try again.");
			return false;
			}
	}
if (document.frmUser.terms.checked != true)
	{
	alert("Agreement to our terms and service is required.");
	return false;
	}
}
//######################################################################
//Operation Type:	Function
//Name:				validateZipCode
//Scope:			Public
//In Parameters:	None
//Out Parameter:	status::boolean
//Desc:				Returns valid zip code status.
//######################################################################
function validateZipCode(zipCode)
	{
	var regexp = /^(00[5-9]{1}|[1-9]{1}[0-9]{2}|0[1-9]{1}[0-9]{1})[0-9]{2}$/;
	return regexp.test(zipCode);
	}
//######################################################################
//Operation Type:	Function
//Name:				reportMessage
//Scope:			Public
//In Parameters:	None
//Out Parameter:	reportDialog::String
//Desc:				Returns a browser window to report a messages.
//######################################################################
function reportMessage(messageId,mailTo,name,subject,postBy,editorialServer,messageBaseURL,messageParams)
{
	var newWin = window.open('','reportReference','scrollbars=no,menubar=no,status=no,directories=no,location=no,resizable=no,toolbar=no,height=350,width=625');
	var doc = newWin.document;
	
	doc.open();
	
	doc.writeln("<HTML>");
	doc.writeln("<head>");
	doc.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/styles.css\" />");
	doc.writeln("<title>Report this message</title>");
	doc.writeln("</head>");
	doc.writeln("<title>Report this message</title>");
	doc.writeln("<body leftmargin='0' marginheight='0' marginwidth='0' topmargin='0' TEXT='#FFFFFF'>");
	doc.writeln("<img src='/images/MHLogo.jpg' alt='Martindale-Hubbell - lawyers.com' border='0'>");
	doc.writeln("");	
	doc.writeln("<form name='reportMessage' method='post' action='reportMessage.asp'>");
	doc.writeln("<input type=hidden name='url' value='http://" + editorialServer + messageBaseURL + "?" + messageParams + "'>");
	doc.writeln("<input type=hidden name='mid' value='" + unescape(messageId) + "'>");
	doc.writeln("<input type='hidden' name='mailto' value='" + unescape(mailTo) + "'>");
	doc.writeln("<input type='hidden' name='boardname' value='" + unescape(name) + "'>");
	doc.writeln("<input type='hidden' name='messagesubject' value='" + unescape(subject) + "'>");
	doc.writeln("<input type='hidden' name='postbyscreenname' value='" + unescape(postBy) + "'>");
	doc.writeln("<table border=0 width='550' cellpadding=0 cellspacing=0>");
	if(mailTo == "sitehelp@lawyers.com") mailTo = "feedback@lawyers.com";
	doc.writeln("<tr valign=bottom><td width='25%'><font face=arial color=black size=2>To:</font></td><td><font face=arial color=black size=2>" + unescape(mailTo) + "&nbsp;</font></td></tr>");
	doc.writeln("<tr valign=bottom><td><font face=arial color=black size=2>Board Name:</font></td><td><font face=arial color=black size=2>" + unescape(name) + "&nbsp;</font></td></tr>");
	doc.writeln("<tr valign=bottom><td><font face=arial color=black size=2>Message Subject:</font></td><td><font face=arial color=black size=2>" + unescape(subject) + "&nbsp;</font></td></tr>");
	doc.writeln("<tr valign=bottom><td><font face=arial color=black size=2>Post by:</font></td><td><font face=arial color=black size=2>" + unescape(postBy) + "&nbsp;</font></td></tr>");
	doc.writeln("<tr><td colspan=2><font face=arial color=black size=2>Comments:</font></td></tr>");
	doc.writeln("<tr><td colspan=2><textarea COLS=74 ROWS=10' name='comments'></textarea></td></tr>");
	doc.writeln("<tr><td><input type='submit' name='cmdSubmit' value='Submit'></td><td align='right'><input type='button' name='cancel' value='Cancel' onclick='window.close()'</td></tr>");
	doc.writeln("</table>");
	doc.writeln("</form>");
	doc.writeln("</body>");
	
	doc.writeln("</HTML>");

	doc.close();
}
//######################################################################
//Operation Type:	Function
//Name:				validate
//Scope:			Public
//In Parameters:	None
//Out Parameter:	None
//Desc:				determine if user entered a message for posting.
//######################################################################
function validate()
{
var str = new String(document.forms["frmMessage"].message.value);
var str2 = new String(document.forms["frmMessage"].subject.value);
var Expr1 = /\s{1,}/;
str = str.replace(Expr1,"");
if (str == ""){
	document.forms["frmMessage"].message.value = ""
}
str2 = str2.replace(Expr1,"");
if (str2 == ""){
	document.forms["frmMessage"].subject.value = ""
}
	if (document.forms["frmMessage"].subject.value == "") {
		alert('Please enter a subject.');
		document.forms["frmMessage"].subject.focus()
		return false
	}
	if (document.forms["frmMessage"].message.value == "" || document.forms["frmMessage"].IsDirty.value == 0) 
		{
		alert('Please enter a message.');
		document.forms["frmMessage"].message.focus();
		return false
	}else {
		document.forms["frmMessage"].IsDirty.value = 0;
	}
}
//######################################################################
//Operation Type:	Function
//Name:				setDirty
//Scope:			Public
//In Parameters:	None
//Out Parameter:	None
//Desc:				Determine if user cleared message helper text.
//######################################################################
function setDirty()
{
if (document.forms["frmMessage"].IsDirty.value == 0)
	{
		document.forms["frmMessage"].message.value = '';
		document.forms["frmMessage"].IsDirty.value = 1;
	}
}
//######################################################################
//Operation Type:	Function
//Name:				closeWindow
//Scope:			Private
//In Parameters:	None
//Out Parameter:	None
//Desc:				Close a child window.
//######################################################################
function closeWindow()
{
	window.close();
}

function openWindow(url)
{
	window.open(url);
}

function showMessage(msgId,strName,intMatch) {
}

function validateDate(){
 var fromYear =document.forms['lookUpMessageByUser'].YrFrom.options[document.forms['lookUpMessageByUser'].YrFrom.selectedIndex].value;
 var ToYear = document.forms['lookUpMessageByUser'].YrTo.options[document.forms['lookUpMessageByUser'].YrTo.selectedIndex].value;
 
 var fromMon =document.forms['lookUpMessageByUser'].MonFrom. options[document.forms['lookUpMessageByUser'].MonFrom.selectedIndex].value;
 var ToMon = document.forms['lookUpMessageByUser'].MonTo.options[document.forms['lookUpMessageByUser'].MonTo.selectedIndex].value;

	if (document.forms['lookUpMessageByUser'].screenName.value  == ""){
		alert('A user display name was not entered.  Please enter a user display name');
	}else if (fromMon ==""){
		alert('A From Date was not selected.  Please select a From Date.');
	}else if (ToMon == ""){
		alert('A To Date was not selected.  Please select a From Date.');
	}else if (fromYear == ""){
		alert('A From Year was not selected.  Please select a From Year.');
	}else if (ToYear == ""){
		alert('A To Year was not selected.  Please select a To Year.');
	}else if (ToYear < fromYear || (ToYear == fromYear && parseInt(ToMon) <= parseInt(fromMon)) ) {
		alert('The To Date cannot precede or be equal to the From Date.');
	}else{
		document.forms['lookUpMessageByUser'].submit(); 
	}
}
function showOldAdvForm(){}
//-->