$(function(){
	// setup player with single clip
	$f("player-cliparg", "/flash/flowplayer3/flowplayer-3.2.4.swf");

	//client side validation of lead form
	$("#LeadAddForm").validate({

	   groups: {
	   	contactmethod: "data[Lead][phone] data[Lead][email]"
	   },

	   rules: {
	     'data[Lead][firstname]': {
	       required: true
	     }
	   },

		wrapper: "span",

		errorLabelContainer: $("#LeadAddForm div.error"),

		submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
				target: 'div.leadform',
				success: function(){
					scrollerload()
				}
			});
		}
	});

	$("img.verify").click(function(){
		//check if form exists, if so tell user to submit
		  if ($('#LeadAddForm').length) { // implies *not* zero
			alert('Please fill out your name and phone number or email to continue.');
			return false;
		  } else {
		    return true;
		  }
	});
	
	//if no form lets try to load scroller
	scrollerload();
});

