
//var tagCookie=document.cookie.value;
//var cookie=tagCookie;
//var formatted=cookie.replace(/\~/g,"\n");

function setTagInput() {
 var tagKitNum=document.tags.tagNum.value;
 tagSku  = 'tagKit'+tagKitNum+'=';
 tagName = document.tags.tagqty.value         + '|';
 tagName += lines                             + '|';
 tagName += document.tags.metalColor.value    + '|';
 tagName += document.tags.silencerColor.value + '|';
 tagName += document.tags.chainColor.value;
 tagOther = line1Value+'|'+line2Value+'|'+line3Value+'|';
 if (lines>3) { tagCookie2 +=line4Value+'|'; }
 if (lines>4) { tagCookie2 +=line5Value+'|'; }
 if (lines>5) { tagCookie2 +=line6Value+'|'; }

 tagSku =tagCookie;
 tagName=tagCookie1;
 tagOther=tagCookie2;
 tagString=tagCookie+'~'+tagCookie1+'~'+tagCookie2;
}

function setTagCookie() {
 clickTag()
 var tagKitNum=document.tags.tagNum.value;
 tagCookie  = 'tagKit'+tagKitNum+'=';
 tagCookie1 = document.tags.tagqty.value         + '|';
 tagCookie1 += lines                             + '|';
 tagCookie1 += document.tags.metalColor.value    + '|';
 tagCookie1 += document.tags.silencerColor.value + '|';
 tagCookie1 += document.tags.chainColor.value;
 tagCookie2 = line1Value+'|'+line2Value+'|'+line3Value+'|';
 if (lines>3) { tagCookie2 +=line4Value+'|'; }
 if (lines>4) { tagCookie2 +=line5Value+'|'; }
 if (lines>5) { tagCookie2 +=line6Value+'|'; }
 tagSku =tagCookie;
 tagName=tagCookie1;
 tagText=tagCookie2;
 document.cookie='tagCookie='+tagCookie+'~'+tagCookie1+'~'+tagCookie2;
 return tagCookie;
}

function cookie2text(tagCookie) {
//  var tagNum     =tagCookie.replace(/^(.*?)\~(.*)$/$1/);
//  var tagQty     =tagCookie.replace(/^(.*?)Qty:(.*?)\|(.*)$/$2/);
//  var tagLines   =tagCookie.replace(/^(.*?)Lines:(.*?)\|(.*)$/$2/);
//  var tagMetal   =tagCookie.replace(/^(.*?)Metal:(.*?)\|(.*)$/$2/);
//  var tagSilencer=tagCookie.replace(/^(.*?)Silencer:(.*?)\|(.*)$/$2/);
//  var tagChains  =tagCookie.replace(/^(.*?)Chains:(.*?)\~(.*)$/$2/);
//  var tagLine1   =tagCookie.replace(/^(.*?)1:(.*?)\~(.*)$/$2/);
//  var tagLine2   =tagCookie.replace(/^(.*?)2:(.*?)\~(.*)$/$2/);
//  var tagLine3   =tagCookie.replace(/^(.*?)3:(.*?)\~(.*)$/$2/);
//  if (lines>3) { var tagLine4 =tagCookie.replace(/^(.*?)4:(.*?)\~(.*)$/$2/); } else { var tagLine4=''; }
//  if (lines>3) { var tagLine5 =tagCookie.replace(/^(.*?)5:(.*?)\~(.*)$/$2/); } else { var tagLine5=''; }
//  if (lines>3) { var tagLine6 =tagCookie.replace(/^(.*?)6:(.*?)\~(.*)$/$2/); } else { var tagLine6=''; }

}
