ajax_CalcPrice = function(){
  $.post("include/dragon.jquery.php",{
              func: 'calcPrice',
              pages:  function(){return $('#numPages').val()},
              days:   function(){return $('#numDays').val()},
              format: function(){return $('input[@name=formatOption]:checked').val()}
            },
            function(result){
              $('#rbSummation').html(result.ar);
              $('#rbBaseCost').html(result.ar);
            },
            "json"
          );
  }

ajax_checkForm = function(){
  $.post("include/dragon.jquery.php",{
              func: 'checkForm',
              name: function(){return $('#name').val()},
              file: function(){return $('#fakeFile').val()},
              email: function(){return $('#iemail').val()},
              phone: function(){return $('#phone').val()}
            },
            function(result){
              if (result.error){
                if (result.errorField.name)   $('#name').attr('class','input error'); else $('#name').attr('class','input');
                if (result.errorField.file)   $('#fakeFile').attr('class','input error'); else $('#fakeFile').attr('class','input');
                if (result.errorField.email)  $('#iemail').attr('class','input error'); else $('#iemail').attr('class','input');
                if (result.errorField.phone)  $('#phone').attr('class','input error'); else $('#phone').attr('class','input');
                  
                $('#error').html('<p>'+result.errorMsg+'</p>');
                $("#error").show();
              }
              else{
                $('#project').submit();
              }
            },
            "json"
          );
}
