$(document).ready(function() {
// check the value of price and accoring to that update
// id=amount, name=text1(-not work), print inside <div id=amount> and  <span id=amount>
$(".toprint").click(function(e1) {
//alert("pp");
  $("div#toprint").jqprint();
});
//$("input[name='price']").attr("checked", "checked");
//alert($("input[name='price']:checked").val());
//alert(("name='price'").val());
var str = $("input[name='price']:checked").val();
//alert(str);
// Delete the x that make the different between the prices.
if (str) {
  str = str.split("x").join("");
  //alert(str);
  }

/* if (str.indexOf("x")  >= 0 ) {
  str = str.replace("/x$/",'');
  }
  */
/* if (str.contains("x")) {
  alert('ccc');
  }
substr($string, 0, $max_length)
*/
$("span#amount").text(str);
$("input[name='price']").change(function e2 () {
	/* 
	$("#amount").val($("input[name='price']:checked").val())
	$("text1").val($("input[name='price']:checked").val())
	$("div#amount").text($("input[name='price']:checked").val());
	*/
	var str = $("input[name='price']:checked").val();
        //alert(str);
        // Delete the x that make the different between the prices.
        str = str.split("x").join("");
        //alert(str);
	$("span#amount").text(str);
	//return false;
});

});


