$(function() {
	$('.cluetip').cluetip({
    	splitTitle: '|',
    	showTitle: false
	});

	$("#chk_design").click(function(){
		if($(this).is(":checked")) {
			$(".chk_design_options, .chk_design_op_label").show();
		} else {
			$(".chk_design_options, .chk_design_op_label").hide();	
		}		 
	});
		$("#chk_design_op1").click(function(){
		if($(this).is(":checked")) {
			$(".chk_design_select").show();
		} else {
			$(".chk_design_select").hide();	
		}		 
	});
		$("#chk_coding").click(function(){
		if($(this).is(":checked")) {
			$(".chk_coding_options, .chk_coding_op_label").show();
		} else {
			$(".chk_coding_options, .chk_coding_op_label").hide();	
		}		 
	})


	var _hash = window.location.hash;
	if(_hash == "#coding" || _hash == "#full") {
		$("input#chk_coding").val(["Coding"]);
		$("#chk_coding").trigger("click").attr("checked","checked");
	}
	if(_hash == "#design" || _hash == "#full") {
		$("input#chk_design").val(["Design"]);
		$("#chk_design").trigger("click").attr("checked","checked");
	}
	$("#former").submit(function() {
		var _returner = true;
		$(".required").each(function() {
			var _text = $(this).val();
			if(_text === "") {
				$(this).css("border-color","#FF3333");
				$("#statusInfo").stop().fadeOut("medium", function(){
					$(this).text("Please fill out all forms!").fadeIn("medium");											
				})			   
				_returner = false;
			}
		});	
		if(_returner) {
			var _serial = $(this).serialize();
			$.post($(this).attr("action"),_serial,function() {
				$("#statusInfo").fadeOut("medium", function(){
					$(this).text("Thanks for contacting us! We'll be in touch with a quote soon.").fadeIn("medium");
					$("input[type=submit]").val("Thank You!");
				})			   
			});
			return false;
		}
		return false;
	});		   
})