/* js for volunteer form validating and special effects */

function yesNo(Which,name)
{
  for (i=0; i<2; i++) {
	var ele=name+'['+i+']';
    document.getElementById(ele).checked = false;
  }
  Which.checked = true;
}
function focusThis(which){
	which.style.backgroundColor='ivory';
	which.style.borderStyle='solid';
	which.style.borderWidth='1px';
	which.style.borderColor='#FFCC00';
	which.style.height='23px';	
}
function focusThisTextArea(which){
	which.style.backgroundColor='ivory';
	which.style.borderStyle='solid';
	which.style.borderWidth='1px';
	which.style.borderColor='#FFCC00';
}
function unFocusThis(which){
	which.style.backgroundColor='white';
	which.style.borderStyle='solid';
	which.style.borderWidth='1px';
	which.style.borderColor='#A5ACB2';		
}
function hiLiteRel(which,o){
	
		if(which.checked == true){
			document.getElementById(o).style.backgroundColor='#FFFFF0';
			document.getElementById(o).style.borderStyle='solid';
			document.getElementById(o).style.borderWidth='1px';
			document.getElementById(o).style.borderColor='#FFCC00';
			document.getElementById(o).style.height='24px';
		}else{
			document.getElementById(o).style.backgroundColor='#FFF';
		}
}
function loLiteRel(which,o){
	
		if(which.checked == true){
			document.getElementById(o).style.backgroundColor='#FFF';
			document.getElementById(o).style.borderStyle='solid';
			document.getElementById(o).style.borderWidth='1px';
			document.getElementById(o).style.borderColor='#A5ACB2';
		}else{
			document.getElementById(o).style.backgroundColor='#FFFFFC';
		}
}
/*   validate */
function validateMe(){
	var didyouagree=document.getElementById('agree').checked;
	
	
	if(didyouagree){
		null;
	}else{
		alert("Please Check that You Agree to the Statements.");
		return false;
	}
	
	//alert(didyouagree);
	
	var msg='';
	
	var o = new Array();
	var e = new Array();
	
	o[0] = 'name';
	o[1] = 'address';
	o[2] = 'citystatezip';
	
	e[0] = 'Must Supply a Name.';
	e[1] = 'Must Supply an Address.';
	e[2] = 'Must Supply a City, State, and Zip Code.';
	
	for(x=0;x<o.length;x++){
		var q = o[x];
		if(document.getElementById(q).value==''){	
			msg+=e[x]+"\n\n";
		}
	}
	
	
	var t = 0;
	var g = new Array('homephone','workphone','cellphone');
	for(n=0;n<3;n++){
		var ele=g[n];
		if(document.getElementById(ele).value != ''){
			t++;
		}
	}
	if(t==0){
		
		msg+="Must Supply at least 1 Phone Number.";
		
	}
	
	if(msg == ''){
		
		return true;
		
	}else{
		
		alert(msg);
		scroll(0,1200);
		return false;
		
	}
}
