// cufon
Cufon.replace('.cufon',{ fontFamily: 'Helvetica', hover: true });
Cufon.replace('.cunfon_light', { fontFamily: 'Helvetica Ultra Light' });
//homepage slider
function slideSwitch() {
	var $active = $('#slideshow img.active');
	if ( $active.length == 0 ) $active = $('#slideshow img:last');
	var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');
	$active.addClass('last-active');
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}
$(document).ready(function() {	
	// begin image viewer
	setInterval( "slideSwitch()", 5000 );
	// inquiry form
	$("#dropdown_wrapper1").click(function() {
		$("#dropdown_list1").toggle();
		return false;
	});
	$("#dropdown_wrapper2").click(function() {
		$("#dropdown_list2").toggle();
		return false;
	});
	$("#dropdown_list1 a").click(function() {
		$("#dropdown1").html("You've selected <strong>" + $(this).attr('href').replace("_"," ") + "</strong>");
		$("#dropdown_value1").attr("value",$(this).attr('href').replace("_"," "));
		$("#dropdown_list1").hide();
		return false;
	});
	$("#dropdown_list2 a").click(function() {
		$("#dropdown2").html("You've selected <strong>" + $(this).attr('href').replace("_"," ") + "</strong>");
		$("#dropdown_value2").attr("value",$(this).attr('href').replace("_"," "));
		$("#dropdown_list2").hide();
		return false;
	});
	$("#submit_btn").click(function() {
		if ($("#checker").is(':checked')) {
			if ($("#email").val() == "") {
				alert("Please enter an email address");
			} else {
				$("#contact_form").submit();
			}
		} else {
			alert("Please agree to the terms of use");	
		}
		return false;
	});
});
