//===== relative URL handling code for js files ================
sWZBaseFolder = "www.best-t-shirt.com";                          
sWZ = window.location.href;                                     
iWZ = sWZ.indexOf(sWZBaseFolder) + sWZBaseFolder.length + 1;    
sWZBase = sWZ.substring(0,iWZ);                                 
//===== Copyright © 2001 Spidersoft. All rights reserved. ======

<!-- 
var cost = 0
// Set mask preparation and other overheads price
var overhead = 450;

function est() 
{
// In: 
//  items (number of garments)
//  colors (total colors in all logos)
//Out: cost

// Set the following variables:
// minimum order
var minorder = 80;
// unit price
var unitprice = 200;
// discount price reduction in percent
var dscntprcnt = 10;
// minimum number of units for discount price to apply
var dscnthrshld = 500;
// per color print price 
var colorprice = 4;
// write the overhead to the form
document.calcform.masks.value=overhead;

// get number of items
var items = 0;
items = (document.calcform.number.value);

// Check minimum order value
if (items < minorder)
{
var alerttext = "Sorry! But you must order at least " + minorder + " T-Shirts  "
alert (alerttext); 

// insert minimum order value
document.calcform.number.value = "" + minorder;
items = minorder;
}
// minus discount if threshold reached
if (items >= dscnthrshld)
{
unitprice = unitprice - (unitprice / 100 * dscntprcnt);
}
// get number of colors
var numcolors = 0;
numcolors = (document.calcform.colors.value);

// calculate cost
var cost = items * unitprice + numcolors * colorprice * items + overhead;
document.calcform.cost.value = "" + cost;
}

  function CurrencyPopup(QueryString)
  {
    var amount = (document.calcform.cost.value);
	QueryString = "Amount=" + amount + "&From=THB";
    CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,height=130,width=450')
    CurrencyWindow.focus()
    CurrencyWindow.location.href = 'http://www.xe.net/ecc/input.cgi?Template=sw&'+QueryString
  }
// -->

