// JavaScript Document

function loadInfo() {
	$("#jeff").hide();	
	$("#marianne").hide();    
	$("#rhonda").hide();
	$("#brian").hide();
	$("#kathleen").hide();
	$("#justin").hide();
}

function isValidEmail(emailAddress) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);  
	return pattern.test(emailAddress);
  
}

$(document).ready(function(){
	$("#btnMOREbrian").click(function() { 
   		$("#brian").slideToggle("slow");    
		$("#containerMOREbrian").slideToggle("slow");  
    });
	
	$("#btnMOREjeff").click(function() { 
   		$("#jeff").slideToggle("slow");
		$("#containerMOREjeff").slideToggle("slow");  
    });
	
	$("#btnMOREmarianne").click(function() { 
   		$("#marianne").slideToggle("slow");
		$("#containerMOREmarianne").slideToggle("slow");  
    });
	
	$("#btnMORErhonda").click(function() { 
   		$("#rhonda").slideToggle("slow");
		$("#containerMORErhonda").slideToggle("slow");  
    });	
	
	$("#btnMOREkathleen").click(function() { 
   		$("#kathleen").slideToggle("slow");
		$("#containerMOREkathleen").slideToggle("slow");  
    });	
	
	$("#btnMOREjustin").click(function() { 
   		$("#justin").slideToggle("slow");
		$("#containerMOREjustin").slideToggle("slow");  
    });	
	
	
	
	
	$("#btnCLOSEbrian").click(function() { 
   		$("#brian").slideToggle("slow");   
		$("#containerMOREbrian").slideToggle("slow");  
    });
	
	$("#btnCLOSEjeff").click(function() { 
   		$("#jeff").slideToggle("slow");		
		$("#containerMOREjeff").slideToggle("slow");  
    });
	
	$("#btnCLOSEmarianne").click(function() { 
   		$("#marianne").slideToggle("slow");		
		$("#containerMOREmarianne").slideToggle("slow");  
    });	
	
	$("#btnCLOSErhonda").click(function() { 
   		$("#rhonda").slideToggle("slow");   
		$("#containerMORErhonda").slideToggle("slow");  
    });
	
	$("#btnCLOSEkathleen").click(function() { 
   		$("#kathleen").slideToggle("slow");   
		$("#containerMOREkathleen").slideToggle("slow");  
    });
	
	$("#btnCLOSEjustin").click(function() { 
   		$("#justin").slideToggle("slow");   
		$("#containerMOREjustin").slideToggle("slow");  
    });
	
	// validate contact page 
	$("#btn-submit").click(function() {
		
		var txt = '';							
			if($('#frm-name').val() == ''){
                txt += 'Please input your name. \n';
            } 
			if($('#frm-phone').val() == ''){
                txt += 'Please input your phone. \n';
            } 
			if($("input[@name='rdio']:checked").length == 0) {
				 txt += 'Please input \"What is the best way to reach you? \". \n';
			}
			if($('#frm-address').val() == ''){
                txt += 'Please input your address. \n';
            }
			if($('#frm-city').val() == ''){
                txt += 'Please input your city. \n';
            }
			if($('#frm-state').val() == 'none'){
                txt += 'Please input your state. \n';
            }
			if($('#frm-zip').val() == ''){
                txt += 'Please input your zip. \n';
            }
			
			if($('#frm-email').val() == '' || !isValidEmail($('#frm-email').val())){
                txt += 'Please input your email. \n';
            }
			
			if($('#frm-comment').val() == ''){
                txt += 'Please input your comment. \n';
            }
			
			if(txt != '') {
                alert(txt);
                return false;
            }
            
            return true;				
    });	// end validate
	
	
});
