// index.js//// This is the script content from the top of the index.htm page// and has been moved to an external file to unclutter the content// and facilitate search engine parsing//today=new Date();today.setTime(today.getTime() + (3600000));today=today.toGMTString();currentdate=new Date();currentdate=currentdate.toLocaleString();index = document.cookie.indexOf('TheBasketCode');if (index > -1) {   countbegin=(document.cookie.indexOf('=',index)+1);   countend=document.cookie.indexOf(';',index);   if(countend==-1) {      fulllist='';   } else {      fulllist=document.cookie.substring(countbegin,countend);   }} else {   fulllist='';}if(fulllist.length < 1) {   document.cookie='TheBasketCode=.; expires='+today;   document.cookie='TheBasketName=.; expires='+today;   document.cookie='TheBasketWeight=.; expires='+today;   document.cookie='TheBasketTaxable=.; expires='+today;   document.cookie='TheBasketPrice=.; expires='+today;   document.cookie='TheBasketExtraFields=.; expires='+today;   document.cookie='TheBasketAdvanced=.; expires='+today;   document.cookie='TheBasketQuantity=.; expires='+today;   document.cookie='TheCurrency=1; expires=Friday, 31-Dec-2010 08:00:00 GMT';   document.cookie='JShopReferrer=.; expires='+today;}function retrieveCookie(thecookie,thenumber,theadditional) {    index = document.cookie.indexOf(thecookie);    countbegin=(document.cookie.indexOf('=',index)+1);    countend=document.cookie.indexOf(';',index);    if(countend==-1) { countend=document.cookie.length; }    fulllist=document.cookie.substring(countbegin,countend);    if (thenumber==0) { return fulllist; }    thisitem=0;    newcookie='';    itemstart=0;    for(var i=0; i<fulllist.length;i++) {        if (fulllist.substring(i,i+1)=='|') {            thisitem++;           itemvalue=fulllist.substring(itemstart,i);           if (thisitem==thenumber) {                if (theadditional==0) {                    return itemvalue;                } else {                    itemstarttwo=0;                    thisitemtwo=0;                    for (var j=0; j<itemvalue.length; j++) {                        if (itemvalue.substring(j,j+1)=='~') {                            thisitemtwo++;                            itemvaluetwo=itemvalue.substring(itemstarttwo,j);                            if (thisitemtwo==theadditional) {                                return itemvaluetwo;                            }                            itemstarttwo=j+1;                        }                    }                }            }            itemstart=i+1;        }    }    return '';}function addToCookie(thecookie,thevalue) {    fulllist=retrieveCookie(thecookie,0,0);    if (fulllist=='.') { fulllist=''; }    fulllist=fulllist+thevalue+'|';    document.cookie=thecookie+'='+fulllist+'; expires='+today;}function removeFromCookie(thecookie,thenumber) {    fulllist=retrieveCookie(thecookie,0,0);    thisitem=0;    newcookie='';    itemstart=0;    for(var i=0; i<fulllist.length;i++) {        if (fulllist.substring(i,i+1)=='|') {            thisitem++;            itemvalue=fulllist.substring(itemstart,i);            if (thisitem!=thenumber) {                newcookie=newcookie+itemvalue+'|';            }            itemstart=i+1;        }    }    if (newcookie=='') { newcookie='.'; }    document.cookie=thecookie+'='+newcookie+'; expires='+today;}function changeCookieValue(thecookie,thenumber,thevalue) {    fulllist=retrieveCookie(thecookie,0,0);    thisitem=0;    newcookie='';    itemstart=0;    for(var i=0; i<fulllist.length;i++) {        if (fulllist.substring(i,i+1)=='|') {            thisitem++;            itemvalue=fulllist.substring(itemstart,i);            if (thisitem==thenumber) {                itemvalue=thevalue;            }            newcookie=newcookie+itemvalue+'|';            itemstart=i+1;        }    }    document.cookie=thecookie+'='+newcookie+'; expires='+today;}function retrieveCookieCount(thecookie) {   fulllist=retrieveCookie(thecookie,0,0);   thisitem=0; newcookie=''; itemstart=0;   for(var i=0; i<fulllist.length;i++) {    if (fulllist.substring(i,i+1)=='|') {        thisitem++;        itemstart=i+1;    }   }   return thisitem;}    function goBuy() {        ilist='';        ilist=ilist+retrieveCookie('TheBasketCode',0,0)+'^';        ilist=ilist+retrieveCookie('TheBasketName',0,0)+'^';        ilist=ilist+retrieveCookie('TheBasketWeight',0,0)+'^';        ilist=ilist+retrieveCookie('TheBasketTaxable',0,0)+'^';        ilist=ilist+retrieveCookie('TheBasketPrice',0,0)+'^';        ilist=ilist+retrieveCookie('TheBasketExtraFields',0,0)+'^';        ilist=ilist+retrieveCookie('TheBasketAdvanced',0,0)+'^';        ilist=ilist+retrieveCookie('TheBasketQuantity',0,0)+'^';        ilist=ilist+retrieveCookie('TheCurrency',0,0)+'^';        ilist=ilist+retrieveCookie('JShopReferrer',0,0)+'^';        ilist=changeUnwanted(ilist);        ilist=escape(ilist);        ilist=changePercent(ilist);        top.name=ilist;        top.location='https://www.secure-server-hosting.com/secutran/secureforms/sh209678/buy.htm';    }function changeUnwanted(tstring) {    nstring='';    for (var i=0; i <= tstring.length; i++) {        nchar=tstring.charAt(i);        if (nchar=='*') { nchar='!&1'; }        if (nchar=='+') { nchar='!&2'; }        if (nchar=='@') { nchar='!&3'; }        if (nchar=='.') { nchar='!&4'; }        if (nchar=='/') { nchar='!&5'; }        if (nchar=='-') { nchar='!&6'; }        nstring=nstring+nchar;    }    return nstring;}function changePercent(tstring) {    nstring='';    for (var i=0; i <= tstring.length; i++) {        nchar=tstring.charAt(i);        if (nchar=='%') { nchar='_'; }        nstring=nstring+nchar;    }    return nstring;}