jQuery(document).ready(function() {
	jQuery('.jqlb').lightBox();
	jQuery('.jqlb_gr').lightBox();
	
	
	jQuery('.offervar_cant_plus').click(function() {
			var id_clicked=jQuery(this).attr("id");
			change_cant(id_clicked, 1);

		});
	
	jQuery('.offervar_cant_minus').click(function() {
			var id_clicked=jQuery(this).attr("id");
			change_cant(id_clicked, -1);
		});
});

function change_cant(id_clicked, addvalue)
{
	var inpname=id_clicked.replace("change_", "");
	var inpvalue=jQuery("input[name='"+inpname+"']").val();
	var cant=parseInt(inpvalue);
	if(!(cant>=0))
		{
			cant=0;
		}
	
	cant=cant+addvalue;
	if(cant<0)
		{
			cant=0;
		}
	var cantstr=cant.toString();
	jQuery("input[name='"+inpname+"']").val(cantstr);
}
