/**
 * @author Andreea Costea
 */


// Quantity spin buttons
function increase_by_one(field) {
	nr = parseInt(document.getElementById(field).value);
	document.getElementById(field).value = nr + 1;
}

function decrease_by_one(field) {
	nr = parseInt(document.getElementById(field).value);
	if (nr > 0) {
		if( (nr - 1) > 0) {
			document.getElementById(field).value = nr - 1;
		}
	}
}

function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = ""
     }
 }


// on page load complete, fire off a jQuery 
$(document).ready(function() {

	$(".arrow-up").click( function() {
		$("#qty").hide(5);
		increase_by_one('qty');
		$("#qty").fadeIn(200);
		return false;
	});
	
	$(".arrow-down").click( function() {
		$("#qty").hide(5);
		decrease_by_one('qty');
		$("#qty").fadeIn(200);
		return false;
	});
	
	
	
});
