<!--
var nan=navigator.appName;
var NS4 = (nan=='Netscape') ? 1 : 0;
var IE4 = (nan.substring(0,9)=='Microsoft') ? 1 : 0;
//alert('NS4=' + NS4 + '   --  IE4=' + IE4);
var bbb;
var duration;
var bn = new Array(20);
var bl = new Array(20);
bn[1] = "banners/aaaaa.gif";
bn[2] = "banners/bbbbbb.gif";
bl[1] = "default.asp?submit=Home";
bl[2] = "default.asp?prod=10";




   function noback() {
      document.location.replace('login.asp?submit=Logout');
   }

   function clearEl() {}

   function activateEl() {}

   function gotoPage(el,sub) {
      var e = el.name;
      var i;
      if (e != 'perpage') {
         for (i = 0; i < el.options.length; i++) {
            if (el.options[i].selected) var val = el.options[i].value;
         }
      }

      var r = document.jump1.perpage.value;

//ROB Added
      var order_seq = document.filter_by.sortBy.value;
      var vsize = document.filter_by.filter_size.value;
      var vcolour = document.filter_by.filter_colour.value;

//      var url = 'prodpage.asp?sub=' + sub + '&type=prod&page=' + val;
      var url = 'prodpage.asp?sub=' + sub + '&type=prod&page=' + val +'&filter_colour=' + vcolour + '&filter_size=' + vsize + '&sortby=' + order_seq;
      if (r != undefined) {
         var pp = document.jump1.perpage.length;
         if (pp>0) {
            for (i = 0; i < pp; i++) {
               if (document.jump1.perpage.options[i].selected) var pv = document.jump1.perpage.options[i].value;
            }
//            url = 'prodpage.asp?sub=' + sub + '&type=prod&page=' + val + '&perpage='+pv;
            url = 'prodpage.asp?sub=' + sub + '&type=prod&page=' + val + '&perpage='+pv + '&filter_colour=' + vcolour + '&filter_size=' + vsize + '&sortby=' + order_seq
         }
      }
      location = url;
   }

   function login() {
      location = "default.asp?submit=login"
   }

   function rotate(i) {
   	duration = 2000;
      ++i;
      if (i > 2) i = 1;
      document.images.banner.src = bn[i];
      document.links["blink"].href.value = bl[i];
      bbb = "window.setTimeout('rotate("+i+");',"+duration+");"
      eval(bbb);
   }

   function buyItem(f) {
//      if (NS4) {var x = "document.frm"+f+".submit()";}
//      eval(x);
   }

   function buyMe(f) {
      if (NS4) {var x = "document.frm"+f+".submit()";}
      eval(x);
   }

   function getPrice(what,which) {
      var xurl = "";
      var exp1 = "document."+what+".sp"+which+".length";
      var exp2 = "document."+what+".sp"+which+".options[i].selected";
      var exp3 = "document."+what+".sp"+which+".options[i].value";
      for (var i=0; i<eval(exp1); i++) {
         if (eval(exp2)) {
            xurl = eval(exp3);
         }
      }
     location = xurl;
   }

   function gotoProcess(what) {
      var xurl = ""
      var exp1 = "document.sidebar."+what+".length"
      var exp2 = "document.sidebar."+what+".options[i].selected"
      var exp3 = "document.sidebar."+what+".options[i].value"
      for (var i=0; i<eval(exp1); i++) {
         if (eval(exp2)) {
            xurl = eval(exp3)
         }
      }
     location = xurl
   }

   function bigpix(what,wd,ht) {
      if (wd=="") {wd=400};
      if (ht=="") {ht=500};
   	var a = "bigpix.asp?what="+what
   	var b = "picwin"
   	var c = "width="+wd+",height="+ht+",resizable,scrollbars=yes"
      var w = window.open(a,b,c);
      w.moveTo(50, 50)
   }


   function emailfriend(what,wd,ht) {
      if (wd=="") {wd=500};
      if (ht=="") {ht=600};
   	var a = "email_a_friend.asp?what="+what
   	var b = "picwin"
   	var c = "width="+wd+",height="+ht+",resizable,scrollbars=yes"
     var w = window.open(a,b,c);
     w.moveTo(50, 50)
   }

   function bigpix2(what,w,h) {
      if (w=="") {w=300};
      if (h=="") {h=200};
      if (what!="") {
         var x = "width="+w+",height="+h+",resizable,scrollbars=yes";
         var win = window.open("","BigPix",x);
         win.document.write("<html><title>The BIG picture</title><head></head>");
         win.document.write("<body><img src="+what+" border=no onClick='self.close()'><br><br><font face=Arial size=2 color=darkblue>Click in window to close</font></body></html>");
         win.moveTo(50,0);
         }
   }

   function colorSelector(what,name) {
      var w = window.open("color.asp?what="+what+"&name="+name,"colorwin","width=349,height=134");
      w.moveTo(420, 230)
   }

   function specialpopup(what,w,h) {
      if (w=="") {w=500};
      if (h=="") {h=300};
      if (what!="") {
         var x = "width="+w+",height="+h+",resizable,scrollbars=yes";
         var win = window.open("specials.asp?what="+what,"Special",x);
         win.moveTo(50, 350);
         }
   }

   function addressFindpopup(what,num,w,h) {
      var x = "width="+w+",height="+h+",resizable,scrollbars=no";
      if (what=='register') num='';
         var a = document.getElementById('address'+num);
         ax = '&address='+a.value;
         a = document.getElementById('city'+num);
         ax = ax+'&city='+a.value;
         a = document.getElementById('county'+num);
         ax = ax+'&county='+a.value;
         a = document.getElementById('postcode'+num);
         ax = ax+'&postcode='+a.value;
//alert("addressLookup.asp?calledBy="+what+"&num="+num+ax,"Details",x);
      var win = window.open("addressLookup.asp?calledBy="+what+"&num="+num+ax,"Details",x);
      win.moveTo(100, 100);
   }






<!-- /////////////// old code

   function AFDFindpopup(what,w,h) {
      var x = "width="+w+",height="+h+",resizable,scrollbars=no";
      var win = window.open("AFDFind.asp?calledBy="+what,"Details",x);
      win.moveTo(100, 100);
   }

/////////////-->

   function orderpopup(what,w,h) {
      if (what!="") {
         var x = "width="+w+",height="+h+",resizable,scrollbars=yes";
         var win = window.open("order_details.asp?order="+what,"Details",x);
         win.moveTo(100, 100);
         }
   }

   function configpopup(what,w,h) {
      if (what!="") {
         var x = "width="+w+",height="+h+",resizable,scrollbars=yes";
         var win = window.open("config_show.asp?what="+what,"Details",x);
         win.moveTo(100, 100);
         }
   }

   function friendpopup(part,w,h) {
      if (part!="") {
         if (w=="") {w=500};
         if (h=="") {h=300};
         var x = "width="+w+",height="+h+",resizable,scrollbars=yes";
         var win = window.open("friend.asp?part="+part+"&mode=ask","Email_a_friend",x);
         win.moveTo(100, 100);
         }
   }


   function windowpopup(html,title,w,h) {
      if (html!="") {
         if (w=="") {w=500};
         if (h=="") {h=300};
     var x = "width="+w+",height="+h+",resizable,scrollbars=yes";
         var win = window.open(html,title,x);
         win.moveTo(100, 100);
         }
   }



   function config_errors(what,w,h) {
      if (what!="") {
         var x = "width="+w+",height="+h+",resizable,scrollbars=yes";
         var win = window.open("config_errors.asp?what="+what,"Errors",x);
         win.moveTo(100, 100);
      }
   }

   function buypopup() {
      var w = window.open("","Cart","width=350,height=180");
      w.document.write("<style>#s1 {font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; color: blue;}");
      w.document.write("#s2 {font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; color: red;}</style>");
      w.document.write("<body><center><br><span id=s1>Product added to your basket</span></center></body>");
      w.moveTo(350, 100)
   }

   function cartpopup(what) {
      var w = window.open("","Cart","width=350,height=180");
      w.document.write("<style>#s1 {font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; color: blue;}");
      w.document.write("#s2 {font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; color: red;}</style>");
      w.document.write("<head><title>Your cart still contains items from last visit</title></head>");
      var i = "";
      if (what > 1) {i = "s"}
      w.document.write("<body><center><br><span id=s1>Your shopping trolley still contains<br><br><span id=s2>"+what+"</span><br><br>item"+i+" from your last visit.</span></center></body>");
      w.moveTo(350, 100)
   }

   function noCookies() {
      var w = window.open("","Cookies","width=500,height=200");
      w.document.write("<style>#s0 {font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; color: white;}</style>");
      w.document.write("<style>#s1 {font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; color: red;}</style>");
      w.document.write("<head><title>Your browser is NOT cookie enabled.</title></head>");
      w.document.write("<body><center><br><span id=s1>This site requires a cookie enabled browser to operate correctly.<br><br>Please enable your browser and visit us again or use one that is enabled, if you desire to purchase from this site.<br><br>Thank you very much.</span></center></body>");
      w.moveTo(220, 180)
   }

   function deletePages(what) {
   	 var x = document.infoPages.num.value
      var p = "num="+x
      for(var i = 0; i < x*3; i++) {
         var e = document.infoPages.elements[i];
         if (e.type=="checkbox") {
         	p = p + "&" + e.name + "=" + e.checked
         }
         if (e.type!="checkbox") {
         	p = p + "&" + e.name + "=" + e.value
         }
      }
      var w = window.open("del_info_pages.asp?"+p,"deleteInfo","width=350,height=200,scrollbars=yes");
      w.moveTo(200, 200)
   }

   function debugWindow() {
      var hw = window.open("debug.asp","Debug","width=650,height=450,scrollbars");
      hw.moveTo(158, 55)
   }

   function helpWindow() {
      var hw = window.open("HowToUse.asp","Help","width=615,height=484,scrollbars");
      hw.moveTo(158, 55)
   }

   function viewProm(what) {
      var url = "maintain_promotions.asp?submit=View&what="+what
      document.promotions.id.value = what;
      location = url;
   }

   function viewDisc(what) {
      var url = "maintain_discounts.asp?submit=View&what="+what
      document.discounts.id.value = what;
      location = url;
   }

   function submit_func() {
      document.forms[0].submit();
   }

   function submit_head(form) {
      document.head.submit();
   }

   function submit_login(form) {
      document.login.submit();
   }

   function submit_feat(form) {
      document.feat.submit();
   }

   function submit_select(form) {
      document.select.submit();
   }

   function submit_art(form) {
      document.selart.submit();
   }

   function submit_prod(form) {
      document.selprod.submit();
   }

   function submit_divs(form) {
      document.divs.submit();
   }

   function uploadPix(name) {
   	   var url = 'graphic.asp?pic=' + name
   	   var pix = window.open(url,"upload","width=520,height=100");
      pix.moveTo(170, 250)
   }

   function isblank(s)
   {
      for(var i = 0; i < s.length; i++) {
         var c = s.charAt(i);
         if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
      }
      return true;
   }

   function verify(f)
   {
      var msg;
      var later = "n";
      var inv = "n";
      var empty_fields = "";
      var errors = "";
      var arr;
      var ia;
      var i;

    // Loop through the elements of the form, looking for all
    // text and textarea elements that don't have an "optional" property
    // defined. Then, check for fields that are empty and make a list of them.
    // Also, if any of these elements have a "min" or a "max" property defined,
    // then verify that they are numbers and that they are in the right range.
    // Put together error messages for fields that are wrong.
    for(i = 0; i < f.length; i++) {
        var g = f.elements[i];
        if ((g.type == "checkbox") && (g.name == "later")) {
           if (g.checked == true) later = "y";
        }
    }
    for(i = 0; i < f.length; i++) {
        var e = f.elements[i];
        if (((e.type == "text") || (e.type == "textarea") || (e.type == "file")) && !e.optional) {
            // first check if the field is empty
            if ((e.value == null) || (e.value == "") || isblank(e.value)) {
                if (later != "y") {
                	empty_fields += "\n          " + e.name;
                }
                else if (e.name != "Graphic") {
                	empty_fields += "\n          " + e.name;
                }
                continue;
            }
            if (e.name == "Email") {
               var email1 = e.value
               arr = email1.split(" ")
               for(ia = 0; ia < arr.length; ia++) {
                  if (arr[ia] != " ") {
                  	email1 = arr[ia]
                  }
               }
            }
            if (e.name == "Emailchk") {
               email2 = e.value
               arr = email2.split(" ")
               for(ia = 0; ia < arr.length; ia++) {
                  if (arr[ia] != " ") {
                  	email2 = arr[ia]
                  }
               }
               if (email1 != email2)
                  errors += "\n email address error"
            }
            // Now check for fields that are supposed to be numeric.
            if (e.numeric || (e.min != null) || (e.max != null)) {
                var v = parseFloat(e.value);
                if (isNaN(v) ||
                    ((e.min != null) && (v < e.min)) ||
                    ((e.max != null) && (v > e.max))) {
                    errors += "- The field " + e.name + " must be a number";
                    if (e.min != null)
                        errors += " that is greater than " + e.min;
                    if (e.max != null && e.min != null)
                        errors += " and less than " + e.max;
                    else if (e.max != null)
                        errors += " that is less than " + e.max;
                    errors += ".\n";
                }
            }
        }
    }

    // Now, if there were any errors, display the messages, and
    // return false to prevent the form from being submitted.
    // Otherwise return true.
    if (!empty_fields && !errors) return true;

    msg  = "__________________________________________________\n\n"
    msg += "The form was not submitted because of the following error(s).\n";
    msg += "          Please correct these error(s) and re-submit.\n";
    msg += "__________________________________________________\n\n"

    if (empty_fields) {
        msg += "- The following required field(s) are empty:\n"
                + empty_fields + "\n";
        if (errors) msg += "\n";
    }
    msg += errors;
    alert(msg);
    return false;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function search() {
   var what = document.find.searchwhat.value;
   if (what != '') {
     document.search.searchwhat.value = what;
     document.search.submit();
   }
   else {
      alert('Please enter a keyword to search on');
   }
}

function searchI() {
   var what = document.find.searchwhat.value;
   if (what != '') {
     document.search.searchwhat.value = "item:"+what;
     document.search.submit();
   }
   else {
      alert('Please enter a keyword to search on');
   }
}

function searchP() {
   var lo = document.find.lo.value;
   var hi = document.find.hi.value;
  document.search.searchwhat.value = "price:"+lo+"#"+hi;
  document.search.submit();
}

function initialize() {
//      MM_preloadImages('NewSidebar/wrtinsbut2.gif','NewSidebar/bar2.gif','NewSidebar/calendar2.gif','NewSidebar/clocks2.gif','NewSidebar/clothing2.gif','NewSidebar/conference2.gif','NewSidebar/executive2.gif','NewSidebar/golf2.gif','NewSidebar/keytag2.gif','NewSidebar/leather2.gif','NewSidebar/mugs2.gif','NewSidebar/novelties2.gif','NewSidebar/stationery2.gif','NewSidebar/sweda2.gif','NewSidebar/custservice2.gif','NewSidebar/checkout2.gif','NewSidebar/howtoorder2.gif','NewSidebar/viewcart2.gif');
}

function M_over(n,i) {
   if (document.images)
      document.images[n].src = i
}

function M_out(n,i) {
   if (document.images)
      document.images[n].src = i
}

var buywin;
function PopCartMsg() {
   buywin = window.open("","buyme","width=430,height=120");
   buywin.document.write("<html><style>#s1 {font-family: Arial, sans-serif; font-size: 10px; font-weight: bold; color: blue;}</style>");
   buywin.document.write("<head><title>One-time buy message</title>");
   buywin.document.write('</script>');
   buywin.document.write("</head>");
   buywin.document.write('<body topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 marginwidth=0 marginheight=0>')
   buywin.document.write('<center><br><span id=s1>The product you have selected has been added to your shopping trolley. <br><br>')
   buywin.document.write('The number of items in the trolley will be shown at the top right of this page. <br><br>')
   buywin.document.write('The shopping trolley may be viewed later by clicking on the link at top of the page<br><br>')
   buywin.document.write('This message will be shown only once during your visit.')
   buywin.document.write('<FORM><INPUT TYPE="button" VALUE="Close Window" onClick="window.close()"></FORM>')
   buywin.document.write('</span></center></body></html>');
   buywin.moveTo(420, 230);
   setTimeout("shutIt()",20000);
}

function shutIt() {
   buywin.close();
}

function SCSbuy(f) {
   var errors = "";
   var msg = "";
   var x = "";
   var a = "";
   for (var i = 0; i < f.length; i++) {
      var e = f.elements[i];
      if (e.type == "text" && e.name != "dum") {
   	    var v = parseFloat(e.value);
   	    if (isNaN(v)) {
    	   	  x = "";
    	   	  a = "";
    	   	  a += e.name;
   	       x += a.substring(3,a.length);
    	       errors += x+" NOT numeric = "+e.value+".\n";
    	    }
      }
   }
   if (!errors) return true;
   msg = "The following errors were found - Please correct and try again.\n\n";
   msg += errors;
   alert(msg);
   return false;
}

function dobgcolors() {
//  if (NS4) {
//      var obj = eval('document.forms["prc"].elements["ie_plenty"]');
//alert(obj);
//      obj.bgcolor = "#A5F7E7";
//   }
}

var v = new Array();
function act(w) {
   var a = w.name;
   var b = a.substr(0,1);
   var n = a.substr(1,2);
   var num = parseFloat(document.matrix.elements["number"].value);
   for (var j=0; j<num; j++) {
      var m = j+(n-1)*(num)+2;
      if (b=="c") {
         var y = document.matrix.elements[m];
         v[j] = y.value;
      }
      if (b=="p") {
         document.matrix.elements[m].value = v[j];
      }
      if (b=="d") {
         document.matrix.elements[m].value = 0;
      }
   }
}

function buyCheck(x)
{
   var a;
   var b;
   var c;
   var d;
   var e;
   var f;

   a = 'document.prc.qty'+x+'.value';
   e = document.prc.fcnt.value;
   b = eval(a);
   a = 'document.prc.sp'+x+'.value';
   c = eval(a);
   d = c.split('~');
   f = 'bad~0~'+d[2];
   a = "document.prc.sp"+x+".value='"+f+"'";
   parseInt(b);
   if (isNaN(b) || b<=0) {
      alert('ERROR - quantity entered - '+b+' - is INVALID');
      c = eval(a);
      return false;
   } else {
      if (d[0]=='bad') {
         alert('Please choose a Size (and Colour if applicable).');
         c = eval(a);
         return false;
      } else {
         if (d[0]=='0') {
            alert('This item is OUT of STOCK and cannot be purchased.');
            f = '0~0~0';
            a = "document.prc.sp"+x+".value='"+f+"'";
            c = eval(a);
            return false;
         } else {
            f = d[0]+'~'+b+'~'+d[2];
            a = "document.prc.sp"+x+".value='"+f+"'";
            c = eval(a);
            if (addmsg=='yes') alert("Adding to basket .....");
            location = "default.asp?submit=AddToCartX&sp"+x+"="+f+"&fcnt="+e;
            return true;
         }
      }
   }
}

function buyDD(x)
{
   var a;
   var b;
   var c;
   var d;
   var e;
   var f;

   a = "document.prc.qty"+x+".value";
   e = document.prc.fcnt.value;
   b = eval(a);
   parseInt(b);
   if (isNaN(b)) {
      alert("ERROR - quantity entered - "+b+" - is INVALID");
      back();
      return false;
   } else {
      a = "document.prc.sp"+x+".value";
      c = eval(a);
      d = c.split('~');
      if (d[0]=='bad') {
         alert('Please choose a Size (and Colour if applicable).');
         return false;
      } else {
         f = d[0]+"~"+b+"~"+d[2];
         a = "document.prc.sp"+x+".value='"+f+"'";
         c = eval(a);
         if (addmsg=='yes') alert("Adding to basket .....");
         location = "default.asp?submit=AddToCartX&sp"+x+"="+f+"&fcnt="+e;
         return true;
      }
   }
}

function buySome(x)
{
   var a = "document.prc.qty"+x+".value";
   var b = eval(a);
   parseInt(b);
   if (isNaN(b)) {
      alert("ERROR - quantity entered - "+b+" - is INVALID");
      back();
   } else {
      a = "document.prc.sp"+x+".value";
      var e = document.prc.fcnt.value;
      var c = eval(a);
      var d = c.split('~')
      var f = d[0]+"~"+b+"~"+d[2];
      a = "document.prc.sp"+x+".value='"+f+"'";
      c = eval(a);
      if (addmsg=='yes') alert("Adding to basket .....");
      location.href = "default.asp?submit=AddToCartX&sp"+x+"="+f+"&fcnt="+e;
   }
}

function buyOne(x)
{
   if (addmsg=='yes') alert("Adding to basket .....");
   location = "default.asp?submit=BuyOne&part="+x;
}


function formatCurrency(num) {
   num = num.toString().replace(/\$|\,/g,'');
   if(isNaN(num)) num = "0";
   sign = (num == (num = Math.abs(num)));
   num = Math.floor(num*100+0.50000000001);
   cents = num%100;
   num = Math.floor(num/100).toString();
   if(cents<10)
   cents = "0" + cents;
   for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
   num = num.substring(0,num.length-(4*i+3))+','+
   num.substring(num.length-(4*i+3));
   return (((sign)?'':'-') + num + '.' + cents)
}

function printPage() {
  if (window.print) {
    window.print();
  } else {
	alert("To print this page click OK then command+P")
  }
}

function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function goTo(url) {
   location=url;
}

function remindme(url) {
   var e = document.login.email.value;
   url = "login.asp?submit=remindme&email="+e
   location=url;
}

function terms_read() {
   var r = document.carrier.read_terms.checked;
   if (r==true) return true;
   alert('You must agree to our Terms and Conditions before proceeding with your order');
   return false;
}

/**
* DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
function emailCheck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please enter a VALID email address.")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
 		 return true
	}

function validateEmailAddress(x){
	var emailID="document."+x
	emailID = eval(emailID)

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please enter a VALID email address.")
		emailID.focus()
		return false
	}
	if (emailCheck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

function wrapBox(szDivID, iState, line) // iState=1 visible, 0 hidden
{
   var wl='giftwrap';
// alert('line = '+line);
  if(document.layers)  // NN4
  {
    document.layers[szDivID].visibility = iState ? "show" : "hide";
  }
  else if(document.getElementById) // gecko(NN6) + IE5+
  {
    var obj = document.getElementById(szDivID);
    obj.style.visibility = iState ? "visible" : "hidden";
  }
  else if(document.all) //IE 4
  {
    document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
  }
  document.giftwrap.line.value=line;
}

function unwrapBox(szDivID, iState, line) // iState=1 visible, 0 hidden
{
   url = "buypaper.asp?submit=unwrap&line="+line
// alert(url);
   location=url;
}

function submitWrap(part,price) {
// alert(part+" - "+price);
    document.giftwrap.part.value=part;
    document.giftwrap.price.value=price;
    document.giftwrap.submit();
 }

function showAddressX(what,w,h) {
   var x = "width="+w+",height="+h+",resizable,scrollbars=yes";
   var win = window.open("get_address.asp?address="+what,"Details",x);
   win.moveTo(100, 100);
}


function showChoice2(control,populate,IS,ID,GA,num) {
alert(num);
   var element;
   var img = "pimage"+num;
   var cv = control;
   var i = cv.indexOf('~');
   var c = cv.substring(0,i);
   var x = cv.substring(i+1);
   i = x.indexOf('~');
   var p = x.substring(0,i);
   var pi = x.substring(i+1);
   document.images[img].src = "products/images/"+pi;
   for (var q=populate.options.length;q>=0;q--) populate.options[q]=null;
   i = 0;
   var z = 'document.prc.choice2_'+num+'[0]=new Option("Choose a SIZE")';
   eval(z);
   for (x=0;x<ID.length;x++) {
      if (GA[x]==c) {
         z = 'document.prc.choice2_'+num+'[++i]=new Option(ID[x],IS[x])';
         eval(z);
      }
   }
}
function setChoice(fullpart,fprice,choice_index,num) {
   var cv = fullpart;
   var z = "document.prc.stock"+num+".value=''"
   eval(z);
   if (cv != 'Choose a SIZE') {;
      if (cv.length > 0) {;
         var i = cv.indexOf('~');
         var c = cv.substring(0,i);
         var x = cv.substring(i+1);
         z = "document.prc.sp"+num+".value=fpart_"+num+"[x]+'~1~0'";
         eval(z);
         z = "document.prc.part"+num+".value=c";
         eval(z);
         z = "document.prc.stock"+num+".value=''";
         eval(z);
         z = "stock_mess_"+num+"[x]";
         z = eval(z);
         if (z!='buy') {
            z = "document.prc.stock"+num+".value=stock_mess_"+num+"[x]";
            eval(z);
            z = "document.prc.sp"+num+".value='0~0~0'";
            eval(z);
          }
         z = "document.prc.majorpart"+num+".value=c";
         eval(z);
         z = "document.prc.price"+num+".value=fprice_"+num+"[x]";
         eval(z);
      }
   }
}

   var col;
   var siz;
   var fromx;
   function filter(what,w1,w2) {
      fromx = 'filter';
      change_href(what,w1,w2);
      fromx = '';
      url = 'prodpage.asp?'+what+'&filter_colour='+col+'&filter_size='+siz;
      location = url;
   }

   function change_href(what,w1,w2) {
      var pp = document.filter_by.filter_colour.length;
      if (pp>0) {
         for (i = 0; i < pp; i++) {
            if (document.filter_by.filter_colour.options[i].selected) col = document.filter_by.filter_colour.options[i].value;
         }
      }
      pp = document.filter_by.filter_size.length;
      if (pp>0) {
         for (i = 0; i < pp; i++) {
            if (document.filter_by.filter_size.options[i].selected) siz = document.filter_by.filter_size.options[i].value;
         }
      }
      if (fromx!='filter') {
         var i1 = w1.indexOf('&filter_colour=');
         w1 = w1.substring(0,i1);
         var i2 = w2.indexOf('&filter_colour=');
         w2 = w2.substring(0,i2);
      }
      var y = document.getElementById('a_prev');
      if (y!=null) y.setAttribute('href','prodpage.asp?'+w1+'&filter_colour='+col+'&filter_size='+siz);
      var x = document.getElementById('a_next');
      if (x!=null) x.setAttribute('href', 'prodpage.asp?'+w2+'&filter_colour='+col+'&filter_size='+siz);
   }

   function XsortBy(url,yn) {
      var i = url.indexOf('sortby')
      if (i>0) {
         url = url.substring(0,i-1);
         i = -1;
      }
      if (yn=='up' & i==-1) url=url+'&sortby=UP';
      if (yn=='down' & i==-1) url=url+'&sortby=DOWN';
      if (yn=='no' & i==-1) url=url+'&sortby=NO';
      location=url;
   }

   function sortByPrice(url) {
      var sort;
      var pp = document.filter_by.sortBy.length;
      if (pp>0) {
         for (i = 0; i < pp; i++) {
            if (document.filter_by.sortBy.options[i].selected) sort = document.filter_by.sortBy.options[i].value;
         }
      }
      var i = url.indexOf('&sortby=');
      if (i>-1) url = url.substring(0,i);
      url = url+'&sortby='+sort;
      location=url;
   }

-->
