<!--

function formrule(field)
{
	if (field.defaultValue == field.value) field.value = "";
}
function formrule2(field) {
  if (field.value == "") {
    field.value = field.defaultValue;
  }
}

  if(window.attachEvent)
    window.attachEvent("onload",restoreStyles);

  function restoreStyles(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++)
      inputList[i].style.backgroundColor = "";
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++)
      selectList[i].style.backgroundColor = "";
  }//-->

<!-- Begin
function addbookmark()
{
bookmarkurl="http://gallagherlawfirm.dataride-previews.com:8500/glaw/00056.htm"
bookmarktitle="Gallagher Law Firm - Admiralty & Maritime Law"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
//  End


// Only script specific to this form goes here.
// General-purpose routines are in a separate file.
  function validateOnSubmit() {
    var elem;
    var errs=0;
    // execute all element validations in reverse order, so focus gets
    // set to the first one in error.
    if (!validateCaseType  (document.forms.demo.CaseType, 'inf_CaseType', true)) errs += 1; 
    if (!validateInjuryType  (document.forms.demo.InjuryType, 'inf_InjuryType', true)) errs += 1; 
    if (!validatePhone  (document.forms.demo.phone, 'inf_phone', true)) errs += 1; 
    if (!validateEmail  (document.forms.demo.email, 'inf_email', true)) errs += 1; 
    if (!validateZip  (document.forms.demo.zip, 'inf_zip', true))       errs += 1; 
    if (!validatePresent(document.forms.demo.name,  'inf_name'))        errs += 1; 
    if (!validatePresent(document.forms.demo.address,  'inf_addr'))     errs += 1; 
    if (!validatePresent(document.forms.demo.dates,  'inf_dates'))      errs += 1; 
    if (!validatePresent(document.forms.demo.comments,  'inf_comments'))        errs += 1; 

    if (errs>1)  alert('There are fields which need correction before sending');
    if (errs==1) alert('There is a field which needs correction before sending');
    if (errs==0) alert('Thank you! Your message has been sent.\n\nPlease note that submission of this email\ndoes not create a lawyer-client relationship.');

    return (errs==0);
  };

// ----------------------------------------------------------------------
// Javascript form validation routines.
// Author: Stephen Poley
//
// Simple routines to quickly pick up obvious typos.
// All validation routines return true if executed by an older browser:
// in this case validation must be left to the server.
//
// Update Aug 2004: have tested that IE 5.0 and IE 5.5 both support DOM model
// sufficiently well, so innerHTML option removed (redundant).
// ----------------------------------------------------------------------

var nbsp = 160;    // non-breaking space char
var node_text = 3; // DOM text node-type
emptyString = /^\s*$/

// -----------------------------------------
//                  trim
// Trim leading/trailing whitespace off string
// -----------------------------------------

function trim(str)
{
  return str.replace(/^\s+|\s+$/g, '')
};

// -----------------------------------------
//                  msg
// Display warn/error message in HTML element
// commonCheck routine must have previously been called
// -----------------------------------------

function msg(fld,     // id of element to display message in
             msgtype, // class to give element ("warn" or "error")
             message) // string to display
{
  // setting an empty string can give problems if later set to a 
  // non-empty string, so ensure a space present. (For Mozilla and Opera one could 
  // simply use a space, but IE demands something more, like a non-breaking space.)
  var dispmessage;
  if (emptyString.test(message)) 
    dispmessage = String.fromCharCode(nbsp);    
  else  
    dispmessage = message;

  var elem = document.getElementById(fld);
  elem.firstChild.nodeValue = dispmessage;  
  
  elem.className = msgtype;
};

// -----------------------------------------
//            commonCheck
// Common code for all validation routines to:
// (a) check for older / less-equipped browsers
// (b) check if empty fields are required
// Returns true (validation passed), 
//         false (validation failed) or 
//         proceed (don't know yet)
// -----------------------------------------

var proceed = 2;  

function commonCheck    (vfld,   // element to be validated
                         ifld,   // id of element to receive info/error msg
                         reqd)   // true if required
{
  if (!document.getElementById) 
    return true;  // not available on this browser - leave validation to the server
  var elem = document.getElementById(ifld);
  if (!elem.firstChild)
    return true;  // not available on this browser 
  if (elem.firstChild.nodeType != node_text)
    return true;  // ifld is wrong type of node  

  if (emptyString.test(vfld.value)) {
    if (reqd) {
      msg (ifld, "clsmallwarning", "Required!");  
      vfld.focus();
      return false;
    }
    else {
      msg (ifld, "warn", "");   // OK
      return true;  
    }
  }
  return proceed;
}

// -----------------------------------------
//            validatePresent
// Validate if something has been entered
// Returns true if so 
// -----------------------------------------



function validatePresent(vfld,   // element to be validated
                         ifld )  // id of element to receive info/error msg
{
  var stat = commonCheck (vfld, ifld, true);
  if (stat != proceed) return stat;

  msg (ifld, "warn", "");  
  return true;
};


function validateCaseType (vfld,   // element to be validated
                         ifld,   // id of element to receive info/error msg
                         reqd)   // true if required
{
  var stat = commonCheck (vfld, ifld, reqd);
  if (stat != proceed) return stat;

  var tfld = trim(vfld.value);  // value of field with whitespace trimmed off


  if (tfld==0) {
    msg (ifld, "clsmallwarning", " Required!");
    vfld.focus();
    return false;
	}
  else { 
      msg (ifld, "warn", "");
  return true;
  }
  return true;
};

function validateInjuryType (vfld,   // element to be validated
                         ifld,   // id of element to receive info/error msg
                         reqd)   // true if required
{
  var stat = commonCheck (vfld, ifld, reqd);
  if (stat != proceed) return stat;

  var tfld = trim(vfld.value);  // value of field with whitespace trimmed off


  if (tfld==0) {
    msg (ifld, "clsmallwarning", " Required!");
    vfld.focus();
    return false;
	}
  else { 
      msg (ifld, "warn", "");
  return true;
  }
  return true;
};

// -----------------------------------------
//               validateEmail
// Validate if e-mail address
// Returns true if so (and also if could not be executed because of old browser)
// -----------------------------------------

function validateEmail  (vfld,   // element to be validated
                         ifld,   // id of element to receive info/error msg
                         reqd)   // true if required
{
  var stat = commonCheck (vfld, ifld, reqd);
  if (stat != proceed) return stat;

  var tfld = trim(vfld.value);  // value of field with whitespace trimmed off
  var email = /^[^@]+@[^@.]+\.[^@]*\w\w$/
  if (!email.test(tfld)) {
    msg (ifld, "clsmallwarning", "E-mail not valid");
    vfld.focus();
    return false;
  }

  var email2 = /^[A-Za-z][\w.-]+@\w[\w.-]+\.[\w.-]*[A-Za-z][A-Za-z]$/
  if (!email2.test(tfld)) 
    msg (ifld, "clsmallwarning", "Unusual e-mail address - check if correct");
  else
    msg (ifld, "warn", "");
  return true;
};


// -----------------------------------------
//            validateTelnr
// Validate telephone number
// Returns true if so (and also if could not be executed because of old browser)
// Permits spaces, hyphens, brackets and leading +
// -----------------------------------------

function validatePhone  (vfld,   // element to be validated
                         ifld,   // id of element to receive info/error msg
                         reqd)   // true if required
{
  var stat = commonCheck (vfld, ifld, reqd);
  if (stat != proceed) return stat;

  var tfld = trim(vfld.value);  // value of field with whitespace trimmed off
  var telnr = /^\+?[0-9 ()-]+[0-9]$/
  if (!telnr.test(tfld)) {
    msg (ifld, "clsmallwarning", "Phone Number not valid.");
    vfld.focus();
    return false;
  }

  var numdigits = 0;
  for (var j=0; j<tfld.length; j++)
    if (tfld.charAt(j)>='0' && tfld.charAt(j)<='9') numdigits++;

  if (numdigits<7) {
    msg (ifld, "clsmallwarning", numdigits + " digits - too short");
    vfld.focus();
    return false;
  }
  
  if (numdigits==7) {
    msg (ifld, "warn", "");
    return true;
  }

  if (numdigits>10)
    msg (ifld, "clsmallwarning", numdigits + " digits - check if correct");
  else { 
    if (numdigits<10)
      msg (ifld, "clsmallwarning", "Only " + numdigits + " digits - check if correct");
    else
      msg (ifld, "warn", "");
    return true;
  }
  return true;
};

function validateZip  (vfld,   // element to be validated
                         ifld,   // id of element to receive info/error msg
                         reqd)   // true if required
{
  var stat = commonCheck (vfld, ifld, reqd);
  if (stat != proceed) return stat;

  var tfld = trim(vfld.value);  // value of field with whitespace trimmed off
  var telnr = /^\+?[0-9 ()-]+[0-9]$/
  if (!telnr.test(tfld)) {
    msg (ifld, "clsmallwarning", "Zip Code not valid.");
    vfld.focus();
    return false;
  }

  var numdigits = 0;
  for (var j=0; j<tfld.length; j++)
    if (tfld.charAt(j)>='0' && tfld.charAt(j)<='9') numdigits++;

  if (numdigits>5)
    msg (ifld, "clsmallwarning", numdigits + " Zip Code too long.");
  else { 
    if (numdigits<5)
      msg (ifld, "clsmallwarning", "Only " + numdigits + " Zip Code too short.");
    else
      msg (ifld, "warn", "");   // OK
      return true;  
  }
  return true;
};





/***********************************************************************************
*	(c) Ger Versluis 2000 version 5.411 24 December 2001 (updated Jan 31st, 2003 by Dynamic Drive for Opera7)
*	For info write to menus@burmees.nl		          *
*	You may remove all comments for faster loading	          *		
***********************************************************************************/

	var NoOffFirstLineMenus=11;				// Number of first level items
	var LowBgColor='efefef';			// Background color when mouse is not over
	var LowSubBgColor='efefef';			// Background color when mouse is not over on subs
	var HighBgColor='cccccc';			// Background color when mouse is over
	var HighSubBgColor='cccccc';			// Background color when mouse is over on subs
	var FontLowColor='555555';			// Font color when mouse is not over
	var FontSubLowColor='555555';			// Font color subs when mouse is not over
	var FontHighColor='black';			// Font color when mouse is over
	var FontSubHighColor='black';			// Font color subs when mouse is over
	var BorderColor='555555';			// Border color
	var BorderSubColor='555555';			// Border color for subs
	var BorderWidthMain=1;				// Border width	var BorderWidthMain=1;			// Border width main items
	var BorderWidthSub=1;			// Border width sub items
 	var BorderBtwnMain=1;			// Borderwidth between elements
	var BorderBtwnSub=1;			// Borderwidth between elements sub items
	var BorderBtwnElmnts=1;			// Border between elements 1 or 0
	var FontFamily="verdana,tahoma,comic sans ms,"	// Font family menu items
	var FontSize=9;				// Font size menu items
	var FontBold=0;				// Bold menu items 1 or 0
	var FontItalic=0;				// Italic menu items 1 or 0
	var MenuTextCentered='left';			// Item text position 'left', 'center' or 'right'
	var MenuCentered='center';			// Menu horizontal position 'left', 'center' or 'right'
	var MenuVerticalCentered='top';		// Menu vertical position 'top', 'middle','bottom' or static
	var ChildOverlap=.1;				// horizontal overlap child/ parent
	var ChildVerticalOverlap=.3;			// vertical overlap child/ parent
	var VerCorrect=0;				// Multiple frames y correction
	var HorCorrect=0;				// Multiple frames x correction
	var LeftPaddng=10;				// Left padding
	var TopPaddng=2;				// Top padding
	
	var StartTop=105;				// Menu offset x coordinate. If StartTop is between 0 and 1 StartTop is calculated as part of windowheight

var IE4 = (document.all && !document.getElementById) ? true : false;
var NS4 = (document.layers) ? true : false;
var IE5 = (document.all && document.getElementById) ? true : false;
var N6 = (document.getElementById && !document.all) ? true : false;

  if (N6) {
    var StartLeft=-322;		
	}
  else {
    var StartLeft=-313;		
	}

					// Menu offset y coordinate. If StartLeft is between 0 and 1 StartLeft is calculated as part of windowheight
	var DistFrmFrameBrdr=0;			// Distance between main menu and frame border
	var UnfoldDelay=10;			// delay before sub unfolds	
	
	
	var FirstLineHorizontal=0;			// SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
	var MenuFramesVertical=0;			// Frames in cols or rows 1 or 0
	var DissapearDelay=1000;			// delay before menu folds in
	var TakeOverBgColor=1;			// Menu frame takes over background color subitem frame
	var FirstLineFrame='navig';			// Frame where first level appears
	var SecLineFrame='space';			// Frame where sub levels appear
	var DocTargetFrame='space';			// Frame where target documents appear
	var TargetLoc='space';				// span id for relative positioning
	var HideTop=0;				// Hide first level when loading new document 1 or 0
	var MenuWrap=1;				// enables/ disables menu wrap 1 or 0
	var RightToLeft=0;				// enables/ disables right to left unfold 1 or 0
	var BottomUp=0;				// enables/ disables Bottom up unfold 1 or 0
	var UnfoldsOnClick=0;			// Level 1 unfolds onclick/ onmouseover
	var WebMasterCheck=0;			// menu tree checking on or off 1 or 0
	var ShowArrow=1;				// Uses arrow gifs when 1
	var KeepHilite=1;				// Keep selected path highligthed
	var Arrws=['admin/blocks/tri.gif',5,10,'admin/blocks/tridown.gif',10,5,'admin/blocks/trileft.gif',5,10];	// Arrow source, width and height
	var BaseHref="";				// BaseHref lets you specify the root directory for relative links. 
var MenuUsesFrames=0;			// MenuUsesFrames is only 0 when Main menu, submenus,
						// document targets and script are in the same frame.
						// In all other cases it must be 1

	var RememberStatus=0; // RememberStatus: When set to 1, menu unfolds to the presetted menu item. 
						// When set to 2 only the relevant main item stays highligthed
						// The preset is done by setting a variable in the head section of the target document.
						// <...head>
						//	<...script type="text/javascript">var SetMenu="2_2_1";<.../script>
						// <.../head>
						// 2_2_1 represents the menu item Menu2_2_1=new Array(.......

						// Below some pretty useless effects, since only IE6+ supports them
						// I provided 3 effects: MenuSlide, MenuShadow and MenuOpacity
						// If you don't need MenuSlide just leave in the line var MenuSlide="";
						// delete the other MenuSlide statements
						// In general leave the MenuSlide you need in and delete the others.
						// Above is also valid for MenuShadow and MenuOpacity
						// You can also use other effects by specifying another filter for MenuShadow and MenuOpacity.
						// You can add more filters by concanating the strings
	var BuildOnDemand=1;			// 1/0 When set to 1 the sub menus are build when the parent is moused over
	var BgImgLeftOffset=5;			// Only relevant when bg image is used as rollover
	var ScaleMenu=0;				// 1/0 When set to 0 Menu scales with browser text size setting

	var HooverBold=0;				// 1 or 0
	var HooverItalic=0;				// 1 or 0
	var HooverUnderLine=0;			// 1 or 0
	var HooverTextSize=0;			// 0=off, number is font size difference on hoover
	var HooverVariant=0;			// 1 or 0

	var MenuSlide="";
	var MenuSlide="progid:DXImageTransform.Microsoft.RevealTrans(duration=.1, transition=19)";
	var MenuSlide="progid:DXImageTransform.Microsoft.GradientWipe(duration=.1, wipeStyle=1)";

	var MenuShadow="";
	var MenuShadow="progid:DXImageTransform.Microsoft.DropShadow(color=#888888, offX=2, offY=2, positive=1)";
	var MenuShadow="progid:DXImageTransform.Microsoft.Shadow(color=#888888, direction=135, strength=3)";

	var MenuOpacity="";
	var MenuOpacity="progid:DXImageTransform.Microsoft.Alpha(opacity=95)";
	
function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){return}
function AfterCloseAll(){return}

// Menu tree
//	MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);
//	For rollover images set "Text to show" to:  "rollover:Image1.jpg:Image2.jpg"

// Menu tree:
// MenuX=new Array("ItemText","Link","background image",number of sub elements,height,width,"bgcolor","bghighcolor",
//	"fontcolor","fonthighcolor","bordercolor","fontfamily",fontsize,fontbold,fontitalic,"textalign","statustext");
// Color and font variables defined in the menu tree take precedence over the global variables
// Fontsize, fontbold and fontitalic are ignored when set to -1.
// For rollover images ItemText or background image format is:  "rollover?"+BaseHref+"Image1.jpg?"+BaseHref+"Image2.jpg" 

Menu1=new Array("Home","index.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");

Menu2=new Array("Personal Injury","Personal_Injury.htm","",5,20,150,"","","","","","",-1,-1,-1,"","");
	
	Menu2_1=new Array("<img src='admin/images/link.gif' border='0' align='absmiddle' alt='Car Accidents'> Car Accidents","Car_Accidents.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");	
	
	Menu2_2=new Array("<img src='admin/images/link.gif' border='0' align='absmiddle' alt='Truck Accidents'> Truck Accidents","Truck_Accidents.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");	
	
	Menu2_3=new Array("<img src='admin/images/link.gif' border='0' align='absmiddle' alt='Medical Malpractice'> Medical Malpractice","Medical_Malpractice.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");	
	
	Menu2_4=new Array("<img src='admin/images/link.gif' border='0' align='absmiddle' alt='Admiralty & Maritime Law'> Admiralty & Maritime Law","Admiralty_&_Maritime_Law.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");	
	
	Menu2_5=new Array("<img src='admin/images/link.gif' border='0' align='absmiddle' alt='Nursing Home Abuse'> Nursing Home Abuse","Nursing_Home_Abuse.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");	

Menu3=new Array("Divorce and Custody","Divorce_and_Custody.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");

Menu4=new Array("Our Results","Our_Results.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");

Menu5=new Array("Our Attorneys","Our_Attorneys.htm","",2,20,150,"","","","","","",-1,-1,-1,"","");
	
	Menu5_1=new Array("<img src='admin/images/link.gif' border='0' align='absmiddle' alt='Richard T. Gallagher, Jr.'> Richard T. Gallagher, Jr.","Richard_T._Gallagher,_Jr..htm","",0,20,150,"","","","","","",-1,-1,-1,"","");	
	
	Menu5_2=new Array("<img src='admin/images/link.gif' border='0' align='absmiddle' alt='Elizabeth S. Robins'> Elizabeth S. Robins","Elizabeth_S._Robins.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");	

Menu6=new Array("Our Firm","Our_Firm.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");

Menu7=new Array("Useful Links","Useful_Links.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");

Menu8=new Array("Contact Us","Contact_Us.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");

Menu9=new Array("Disclaimer","Disclaimer.htm","",0,20,150,"","","","","","",-1,-1,-1,"","");

Menu10=new Array("","javascript:void(0);","",0,20,150,"","","","","","",-1,-1,-1,"","");

Menu11=new Array("<img src='admin/images/bookmark.gif' border='0' align='absmiddle' alt='Bookmark This Page'> Bookmark Page","javascript:addbookmark();","",0,20,150,"","","","","","",-1,-1,-1,"","");


//  End -->
