if(top.location != location) {
    top.location.href = document.location.href;
}

document.write('<LINK type="text/css" rel="Stylesheet" href="beads.css">');


if (!vs3like(document.URL,'popup.html') && !vs3like(document.URL,'cgi-bin')){
document.write('<TABLE id=indmenu class=extramenu cellSpacing=0 cellPadding=2 bgColor=#cccccc name="indmenu" onmouseover="this.style.visibility=\'visible\';" onmouseout="this.style.visibility=\'hidden\';">');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/kit-index.html\';" vAlign=top>Bead Kits</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/book-index.html\';" vAlign=top>Books</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/ceramic-bead-index.html\';" vAlign=top>Ceramic Beads</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/czech-glass-index.html\';" vAlign=top>Czech Glass</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/miyuki-delica-index.html\';" vAlign=top>Delicas (Miyuki)</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/findings-index.html\';" vAlign=top>Findings</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/lampwork-index.html\';" vAlign=top>Lampwork Glass</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/miyuki-delica-index.html\';" vAlign=top>Miyuki Delicas</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/murano-index.html\';" vAlign=top>Murano Glass</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/plastic_index.html\';" vAlign=top>Plastic Beads</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/semi-precious-beads-index.html\';" vAlign=top>Semi-Precious</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/findings-index.html#ss\';" vAlign=top>Sterling Silver</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/swarovski-index.html\';" vAlign=top>Swarovski</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/tools-index.html\';" vAlign=top>Tools</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/wigjig-index.html\';" vAlign=top>Wigjig</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/workshops/\';" vAlign=top>Workshops</TD></TR>');
document.write('</TABLE>');

document.write('<TABLE id=popmenu class=extramenu cellSpacing=0 cellPadding=2 bgColor=#cccccc name="popmenu" onmouseover="this.style.visibility=\'visible\';" onmouseout="this.style.visibility=\'hidden\';">');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/tiara-band.html\';" vAlign=top>Alice Bands</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/bead-magazines.html\';" vAlign=top>Bead Magazines</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/beadalon.html\';" vAlign=top>Beadalon</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/swarovski-index.html#bic\';" vAlign=top>Bicone Crystals</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/book-index.html\';" vAlign=top>Books</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/hobby-pliers.html#chain\';" vAlign=top>Chainnose Pliers</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/threads.html\';" vAlign=top>Cotten Thread</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/findings-jumprings.html\';" vAlign=top>Jump Rings</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/lampwork-index.html\';" vAlign=top>Lampwork Beads</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/lampwork-index.html\';" vAlign=top>Lampwork Pendants</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/bead-magazines.html\';" vAlign=top>Magazines</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/wire.html#spwire\';" vAlign=top>Silver Plated Wire</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/softflex.html#softflex\';" vAlign=top>Soft Flex</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/softflex.html#softtouch\';" vAlign=top>Soft Touch</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/sterling-silver-wire.html\';" vAlign=top>Sterling Silver Wire</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/swarovski-index.html\';" vAlign=top>Swarovski Crystal</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/tiara-band.html#crown\';" vAlign=top>Tiara Bands</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/findings-clasps.html#trigger\';" vAlign=top>Trigger Clasps</TD></TR>');
document.write('<TR><TD onmouseover="this.className=\'menuh\';" onmouseout="this.className=\'menu\';" onclick="location=\'/workshops/\';" vAlign=top>Workshops</TD></TR>');
document.write('</TABLE>');
}


function numeralsOnly(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 
        ((evt.which) ? evt.which : 0));
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
//        alert("Enter numerals only in this field.");
        return false;
    }
    return true;
}

function vs3like(intstr,delim){
intstr = intstr.toLowerCase();
delim = delim.toLowerCase();
tstr=intstr.split(delim);
 if (tstr[1]||intstr.substring(intstr.length-delim.length,intstr.length)==delim){
 return true;
 }else{
 return false;
 }
}

 if (!vs3like(document.URL,'www.') && vs3like(document.URL,'mailorder-beads\.co\.uk')){
 var wwwurl = document.URL;
 wwwurl = wwwurl.replace(/mailorder-beads.co.uk/i,'www.mailorder-beads.co.uk');
 location = wwwurl;
 }

 if (!vs3like(document.URL,'mailorder-beads\.co\.uk') && vs3like(document.URL,'http:\/\/')){
 location = 'http://www.mailorder-beads.co.uk';
 }

var alltotal=0;
var nonadis=0;
var beadstotal=0;
var onlybeads=0;
var SDbeads=0;
var nonbeads=0;
var randstr = '';
var afval=0;

// COOKIE FUNCTIONS
function vs3getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
 if ( endstr == -1 )
 endstr = document.cookie.length;
 var vs3cookval = unescape(document.cookie.substring(offset, endstr));
 vs3cookval = vs3cookval.replace(/XV1S/g,',');
 vs3cookval = vs3cookval.replace(/XV2S/g,'\(');
 vs3cookval = vs3cookval.replace(/XV3S/g,'\)');
 vs3cookval = vs3cookval.replace(/XV4S/g,'\%');
 return(vs3cookval);
}

if (document.cookie.length > 3900){
alert(document.cookie.length)
}

function vs3getCookie(name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var ic = 0;
 while ( ic < clen ) {
 var jc = ic + alen;
 if ( document.cookie.substring(ic, jc) == arg ) return(vs3getCookieVal (jc));
 ic = document.cookie.indexOf(" ", ic) + 1;
 if ( ic == 0 ) break;
 }
 return(null);
}

function vs3setCookie(name,value,expires,path,domain,secure) {
 value=value.replace(/#0.00#0.00#0.00#0.00#0.00#0.00#0.00#0.00#0.00#0.00#0.00#0.00#]/g,'#]');
 value=value.replace(/#0#0#0#0#0#0#0#0#0#0#0#0#]/g,'#]');
//document.cookie = name + "=" + escape (value) +
value = value.replace(/,/g,'XV1S');
value = value.replace(/\(/g,'XV2S');
value = value.replace(/\)/g,'XV3S');
value = value.replace(/\%/g,'XV4S');
document.cookie = name + "=" + value +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}

function vs3deleteCookie(name,path,domain) {
 if ( vs3getCookie(name) ) {
 document.cookie = name + "=" +
 ((path) ? "; path=" + path : "") +
 ((domain) ? "; domain=" + domain : "") +
 "; expires=Thu, 01-Jan-70 00:00:01 GMT";
 }
}
/////////////////

var swsprice = '9.95';
var swkprice = '14.95';
function advdisc(){
vs3setCookie('ac',document.vsorder.swmcode.value,'',vscpath,'','');
 if (document.vsorder.swmcode.value.toLowerCase()=='bd_kit'){
 swsprice = '8.96';
 swkprice = '13.46';
 alert('Correct advert code entered. Items on this page will be discounted by 10%');
 }else{
 swsprice = '9.95';
 swkprice = '14.95';
 alert('Invalid advert code entered');
 }
}

function getadv(){
 if (vs3getCookie('ac')){
  if (vs3getCookie('ac').toLowerCase()=='bd_kit'){
  document.vsorder.swmcode.value = vs3getCookie('ac');
  swsprice = '8.96';
  swkprice = '13.46';
  }
 }
}

var pendantcodes = ' 1024s 1024w 1025s 1025w 1026s 1026w 1027s 1027w 1028s 1028w 1029s 1029w 1030s 1030w 1031s 1043w 1044s 1044w 1054s 1054w 1055s 1055w 1056s 1056w 1057s 1057w 1058s 1058w 1059s 1059w 1060s 1060w 1061s 1061w 1062s 1062w 1045s 1045w 1046s 1046w 1047s 1047w 1048s 1048w 1049s 1049w 1050s 1050w 1051s 1051w 1052s 1052w 1053s 1053w ';
var pendantrel = 0;

var novat="|Channel Islands|Jersey|Guernsey|Alderney|Sark|Herm|Albania|Andorra|Armenia|Azerbaijan|Azores|Balearic Islands|Belarus|Bosnia-Herzegovina|Bulgaria|Canary Islands|Corsica|Croatia|Faroe Islands|Georgia|Gibraltar|Greenland|Iceland|Kazakhstan|Kirghizstan|Liechtenstein|Macedonia|Madeira|Moldova|Monaco|Montenegro|Norway|Romania|Russia|San Marino|Serbia|Spitzbergen|Switzerland|Tajikistan|Turkey|Turkmenistan|Ukraine|Uzbekistan|Vatican City State|";
var vsval1="";
var maxcook = 3500;
var vscpath = '/';
var atd = 0;
var atm = 0;
var atk = 0;
var atdQ = 0;
var allatds = '';
var allmags = 0;
var allsneck = 0;
var allsbrac = 0;
var allmfks = '';
var delarray;
var magarray;
var mfkarray
var delfives = '';
var magthrees = '';
var mfkfives = '';
var delicadc = 0;
var magsdc = 0;
var mfkdc = 0;
var alldata;
var vsrgv = 0;
var vsrgvrunning = 0;
prtcart = '';
tmpdesc = '';
var trsms = '';
var tremail = '';
var promotext = '';
var ckbs = '';
var allckbs = 0;
var swrs = '';
var allswrs = 0;

if (!vs3getCookie('vspref')){
vs3setCookie('vspref',document.referrer,'',vscpath,'','');
var dref = document.referrer;
 if (document.referrer && !vs3like(document.referrer,'mailorder-beads.co.uk')){
 dref = dref.replace(/\|/g,'');
 dref = dref.replace(/\&/g,' ');
 document.write('<img src="/cgi-bin/beads/clock/clock.pl?r='+dref+'" style="visibility:hidden" height=1 width=1>');
 }
}

var message="We have temporarily disabled the right click feature working on our pictures from (17/04/2006.), we will be enable it again in the future. Thank you for your patience.";
var dcm = document.oncontextmenu;
document.oncontextmenu=new Function("return false");


function nopipes(s){
s.value = s.value.replace(/\|/g,'');
s.value = s.value.replace(/\"/g,'\'');
}

function sortNumbers(a, b) {
return b - a
}

function discountpop(){
 var vmsg=document.getElementById('discountmes');
 if (eval(afval)+vsrgvrunning-nonbeads > 89.99 && eval(afval)+vsrgvrunning-nonbeads < 100.01){

 var almostmes='Your items order total is over £90. If your order is over £100, you will get an automatic discount of 10% on all items except publications or shipping costs. <a href=index.html>Click here</a> to return to the home page if you want to continue shopping.'
 vmsg.innerHTML='<b>'+almostmes+'</b>';
 alert('Your items order total is over £90. If your order is over £100, you will get an automatic discount of 10% on all items except publications or shipping costs.\n\nClick the link on this page to return to the home page if you want to continue shopping and claim your discount.')
}

 if (eval(afval)+vsrgvrunning-nonbeads > 100){
 var discmes='As your items order is over £100, 10% will automatically be deducted from any relevant items. Please note there is no discount on books, magazines, or shipping.';
 var vmsg=document.getElementById('discountmes');
 vmsg.innerHTML='<b>'+discmes+'</b>';
 }


 if (eval(afval)+vsrgvrunning-nonbeads > 69.99){
 vmsg.innerHTML +='<p><b>As your items order is £70 or above, postage within the UK is FREE.</b>';

 }

}

//configure below variable for menu width, position on page
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var menuwidth=113;
var offsetright=5;
var offsettop=5;

function doindmenuin(){
document.getElementById('indmenu').style.visibility = 'visible';
if (ie4) {document.getElementById('indmenu').style.pixelTop=document.body.scrollTop+offsettop;}
else if (ns6) {document.getElementById('indmenu').style.top=window.pageYOffset+offsettop;}
document.getElementById('indmenu').style.right=106;
}
function doindmenuout(){
document.getElementById('indmenu').style.visibility = 'hidden';
}

function dopopmenuin(){
document.getElementById('popmenu').style.visibility = 'visible';
if (ie4) {document.getElementById('popmenu').style.pixelTop=document.body.scrollTop+offsettop;}
else if (ns6) {document.getElementById('popmenu').style.top=window.pageYOffset+offsettop;}
document.getElementById('popmenu').style.right=106;
}
function dopopmenuout(){
document.getElementById('popmenu').style.visibility = 'hidden';
}

function makeStatic() {
 if (ie4) {object1.style.pixelTop=document.body.scrollTop+offsettop;}
 else if (ns6) {document.getElementById("object1").style.top=window.pageYOffset+offsettop;}
 setTimeout("makeStatic()",0);
}

if (!vs3like(document.URL,'popup.html') && !vs3like(document.URL,'cgi-bin')){
 if (ie4||ns6) {document.write('<span ID="object1" STYLE="visibility:hidden; Position:absolute; Top:0; Right:'+offsetright+'; Z-Index:5;cursor:pointer;background-color:#000000;"><TABLE class="menutab" BORDER=0 width="'+menuwidth+'" CELLPADDING="1" CELLSPACING="0" BORDERCOLOR=#cccccc bgcolor=#cccccc>')}
 if (ie4||ns6)
 document.write('<TR><TD BGCOLOR=#9900cc></TD><TD BGCOLOR=#9900cc BORDERCOLORDARK=#9900cc BORDERCOLORLIGHT=#9900cc style="padding-left:0px; color:#ffffff; cursor:default;"><DIV id=cb style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; FLOAT: right; MARGIN-BOTTOM: 2px; BORDER-LEFT: #ffffff 1px solid; WIDTH: 20px; CURSOR: pointer; BORDER-BOTTOM: #ffffff 1px solid; TEXT-ALIGN: center" onclick="document.getElementById(\'object1\').style.visibility=\'hidden\';" title="Close This Menu">X</DIV><b>Menu</b></TD></TR>')
 var menui = new Array();
 var menul = new Array();

//configure below for menu items. Extend list as desired
 menui[0]="Main Index";
 menui[1]="View Cart";
 menui[2]="Checkout";
 menui[3]="Search";
 menui[4]="About Accounts";
 menui[5]="Beaders Forum";
 menui[6]="Indexes";
 menui[7]="Popular Items";
  if (vs3getCookie('li')){
  menui[8]="My Account<br>" + vs3getCookie('arn');
  menui[9]="Log Out";
  }else{
  menui[8]="Account Login";
  }

// CHANGE
 menul[0]="http://www.mailorder-beads.co.uk/index.html";
 menul[1]="http://www.mailorder-beads.co.uk/shopping-cart.html";
 menul[2]="final-total.html";
 menul[3]="http://search.freefind.com/find.html?id=10150246";
 menul[4]="/accountpage.html";
  if (vs3getCookie('li')){
  menul[5]="http://www.mailorder-beads.co.uk/cgi-bin/beads/forum/goforum.pl?user="+vs3getCookie('aun')+"&pass="+vs3getCookie('apw')+"&action=Login&board=_master&jump=forum.pl&jumpforum=Beaders Forum";
  }else{
  menul[5]="http://www.mailorder-beads.co.uk/cgi-bin/beads/forum/forum.pl?board=_master&forum=Beaders%20Forum";
  }
 menul[6]="";
 menul[7]="";
 menul[8]="https://www.mailorder-beads.co.uk/accounts/accountlogin.html";
  if (vs3getCookie('li')){
  menul[9]="";
  }

 for (i=0;i<=menui.length-1;i++){

  if (menui[i] == 'Checkout'){
  if (ie4||ns6) {document.write('<TR onmouseover="className=\'menuh\'" onMouseout="className=\'menu\'"><TD style="padding-left:2px;"></TD><TD BORDERCOLOR=#cccccc class="menu" ONCLICK="if (!alltotal){displayCart(1);} spend();">'+menui[i]+'</TD></TR>')}

  }else if(menui[i] == 'Log Out'){
  if (ie4||ns6) {document.write('<TR onmouseover="className=\'menuh\'" onMouseout="className=\'menu\'"><TD style="padding-left:2px;"></TD><TD BORDERCOLOR=#cccccc class="menu" ONCLICK="vs3setCookie(\'li\',\'\',\'\',vscpath,\'\',\'\'); window.location.reload();">'+menui[i]+'</TD></TR>')}

  }else if(menui[i] == 'Indexes'){
  if (ie4||ns6) {document.write('<TR onmouseover="className=\'menuh\'; doindmenuin();" onMouseout="className=\'menu\'; doindmenuout();"><TD style="padding-left:2px;"><img src=images/purplearrow.gif></TD><TD BORDERCOLOR=#cccccc class="menu">'+menui[i]+'</TD></TR>')}
  }else if(menui[i] == 'Popular Items'){
  if (ie4||ns6) {document.write('<TR onmouseover="className=\'menuh\'; dopopmenuin();" onMouseout="className=\'menu\'; dopopmenuout();"><TD style="padding-left:2px;"><img src=images/purplearrow.gif></TD><TD BORDERCOLOR=#cccccc class="menu">'+menui[i]+'</TD></TR>')}

  }else{
  if (ie4||ns6) {document.write('<TR onmouseover="className=\'menuh\'" onMouseout="className=\'menu\'"><TD style="padding-left:2px;"></TD><TD BORDERCOLOR=#cccccc class="menu" ONCLICK="location=\''+menul[i]+'\'">'+menui[i]+'</TD></TR>')}
  }
 }

if (ie4||ns6) {document.write('</TABLE></span>')}
}






function trap(){
 if (ie4||ns6){
  if (!vs3like(document.URL,'popup.html') && !vs3like(document.URL,'cgi-bin')){
  makeStatic();
  document.getElementById("object1").style.visibility='visible';
  }
 }

 for(i=0;i<document.images.length;i++){
 document.oncontextmenu=dcm;
 document.images[i].title = document.images[i].alt;
  if (vs3like(document.images[i].id,'pdf')){
  }else{
  document.images[i].oncontextmenu=new Function("alert(message);return false");
  }
 }

// if(document.URL.substring(document.URL.length-10,document.URL.length) != 'order.html'){
 if (!vs3like(document.URL,'order.')){
 delex();
 }

 if (vs3getCookie('ppos')){
 var posdata=vs3getCookie('ppos').split('|');
  if (document.URL == posdata[1]){
  window.scrollTo(0,parseInt(posdata[0]));
  }

 posdata[1] = posdata[1].replace(/ /g,'%20');
  if (document.URL == posdata[1]){
  window.scrollTo(0,parseInt(posdata[0]));
  }

 vs3deleteCookie('ppos','/','');
 }




// DELICA DISCOUNT //
allatds = allatds.substring(0,allatds.length - 1);
delarray = allatds.split(',');

// alert(delarray.length)
if (delarray.length > 4){
delarray = delarray.sort(sortNumbers);

 for (var dd = 0; dd < delarray.length; dd++) {
 atd += 1;
  if (atd < 5){
  delfives += delarray[dd] + ',';
  } else {
  delfives += delarray[dd] + '|';
  atd = 0;
  }
 }
delfives = delfives.substring(0,delfives.length - 1);
//alert(delfives)

delarray = delfives.split('|');

var delones;
 for (var dd = 0; dd < delarray.length; dd++) {
 delones = delarray[dd].split(',');
  if (delones.length == 5){
  delicadc += eval(delones[4]);
  }
 }

delicadc = priceFormat(delicadc);

 if (alldata){
  if ((vs3like(alldata,'[DDIS:Delica Beads Special Discount#')) && (!vs3like(alldata,'[DDIS:Delica Beads Special Discount#-'+delicadc+'#'))){
  clearSlot(deldd);
  }
 }

 if (alldata){
  if (!vs3like(alldata,'[DDIS:Delica Beads Special Discount#-'+delicadc+'#')){
  addToCart('DDIS:Delica Beads Special Discount','-'+delicadc,'0','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
  }
 }
}else{
 if (alldata){
  if (vs3like(alldata,'[DDIS:Delica Beads Special Discount#')){
  clearSlot(deldd);
  }
 }
}
////////////////////



//SW SLIDER DISCOUNT
//var sldc = 0;
//if (allsbrac > 0 && allsneck > 0){
// if (allsbrac < allsneck){
// sldc = allsbrac;
// }else{
// sldc = allsneck;
// }
//sldc *= 9.95;
//sldc = priceFormat(sldc);

//  if ((vs3like(alldata,'[SLDIS:SW Slider Special Discount#')) && (!vs3like(alldata,'[SLDIS:SW Slider Special Discount#-'+sldc+'#'))){
//  clearSlot(delsld);
//  }

// if (!vs3like(alldata,'[SLDIS:SW Slider Special Discount#-'+sldc+'#')){
// addToCart('SLDIS:SW Slider Special Discount','-'+sldc,'0','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
// }
//}else{
// if (alldata){
//  if (vs3like(alldata,'[SLDIS:SW Slider Special Discount#')){
//  clearSlot(delsld);
//  }
// }
//}
////////////////////



//SWHANDBAGS DISCOUNT
var sldc = priceFormat(parseInt(allmags / 6) * 4.95);
if (sldc > 0){
 if ((vs3like(alldata,'[HBDIS:SW Handbags Special Discount#')) && (!vs3like(alldata,'[HBDIS:SW Handbags Special Discount#-'+sldc+'#'))){
 clearSlot(delsld);
 }

 if (!vs3like(alldata,'[HBDIS:SW Handbags Special Discount#-'+sldc+'#')){
 addToCart('HBDIS:SW Handbags Special Discount','-'+sldc,'0','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
 }
}else{
 if (alldata){
  if (vs3like(alldata,'[HBDIS:SW Handbags Special Discount#')){
  clearSlot(delsld);
  }
 }
}
////////////////////


//SWPENDANT DISCOUNT
//pendantrel = (pendantrel * 20) / 100;
//pendantrel = priceFormat(pendantrel);

// if (alldata){
//  if (delcd && vs3like(alldata,'[CDIS:SW Flower Pendant Special Discount#') && !vs3like(alldata,'[CDIS:SW Flower Pendant Special Discount#-'+pendantrel+'#')){
//   clearSlot(delcd);
//  }
// }

///////////

// REM OFFER
 if (alldata){
  if (delmd && parseFloat(beadstotal) < 40){ //45 minus 5
  clearSlot(delmd);
  }
  if (delcd && parseFloat(beadstotal) < 25){
  clearSlot(delcd);
  }
//  if (delmk && parseFloat(beadstotal) < 10){
//  clearSlot(delmk);
//  }

  if (deladis && !vs3like(document.URL,'order.') && !vs3like(document.URL,'final-total.')){
  clearSlot(deladis);
  }
 }


// COSMIC OVALS
// if (alldata){
// var cthis = priceFormat(parseFloat(allckbs) / 4);
//  if (delcd && vs3like(alldata,'[CDIS:Cosmic-Oval Special Discount#') && !vs3like(alldata,'[CDIS:Cosmic-Oval Special Discount#-'+cthis+'#')){
//  clearSlot(delcd);
//  }
// }




// MAGAZINE DISCOUNT //
//allmags = allmags.substring(0,allmags.length - 1);
//magarray = allmags.split(',');
//if (magarray.length > 2 && vs3getCookie('z') && vs3getCookie('z').toLowerCase()=='cc_jul'){
//magarray = magarray.sort(sortNumbers);
// for (var dd = 0; dd < magarray.length; dd++) {
// atm += 1;
//  if (atm < 3){
//  magthrees += magarray[dd] + ',';
//  } else {
//  magthrees += magarray[dd] + '|';
//  atm = 0;
//  }
// }
//magthrees = magthrees.substring(0,magthrees.length - 1);
//magarray = magthrees.split('|');
//var magones;
// for (var dd = 0; dd < magarray.length; dd++) {
// magones = magarray[dd].split(',');
//  if (magones.length == 3){
//  magsdc += eval(magones[2]);
//  }
// }
//magsdc = priceFormat(magsdc);
// if (alldata){
//  if ((vs3like(alldata,'[MDIS:Magazines Special Discount#')) && (!vs3like(alldata,'[MDIS:Magazines Special Discount#-'+magsdc+'#'))){
//  clearSlot(delmd);
//  }
// }
// if (alldata){
//  if (!vs3like(alldata,'[MDIS:Magazines Special Discount#-'+magsdc+'#')){
//  addToCart('MDIS:Magazines Special Discount','-'+magsdc,'0','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
//  }
// }
//}else{
// if (alldata){
//  if (vs3like(alldata,'[MDIS:Magazines Special Discount#')){
//  clearSlot(delmd);
//  }
// }
//}
////////////////////




///// CRAFT KIT BOX DISCOUNT
// if (alldata){
//  if (delcd && vs3like(alldata,'[CDIS:Craft Kit Boxes Special Discount#') && !vs3like(alldata,'[CDIS:Craft Kit Boxes Special Discount#-'+priceFormat(allckbs * 15 / 100)+'#')){
//   if (!vs3like(document.URL,'order.')){
//   clearSlot(delcd);
//   }
//  }
// if (vs3getCookie('z') && vs3getCookie('z').toLowerCase()=='cc_ckc' && vs3like(document.URL,'order.')){
//  if (allckbs > 0){
//   if (!vs3like(alldata,'CDIS:Craft Kit Boxes Special Discount#-'+priceFormat(allckbs * 15 / 100)+'#')){
//   addToCart('CDIS:Craft Kit Boxes Special Discount','-'+priceFormat(allckbs * 15 / 100),'0','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
//   }
//  }
//  }
// }
////////////////////

///// SWAROVSKI MIX DISCOUNT
// if (alldata){
//  if (delcd && vs3like(alldata,'[SMDIS:Swarovski Mix Special Discount#')){
//   if (!vs3like(document.URL,'order.')){
//   clearSlot(delcd);
//   }
//  }
// if (vs3getCookie('z') && vs3getCookie('z').toLowerCase()=='cc_swm' && vs3like(document.URL,'order.')){
//  if (allckbs > 0){
//   if (!vs3like(alldata,'SMDIS:Swarovski Mix Special Discount#-'+priceFormat(allckbs * 20 / 100)+'#')){
//   addToCart('SMDIS:Swarovski Mix Special Discount','-'+priceFormat(allckbs * 20 / 100),'0','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
//   }
//  }
//  }
// }
////////////////////

///// CRAFT KIT BOX 'A' DISCOUNT
// if (alldata){
//  if (delcd && vs3like(alldata,'[CDIS:Stripy Sample Pack#')){
//   if (alltotal < 40.00){
//   clearSlot(delcd);
//   }
//  }
// }
/////////////

///// SWAROVSKI MAG OFFER
// if (alldata){
//  if (delsd && vs3like(alldata,'[P_SWAR:All That Sparkles Supplement#0.00')){
//   if (!vs3like(document.URL,'order.')){
//   clearSlot(delsd);
//   }
//  }
//  if (delad && vs3like(alldata,'[SDIS:All That Sparkles Discount')){
//   if (!vs3like(document.URL,'order.')){
//   clearSlot(delad);
//   }
//  }
// if (vs3getCookie('z') && vs3getCookie('z').toLowerCase()=='cc_sws' && vs3like(document.URL,'order.')){
//   if (vs3like(alldata,'P_SWAR:All That Sparkles Supplement#2.50') && !vs3like(alldata,'SDIS:All That Sparkles Discount')){
//   addToCart('SDIS:All That Sparkles Discount','-2.50','0.00','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
//   }else{
//    if (!vs3like(alldata,'P_SWAR:All That Sparkles Supplement#0.00') && !vs3like(alldata,'SDIS:All That Sparkles Discount')){
//    addToCart('P_SWAR:All That Sparkles Supplement','0.00','170.00','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
//    }
//   }
//  }
// }
////////////////////









// MIYUKI MASCOTS DISCOUNT //
//allmfks = allmfks.substring(0,allmfks.length - 1);
//mfkarray = allmfks.split(',');
//
//if (mfkarray.length > 4){
//mfkarray = mfkarray.sort(sortNumbers);
//
// for (var dd = 0; dd < mfkarray.length; dd++) {
// atk += 1;
//  if (atk < 5){
//  mfkfives += mfkarray[dd] + ',';
//  } else {
//  mfkfives += mfkarray[dd] + '|';
//  atk = 0;
//  }
// }
//mfkfives = mfkfives.substring(0,mfkfives.length - 1);
//
//mfkarray = mfkfives.split('|');
//
//var mfkones;
// for (var dd = 0; dd < mfkarray.length; dd++) {
// mfkones = mfkarray[dd].split(',');
//  if (mfkones.length == 5){
//  mfkdc += eval(mfkones[4]);
//  }
// }
//
//mfkdc = priceFormat(mfkdc);
//
// if (alldata){
//  if ((vs3like(alldata,'[FDIS:Miyuki Kits Special Discount#')) && (!vs3like(alldata,'[FDIS:Miyuki Kits Special Discount#-'+mfkdc+'#'))){
//  clearSlot(delmk);
//  }
// }
//
// if (alldata){
//  if (!vs3like(alldata,'[FDIS:Miyuki Kits Special Discount#-'+mfkdc+'#')){
//  addToCart('FDIS:Miyuki Kits Special Discount','-'+mfkdc,'0','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
//  }
// }
//}else{
// if (alldata){
//  if (vs3like(alldata,'[FDIS:Miyuki Kits Special Discount#')){
//  clearSlot(delmk);
//  }
// }
//}
////////////////////




///// GLASS KIT DISCOUNT ///////
 gkq = parseInt(eval(gkq)/10);
 if (alldata){
  if ((vs3like(alldata,'[KDIS:Bead Kits Special Discount#')) && (!vs3like(alldata,'[KDIS:Bead Kits Special Discount#-'+priceFormat(25.75*gkq)+'#'))){
  clearSlot(delkd);
  }
  if (gkq > 0){
   if (!vs3like(alldata,'[KDIS:Bead Kits Special Discount#-'+priceFormat(25.75*gkq)+'#')){
   addToCart('KDIS:Bead Kits Special Discount','-'+priceFormat(25.75*gkq),'0','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','');
   }
  }
 }
//////////////

 

///// SPECIAL ITEM DISCOUNT ///////
 if (alldata){
 var sdadd = priceFormat((SDbeads * 15) / 100);
  if (delmk && (vs3like(alldata,'[FDIS:Special items discount#')) && (!vs3like(alldata,'[FDIS:Special items discount#-'+sdadd+'#'))){
  clearSlot(delmk);
  }
 }
//////////////



//document.body.innerHTML=('<a target="_blank" href="https://www.mcafeesecure.com/RatingVerify?ref=www.mailorder-beads.co.uk"><img width="115" height="32" border="0" src="//images.scanalert.com/meter/www.mailorder-beads.co.uk/12.gif" alt="McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams" oncontextmenu="alert(\'Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.\'); return false;" style="float:left"></a>')+document.body.innerHTML;


}


var thispage="";
var nextpage="";
var vsval2="";
var vsval3="";
var vscurrency="£";
var vscartresponse="has been added to your cart.";
var delship=0;
var deldisc=0;
var deltax=0;
var vsshipdescrip="Shipping";
var vstaxdescrip="Tax";
var vsapu;
var vstb;
var vsru=1;
var allweight;
var vstons="";
var discrel=0;
var vatrel=0;
var discvatrel=0;
var delvat=0;
var deldd=0;
var delmd=0;
var delsld=0;
var delkd=0;
var delck=0;
var delmk=0;

var deladis=0;

var delcd=0;
var delsd=0;
var delad=0;
var vsshowqty='';
var origval=1;
var gkq=0;




if (vs3getCookie('dc')){
var xyxty='|'+vs3getCookie('dc')+'|';
}else{
var xyxty='';
}




function priceFormat(vs3n) {
 if (isNaN(vs3n)){
 return '0.00';
 }
vs3n=vs3n*100;
vs3n=Math.round(vs3n);
vs3n=vs3n/100;
vs3n=(''+vs3n+'').split(".");
 if (vs3n[1] && vs3n[1].length == 1){
 vs3n[1] += '0';
 }
 if (!vs3n[1]){
 vs3n[1] ='00';
 }
vs3n = vs3n[0] + '.' + vs3n[1];
return vs3n;
}

function displayCart(vsshowtax,vsccolor1,vsccolor2,vscfont,vscfontsize,vscfontcolor,vscfont1,vscfontsize1,vscfontcolor1,vsitems,vsqty,vseach,vstotal,vsremove,vsordertotal,vsempty,vscborder,vsbold,vsbold1,showrembut) {
// GIFT VOUCHER NEWSLETTER PROMO
vs3setCookie('hdv','0','',vscpath,'','');

allatds = '';
allmags = 0;
allmfks = '';
allckbs = 0;
afval=0;
nonbeads=0;
orderref='';
gkq=0;
allsbrac = 0;
allsneck = 0;
pendantrel = 0;

vstb1=0;vstb2=0;vstb3=0;vstb4=0;vstb5=0;vstb6=0;vstb7=0;vstb8=0;vstb9=0;vstb10=0;vstb11=0;vstb12=0;
//vstrack = document.cookie.indexOf("vsCart");
//startcount = (document.cookie.indexOf("=", vstrack) + 1);
//finishcount = document.cookie.indexOf(";", vstrack);
//if (finishcount == -1) {
// finishcount = document.cookie.length;
// }
//alldata = document.cookie.substring(startcount, finishcount);
 if (vs3getCookie('vsCart')){
 alldata = vs3getCookie('vsCart');
 }else{
 alldata = '';
 }
alltotal = 0;
nonadis=0;
beadstotal = 0;
onlybeads = 0;
SDbeads = 0;
allweight = 0;
listcount = 0;
vscount = 0;
if (vsshowtax==0) {document.writeln('<TABLE width=75% border='+vscborder+' cellspacing=1 cellpadding=2 '+vsccolor1+' cols=5>');}
 for (var i = 0; i <= alldata.length; i++) {
  if (alldata.substring(i,i+1) == ']') {
  listcount=listcount+1;
  }
 }
 if (listcount > 0){
  if (vsshowtax==0) {
   if (showrembut==2){
   document.writeln('<TR><td nowrap width=70%><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+'<img src="/images/cart.gif" align=bottom border=0 hspace=5>'+vsitems+'</TD><TD valign="bottom" width=1 colspan=1><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vsqty+'</b></TD><TD valign="bottom" width=1 colspan=1><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vseach+'</TD><td valign="bottom" width=1 colspan=1 align=right><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vstotal+'</TD></TR>');
   }else{
   document.writeln('<TR><td nowrap width=70%><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+'<img src="/images/cart.gif" align=bottom border=0 hspace=5>'+vsitems+'</TD><TD valign="bottom" width=1 colspan=1><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vsqty+'</b></TD><TD valign="bottom" width=1 colspan=1><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vseach+'</TD><td valign="bottom" width=1 colspan=1 align=right><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vstotal+'</TD><TD valign="bottom" width=1 colspan=1 align=center><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vsremove+'</TD></TR>');
   }
  }
 } else {
 if (vsshowtax==0) {document.writeln('<TR><TD colspan=5><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+'<img src="/images/cart.gif" align=middle border=0 hspace=5><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vsempty+'</TD></TR>');}
 }
listcount = 0;

vsrgvrunning = 0;
 for (var i = 0; i <= alldata.length; i++) {
  if (alldata.substring(i,i+1) == '[') {
  listbegin = i+1;
  } else if (alldata.substring(i,i+1) == ']') {
  listfinish = i;
  listtotal = 0;
  vscount = 0;
  listtotal = (eval(vsprice*vsamount));
  vsweight = vsweight * vsamount;
  liststore = listtotal * 100;

//if (deldisc > 0){
//  alltotal = alltotal + listtotal;
//}
  allweight = allweight + vsweight;
  listcount=listcount+1;

   vscode = '';
   vswpobject = '';
   vshavcode = '';
    for (var j = 0; j <= vsobject.length; j++) {
     if ((vsobject.charAt(j) != ':')){
      if (vshavcode == '1'){
      if (vsobject.charAt(j-1) != ':') {vswpobject = vswpobject+vsobject.charAt(j);}
      }else{
      vscode = vscode+vsobject.charAt(j);
      }
    }else{
    vshavcode = '1';


if (vscode == vsshipdescrip) {delship = listcount;}
if (vscode == 'Discount') {deldisc = listcount;}
if (vscode == 'LessVAT') {delvat = listcount;}
if (vscode == vstaxdescrip) {deltax = listcount;}
if (vscode == 'DDIS') {deldd = listcount;}
//if (vscode == 'MDIS') {delmd = listcount;}
if (vscode == 'FDIS') {delmk = listcount;}

if (vscode == 'ADIS') {deladis = listcount;}

if (vscode == 'KDIS') {delkd = listcount;}
if (vscode == 'CDIS') {delmd = listcount;}
if (vs3like(vsobject,'5 Pound gift voucher number ')){delcd = listcount;}
//if (vscode == 'SMDIS') {delcd = listcount;}
if (vscode == 'P_SWAR') {delsd = listcount;}
if (vscode == 'SDIS') {delad = listcount;}
//if (vscode == 'SLDIS') {delsld = listcount;}
if (vscode == 'HBDIS') {delsld = listcount;}

// DELICA DISCOUNT //
     if (vs3like(vsobject,'mdc') && vs3like(vscode,'s')){
      for (var dd = 0; dd < vsamount; dd++) {
      allatds += vsprice + ',';
      }
     }
////////////////////

//SW SLIDER DISCOUNT
 if (vs3like(vsobject,'slider bracelet')){
 allsbrac += parseInt(vsamount);
 }
 if (vs3like(vsobject,'slider necklace')){
 allsneck += parseInt(vsamount);
 }
////////////////////



// SWHANDBAGS DISCOUNT //
 if (vscode == '1015s' || vscode == '1016s' || vscode == '1017s' || vscode == '1018s' || vscode == '1019s' || vscode == '1020s'){
 allmags += eval(vsamount);
 }
////////////////////

// SWPENDANT DISCOUNT //
// if (vs3like(pendantcodes,' '+vscode+' ')){
// pendantrel += eval(vsprice * vsamount);
// }
///////////



// COSMIC OVAL //
 if (vs3like(vsobject,'cosmic Oval')){
 allckbs += eval(vsprice * vsamount);
// }else{
// ckbs = 0;
 }
////////////////////




// CRAFT KIT BOXES DISCOUNT //
//ckbs = vscode;
//ckbs = ckbs.replace(/s/,'');
// if (isNaN(ckbs)==false && eval(ckbs) > 3389 && eval(ckbs) < 3401){
// allckbs += eval(vsprice * vsamount);
// }else{
// ckbs = 0;
// }
////////////////////

// SWAROVSKI MIX DISCOUNT //
// if (vs3like(vsobject,'Swarovski Mix') && !vs3like(vsobject,'Discount')){
// allckbs += eval(vsprice * vsamount);
// }

////////////////////





// MIYUKI KITS DISCOUNT //
     if (vs3like(vscode,'mfk') && vs3like(vscode,'s')){
      for (var dd = 0; dd < vsamount; dd++) {
      allmfks += vsprice + ',';
      }
     }
////////////////////




// GLASS KIT DISCOUNT //
     if (vs3like(vsobject,'Glass Kit') && vs3like(vscode,'s')){
     gkq += eval(vsamount);
     }
////////////////////


    }
   }

//   if (vsshowtax==0) {
   listtotal=priceFormat(listtotal);
   if (!vsprice){vsprice=0;listtotal=0;}

 // GIFT VOUCHER NEWSLETTER PROMO
 if (vs3like(vsobject,'P_DISV5:5 Pound gift voucher number ')){
 vs3setCookie('hdv','1','',vscpath,'','');
 }

if (vscode == 'Shipping' && vs3like(document.URL,'order.') && (vs3like(vsobject,' SMS tracking ') || vs3like(vsobject,' Email tracking '))){
trackdet=vsobject.split(' tracking ');
 if (vs3like(vsobject,' SMS tracking ')){
 trsms = trackdet[1];
 }
 if (vs3like(vsobject,' Email tracking ')){
 tremail = trackdet[1];
 }
}




   if (((vscode==vsshipdescrip||vscode==vstaxdescrip||vscode=='Discount'||vscode=='LessVAT') && (showrembut==1)) || (vscode=='ADIS') || (vscode=='DDIS') || (vscode=='CDIS') || (vscode=='HBDIS') || (vscode=='SMDIS') || (vscode=='MDIS')|| (vscode=='FDIS')|| (vscode=='KDIS') || (vscode=='P_DISV5') || (vscode=='P_DISV10') || (vscode=='RDGVOU') || (vscode.substring(0,2) == 'WS') || (vscode.substring(0,3) == 'HMB') || (vscode.substring(0,2) == 'C_') || (vscode.substring(0,4) == 'P_C_')){
    if ((vscode=='P_DISV5') || (vscode=='P_DISV10') || (vscode=='RDGVOU') || (vscode.substring(0,2) == 'WS') || (vscode.substring(0,3) == 'HMB') || (vscode.substring(0,2) == 'C_') || (vscode.substring(0,4) == 'P_C_')){
/// WS
     if (vscode.substring(0,2) == 'WS'){
     randstr = 'r'+String((new Date()).getTime()).replace(/\D/gi,'');
     vsshowdel='<a href="javascript:document.images.'+randstr+'.src=\'/cgi-bin/beads/bookings/deltemp.pl?ref='+vsamount+'VC'+vsobject+'\'; alert(\'This workshop has been removed from your cart.\'); clearSlot('+listcount+');"><image src=/images/del.gif name="'+randstr+'" border=0 onclick="this.style.visibility=\'hidden\'"></a>';
     }else if(vscode.substring(0,3) == 'HMB'){
/// HMB
     randstr = 'b'+String((new Date()).getTime()).replace(/\D/gi,'');
     vsshowdel='<a href="javascript:document.images.'+randstr+'.src=\'/cgi-bin/beads/hanmadebeads/deltemp.pl?ref='+vscode+' '+vsamount+'\'; alert(\'This item has been removed from your cart.\'); clearSlot('+listcount+');"><image src=/images/del.gif name="'+randstr+'" border=0 onclick="this.style.visibility=\'hidden\'"></a>';
     }else if(vscode.substring(0,2) == 'C_' || vscode.substring(0,4) == 'P_C_'){
/// CUSTOM
     randstr = 'b'+String((new Date()).getTime()).replace(/\D/gi,'');
     vsshowdel='<a href="javascript:document.images.'+randstr+'.src=\'/cgi-bin/beads/custompages/deltemp.pl?ref='+vscode+' '+vsamount+'\'; alert(\'This item has been removed from your cart.\'); clearSlot('+listcount+');"><image src=/images/del.gif name="'+randstr+'" border=0 onclick="this.style.visibility=\'hidden\'"></a>';
     }else{
     vsshowdel='<a href="javascript:clearSlot('+listcount+')"><image src=/images/del.gif border=0></a>';
     }

    }else{
    vsshowdel='&nbsp;';
    }
   vsshowqty=vsamount;
   }else{
   vsshowdel='<a href="javascript:clearSlot('+listcount+')"><image src=/images/del.gif border=0></a>';
   vsshowqty='<input type=text name=vs_nq'+listcount+' size=2 value='+vsamount+' onfocus="origval=this.value" onblur="redocart(this.name,this.value)">';
   }

  
   if (showrembut==2) {
   remcolumn=''
   }else{
   remcolumn='<td align=center colspan=1><font face="'+vscfont1+'" size='+vscfontsize1+' color='+vscfontcolor1+'>'+vsbold1+vsshowdel+'</td>'
   }

////////// NEW /////////////
 // 10% discount
 if ((vscode.substring(0,2) != 'P_') && (vscode != 'Discount') && (vscode != 'Shipping') && (vscode != 'LessVAT') && (vscode != 'RDGVOU')) {

//alert(ckbs) \\\AHHHHHHGG
//  if ((!(eval(ckbs) > 3389 && eval(ckbs) < 3401))       ||      !vs3getCookie('z')     || ((vs3getCookie('z') && vs3getCookie('z').toLowerCase()!='cc_ckc'))         ){
// SWAROVSKI MIX - GENERAL DISCOUNT
 if ((!vs3like(vsobject,'Swarovski Mix'))       ||      !vs3getCookie('z')     || ((vs3getCookie('z') && vs3getCookie('z').toLowerCase()!='cc_swm'))         ){ 
  discrel += eval(listtotal);
  }
 }

// VAT DEDUCT
// ((vs3like(alldata,'World Zone')) || (vs3like(novat,xyxty)))
 if ((vscode != 'RDGVOU') && (vscode.substring(0,2) != 'P_') && (vscode != 'Discount') && (vscode != 'LessVAT') && ((vs3like(alldata,'World Zone')) || (vs3like(novat,xyxty)))) {
// if ((vscode.substring(0,2) != 'P_') && (vscode != 'Discount') && (vs3like(alldata,'World Zone')) && (vscode != 'LessVAT')) {
// if ((vscode.substring(0,2) != 'P_') && (vscode != 'Discount') && (vscode != 'LessVAT')) {


///if ((vscode != 'RDGVOU') && (vscode.substring(0,2) != 'P_') && (vscode != 'Discount') && (vscode != 'LessVAT')) {
 vatrel += eval(listtotal);
   if (vscode != 'Shipping'){
   discvatrel += eval(listtotal);
   }
 }


////////////////////////////
//REDEEM GV
 if (vscode == 'RDGVOU'){
 vsrgv = listtotal-listtotal-listtotal;
 vsrgvrunning += vsrgv;
 }
///////////

 alltotal += eval(listtotal);
  if (vscode != 'ADIS'){
  nonadis += eval(listtotal);
  }


// beadstotal - EVERYTHING EXCEPT WORKSHOPS
//  if ((vscode.substring(0,2) != 'WS' || !(eval(ckbs) > 3389 && eval(ckbs) < 3401))    ||      !vs3getCookie('z')     || ((vs3getCookie('z') && vs3getCookie('z').toLowerCase()!='cc_ckc'))      ){
  if (vscode.substring(0,2) != 'WS'){
  beadstotal += eval(listtotal);
  }

// onlybeads - EVERYTHING EXCEPT WORKSHOPS, PUBLICATIONS, SHIPPING
  if (vscode.substring(0,2) != 'WS' && vscode.substring(0,2) != 'P_' && vscode !=  'Shipping'){
  onlybeads += eval(listtotal);
  }

// SDbeads - SPECIAL DISCOUNT ITEMS
  if (vscode.substring(0,2) == 'S_' || vscode.substring(0,4) == 'P_S_'){
  SDbeads += eval(listtotal);
  }

if (vsshowtax==0) {
 if (vscode != 'Shipping' &&  vscode.substring(0,3) != 'HMB' &&  vscode.substring(0,2) != 'C_' &&  vscode.substring(0,4) != 'P_C_' &&  vscode.substring(0,2) != 'WS' && vscode != 'RND' && vscode != 'CUBE' && vscode.substring(vscode.length - 3,vscode.length) != 'CTM'){
 vsobject = vsobject.replace(/3mb/g,' 3mm Bicone');
 vsobject = vsobject.replace(/4mb/g,' 4mm Bicone');
 vsobject = vsobject.replace(/5mb/g,' 5mm Bicone');
 vsobject = vsobject.replace(/6mb/g,' 6mm Bicone');
 vsobject = vsobject.replace(/8mb/g,' 8mm Bicone');
 vsobject = vsobject.replace(/crm/g,' Ceramic');
 vsobject = vsobject.replace(/glf/g,' Glass Faceted');
 vsobject = vsobject.replace(/fsd/g,' Fake Suede Thread');
 vsobject = vsobject.replace(/fwp/g,' Freshwater Pearls');
 vsobject = vsobject.replace(/mtp/g,' Mother of Pearl');
 vsobject = vsobject.replace(/pgl/g,' Painted Indian Glass');
 vsobject = vsobject.replace(/mtc/g,' Metal Charm');
 vsobject = vsobject.replace(/mlb/g,' Metal Letter');
 vsobject = vsobject.replace(/mdc/g,' Delicas');
 vsobject = vsobject.replace(/ptc/g,' Plastic');
 vsobject = vsobject.replace(/gtd/g,' Glow-in-the-dark');
 vsobject = vsobject.replace(/spk/g,' Sparkle');
 vsobject = vsobject.replace(/stw/g,' Lampwork Silver Twist 92');
 vsobject = vsobject.replace(/gsw/g,' Lampwork Gold Swirl 93');
 vsobject = vsobject.replace(/swr/g,' Swarovski');
 vsobject = vsobject.replace(/dmt/g,' Diamante');
 vsobject = vsobject.replace(/btf/g,' Butterfly');
 vsobject = vsobject.replace(/sqd/g,' Squaredelle');
 vsobject = vsobject.replace(/flw/g,' Flower');
 }

 if (vscode.substring(vscode.length - 3,vscode.length) == 'CTM'){
 vsobject = vsobject.replace(/CTM:/g,':');
 }


//  if (vs3like(vsobject,'Uk, 1st Class') && allweight > 1999){
//  vsobject = vsobject.replace(/Uk, 1st Class/g,'DHL 48hr');
//  }

   document.writeln('<tr '+vsccolor2+'><td><font face="'+vscfont1+'" size='+vscfontsize1+' color='+vscfontcolor1+'>'+vsbold1+vsobject+'</td><td colspan=1><font face="'+vscfont1+'" size='+vscfontsize1+' color='+vscfontcolor1+'>'+vsshowqty+'</td><td colspan=1 nowrap><font face="'+vscfont1+'" size='+vscfontsize1+' color='+vscfontcolor1+'>'+vsbold1+vsprice+'</td><td colspan=1 align=right nowrap><font face="'+vscfont1+'" size='+vscfontsize1+' color='+vscfontcolor1+'>'+vsbold1+listtotal+'</td>'+remcolumn+'</tr>');
   document.writeln('<INPUT TYPE="hidden" NAME="Purchase'+listcount+'" VALUE="'+vsobject+'">');
   vsval1=vsval1+"Purchase"+listcount+",";
tmpdesc = vsobject;
tmpdesc = tmpdesc.replace(/:/g,'-');
prtcart += ':' + tmpdesc;
   document.writeln('<INPUT TYPE="hidden" NAME="Quantity'+listcount+'" VALUE="'+vsamount+'">');
   vsval1=vsval1+"Quantity"+listcount+",";
prtcart += ':' + vsamount + '::';
   document.writeln('<INPUT TYPE="hidden" NAME="Price Each'+listcount+'" VALUE="'+vsprice+'">');
   vsval1=vsval1+"Price Each"+listcount+",";
prtcart += ':' + vsprice;
   document.writeln('<INPUT TYPE="hidden" NAME="vshop_weight'+listcount+'" VALUE="'+priceFormat(vsweight)+'">');

   document.writeln('<INPUT TYPE="hidden" NAME="Total Cost'+listcount+'" VALUE="'+listtotal+'">');
   vsval1=vsval1+"Total Cost"+listcount+",";
prtcart += ':' + listtotal;
   }
}



else if (alldata.substring(i,i+1) == '#') {
vscount = vscount + 1;
   if (vscount == 1) {vsobject = alldata.substring(listbegin, i);}
   if (vscount == 2) {vsprice = alldata.substring(listbegin, i);}
   if (vscount == 3) {vsweight = alldata.substring(listbegin, i);}
   if (vscount == 4) {vsamount = alldata.substring(listbegin, i);}   
   if (vscount == 5) {vstb1 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 6) {vstb2 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 7) {vstb3 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 8) {vstb4 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 9) {vstb5 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 10) {vstb6 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 11) {vstb7 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 12) {vstb8 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 13) {vstb9 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 14) {vstb10 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 15) {vstb11 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   if (vscount == 16) {vstb12 += (parseFloat(alldata.substring(listbegin, i))*vsamount)*vsprice/100;}
   listbegin = i+1;
  }
 }

 if (listcount > 0) {
 vsval1=vsval1+"Goods Total,";
 if (vsshowtax==0) {

  if (vs3like(alldata,'[WS') || vs3like(alldata,'[HMB') || vs3like(alldata,'[C_') || vs3like(alldata,'[P_C_')){
  if (showrembut==2){vsmtcol=''}else{vsmtcol='<td align=center><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+'&nbsp;</b></td>'}
  }else{
  if (showrembut==2){vsmtcol=''}else{vsmtcol='<td align=center><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+'<a href="javascript:mtCart();">Empty</a></b></td>'}
  }

 document.writeln('<tr><td nowrap colspan=1 align=left><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'><b><a href="javascript:void(0)">Recalculate cart quantities</a></b> &nbsp; <input type=button value="Save cart" onclick="if(confirm(\'This will save your cart contents so it will still be there the next time you come back to The Beadshop website.\\n\\nIf you make any subsequent changes to the cart, please save again before closing this website, otherwise nothing will be saved.\')){savecart();}">&nbsp;</td><td nowrap colspan=2 align=right><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+vsordertotal+': '+vscurrency+'</b></td><td nowrap align=right><font face="'+vscfont+'" size='+vscfontsize+' color='+vscfontcolor+'>'+vsbold+priceFormat(alltotal)+'</b></td>'+vsmtcol+'</tr></table>');

 document.writeln('<INPUT TYPE="hidden" NAME="Goods Total" VALUE="'+priceFormat(alltotal)+'">');
    vsnl=new Date();
    orderref=vsnl.getDate()+''+(vsnl.getMonth()+1)+''+vsnl.getYear()+''+vsnl.getHours()+''+vsnl.getMinutes()+''+vsnl.getSeconds()+parseInt(alltotal);
    document.writeln('<input type=hidden name=vshop_orderref value='+orderref+'>');

  vs2x=0
  vs2y=0
  if (delship){
  vs2x=priceFormat(parseFloat(document.vsorder['Total Cost'+delship].value));
  }
  if (deltax){
  vs2y=priceFormat(parseFloat(document.vsorder['Total Cost'+deltax].value));
  }

  if (listcount>0){

  afval=priceFormat(priceFormat(parseFloat(alltotal))-(parseFloat(vs2x)+parseFloat(vs2y)));
  document.writeln('<input type=hidden name=vshop_netamount value='+afval+'>');
  }
}
 } else {
if (vsshowtax==0) {document.writeln('<tr><td colspan=5>&nbsp;</td></tr></TABLE>');}
 }
prtcart = listcount + prtcart;


//nonbeads like workshops
nonbeads = alltotal - beadstotal;
}



function clearSlot(datnumber,noreload,datnumber1,datnumber2) {
wantItList = '';
listcount = 0;
 for (var i = 0; i <= alldata.length; i++) {
  if (alldata.substring(i,i+1) == '[') {
  listbegin = i+1;
  } else if (alldata.substring(i,i+1) == ']') {
  listfinish = i;
  listcount=listcount+1;
   if ((listcount != datnumber) && (listcount != datnumber1) && (listcount != datnumber2)) {
   wantItList = wantItList+'['+alldata.substring(listbegin, listfinish)+']';
   }
  }
 }
//document.cookie="vsCart="+wantItList+"; path=/;";
vs3setCookie('vsCart',wantItList,'',vscpath,'','');
///// NEW //////
setppos();
////////////////

   if ((navigator.appName == 'Netscape') && (vs3like(document.URL,'#'))){
    if ((vs3like(document.URL,'\/'+nextpage)) || (vs3like(document.URL,'\\'+nextpage))){
    location.reload();
    }else{
    location = nextpage;
    }
   }else{
 if (!noreload){
  if (vs3like(document.URL,'order.')){
  location='/final-total.html';
  }else{
  if (thispage){location = thispage;}else{window.location.reload();}
  }
 }
   }


//alert(vs3getCookie('vsCart'))

}















function redocart(n,v){

 if (document.vsorder[n].value == origval){
 return;
 }

 if (v < 1){
 alert('You must order at least 1 of this item.');
 document.vsorder[n].value = origval;
 return;
 }

 if (vs3like(v,'.')){
 alert('Please enter a whole number for your quantity of this item.\n\nWe cannot accept orders with decimal points.');
 document.vsorder[n].value = origval;
 return;
 }

 wantItList = null;
 listcount = 0;
  for (var i = 0; i <= alldata.length; i++) {
   if (alldata.substring(i,i+1) == '[') {
   listbegin = i+1;
   } else if (alldata.substring(i,i+1) == ']') {
   listfinish = i;
   listcount=listcount+1;
    if ((listcount != delship)&&(listcount != deltax)) {



     if ('vs_nq'+listcount != n){
     wantItList = wantItList+'['+alldata.substring(listbegin, listfinish)+']';
     }else{
     var newcline=alldata.substring(listbegin, listfinish).split('#');
     wantItList = wantItList+'['+newcline[0]+'#'+newcline[1]+'#'+newcline[2]+'#'+v+'#]';
     }
    }
   }
  }

vs3setCookie('vsCart',wantItList,'',vscpath,'','');
setppos();

    location.reload();
}













function addToCart(wantIt, wantPrice, wantWeight, wantAmount, vstb1, vstb2, vstb3, vstb4, vstb5, vstb6, vstb7, vstb8, vstb9, vstb10, vstb11, vstb12, noreload, remslot, vsnooptxt, vszeroitems) {
//// NEW //////
 if (vs3like(wantAmount,'.')){
 alert('Please enter a whole number for your quantity of this item.\n\nWe cannot accept orders with decimal points.');
 return;
 }

 if (document.cookie.length > maxcook) {
 alert('Your shopping cart is full and cannot accept any more items.\n\nPlease submit this order before returning to the site to add more items.');
 return;
 }
//// 
x = 0; vsicode = '';
 for (var i = 0; i <= wantIt.length; i++) {
 if (wantIt.charAt(i) == ':') {
  x = x + 1;
  } else {
  if (!x) {vsicode = vsicode+wantIt.charAt(i);}
  }
 }

if (x > 1) {
alert(vsnooptxt);
} else {

if (remslot){
 if (((delship) && (vsicode == vsshipdescrip))||((deltax) && (vsicode == vstaxdescrip))){
 wantItList = null;
 listcount = 0;
  for (var i = 0; i <= alldata.length; i++) {
   if (alldata.substring(i,i+1) == '[') {
   listbegin = i+1;
   } else if (alldata.substring(i,i+1) == ']') {
   listfinish = i;
   listcount=listcount+1;
    if ((listcount != delship)&&(listcount != deltax)) {
    wantItList = wantItList+'['+alldata.substring(listbegin, listfinish)+']';
    }
   }
  }
//document.cookie="vsCart="+wantItList+"; path=/;";
vs3setCookie('vsCart',wantItList,'',vscpath,'','');
 }
}
vsMcode = '';
gd = 0;
pPrice = '';
 for (var i = 0; i <= wantIt.length; i++) {
  if (wantIt.charAt(i) == '[') {
  gd = 1;}
  if (wantIt.charAt(i) == ']') {
  gd = 0;}

if (gd == 0) {
 if (wantIt.charAt(i) != ']'){
 pPrice = pPrice+wantIt.charAt(i);}
} else {
 if (wantIt.charAt(i) != '['){
 vsMcode = vsMcode+wantIt.charAt(i);}
 }
}
wantIt = pPrice;
pPrice = '';
 for (var i = 0; i <= wantIt.length; i++) {
 if (wantIt.charAt(i) != ':') {
  pPrice = pPrice + wantIt.charAt(i);
  }else
  {
  pPrice = pPrice + vsMcode + ':';
  }
 }
wantIt = pPrice;

pPrice = '';
vsmin = '0'
 if (wantPrice.charAt(wantPrice.length-1) == '%'){
  for (var x = 0; x < wantPrice.length-1; x++) {
   if (wantPrice.charAt(x) != '-'){pPrice = pPrice + wantPrice.charAt(x);} else {vsmin = '1';}
   }
 wantPrice = (pPrice * priceFormat(alltotal)) / 100;
 wantPrice = priceFormat(wantPrice);
 if (vsmin == '1') {wantPrice = '-'+wantPrice;}
 }
 pPrice=''
  if ((wantPrice.charAt(wantPrice.length-3) != '.') && (wantPrice.charAt(wantPrice.length-3) != "0")){
  for (var x = 0; x < wantPrice.length-1; x++) {
  pPrice = pPrice + wantPrice.charAt(x);
  }
  wantPrice = pPrice;
 }
 if (wantAmount < 1) {
 alert(vszeroitems);
 return;
 }


//// CHECK IF ITEM IS ALREADY IN CART
 var wantItList = '';
 var titem;
 var itemfound = 0;
 listcount = 0;
  for (var i = 0; i <= alldata.length; i++) {
   if (alldata.substring(i,i+1) == '[') {
   listbegin = i+1;
   } else if (alldata.substring(i,i+1) == ']') {
   listfinish = i;
   listcount=listcount+1;
   titem=alldata.substring(listbegin, listfinish).split('#');
    if (wantIt==titem[0]){
    itemfound = 1;
    wantItList = wantItList+'['+titem[0]+'#'+titem[1]+'#'+titem[2]+'#'+eval(eval(titem[3])+eval(wantAmount))+'#'+']';
    }else{
    wantItList = wantItList+'['+alldata.substring(listbegin, listfinish)+']';
    }
   }
  }

 if (vsicode.substring(0,3) == 'HMB' || vsicode.substring(0,2) == 'C_' || vsicode.substring(0,4) == 'P_C_'){
 itemfound = 0;
 }


 if (itemfound == 1 && vsicode != 'DDIS' && vsicode != 'HBDIS' && vsicode != 'MDIS' && vsicode != 'FDIS' && vsicode != 'KDIS' && vsicode != 'CDIS' && vsicode != 'SMDIS'){
 vs3setCookie('vsCart',wantItList,'',vscpath,'','');
 }else{
 vs3setCookie('vsCart',vs3getCookie('vsCart')+"["+wantIt+"#"+wantPrice+"#"+wantWeight+"#"+wantAmount+"#"+vstb1+"#"+vstb2+"#"+vstb3+"#"+vstb4+"#"+vstb5+"#"+vstb6+"#"+vstb7+"#"+vstb8+"#"+vstb9+"#"+vstb10+"#"+vstb11+"#"+vstb12+"#]",'',vscpath,'','');
 }
////////////



//vs3setCookie('vsCart',vs3getCookie('vsCart')+"["+wantIt+"#"+wantPrice+"#"+wantWeight+"#"+wantAmount+"#"+vstb1+"#"+vstb2+"#"+vstb3+"#"+vstb4+"#"+vstb5+"#"+vstb6+"#"+vstb7+"#"+vstb8+"#"+vstb9+"#"+vstb10+"#"+vstb11+"#"+vstb12+"#]",'',vscpath,'','');

///// NEW //////
setppos();
////////////////



   if ((navigator.appName == 'Netscape') && (vs3like(document.URL,'#'))){
    if ((vs3like(document.URL,'\/'+nextpage)) || (vs3like(document.URL,'\\'+nextpage))){
    location.reload();
    }else{
    location = nextpage;
    }
   }else{
    if (!noreload){
    if (nextpage){location = nextpage;}else{alert(wantAmount+' x '+wantIt+' '+vscartresponse);}
    }
   }
  
 }
}

function spend(){
  if (eval(alltotal)+vsrgvrunning < 4.95) {
  alert('Sorry, We have a minimum goods total of £4.95\n\nYou have to spend a further £'+ priceFormat(4.95-eval(alltotal)+vsrgvrunning) +' to continue.');
  return false;
 } else {
 // CHANGE
 location = "https://www.mailorder-beads.co.uk/final-total.html";
// location = "https://www.mailorder-beads.co.uk/test/final-total.html";
 return true;
 }

}





////////////////////////////// SHIPPING







vstons1=0.00;vstons2=0.00;vstons3=0.00;vstons4=0.00;vstons5=0.00;vstons6=0.00;vstons7=0.00;vstons8=0.00;vstons9=0.00;vstons10=0.00;vstons11=0.00;vstons12=0.00;
vsband="Postage & Packing: Please Select :";
vsband1="Uk, 1st Class";vstaxex1="";
vsband2="Uk, Guaranteed Next Working Day";vstaxex2="";
vsband3="(Europe Airmail)";vstaxex3="";
vsband4="(World Zone 1 Airmail)";vstaxex4="";
vsband5="(World Zone 2 Airmail)";vstaxex5="";
vsband6="DHL 48hr service";vstaxex6="";
vsband7="";vstaxex7="";
vsband8="";vstaxex8="";
vsband9="";vstaxex9="";
vsband10="";vstaxex10="";
vsband11="";vstaxex11="";
vsband12="";vstaxex12="";
vspunit="g";
vspunitpl="g";
function getWeight(){
vsapu1="9.95";vsapu2="9.95";vsapu3="90.00";vsapu4="90.00";vsapu5="90.00";vsapu6="90.00";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";
if (allweight<=31000) {vsapu1="9.95";vsapu2="9.95";vsapu3="75.00";vsapu4="75.00";vsapu5="75.00";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=20000) {vsapu1="9.95";vsapu2="9.95";vsapu3="60.00";vsapu4="75.00";vsapu5="75.00";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=10000) {vsapu1="9.95";vsapu2="9.95";vsapu3="45.00";vsapu4="75.00";vsapu5="75.00";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=5000) {vsapu1="9.95";vsapu2="9.95";vsapu3="33.55";vsapu4="65.00";vsapu5="65.00";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=4000) {vsapu1="9.95";vsapu2="9.95";vsapu3="28.55";vsapu4="55.00";vsapu5="55.00";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=3000) {vsapu1="9.95";vsapu2="9.95";vsapu3="22.55";vsapu4="45.00";vsapu5="45.00";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=2500) {vsapu1="9.95";vsapu2="9.95";vsapu3="16.55";vsapu4="35.00";vsapu5="35.00";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=1999) {vsapu1="8.50";vsapu2="9.95";vsapu3="13.75";vsapu4="24.50";vsapu5="24.50";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=1750) {vsapu1="7.50";vsapu2="9.95";vsapu3="11.50";vsapu4="21.50";vsapu5="21.50";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=1500) {vsapu1="6.50";vsapu2="9.95";vsapu3="10.25";vsapu4="18.75";vsapu5="18.75";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=1250) {vsapu1="5.50";vsapu2="9.95";vsapu3="8.95";vsapu4="15.95";vsapu5="15.95";vsapu6="5.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=1000) {vsapu1="4.50";vsapu2="7.95";vsapu3="7.50";vsapu4="12.95";vsapu5="12.95";vsapu6="4.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=750) {vsapu1="3.95";vsapu2="7.95";vsapu3="6.25";vsapu4="10.35";vsapu5="10.35";vsapu6="4.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=500) {vsapu1="2.60";vsapu2="6.50";vsapu3="4.65";vsapu4="7.45";vsapu5="7.45";vsapu6="4.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=250) {vsapu1="1.70";vsapu2="6.50";vsapu3="3.25";vsapu4="4.75";vsapu5="4.75";vsapu6="4.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=100) {vsapu1="1.05";vsapu2="6.50";vsapu3="2.25";vsapu4="2.80";vsapu5="2.80";vsapu6="4.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=60) {vsapu1="1.05";vsapu2="5.95";vsapu3="2.25";vsapu4="2.80";vsapu5="2.80";vsapu6="4.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
if (allweight<=0.05) {vsapu1="0.00";vsapu2="6.95";vsapu3="4.40";vsapu4="6.15";vsapu5="7.30";vsapu6="4.95";vsapu7="0.00";vsapu8="0.00";vsapu9="0.00";vsapu10="0.00";vsapu11="0.00";vsapu12="0.00";}
vsapu6 = vsapu2;
/////

}




function doallship(showship,showtax) {

if(listcount>0){
 if(listcount==1){vspunitpl=vspunit;}
 if (showship==1) {
 if (document.vsorder.vscband.selectedIndex==1){vsapu=vsapu1;}
 if (document.vsorder.vscband.selectedIndex==2){vsapu=vsapu2;}
 if (document.vsorder.vscband.selectedIndex==3){vsapu=vsapu3;}
 if (document.vsorder.vscband.selectedIndex==4){vsapu=vsapu4;}
 if (document.vsorder.vscband.selectedIndex==5){vsapu=vsapu5;}
 if (document.vsorder.vscband.selectedIndex==6){vsapu=vsapu6;}
 if (document.vsorder.vscband.selectedIndex==7){vsapu=vsapu7;}
 if (document.vsorder.vscband.selectedIndex==8){vsapu=vsapu8;}
 if (document.vsorder.vscband.selectedIndex==9){vsapu=vsapu9;}
 if (document.vsorder.vscband.selectedIndex==10){vsapu=vsapu10;}
 if (document.vsorder.vscband.selectedIndex==11){vsapu=vsapu11;}
 if (document.vsorder.vscband.selectedIndex==12){vsapu=vsapu12;}

  if (vsru==0){
 if ((!allweight)&&(document.vsorder.vscband.selectedIndex > 0)) {allweight=0;}
  document.vsorder.vsShipping.value=vsshipdescrip+': '+priceFormat(parseFloat(allweight))+' '+vspunitpl+' '+document.vsorder.vscband.options[document.vsorder.vscband.selectedIndex].text;
  document.vsorder.vsallship.value = priceFormat(vsapu*allweight);
  }else{
 if ((!trueweight)&&(document.vsorder.vscband.selectedIndex > 0)) {trueweight=0;}

var interlinkoption = '';

//if (document.vsorder.vscband.selectedIndex==6){
 if (document.vsorder.trackoption){
  if (document.vsorder['Delivery Country'].options[document.vsorder['Delivery Country'].selectedIndex].value==6){
   if (document.vsorder.trackoption.selectedIndex == 0){
   interlinkoption = " No tracking";
   }
   if (document.vsorder.trackoption.selectedIndex == 1){
   interlinkoption = " SMS tracking " + document.vsorder.mobile.value;
   }
   if (document.vsorder.trackoption.selectedIndex == 2){
   interlinkoption = " Email tracking " + document.vsorder.mobile.value;
   }
  }
 }
//}

    document.vsorder.vsShipping.value=vsshipdescrip+': '+priceFormat(parseFloat(trueweight))+' '+vspunitpl+' '+document.vsorder.vscband.options[document.vsorder.vscband.selectedIndex].text+interlinkoption;





  document.vsorder.vsallship.value = vsapu;
  }
 
  if (vsapu==0){document.vsorder.vsallship.value = 0;}


 if (eval(beadstotal)+vsrgvrunning > 69.99 && (document.vsorder['vscband'].selectedIndex==1 || document.vsorder['vscband'].selectedIndex==2 || document.vsorder['vscband'].selectedIndex==6)){


var tmptotal = alltotal;

 document.vsorder.vsallship.value = "0.00";
 }


if (document.vsorder.vscband.selectedIndex==1){vstons=(document.vsorder.vsallship.value*vstons1)/100;}
 if (document.vsorder.vscband.selectedIndex==2){vstons=(document.vsorder.vsallship.value*vstons2)/100;}
 if (document.vsorder.vscband.selectedIndex==3){vstons=(document.vsorder.vsallship.value*vstons3)/100;}
 if (document.vsorder.vscband.selectedIndex==4){vstons=(document.vsorder.vsallship.value*vstons4)/100;}
 if (document.vsorder.vscband.selectedIndex==5){vstons=(document.vsorder.vsallship.value*vstons5)/100;}
 if (document.vsorder.vscband.selectedIndex==6){vstons=(document.vsorder.vsallship.value*vstons6)/100;}
 if (document.vsorder.vscband.selectedIndex==7){vstons=(document.vsorder.vsallship.value*vstons7)/100;}
 if (document.vsorder.vscband.selectedIndex==8){vstons=(document.vsorder.vsallship.value*vstons8)/100;}
 if (document.vsorder.vscband.selectedIndex==9){vstons=(document.vsorder.vsallship.value*vstons9)/100;}
 if (document.vsorder.vscband.selectedIndex==10){vstons=(document.vsorder.vsallship.value*vstons10)/100;}
 if (document.vsorder.vscband.selectedIndex==11){vstons=(document.vsorder.vsallship.value*vstons11)/100;}
 if (document.vsorder.vscband.selectedIndex==12){vstons=(document.vsorder.vsallship.value*vstons12)/100;}
 if (allweight==0){vstons=0;}

  if (document.vsorder.vscband.selectedIndex==0){
  document.vsorder.vsShipping.value='';
  document.vsorder.vsallship.value = '';
  document.vsorder.vsallboth.value = '';
  }
 }

 if (showtax==1) {
 if (showship==0) {allweight=1; trueweight=1;}
 if (document.vsorder.vscband.selectedIndex==1){vstb=vstb1;}
 if (document.vsorder.vscband.selectedIndex==2){vstb=vstb2;}
 if (document.vsorder.vscband.selectedIndex==3){vstb=vstb3;}
 if (document.vsorder.vscband.selectedIndex==4){vstb=vstb4;}
 if (document.vsorder.vscband.selectedIndex==5){vstb=vstb5;}
 if (document.vsorder.vscband.selectedIndex==6){vstb=vstb6;}
 if (document.vsorder.vscband.selectedIndex==7){vstb=vstb7;}
 if (document.vsorder.vscband.selectedIndex==8){vstb=vstb8;}
 if (document.vsorder.vscband.selectedIndex==9){vstb=vstb9;}
 if (document.vsorder.vscband.selectedIndex==10){vstb=vstb10;}
 if (document.vsorder.vscband.selectedIndex==11){vstb=vstb11;}
 if (document.vsorder.vscband.selectedIndex==12){vstb=vstb12;}
 document.vsorder.vsTax.value=vstaxdescrip+': '+document.vsorder.vscband.options[document.vsorder.vscband.selectedIndex].text+' '+document.vsorder.vscband.options[document.vsorder.vscband.selectedIndex].value;

 if (showship==1) {
 document.vsorder.vsalltax.value = priceFormat(parseFloat(priceFormat(vstb))+vstons);
 }else{
 document.vsorder.vsalltax.value = priceFormat(vstb); 
 }
 
if (!priceFormat(parseFloat(priceFormat(vstb)+priceFormat(vstons)))){document.vsorder.vsalltax.value = 0;}
if((isNaN(document.vsorder.vsalltax.value))||(document.vsorder.vsalltax.value=='')) {document.vsorder.vsalltax.value=0}

  if (document.vsorder.vscband.selectedIndex==0){
  document.vsorder.vsTax.value='';
  document.vsorder.vsalltax.value = '';
  document.vsorder.vsallboth.value = '';
  }
 }
 
if ((allweight==0)&&(document.vsorder.vscband.selectedIndex > 0)) {document.vsorder.vsallship.value='0';}


 if ((showship==1)&&(showtax==1)) {
 document.vsorder.vsallboth.value = priceFormat(parseFloat(document.vsorder.vsallship.value)+parseFloat(document.vsorder.vsalltax.value));
 } else if (showship==1) {
 document.vsorder.vsallboth.value = document.vsorder.vsallship.value;
 } else if (showtax==1) {
 document.vsorder.vsallboth.value = document.vsorder.vsalltax.value;
 }
if(!document.vsorder.vsallboth.value){document.vsorder.vsallboth.value=0;}
if (isNaN(document.vsorder.vsallboth.value)){document.vsorder.vsallboth.value = '';}
}
}



function dosd(){

 if (document.vsorder.pcode.value.toLowerCase()!='mj_nov09' && document.vsorder.pcode.value.toLowerCase()!='cc_ms'){
 alert('You have entered an invalid promotion code.')
 return false;
 }

 if (document.vsorder.pcode.value.toLowerCase()=='mj_nov09'){
  if (parseFloat(beadstotal) < 45.00){
  alert('You must spend at least £45 to take advantage of this offer.')
  return false;
  }
// if (parseFloat(pendantrel) == 0){
// alert('This offer only applies when purchasing specific Swarovski Flower Pendants.')
// return false;
// }
  if (!vs3like(alldata,'[CDIS:Make Jewellery Magazine Discount#')){
  vs3setCookie('vsCart',vs3getCookie('vsCart')+"[CDIS:Make Jewellery Magazine Discount#-5.00#0.00#1#############]",'',vscpath,'','');
  }
 alert('Correct promotion code entered. £5.00 been deducted from your cart total.');
 location='final-total.html';
 }




 if (document.vsorder.pcode.value.toLowerCase()!='cc_ms'){
 alert('You have entered an invalid promotion code.')
 return false;
 }

// if (parseFloat(beadstotal) < 10.00){
// alert('You must spend at least £10 to take advantage of this offer.')
// return false;
// }

 if (document.vsorder.pcode.value.toLowerCase()=='cc_ms'){
 var sdadd = priceFormat((SDbeads * 15) / 100);

  if (!vs3like(alldata,'[FDIS:Special items discount#-'+sdadd) && SDbeads > 0){
  vs3setCookie('vsCart',vs3getCookie('vsCart')+'[FDIS:Special items discount#-'+sdadd+'#0.00#1#############]','',vscpath,'','');
  }
 alert('Correct promotion code entered. A special items discount has been added to your cart.');
 location='final-total.html';
 }


// if (document.vsorder.pcode.value.toLowerCase()=='cc_cysl'){
//  if (parseFloat(beadstotal) < 10.00){
//  alert('You must spend at least £10 to take advantage of this offer.')
//  return false;
//  }
//  if (vs3getCookie('hdv') != '1'){
//  alert('Correct promotion code entered. A 5 pound gift voucher has been added to your cart.');
//  nextpage = 'final-total.html';
//  addToCart('P_DISV5:5 Pound gift voucher number '+getvnum(),'0.00','0.00','1','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','','You must order at least one of this item.');
//  }
// }

}


function addTS(ship,tax){
// added to prevent double shipping etc.
//clearSlot(deldisc,'1',delvat,delship);
clearSlot('','1','',delship);

 if ((ship==1)&&(tax==1)){
  if((document.vsorder.vsallboth.value)&&(document.vsorder.vsShipping.value)&&(document.vsorder.vsallship.value)&&(document.vsorder.vsTax.value)&&(document.vsorder.vsalltax.value)){
  doallship(ship,tax);
  addToCart(document.vsorder.vsShipping.value,document.vsorder.vsallship.value,'0','1','0','0','0','0','0','0','0','0','0','0','0','0','noreload','remslot','','');
  }
 }else if (ship==1){
  if((document.vsorder.vsallboth.value)&&(document.vsorder.vsShipping.value)&&(document.vsorder.vsallship.value)){
  doallship(ship,tax);
//ADDS HERE

// if(vs3getCookie('z') && vs3getCookie('z').toLowerCase()=='knit' && eval(beadstotal)+vsrgvrunning > 19.99 && vs3like(document.vsorder.vsShipping.value,'1st Class')){
// promotext = ' (Knit promo)';
// document.vsorder.vsallship.value = '0.00';
// }

var thisshipdesc = document.vsorder.vsShipping.value;
 if(vs3like(document.vsorder['Delivery Country'].options[document.vsorder['Delivery Country'].selectedIndex].text,'Mainland Only') && eval(beadstotal)+vsrgvrunning < 70 && eval(allweight) > 1999 && document.vsorder.UKoption[1].checked){
 thisshipdesc = "Shipping: "+priceFormat(allweight)+"g DHL 48hr service";
 }


 if(vs3like(document.vsorder['Delivery Country'].options[document.vsorder['Delivery Country'].selectedIndex].text,'Offshore') && eval(beadstotal)+vsrgvrunning < 70 && eval(allweight) > 1999 && document.vsorder.UKoption[1].checked){
 thisshipdesc = "Shipping: "+priceFormat(allweight)+"g Uk, Guaranteed Next Working Day";
 document.vsorder.vsallship.value = 20.95;
 }

 if(vs3like(document.vsorder['Delivery Country'].options[document.vsorder['Delivery Country'].selectedIndex].text,'Channel') && eval(beadstotal)+vsrgvrunning < 70 && eval(allweight) > 1999 && document.vsorder.UKoption[1].checked){
 thisshipdesc = "Shipping: "+priceFormat(allweight)+"g Uk, Guaranteed Next Working Day";
 document.vsorder.vsallship.value = 20.95;
 }



///// NEWSLETTER FREE 1ST CLASS POSTAGE OFFER
if (document.vsorder['Delivery Country'].options[document.vsorder['Delivery Country'].selectedIndex].value == 1){
 if (beadstotal < 70.00){
  if(beadstotal > 30.00 && (document.vsorder['Delivery Country'].options[document.vsorder['Delivery Country'].selectedIndex].value == 1 || document.vsorder['Delivery Country'].options[document.vsorder['Delivery Country'].selectedIndex].value == 6) && vs3getCookie('z') && vs3getCookie('z').toLowerCase()=='cc_nov' && document.vsorder.UKoption[0].checked){
  thisshipdesc = "Shipping: "+priceFormat(allweight)+"g Uk, 1st Class";
  document.vsorder.vsallship.value = 0;
  }
 }
}
/////////



  addToCart(thisshipdesc+promotext,priceFormat(document.vsorder.vsallship.value),'0','1','0','0','0','0','0','0','0','0','0','0','0','0','','remslot','','');
  }
 }

 if (tax==1){
 if (ship==0){
  if((document.vsorder.vsallboth.value)&&(document.vsorder.vsTax.value)&&(document.vsorder.vsalltax.value)){
  doallship(ship,tax);
  addToCart(document.vsorder.vsTax.value,document.vsorder.vsalltax.value,'0','1','0','0','0','0','0','0','0','0','0','0','0','0','','remslot','','');
  }
 }else{
  if((document.vsorder.vsallboth.value)&&(document.vsorder.vsShipping.value)&&(document.vsorder.vsallship.value)&&(document.vsorder.vsTax.value)&&(document.vsorder.vsalltax.value)){
  doallship(ship,tax);
  addToCart(document.vsorder.vsTax.value,document.vsorder.vsalltax.value,'0','1','0','0','0','0','0','0','0','0','0','0','0','0','','','','');
  }
 }
 }
}

function displayShip(ship,tax,vsccolor1,vsccolor2,vscborder,vshide,vsbtext) {
//document.writeln('<TABLE width=75% border='+vscborder+' cellspacing=1 cellpadding=2 '+vsccolor1+'>');
getWeight()
allweight = priceFormat(allweight);
if (vsru == 1) { trueweight = allweight;}
//document.writeln('<tr><td colspan=2 align=right '+vsccolor1+'>');
document.writeln('<select name="vscband" size=1 onChange="doallship('+ship+','+tax+')" style="visibility: hidden;">');

document.writeln('<option selected>'+vsband);
if (vsband1){document.writeln('<option value="'+vstaxex1+'">'+vsband1);}
if (vsband2){document.writeln('<option value="'+vstaxex2+'">'+vsband2);}
if (vsband3){document.writeln('<option value="'+vstaxex3+'">'+vsband3);}
if (vsband4){document.writeln('<option value="'+vstaxex4+'">'+vsband4);}
if (vsband5){document.writeln('<option value="'+vstaxex5+'">'+vsband5);}
if (vsband6){document.writeln('<option value="'+vstaxex6+'">'+vsband6);}
if (vsband7){document.writeln('<option value="'+vstaxex7+'">'+vsband7);}
if (vsband8){document.writeln('<option value="'+vstaxex8+'">'+vsband8);}
if (vsband9){document.writeln('<option value="'+vstaxex9+'">'+vsband9);}
if (vsband10){document.writeln('<option value="'+vstaxex10+'">'+vsband10);}
if (vsband11){document.writeln('<option value="'+vstaxex11+'">'+vsband11);}
if (vsband12){document.writeln('<option value="'+vstaxex12+'">'+vsband12);}
document.writeln('</select>');
//document.writeln('</select></td><td colspan=1 '+vsccolor1+'>&nbsp;</td></tr>');

 if (ship==1){
  if (vshide==1){
  document.writeln('<input type=hidden name=vsShipping><input type=hidden name=vsallship>')
  }else{
//  document.writeln('<tr><td colspan=2 align=right '+vsccolor2+'>');
//  document.writeln('<input type=text name=vsShipping size=48></td><td '+vsccolor2+'><input type=text size=6 name=vsallship></td></tr>');
  }
 }

 if (tax==1){
  if (vshide==1){
  document.writeln('<input type=hidden name=vsTax><input type=hidden name=vsalltax>');
  }else{
//  document.writeln('<tr><td colspan=2 align=right '+vsccolor2+'>');
//  document.writeln('<input type=text name="vsTax" size=48></td><td '+vsccolor2+'><input type=text size=6 name=vsalltax></td></tr>');
  }
 }

//document.writeln('<tr><td colspan=2 align=right '+vsccolor1+'><INPUT TYPE="button" NAME="vsAddBoth" VALUE="  '+vsbtext+'  " onclick="addTS('+ship+','+tax+')"></td><td colspan=1 '+vsccolor1+'>');
  if ((tax==1)&&(ship==1)){
   if (vshide!=1){
//   document.writeln('<input type=text size=6 name=vsallboth>');
   }else{
   document.writeln('<input type=hidden name=vsallboth>&nbsp;');
   }
  }else{
  document.writeln('<input type=hidden name=vsallboth>&nbsp;');
  }
 
//document.writeln('</td></tr></table>');
}


////////////////////// OTHERS

function storedet(){
var exp=new Date();
var expiresafter=exp.getTime() + (366 * 24 * 60 * 60 * 1000);
exp.setTime(expiresafter);

var store4='';
var pdata='';
pdata +=document.vsorder['Full Name'].value + ':|';
pdata +=document.vsorder['E-Mail'].value + ':|';
pdata +=escape(document.vsorder['Address'].value) + ':|';
pdata +=escape(document.vsorder['Delivery Address'].value) + ':|';
pdata +=document.vsorder['PostCode'].value + ':|';
pdata +=document.vsorder['Delivery PostCode'].value + ':|';
pdata +=document.vsorder['Country'].value + ':|';
pdata +=document.vsorder['Delivery Country'].value + ':|';
pdata +=document.vsorder['Telephone'].value + ':|';
//pdata +=document.vsorder[''].selectedIndex + ':|';

 if (document.vsorder.vshop_save.checked){
 vs3deleteCookie('userdet',vscpath,'');
 vs3deleteCookie('p',vscpath,'');
 store4=exp;
 vs3setCookie('userdet',pdata,store4,vscpath,'','');

  if (vs3like(document.vsorder['Delivery Country'].value,'United Kingdom') || vs3like(document.vsorder['Delivery Country'].value,'Channel Islands')  || vs3like(document.vsorder['Delivery Country'].value,'Jersey')  || vs3like(document.vsorder['Delivery Country'].value,'Guernsey')  || vs3like(document.vsorder['Delivery Country'].value,'Alderney')  || vs3like(document.vsorder['Delivery Country'].value,'Sark')  || vs3like(document.vsorder['Delivery Country'].value,'Herm')  || vs3like(document.vsorder['Delivery Country'].value,'Northern Ireland')){
  vs3setCookie('p',document.vsorder['Delivery PostCode'].value,store4,vscpath,'','');
  }else{
  vs3deleteCookie('p',vscpath,'');
  }

 }else{
 //store4='';
 }
}








function promdisc(){
 if(vs3getCookie('z') && vs3getCookie('z').toLowerCase()=='knit' && eval(beadstotal)+vsrgvrunning > 19.99 && vs3like(document.vsorder.vsShipping.value,'1st Class')){
 promotext = ' (Knit promo)';
 document.vsorder.vsallship.value = '0.00';
 }
}



















function getdet(){

 if (trsms){
 document.vsorder['Telephone'].value=trsms;
 }
 if (tremail){
 document.vsorder['E-Mail'].value=tremail;
 }

 if (vs3getCookie('p')){
  if (vs3getCookie('p')=='|'){
  document.vsorder['Delivery PostCode'].value='';
  vs3deleteCookie('p',vscpath,'');
  }
 document.vsorder['PostCode'].value=vs3getCookie('p');
 }


var gdata='';
 if (vs3getCookie('userdet')){
 gdata=vs3getCookie('userdet').split(':|');
 if (gdata[0]) {document.vsorder['Full Name'].value=gdata[0];}
 if (gdata[1]) {document.vsorder['E-Mail'].value=gdata[1];}
 if (gdata[2]) {document.vsorder['Address'].value=unescape(gdata[2]).replace(/__/g,'\n');}
 if (gdata[3]) {document.vsorder['Delivery Address'].value=unescape(gdata[3]).replace(/__/g,'\n');}
// if (gdata[2]) {document.vsorder['Address'].value=unescape(gdata[2]);}
// if (gdata[3]) {document.vsorder['Delivery Address'].value=unescape(gdata[3]);}
 if (gdata[4]) {document.vsorder['PostCode'].value=gdata[4];}
 if (gdata[5]) {document.vsorder['Delivery PostCode'].value=gdata[5];}
 if (gdata[6]) {document.vsorder['Country'].value=gdata[6];}
 //document.vsorder['Delivery Country'].value=gdata[7];
 if (gdata[8]) {document.vsorder['Telephone'].value=gdata[8];}
 }
document.vsorder['Delivery Country'].value=vs3getCookie('dc');
 if (!document.vsorder['Country'].value){
 document.vsorder['Country'].value=vs3getCookie('dc');
 }

 if (vs3getCookie('p')){
 document.vsorder['Delivery PostCode'].value=vs3getCookie('p');
 }

}


function vsemail(vadr,msg){
var vsemp=/^(.+)@(.+)$/
var vssch="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + vssch + "\]"
var vseu="(\"[^\"]*\")"
var vsipd=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var vsatm=validChars + '+'
var vsbit="(" + vsatm + "|" + vseu + ")"
var vsup=new RegExp("^" + vsbit + "(\\." + vsbit + ")*$")
var vsdp=new RegExp("^" + vsatm + "(\\." + vsatm +")*$")
var vsma=vadr.match(vsemp)
if (vsma==null){
alert(msg)
return false
}
var vsubit=vsma[1]
var vsdom=vsma[2]

if (vsubit.match(vsup)==null){
alert(msg)
return false
}
var vsipa=vsdom.match(vsipd)
if (vsipa!=null){
for (var i=1;i<=4;i++){
if (vsipa[i]>255){
alert(msg)
return false
}
}
}
var vsdar=vsdom.match(vsdp)
if (vsdar==null){
alert(msg)
return false
}
var vsapa=new RegExp(vsatm,"g")
var vsdoa=vsdom.match(vsapa)
var len=vsdoa.length
if ((vsdoa[vsdoa.length-1].length<2)||(vsdoa[vsdoa.length-1].length>4)){
alert(msg)
return false
}
if (len<2){
alert(msg)
return false
}
}

function delex(){
 if ((deldisc > 0) || (delvat > 0) || (delship > 0)){
 clearSlot(deldisc,'',delvat,delship);
 }
}

function MM_openBrWindow(theURL,winName,features) {
var thewindow = theURL.split('\/');

var thiswindow = thewindow[thewindow.length-1];
thiswindow = thiswindow.replace(/\./g,'');
thiswindow = thiswindow.replace(/ /g,'');
thiswindow = thiswindow.replace(/-/g,'');

window.open('popup.html?'+theURL,thiswindow,features);
}

function setppos(){
var curpage = document.URL.split('#');
vs3setCookie('ppos',''+document.body.scrollTop+'|'+curpage[0],'',vscpath,'','');
}

function mtCart(){
 if (confirm('This will remove all the items from your shopping cart.')){
 setppos();
 vs3deleteCookie('vsCart','/','');
   if ((navigator.appName == 'Netscape') && (vs3like(document.URL,'#'))){
    if ((vs3like(document.URL,'\/'+nextpage)) || (vs3like(document.URL,'\\'+nextpage))){
    location.reload();
    }else{
    location = nextpage;
    }
   }else{
   if (nextpage){location = nextpage;}
  }  
 }
}

function getvnum(){
var vs3nl=new Date();
var xyr=''+vs3nl.getYear()+'';
xyr=xyr.substring(xyr.length-2,xyr.length);
var xrn=((Math.random()*10000000)+1000)+'';
xrn=xrn.replace('.','');

var vs3gh=(vs3nl.getDate()+''+(vs3nl.getMonth()+1)+''+xyr+vs3nl.getHours()+''+vs3nl.getMinutes()+''+vs3nl.getSeconds()+''+xrn).substring(0,16);

vs3gh1=vs3gh.substring(0,4)
vs3gh2=vs3gh.substring(4,8)
vs3gh3=vs3gh.substring(8,12)
vs3gh4=vs3gh.substring(12,16)

vs3gh=vs3gh1+'-'+vs3gh2+'-'+vs3gh3+'-'+vs3gh4;
return vs3gh;
}

function ng43(p){
var bspw1='BW';
var bspw2='TI';
var bspw3='JA';
var bspw4='AR';
 if (p==bspw2+bspw4+bspw1+bspw3){
 addToCart('P_2333s:Tiaras Book','12.99','0.05',document.vsorder.Codeamounttiara.value,'0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','Please select your options for this item.','You must order at least one of this item.');
 }else{
  if (p){
  alert('You have entered an invalid promotional code.')
  }else{
  addToCart('P_2333s:Tiaras Book','14.99','0.05',document.vsorder.Codeamounttiara.value,'0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','','','Please select your options for this item.','You must order at least one of this item.');
  }
 }
}

function savecart(){
var cartexp=new Date();
var cartexpiresafter=cartexp.getTime() + (366 * 24 * 60 * 60 * 1000);
cartexp.setTime(cartexpiresafter);
var keepcart4=cartexp;
vs3setCookie('vsCart',vs3getCookie('vsCart'),keepcart4,vscpath,'','');
}





var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-12456441-1");
pageTracker._trackPageview();
} catch(err) {}

