// JavaScript Document
function nw(path){
newWindow = window.open(path,"","scrollbars,height=400,width=800");
newWindow.focus();
};

function putIntoBasket (idpos, kol){
	JsHttpRequest.query(
            'zapchasti/in_basket.php', 
            {
                'id_pos': idpos, 'kol': kol
            },
            
            function(result, errors) {
                if (result) {
                    document.getElementById("basket").innerHTML = result["basket"];
                }
            	}, true  
        );
};
function upVal(id){
	var tf = document.getElementById(id);
	tf.value = parseInt(tf.value) + 1;  
};
function dwnVal(id){
	var tf = document.getElementById(id);
	if (parseInt(tf.value) > 1) {tf.value = parseInt(tf.value) - 1;} else {tf.value = 1;}  
};
function checkVal(id){
	var tf = document.getElementById(id);
	if (parseInt(tf.value) > 1) { return true;  tf.value = parseInt(tf.value);} else { tf.value = 1; return false;}  
};


