// JavaScript Document
	
function selectState(state){
	$("#dd_state ul").hide();
	$("#dd_state a.selection").html(state);
	$("#state").val(state);
}

function forceNumeric(field){
	$("#"+field).keyup(function(){
		var val = $(this).val().trim();
		if(val.length == 0){
			$(this).val("0");	
		}else{
			var lastChar = val.substring(val.length - 1);
			if(!isNumeric(lastChar)){
				$(this).val(val.substring(0, val.length - 1));
				if($(this).val().length == 0) $(this).val("0");
			}
		}
	});
}

function submitConstructionQuoteForm(){
	$("#constructionQuote .response").fadeOut("fast");
	var options = {target:"#constructionQuote", success:function(){
		$("#constructionQuote .response").fadeIn();
		try{ resetForm(); }catch(e){}
		$.scrollTo("#content", 300);
	}};
	$("#constructionQuoteForm").ajaxForm();
	$("#constructionQuoteForm").ajaxSubmit(options);
}

function submitEventQuoteForm(){
	$("#eventQuote .response").fadeOut("fast");
	var options = {target:"#eventQuote", success:function(){
		$("#eventQuote .response").fadeIn();
		try{ resetForm(); }catch(e){}
		$.scrollTo("#content", 300);
	}};
	$("#eventQuoteForm").ajaxForm();
	$("#eventQuoteForm").ajaxSubmit(options);
}

function submitSalesQuoteForm(){
	$("#salesQuote .response").fadeOut("fast");
	var options = {target:"#salesQuote", success:function(){
		$("#salesQuote .response").fadeIn();
		try{ resetForm(); }catch(e){}
		$.scrollTo("#content", 300);
	}};
	$("#salesQuoteForm").ajaxForm();
	$("#salesQuoteForm").ajaxSubmit(options);
}

function submitTrailerQuoteForm(){
	$("#trailerQuote .response").fadeOut("fast");
	var options = {target:"#trailerQuote", success:function(){
		$("#trailerQuote .response").fadeIn();
		try{ resetForm(); }catch(e){}
		$.scrollTo("#content", 300);
	}};
	$("#trailerQuoteForm").ajaxForm();
	$("#trailerQuoteForm").ajaxSubmit(options);
}
