$(function(){

	$('#contactform').slidinglabels({

		/* these are all optional */
        className    : 'form-slider', // the class you're wrapping the label & input with -> default = slider
		topPosition  : '8px',  // how far down you want each label to start
		leftPosition : '5px',  // how far left you want each label to start
		axis         : 'x',    // can take 'x' or 'y' for slide direction
		speed        : '0.2s'  // can take 'fast', 'slow', or a numeric value

	});
});

$(function(){
  $('#submit').click(function() {
  	$(".form-error-info").hide();
    $("*").removeClass('form-error');
	var name = $("input#name").val();
    if (name == "") {  
    	$(".form-error-info").show();
    	$("input#name").addClass('form-error');
    	$("input#name").focus();  
    	return false;  
    }  
	var org = $("input#org").val();
    if (org == "") {  
    	$(".form-error-info").show();
    	$("input#org").addClass('form-error');
    	$("input#org").focus();  
    	return false;  
    }  
	var email = $("input#email").val(); 
    if (email == "") {  
    	$(".form-error-info").show();
    	$("input#email").addClass('form-error');
    	$("input#email").focus();  
    	return false;  
    }  
	var message = $("textarea#message").val();  
    if (message == "") {  
    	$(".form-error-info").show();
    	$("textarea#message").addClass('form-error');
    	$("textarea#message").focus();  
    	return false;  
    }  
	var pos = $("input#pos").val();  
	$('#submit').val('Sending...');
	var dataString = $('#contactform').serialize();
//	alert(dataString);
    $('#contentSub').load('bin/messages.php #sending');
	$.ajax({
      type: "POST",
      url: "bin/process.php",
      data: dataString,
      error: function() {
        $('#contentSub').load('bin/messages.php #send-error')
      },
      success: function() {
        $('#contentSub').load('bin/messages.php #send-success')
      }
     });
    return false;
	});

});
