
function validateUser() {
  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";
  if (document.loginForm.username.value == "" || document.loginForm.username.value.indexOf("@")==-1 || document.loginForm.username.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg = " - Email Address" + vbCRLF;
  }
  if ((document.loginForm.password.value == "") || (document.loginForm.password.value == "Password")) {
    incomplete = 1;
    msg += " - Password" + vbCRLF;
  }
  if (incomplete == 1) {
    alert("Please complete the login information:" + vbCRLF + msg);
  }
  else {document.loginForm.submit();}
}

function validateConsumerForm() {
  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";
  if (document.consumerForm.FirstName.value == "") {
    incomplete = 1;
    msg = " - First Name" + vbCRLF;
  }
  if (document.consumerForm.LastName.value == "") {
    incomplete = 1;
    msg += " - Last Name" + vbCRLF;
  }
  if (document.consumerForm.Email.value == "" || document.consumerForm.Email.value.indexOf("@")==-1 || document.consumerForm.Email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += " - Email Address" + vbCRLF;
  }
  if (document.consumerForm.HomePhoneArea.value == "" || document.consumerForm.HomePhonePre.value == "" || document.consumerForm.HomePhoneSuff.value == "" || isNaN(document.consumerForm.HomePhoneArea.value) || isNaN(document.consumerForm.HomePhonePre.value) || isNaN(document.consumerForm.HomePhoneSuff.value) ) {
    incomplete = 1;
    msg += " - Home Phone" + vbCRLF;
  }
  if (incomplete == 1) {
    alert("Please complete the following fields before proceeding:" + vbCRLF + msg);
  }
  else {
	  
	var answer = confirm ("**IMPORTANT NOTICE**\n\nIf you are a prospective client, please understand that we cannot represent you or provide specific legal advice until you receive a written statement from us that we represent you (a retainer agreement). If you are an existing client, please do not assume that any requested action will be taken until you receive a communication from a member of our firm confirming that it will be addressed. You should not rely upon an action being taken simply because you have sent a message requesting same.\n\nIf you wish to initiate a possible representation, or request a specific action, the best way to do so is to call our office.");

    if (answer) {
      document.consumerForm.submit();
	}
	
  }
}

function validateJoinNetworkForm() {
  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";
  if (document.joinNetworkForm.FirmName.value == "") {
    incomplete = 1;
    msg = " - Firm Name" + vbCRLF;
  }
  if (document.joinNetworkForm.FirstName.value == "") {
    incomplete = 1;
    msg += " - First Name" + vbCRLF;
  }
  if (document.joinNetworkForm.LastName.value == "") {
    incomplete = 1;
    msg += " - Last Name" + vbCRLF;
  }
  if (document.joinNetworkForm.Email.value == "" || document.joinNetworkForm.Email.value.indexOf("@")==-1 || document.joinNetworkForm.Email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += " - Email Address" + vbCRLF;
  }
  if (document.joinNetworkForm.WorkPhoneArea.value == "" || document.joinNetworkForm.WorkPhonePre.value == "" || document.joinNetworkForm.WorkPhoneSuff.value == "" || isNaN(document.joinNetworkForm.WorkPhoneArea.value) || isNaN(document.joinNetworkForm.WorkPhonePre.value) || isNaN(document.joinNetworkForm.WorkPhoneSuff.value) ) {
    incomplete = 1;
    msg += " - Work Phone" + vbCRLF;
  }
  if (incomplete == 1) {
    alert("Please complete the following fields before proceeding:" + vbCRLF + msg);
  }
  else {document.joinNetworkForm.submit();}
}

function TabNext(obj,event,len,next_field) {
  if (event == "down") {
    phone_field_length=obj.value.length;
  }
  else if (event == "up") {
    if (obj.value.length != phone_field_length) {
      phone_field_length=obj.value.length;
      if (phone_field_length == len) {
        next_field.focus();
      }
    }
  }
}

function runFlash(width, height, src, align) {
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' +width+ '" height="' +height+ '" align="' +align+ '">\n');
  document.write('<param name="movie" value="' +src+ '" />\n');
  document.write('<param name="wmode" value="transparent" />\n');
  document.write('<param name="quality" value="high" />\n');
  document.write('<embed src="' +src+ '" quality="high" wmode="transparent" align="' +align+ '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' +width+ '" height="' +height+ '">\n');
  document.write('</embed>\n');
  document.write('</object>\n');
}

		
