jQuery(document).ready(function() {


	jQuery(".dashboard").datepicker({ dateFormat: 'dd/mm/yy', showOn: 'both', buttonImage: 'img/date.gif', buttonImageOnly:true, changeMonth: true, changeYear: true });


	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 reset_select(att_name)

{

	jQuery("select[name='"+att_name+"']")[0].options[0].selected=true;

}





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);



}


function prepare_save()
{
	jQuery("#firstsave").val("1");
	return true;
}
