function setKedvenc(termek_id){
	var url="index.php?option=com_whp&controller=termek&task=setKedvenc&format=raw";
	url += "&termek_id="+termek_id;
	//alert(url);
	$j.ajax({
      url: url,
      type: "POST",
      async: false,
      success: function(response){
      //alert(url); 	
		 var resp= $j.parseJSON( response );
		 if( resp.error == '' ){
				
		 }else{
			alert(resp.error);
		 }
      }
	});
	listazKedvencek();

}

function torolKedvenc(termek_id){
	//alert(termek_id);
	var url="index.php?option=com_whp&controller=termek&task=torolKedvenc&format=raw";
	url += "&termek_id="+termek_id;
	//alert(url);
	$j.ajax({
      url: url,
      type: "POST",
      async: false,
      success: function(response){
      //alert(url); 	
		 var resp= $j.parseJSON( response );
		 if( resp.error == '' ){
			
		 }else{
			alert(resp.error);
		 }
      }
	});
	listazKedvencek();

}

function listazKedvencek(){
	var url="index.php?option=com_whp&controller=termek&task=listazKedvencek&format=raw";
	//alert(url);
	$j.ajax({
      url: url,
      type: "POST",
      async: false,
      success: function(response){
      //alert(url); 	
		 var resp= $j.parseJSON( response );
		 if( resp.error == '' ){
				$j("#ajaxContentKedvencek").html( resp.html );
			
		 }else{
			alert('error');
		 }
      }
	});

}



function gotoKedvenc(){
	termek_id = $j('#termek_id').val();
	var url="index.php?option=com_whp&controller=reader&task=gotoKedvenc&format=raw";
	url += "&termek_id="+termek_id;
	//alert(url);
	$j.ajax({
      url: url,
      type: "POST",
      async: false,
      success: function(response){
      //alert(url); 	
		 var resp= $j.parseJSON( response );
		 if( resp.error == '' ){
			$j("#ajaxContentKedvencek .page img").fadeOut(600, function() {
				$j("#ajaxContentKedvencek").html( resp.html );
			});
		 }else{
			alert(resp.error);
		 }
      }
	});

}


