	// jQuery calls
	
	$(function() {
		$('.arrow-list a').click(function() {
			if ($(this).parent().hasClass('active')) { $(this).parent().removeClass('active');  } else { $(this).parent().addClass('active'); };
			$(this).next('p').slideToggle('fast');
		});
		
		$('#content-slide').cycle({ 
		    fx:     'fade', 
		    speed:  'normal', 
		    timeout: 8000, 
		    next:   '#next2', 
		    prev:   '#prev2'
		});
		
		$('#header-homepage-bgs').cycle({ 
		    fx:     'fade', 
		    speed:  'slow', 
		    timeout: 5000
		});
		
		$('#videos li').hover(function() {
			$(this).find('img').fadeTo('normal',.75).css('border','1px solid #1a3c77');
		}, function() {
	        $(this).find('img').fadeTo('normal',1).css('border','1px solid #fff');
		});
	});
	
	// Cufon calls
	
	Cufon.replace('h6');
	
	//Validate Form
	function validateForm(aform) {
		var el = aform.elements;
		var errorMsg = '';
		
		for(var i = 0 ; i < el.length ; ++i) {
			var googleToolbar = el[i].title;
			
			if(googleToolbar.substr(0,11) == "Your Google") {continue;}
			
			if(el[i].name == "sec_q") {
				if(el[i].value != "5") {
					errorMsg += "Incorrect Answer for the Security Question.";
				}
			} else if(el[i].name == 'email') {
				//if(isEmail(el[i].value) == false) {
					errorMsg += 'Invalid Email' + '\n';
				//}
			} else if(el[i].type == 'checkbox') {
				if(el[i].checked == false  && el[i].title.length > 0) {
					errorMsg += el[i].title + '\n';
				}
			} else if (el[i].type == 'select-one') {
				if(el[i].selectedIndex < 1 && el[i].title.length > 0) {
					errorMsg += el[i].title + '\n';
				}
			} else if (el[i].title.length > 0) {
				if(el[i].value.length == 0) {
					errorMsg += el[i].title + '\n';
				}
			}
		}
		
		if(errorMsg.length > 0) {
			errorMsg = 'Please complete all required fields below:\n'+errorMsg;
			alert(errorMsg);
			return false;
		} else {
			return true;
		}
		
		return false;
	}
