$(document).ready(
function()
{
	if($("#productnaam").html() != null ){
		tmp = $("#productnaam").html()
		tmp = tmp.replace("<h2>",' ')
		tmp = tmp.replace("</h2>",'')
   //	document.title += " " + tmp
	}
});

function SetSearchString(){

	if ($("#search_string").val().length >= 3){
		$("#zoek").removeAttr("disabled")
	} else if ($("#search_string").val()== "*"){
		$("#zoek").removeAttr("disabled")
	} else {
		if ($("#zoek").attr("disabled") != "disabled"){$("#zoek").attr("disabled","disabled")}
	}
}
function Calc(id, toggle){
	if (id>=1){
	SelectedItem = id;}
//	window.alert(id+"-"+toggle)
	if(toggle){
	$("#"+SelectedItem).toggle()
	if ($("#"+id).css("display") == "none")
		{
			$("#"+id).val(0)
			$("#totaal_"+id).html('')
		return;
		} else {
			$("#"+id).focus()
			$("#"+id).val(1)
		}
	}

	var Senddata = new Object();
  	Senddata.prijs = $("#pr_"+SelectedItem).html()
  	Senddata.aantal = $("#"+SelectedItem).val()

	  var dataString = $.toJSON(Senddata);

	 	 $.post("<?= DOMAIN_URL; ?>/shop/script/process.php?action=Calc",
		  {Senddata:dataString}
		   ,function(data) {
		//window.alert(data.prijs)
		$("#totaal_"+SelectedItem).html("€ "+data.prijs)

			}, "json");
}
