$(document).ready(function(){
$("#indicator").hide();


$(".has_sub a").live("click",function() {
  var cid = $(this).parent().attr("id"); 
 
$("#" + cid).children('ul:first').slideToggle("fast");
  c= $(this).css('background-image');
  a = c.search('arrow_red.png') 
  
 if(a > 0) {
   $(this).css('background','url("skin1/images/graphics/arrow_grey.png") no-repeat  0 6px'); 
  }
  else {
     $(this).css('background','url("skin1/images/graphics/arrow_red.png") no-repeat  0 2px');
  }
});





/************************************************************
*   Price input changer
************************************************************/
$(".price").live("change",function() {
i= $(this).val();
a = $(this).parent().attr('data-ajax').split(",");
     $.ajax({
       type: "POST",
       url: "product_price_update.php",
              data: {pid: a[0],id: a[1],i:i},
              success: function(msg){
			  
       }
     });
});




 
 
 
 
/*****************************************************************
*   Product Updater
************************************************************/
$(".produkt").live("change",function() {
i= $(this).val();
a = $(this).parent().attr('data-ajax').split(",");

     $.ajax({
       type: "POST",
       url: "product_update.php",
              data: {id: a[0],field: a[1],i:i},
              success: function(msg){
			  
       }
     });
	 
	 
});

/*********************
* Indicator for Ajax Calls
***************************/
$("#indicator").bind("ajaxSend", function(){
$(this).show();
}).bind("ajaxComplete", function(){
$(this).hide();
});


 });
 