function addCart(id, redirect){
	
	if (getCookie("goods")!=null) v=getCookie("goods");
	else v="";
	setCookie("goods", v+"_"+id, 2);
	window.location.reload();
	
	if (redirect) window.location='/order/';

}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
	t=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : "; path=/;expires="+exdate.toGMTString())
}



function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}

