	var minAddQty = 0;
	var maxAddQty = 999;

	function changeQty( id, inc, allowZero ) {
		var inp = xGetElementById( id );
		if(inp) {
			var qty = parseInt( getValue( inp ) );
			if( isNaN(qty) ) {
				setValue( inp, 1 );
				alert(id);
				inp.style.fontWeight = "bold";
			} else {
				//q+=(new Number(c));
				qty += inc;
				if( qty >= minAddQty && qty <= maxAddQty ) {
					setValue( inp, qty );
					inp.style.fontWeight = "bold";
				}
				
				if(qty == 0) {
					inp.style.fontWeight = "normal";
				}
				
			}
		}
	}
	
	function getValue( inp ) {
		if ( inp.value )
			return inp.value;
	}
	
	function setValue( inp, val ) {
		if ( inp.value )
			inp.value = val;
	}

	function checkQty( id ) {
		var inp = xGetElementById( id );
		if(inp) {
			var qty = parseInt( getValue( inp ),10 );
			
			if( qty == null || isNaN(qty) ) {
				setValue( inp, 0 );
				inp.style.fontWeight = "normal";
			} else if( qty < minAddQty ) {
				setValue( inp, minAddQty );
				inp.style.fontWeight = "bold";
			} else if ( qty > maxAddQty ) {
				setValue( inp, maxAddQty );
				inp.style.fontWeight = "bold";
			} else if(qty == 0){
				inp.style.fontWeight = "normal";
			} else {
				setValue( inp, qty );
				inp.style.fontWeight = "bold";
			}
		}
	}

