/*
	QShop E-Commerce Solutions
	Copyright@Visual Technologies inc. 2002 - 2011
	http://qshop.com.pl
	This software is copyrighted, do not attempt to copy without permission
*/
function cart_operate() {
	this.set_ship_self = function(obj) {
		window.location.href = "cart.php?action=update_ship"+replace_amp('&amp;')+"id="+obj.value;
	}
	this.set_ship_default = function() {
		param = document.getElementById('ship_default').options[document.getElementById('ship_default').selectedIndex].value;
		window.location.href = "cart.php?action=update_ship"+replace_amp('&amp;')+"id="+param;
	}
}
cart_operate = new cart_operate();
function paczkomaty_accepted() {
	window.location.href = "cart.php?paczkomaty_accepted=1";;	
}
function updateship(item) {
	param = item.options[item.selectedIndex].value;
	window.location.href = "cart.php?action=update_item"+replace_amp('&amp;')+"id="+param;
}
function inpost_select(item,itemId) {
	param = item.options[item.selectedIndex].value;
	window.location.href = "cart.php?action=update_item"+replace_amp('&amp;')+"id="+itemId+""+replace_amp('&amp;')+"town="+param;
}
function inpost_select_more(item,itemId,city) {
	param = item.options[item.selectedIndex].value;
	window.location.href = "cart.php?action=update_item"+replace_amp('&amp;')+"id="+itemId+""+replace_amp('&amp;')+"town="+city+""+replace_amp('&amp;')+"code="+param;
}
function updateship_all(item) {
	param = item.options[item.selectedIndex].value;
	window.location.href = "cart.php?action=update_ship"+replace_amp('&amp;')+"id="+param;
}
function updatesend(item,itemId) {
	param = item.options[item.selectedIndex].value;
	window.location.href = "cart.php?action=update_send"+replace_amp('&amp;')+"id="+itemId+""+replace_amp('&amp;')+"ship_by="+param;
}
function get_event() {
	window.onresize = function() { WINDOW_RESIZE(); }
	window.onscroll = function() { WINDOW_RESIZE(); } 
}
function change_qty(obj,itemid,ship) {
	ElementID=obj.target?obj.target.id:obj.srcElement.id; 
	val = parseFloat(GE(ElementID).value);
	if(obj.keyCode==13) {
		if(val>0) {
			document.location.href = "cart.php?action=update_item"+replace_amp('&amp;')+"id="+itemid+"&qty="+val;
		} else {
			alert(cart_alert);
		}
	}
	if ((obj.keyCode > 31 && (obj.keyCode < 48 || obj.keyCode > 57))&&(obj.keyCode > 31 && (obj.keyCode < 96 || obj.keyCode > 105))) {
		out = false;
	} else {
		out = true;
	}
	return out;
}
function __cart() {
	this.reload_upg = function(itemId,val,year) {
		document.getElementById('price_upg_send_'+itemId).value = val;
		document.getElementById('date_upg_'+itemId).value = year;
		eval('document.upg_form'+itemId+'.submit()');
	}
	this.reload_qty_upg = function(item,itemId) {
		qty = item.options[item.selectedIndex].value;
		document.getElementById('qty_upg_'+itemId).value = qty;
		eval('document.upg_form'+itemId+'.submit()');
	}
}
__cart = new __cart();
