function add_shopping(productID){
	//alert(productID);
	url="shopping.asp?action=add&productID="+productID;
	window.location=url;
}

function del(obj){
	var IDList="";
	var bSel=false;
	for(i=0;i<obj.length;i++){
		if(obj.elements[i].type=="checkbox")
			if(!obj.elements[i].checked){
				if(IDList=="")
					IDList=obj.elements[i].value;
				else
					IDList+=","+obj.elements[i].value;
			}
			else bSel=true;
	}
			
	if(bSel==true){
		if(!confirm("Are you sure to delete all option?"))
			return false;
	
		//alert(IDList);
		url="shopping.asp?action=del&IDList="+IDList;
		window.location=url;
	}
	else{
		alert("please select which you want to delete!");
		return false;
	}
}

function delAll(obj){
	if(!confirm("Are you sure to Clear All?"))
		return false;
	var IDList="";
	url="shopping.asp?action=del&IDList="+IDList;
	window.location=url;
	return true;
}

function updating(obj){
	var numList="";
	for(i=0;i<obj.length;i++){
		if(obj.elements[i].type=="text"){
			if(numList=="")
				numList=obj.elements[i].value;
			else
				numList+=","+obj.elements[i].value;
		}
	}
	url="shopping.asp?action=update&numList="+numList;
	window.location=url;
	return true;
}

function continueShopping(state){
	 window.location="pro1-list.asp";
}

function checkOut(obj,userID){
	if(obj.length>5){
		if(confirm("Are you sure to check-out?")){
			obj.action="../orderform.asp";
			obj.submit();
		}
	}
	else
		alert("Order is nothing!");
}
