    //Contains 'true' if the user's browser is Netscape, false otherwise
    var isNN = (navigator.appName.indexOf("Netscape") != -1);

    /**
     * This script is used to send focus to the next text field in a series of text fields
     * Used with permission of The JavaScript Source!! http://javascript.internet.com
     */
    function autoTab(input, len, e) {
        var keyCode = (isNN) ? e.which : e.keyCode;
        var filter = (isNN) ? [0, 8, 9] : [0, 8, 9, 16, 17, 18, 37, 38, 39, 40, 46];
        if (input.value.length >= len && !containsElement(filter, keyCode)) {
            input.value = input.value.slice(0, len);
            nextElement = input.form[(getIndex(input) + 1) % input.form.length];
            if ((nextElement.type == "text") || (nextElement.type == "textarea"))
                nextElement.select();
            nextElement.focus();
        }

        function containsElement(arr, ele) {
            var found = false, index = 0;
            while (!found && index < arr.length)
                if (arr[index] == ele)
                    found = true;
                else
                    index++;
            return found;
        }

        function getIndex(input) {
            var index = -1, i = 0, found = false;
            while (i < input.form.length && index == -1)
                if (input.form[i] == input)
                    index = i;
                else
                    i++;
            return index;
        }

        return true;
   } //end autoTab

   function launchIMP(uurl){

          // Simple Browser Check
             var ns4 = (document.layers) ? 1 : 0;
             var ie4 = (document.all) ? 1 : 0;
             var ns6 = (document.getElementById && !document.all) ? 1 : 0;

        // Browser Window Dimensions
           function windowWidth(){
                return (ns4||ns6) ? window.innerWidth : document.body.clientWidth;
                 }
           function windowHeight(){
                return (ns4||ns6) ? window.innerHeight : screen.height;
           }

        //Set popup window to 85% of parent window
        var displaywidth = windowWidth();
        var displayheight = windowHeight();

        var percwidth =  Math.round(displaywidth * 0.85);
        var percheight = Math.round(displayheight * 0.85);

        attributes = "toolbar=no, status=no, menubar=no, resizable=yes, width=650, height=" + percheight + ", scrollbars=yes, top=30, left=30, location=no";
        if (typeof(win) != "object")
        {
                var win = window.open(uurl,'impinfo',attributes);
        }
        else
        {
                if (!win.closed)
                {
                        win.location.href = uurl;
                }
                else
                {
                        var win = window.open(uurl,'impinfo',attributes);
                }
        }
        win.focus();
   }//end launchIMP

   function showTip(uurl){
        // Simple Browser Check
     var ns4 = (document.layers) ? 1 : 0;
     var ie4 = (document.all) ? 1 : 0;
     var ns6 = (document.getElementById && !document.all) ? 1 : 0;

        // Browser Window Dimensions
           function windowWidth(){
                return (ns4||ns6) ? window.innerWidth : document.body.clientWidth;
                 }
           function windowHeight(){
                return (ns4||ns6) ? window.innerHeight : screen.height;
           }

        attributes = "toolbar=no, status=no, menubar=no, resizable=yes, width=563px, height=350px, scrollbars=yes, top=50, left=50, location=no";

        var win = window.open(uurl,'tip',attributes);

        win.focus();
   }//end showTip

    function fillPermanentAddress()
    {
        var sameAsAbove = document.applicationForm.sameAsAbove;

        if (sameAsAbove.checked)
        {
           document.applicationForm.permanentAddress1Input.value = document.applicationForm.mailStreetAddress1Input.value;
           document.applicationForm.permanentAddress2Input.value = document.applicationForm.mailStreetAddress2Input.value;
           document.applicationForm.permanentCityInput.value = document.applicationForm.mailCityInput.value;
           document.applicationForm.permanentStateInput.value = document.applicationForm.mailStateInput.value;
           document.applicationForm.permanentZipInput.value = document.applicationForm.mailZipInput.value;
        }
        else
        {
           document.applicationForm.permanentStreetAddress1Input.value = "";
           document.applicationForm.permanentStreetAddress2Input.value = "";
           document.applicationForm.permanentCityInput.value = "";
           document.applicationForm.permanentStateInput.value = "";
           document.applicationForm.permanentZipInput.value = "";
        }
    }//end fillPermanentAddress

    function faqPop(url) {
                 if (url) {
                  //check to see if user clicked an anchored link

                  //define window parameters - url, window name and window attributes
                  winUrl = url;
                  var winName = "faq";
                  var winAttributes = "width=560,height=484,scrollbars,status";

                  //launch the new window and capture a reference to that window
                  childWindow = window.open(winUrl,winName,winAttributes);

                  //bring "focus" to the new window so it appears on top of the window stack
                  childWindow.focus();

                var bName = navigator.appName;
                if (bName.substring(0,9) == "Microsoft")
                {
                        var useragent = navigator.userAgent;
                        var pos = useragent.indexOf('MSIE');
                        if (pos > -1) {
                                bVer = useragent.substring(pos + 5);
                                var pos = bVer.indexOf(';');
                                var bVer = bVer.substring(0,pos);
                        }
                        if (bVer == "5.5" || bVer == "6.0")
                        {
                                pollingChild = 0;
                                goToAnchor();
                        }
                }
            }
        }//end faqPop

        function selectRadio(myForm,myVal)
        {
                var radios = myForm.elements['eachCell'];
                for(var i=0; i < radios.length; i++)
                {
                        radios[i].checked=(radios[i].value==myVal)?true:false;
                }
        }//end selectRadio
 
	function prevAddInfo()
	{
		if (applicationForm.group1[0].checked) {
			document.getElementById('prevAddressInfo').style.display='block';
		}
		else
		{
			document.getElementById('prevAddressInfo').style.display='none';
			document.applicationForm.homeStreetPreAddress1Input.value='';
			document.applicationForm.homeStreetPreAddress2Input.value='';
			document.applicationForm.homePreCityInput.value='';
			document.applicationForm.homePreStateInput.value='';
			document.applicationForm.homePreZipInput.value='';
		}
	}
	function prevAddInfoInputCheck()
	{
	
		if((document.applicationForm.homeStreetPreAddress1Input.value!="") || (document.applicationForm.homeStreetPreAddress2Input.value!="") || (document.applicationForm.homePreCityInput.value!="") || (document.applicationForm.homePreStateInput.value!="") || (document.applicationForm.homePreZipInput.value!="") )
		{	
			document.applicationForm.group1[0].checked=true
			prevAddInfo();
		}
		else
		{
			document.applicationForm.group1[1].checked=true
		}
	}

// Formats numbers with commas
// http://www.mredkj.com/javascript/nfbasic.html
	function addCommas(nStr)
	{
		nStr += '';
		x = nStr.split('.');
		x1 = x[0];
		x2 = x.length > 1 ? '.' + x[1] : '';
		var rgx = /(\d+)(\d{3})/;
		
		x1 = x1.replace(/\,/g,'');
		while (rgx.test(x1)) {
			x1 = x1.replace(rgx, '$1' + ',' + '$2');
		}
		return x1 + x2;
	}