// script.aculo.us scriptaculous.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006

// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// 
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// 
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

var Scriptaculous = {
  Version: '1.6.4',
  require: function(libraryName) {
    // inserting via DOM fails in Safari 2.0, so brute force approach
    document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
  },
  load: function() {
    if((typeof Prototype=='undefined') || 
       (typeof Element == 'undefined') || 
       (typeof Element.Methods=='undefined') ||
       parseFloat(Prototype.Version.split(".")[0] + "." +
                  Prototype.Version.split(".")[1]) < 1.5)
       throw("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0");
    
    $A(document.getElementsByTagName("script")).findAll( function(s) {
      return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
    }).each( function(s) {
      var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
      var includes = s.src.match(/\?.*load=([a-z,]*)/);
      (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider').split(',').each(
       function(include) { Scriptaculous.require(path+include+'.js') });
    });
  }
}

Scriptaculous.load();

//This script was written by G.DeGennaro This was not included in the scriptaculous library.
    function clearText(boxId)
    {
     txtBox = document.getElementById(boxId);
     txtBox.value= "";
    }
 
 	function clearInput()
	{
		document.getElementById('state').value="";
		document.getElementById('state2').value="";
		
		var myAjax = new Ajax.Updater("DivSelectList1", "names2.cfm", {method:"post",parameters:"id=0"});
		var myAjax = new Ajax.Updater("DivSelectList2", "names2.cfm", {method:"post",parameters:"LastName=0"});	
		var myAjax = new Ajax.Updater("DivSelectList", "names2.cfm", {method:"post",parameters:"zipId=0" + "&StateId=0"});
	}
	
		function clearText(firm,city,county,LastName)
	{
		txtBox = document.getElementById(firm);
		txtBox.value="";
		txtBox1 = document.getElementById(city);
		txtBox1.value="";
		txtBox2 = document.getElementById(county);
		txtBox2.value="";
		txtBox3 = document.getElementById(LastName);
		txtBox3.value="";
	}
	
	
	function clearFirmTab(firm){
		txtBox = document.getElementById(firm);
		txtBox.value="";
	}


	function Highlight(tabIDH,tabIDNH1,tabIDNH2,tabIDNH3,tabIDNH4)
	{
	
	tabBox = document.getElementById(tabIDH);
		tabBox.style.borderTop='1px solid #000';
		tabBox.style.borderRight='1px solid #000';
		tabBox.style.borderLeft='1px solid #000';
		tabBox.style.borderBottom='0px solid #000';
	tabBox1 = document.getElementById(tabIDNH1);
		tabBox1.style.borderTop='0px solid #000';
		tabBox1.style.borderRight='0px solid #000';
		tabBox1.style.borderLeft='0px solid #000';
		tabBox1.style.borderBottom='1px solid #000';
	tabBox2 = document.getElementById(tabIDNH2);
		tabBox2.style.borderTop='0px solid #000';
		tabBox2.style.borderRight='0px solid #000';
		tabBox2.style.borderLeft='0px solid #000';
		tabBox2.style.borderBottom='1px solid #000';
	tabBox3 = document.getElementById(tabIDNH3);
		tabBox3.style.borderTop='0px solid #000';
		tabBox3.style.borderRight='0px solid #000';
		tabBox3.style.borderLeft='0px solid #000';
		tabBox3.style.borderBottom='1px solid #000';
	tabBox4 = document.getElementById(tabIDNH4);
		tabBox4.style.borderTop='0px solid #000';
		tabBox4.style.borderRight='0px solid #000';
		tabBox4.style.borderLeft='0px solid #000';
		tabBox4.style.borderBottom='1px solid #000';
	}

		/*************************************************************************
		  This code is from Dynamic Web Coding at http://www.dyn-web.com/
		  Copyright 2001-3 by Sharon Paine 
		  See Terms of Use at http://www.dyn-web.com/bus/terms.html
		  regarding conditions under which you may use this code.
		  This notice must be retained in the code as is!
		*************************************************************************/
		
		// onresize for ns4
		var origWidth, origHeight;
		if (document.layers) {
			origWidth = window.innerWidth; origHeight = window.innerHeight;
			window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
		}
		
		var cur_lyr;	// holds id of currently visible layer
		function swapLayers(id) {
		  if (cur_lyr) hideLayer(cur_lyr);
		  showLayer(id);
		  cur_lyr = id;
		}
		
		function showLayer(id) {
		  var lyr = getElemRefs(id);
		  if (lyr && lyr.css) lyr.css.visibility = "visible";
		}
		
		function hideLayer(id) {
		  var lyr = getElemRefs(id);
		  if (lyr && lyr.css) lyr.css.visibility = "hidden";
		}
		
		function getElemRefs(id) {
			var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
			if (el) el.css = (el.style)? el.style: el;
			return el;
		}
				
				function getVal2(){
								completer.options.defaultParams='statea=' + document.getElementById('state').value;
								completer1.options.defaultParams='stateb=' + document.getElementById('state2').value;
								 completer2.options.defaultParams='statec=' + document.getElementById('state').value;  
					}
				
				function getMultCity(){
					
					var myAjax = new Ajax.Updater("DivSelectList", "names2.cfm", {method:"post",parameters:"zipId=" + escape(document.getElementById('city').value) + "&StateId=" + escape(document.getElementById('state').value)});
					var myAjax = new Ajax.Updater("DivSelectList2", "names2.cfm", {method:"post",parameters:"LastName=0"});	
					var myAjax = new Ajax.Updater("DivSelectList1", "names2.cfm", {method:"post",parameters:"id=0"});
					}
					
				function getMultFirm(){
					var myAjax = new Ajax.Updater("DivSelectList1", "names2.cfm", {method:"post",parameters:"id=" + escape(document.getElementById('firm').value) + "&id2=" + escape(document.getElementById('state').value)});
					var myAjax = new Ajax.Updater("DivSelectList2", "names2.cfm", {method:"post",parameters:"LastName=0"});
					var myAjax = new Ajax.Updater("DivSelectList", "names2.cfm", {method:"post",parameters:"zipId=0" + "&StateId=0"});
					}
				function getMultLastName(){
					var myAjax = new Ajax.Updater("DivSelectList1", "names2.cfm", {method:"post",parameters:"id=0"});
					var myAjax = new Ajax.Updater("DivSelectList2", "names2.cfm", {method:"post",parameters:"LastName=" + escape(document.getElementById('LastName').value)});	
					var myAjax = new Ajax.Updater("DivSelectList", "names2.cfm", {method:"post",parameters:"zipId=0" + "&StateId=0"});

					}
				
				function checkMultCounties(){
					if(document.getElementById('MultCity1') && document.getElementById('MultCity1').value == 'Select County'){
						alert('City contains multiple counties. Please select county.');
						return false;}
					else
						return true;
				}
				
	