$(function() {
  $("#shop_submit").click(function() {		
	  var option = $(".addtocart fieldset select").val();
	  var qty = $("input.iqty").val();
	  var pclas = $("input#pclas").val();
	  var pname = $("input#pname").val();
	  var pid = $("input#pid").val();
	  var purl = $("input#purl").val();
	  var postid = $("input#postid").val();
		
	  var dataString = 'option='+ option + '&qty=' + qty + '&pclas=' + pclas + '&pname=' + pname + '&pid=' + pid  + '&purl=' + purl + '&postid=' + postid;
		//alert (dataString);return false;
		
	  $.ajax({
      type: "POST",
      url: "http://intellidogs.com/shopping-cart/",
      data: dataString,
      success: function() {
        $('#store_content').html("<div id='message'></div>");
        $('#close_button').show();
        $('#message').html("<h2>" + pname + " added to cart</h2>")
        .append('<p>Close this window to continue shopping or purchase your custom training manual by going to the checkout.</p><p><a href="/intellidogs/shopping-cart/" class="cta main">Go to checkout</a></p>')
        .hide()
        .fadeIn(200);
      }
     });
    return false;
	});
});

