//javascript functions used in budilka.net project
function updateCart(item) {
	itemCode = item.name;
	quantity = item.options[item.selectedIndex].value;
	
	document.location.href = 'index.php?cart=update&item='+itemCode+'&quantity='+quantity;
}

var itemGlobal;
function b2bUpdateCart(item) {
	itemGlobal = item;
	quantity = document.forms['b2b_items'].elements[item+'_quantity'].value;
	ajax.get('index.php?cart=update_b2b&item='+item+'&quantity='+quantity,b2bUpdateCartHtml);
}

function b2bUpdateCartHtml(text) {
	var txt = text.split("___");
	document.getElementById(itemGlobal+'_price').innerHTML = txt[0];
	document.getElementById('total_value').innerHTML = txt[1];
}

function validateCopyOrder(orderNum) {
	answer = confirm('Ste prepričani da želite ponovno naročiti izdelke iz naročila št. '+orderNum+'?');
	
	return answer;
}
function validateDelOrder(orderNum) {
	answer = confirm('Ste prepri?ani da želite izbrisati naročilo št. '+orderNum+'?');
	
	return answer;
}
function checksize() {
	elementID = "size";
	var index = document.getElementById(elementID).selectedIndex;
	var post = document.getElementById(elementID)[index].value;	
	return false;

}
