/* blank */
jQuery(document).ready(function($){
  $("#jquery_jplayer_1").jPlayer({
    ready: function () {
      $(this).jPlayer("setMedia", {
        m4v: "/wp-content/themes/emeraldisle/video/interior-landscape-design-video.m4v",
        ogv: "/wp-content/themes/emeraldisle/video/interior-landscape-design-video.ogv"
      });
      $(this).jPlayer("play");
    },
    ended: function (event) {
      $(this).jPlayer("play");
    },
    swfPath: "/wp-content/themes/emeraldisle/js/jplayer",
    solution: "flash, html",
    supplied: "m4v, ogv",
    muted: true
  });

	$("#jquery_jplayer_2").jPlayer({
		ready: function () {
			$(this).jPlayer("setMedia", {
				mp3: "/wp-content/themes/emeraldisle/video/summer_solstice_2010-freesoundtrackmusic.mp3"
			}).jPlayer("play");
		},
		ended: function (event) {
			$(this).jPlayer("play");
		},
		solution: "flash, html",
		swfPath: "/wp-content/themes/emeraldisle/js/jplayer",
		supplied: "mp3"
	});

  $('#post-81 .wpcf7-text').blur(function() { 
    var qty = $(this).val();
    if(qty > 0) {
      var price = $(this).parent().parent().siblings("td:eq(1)").children('.price').html().replace(/\$/g, '');
      $(this).parent().parent().siblings("td:eq(2)").children('.subtotal').html('$' + (price * qty));
    }

    var subtotal = 0;
    $('.subtotal').each(function() {
      var value = parseFloat($(this).html().replace(/\$/g, '')); 
      if(value > 0) {
        subtotal += value;
      }
    });
    $('#ordersubtotal').val(subtotal);
    var tax = subtotal * 0.06;
    tax = tax.toFixed(2);
    $('#ordertax').val(tax);
    $('#ordertotal').val(parseFloat(subtotal) + parseFloat(tax));

  });
});

