function SetCookie(name,value) {
a=GetCookie(name);
if(a==null) {a=''}
document.cookie = name + "=" +escape(a) + escape(value) +  "; path=/viaduk/turtle_moto.nsf/";
}
function SetNCookie(name,value) {
document.cookie = name + "=" + escape(value) +  "; path=/viaduk/turtle_moto.nsf/";
}
function GetCookie(name) {
var result = null;
var myCookie = " " + document.cookie + ";";
var searchName = " " + name + "=";
var startOfCookie = myCookie.indexOf(searchName);
var endOfCookie;
if(startOfCookie != -1) {
startOfCookie += searchName.length;
endOfCookie = myCookie.indexOf(";",startOfCookie);
result = unescape(myCookie.substring(startOfCookie,endOfCookie));
}
return result;
}
function ClearCookie(name) {
var ThreeDays = 3 * 24 * 60 * 60 * 1000;
var expDate = new Date();
expDate.setTime(expDate.getTime() - ThreeDays);
document.cookie = name + "ImOutOfHere; expires=" + expDate.toGMTString();
}
function sCookie(_uid,_catnum,_title,_vendor,_pos,_col,_sum,_cost,_cmt) {
SetCookie('turtle_moto',_uid+'_'+_catnum+'_'+_title+'_'+_vendor+'_'+_pos+'_'+_col+'_'+_sum+'_'+_cost+'_'+_cmt+'_');
}
function refCookie(_num) {
SetNCookie('turtle_moto','');
for(var i=0;i<(_bag_count/9);i++) {
_in = eval("document.forms[0].b_in"+i+".value");
if(i!=_num) {sCookie(b_uid[i],b_catnum[i],b_title[i],b_vendor[i],b_pos[i],b_col[i],_in,b_cost[i],b_cmt[i]);}
else {continue;}
}
if(_num>-1) {window.location.reload();}
}
