/*
	firdom() version 1.1 (24.11.2003)
	written by Chris Heilmann (http://www.onlinetools.org)
*/
function firdom(){
	if(document.getElementsByTagName && document.createElement){
		for (var l=1;l<=6;l++){
			var h1s=document.getElementsByTagName('h'+l);
			scanandreplace(h1s,'h'+l);
		}
	}
}
function scanandreplace(h1s,tag){
	for(var i=0;i<h1s.length;i++){
		for(var f=0;f<replaceImages.length;f++){
			var chunks=replaceImages[f].split('|');
			var thish1=document.getElementsByTagName(tag)[i];
			if(thish1.firstChild.nodeValue==chunks[0]){
				var newImg=document.createElement('img');			
				newImg.setAttribute('alt',chunks[0])
				newImg.setAttribute('src',chunks[1])
				// or newImg.src=chunks[1];
				thish1.replaceChild(newImg,thish1.firstChild)
				break;
			}
		}
	}
}
/*window.onload=firdom;

/* note that an array (replaceImages) will need to be set up in the header of each page that uses image replacement */
/*
	<script type="text/javascript">
	<!--
	replaceImages = new Array(
	'Title Text Goes Here|img/img_name_goes_here.gif',
	'Additional Titles Go Here|img/img_additional_here.gif');
	//-->
	</script>
*/

/*function //lifeIns() {
	replaceImages = new Array('Life Insurance|img/headings/life-headline.gif',
	'5 Star Life Insurance Company|img/headings/life-id.gif');

}

function afbaHome() {
	replaceImages = new Array('AFBA The 5Star Association|img/home-mastehead.gif');

}

function //healthIns() {
	replaceImages = new Array('Health Insurance|img/headings/health-headline.gif',
	'AFBA|img/headings/health-id.gif');

}*/



function goto_URL(object) {
    document.location.href = object.options[object.selectedIndex].value;
}

function goThere()
{
var member=document.eventlist.events.options[document.eventlist.events.selectedIndex].value;

	if (member!="")
	{
	self.location.href=member;
	}
}

function goThere2()
{
var member=document.eventlist2.events2.options[document.eventlist2.events2.selectedIndex].value;

	if (member!="")
	{
	self.location.href=member;
	}
}


function isValidEmail(email, required) {
   
    if (required==undefined) {   // if not specified, assume it's required
        required=true;
    }
    if (email==null) {
        if (required) {
            return false;
        }
        return true;
    }
    if (email.length==0) {  
        if (required) {
            return false;
        }
        return true;
    }
    if (! allValidChars(email)) {  // check to make sure all characters are valid
        return false;
    }
    if (email.indexOf("@") < 1) { //  must contain @, and it must not be the first character
        return false;
    } else if (email.lastIndexOf(".") <= email.indexOf("@")) {  // last dot must be after the @
        return false;
    } else if (email.indexOf("@") == email.length) {  // @ must not be the last character
        return false;
    } 
    
    else if( (email.lastIndexOf('.') > (email.length - 3)) ||
	           (email.lastIndexOf('.') < (email.length - 4)) ||
	           (email.indexOf('..',0)> -1) ||
	           (email.indexOf('@.',0)> -1) ||
	           (email.indexOf('.@',0)> -1) 
	           
	         ) {
	   return false;
	}
	return true;
}

function allValidChars(email) {
  var parsed = true;
  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-_";
  for (var i=0; i < email.length; i++) {
    var letter = email.charAt(i).toLowerCase();
    if (validchars.indexOf(letter) != -1)
      continue;
    parsed = false;
    break;
  }
  return parsed;
}

function isNumber(number){

var anum=/(^\d+$)|(^\d+\.\d+$)/
if (anum.test(number))
result=true
else{
result=false
}
return (result)
}

