

Alegere = new Class( {
	initialize: function(){
	},
	gasesteCulori: function() {
		var thatAlegere = this;
		var myAjax = new Request( {
			url: baseUrl + 'Produse/gasesteCulori/' + $('StocProdusId').value + '/' + $('StocMarimeId').options[ $('StocMarimeId').selectedIndex ].value,
			evalScripts: false,
			onComplete: function(){
				this.response.text = this.response.text.stripScripts(true);
				var that = this;
				$( 'StocCuloareId' ).set( 'html', this.response.text );
 				thatAlegere.gasesteCantitati();
			}
		} );
		myAjax.send();
	},
	gasesteCantitati: function() {
		var myAjax = new Request( {
			url: baseUrl + 'Produse/gasesteCantitati/' + $('StocProdusId').value + '/' + $('StocMarimeId').options[ $('StocMarimeId').selectedIndex ].value + '/' + $('StocCuloareId').options[ $('StocCuloareId').selectedIndex ].value,
			evalScripts: true,
			onComplete: function(){
				var that = this;
				this.response.text = this.response.text.stripScripts(true);
				$( 'StocCantitate' ).set( 'html', that.response.text );
			}
		} );
		myAjax.send();
	},
	gasestePret: function() {
		var myAjax = new Request( {
			url: baseUrl + 'Produse/gasestePret/' + $('StocId').value + '/' + $('StocCantitate').options[ $('StocCantitate').selectedIndex ].value,
			evalScripts: true,
			onComplete: function(){
				var that = this;
				$( 'pretTotal' ).set( 'html', that.response.text + ' RON');
			}
		} );
		myAjax.send();
	}
} );
