
/* ---------------------------------------------------- */
/*		Contact Form
/* ---------------------------------------------------- */

$(function(){

	$('#form-submit').after('<p class="hide" id="response">');
	
	//Do what we need to when form is submitted.
	$('#form-submit').click(function(e){
	
	//Setup any needed variables.
	var input_fname = $('#form-fname').val(),
		input_ename = $('#form-ename').val(),
		input_foretag = $('#form-foretag').val(),
		input_avdelning = $('#form-avdelning').val(),
		input_adress = $('#form-adress').val(),
		input_postnr = $('#form-postnr').val(),
		input_ort = $('#form-ort').val(),
		input_tel = $('#form-tel').val(),
		input_email = $('#form-email').val(),
		input_message = $('#form-message').val(),
		response_text = $('#response');
		//Hide any previous response text 
		response_text.hide();
		
		//Change response text to 'loading...'
		response_text.html('<img src="img/loader.gif" height="11" width="16" alt="Laddar..." />').show();
		
		//Make AJAX request 
		$.post('php/deltagaranmalan-send.php', {fname: input_fname, ename: input_ename, foretag: input_foretag, avdelning: input_avdelning, adress: input_adress, postnr: input_postnr, ort: input_ort, tel: input_tel, email: input_email, message: input_message}, function(data){
			response_text.html(data);
		});
		
		//Cancel default action
		e.preventDefault();
	});

});




$(function(){

	$('#form-submit2').after('<p class="hide" id="response">');
	
	//Do what we need to when form is submitted.
	$('#form-submit2').click(function(e){
	
	//Setup any needed variables.
	var input_foretag = $('#form-foretag').val(),
		input_fname = $('#form-fname').val(),
		input_ename = $('#form-ename').val(),
		input_tel = $('#form-tel').val(),
		input_email = $('#form-email').val(),
			response_text = $('#response');
		//Hide any previous response text 
		response_text.hide();
		
		//Change response text to 'loading...'
		response_text.html('<img src="img/loader.gif" height="11" width="16" alt="Laddar..." />').show();
		
		//Make AJAX request 
		$.post('php/utstallaranmalan-send.php', {foretag: input_foretag, fname: input_fname, ename: input_ename,  tel: input_tel, email: input_email}, function(data){
			response_text.html(data);
		});
		
		//Cancel default action
		e.preventDefault();
	});

});


