// m=maths varables d=display variables o=Order information

//***************************************************************************************************

oMax=70;                         //Max items in cart
oColours=4;                      //defines max colours in Tiaras
oNum=0;                          //number of items, starts at 0: do not change
oSent=false;                     //true if order sent to prevent double sending

mDollar        =1.64;            //GB Sterling TO Dollar conversion rate
mSterling      =1;               //define one pound sterling
mCurrentrate   =mSterling;       //Start with Sterling as current currency
mPnpGB         =4.00;            //postage is £4 domestic, $10 INTernational
mPnpINT        =(10/mDollar);     
mPnp           =mPnpGB;          //start with local postage
mPostMethod    ="local";         // local--int

dDollar        ="$";             // Define symbols for each currency
dSterling      ="£";
dCurrentsymbol =dSterling;


//***************************************************************************************************


CurrentOrder =new OrderSheet;         // Data structure to store the order info in
Tiara        =new TiaraData;          // Data structure to store Tiara information
userInfo     =new Personal;


function Personal() {
this.name = "";
this.ad1 = "";
this.ad2 = "";
this.ad3 = "";
this.postcode = "";
this.email = "";
this.extra = "";
this.method = "";
this.required = "";
}

function OrderSheet() {
this.quantity       =new Array(oMax);
this.name          =new Array(oMax);
this.goldsilver    =new Array(oMax);
this.description   =new Array(oMax);
this.unitprice     =new Array(oMax);
this.unittotal     =new Array(oMax);
this.colour        =new Array(oMax);  
this.colour[1]     =new Array(oColours);
this.colour[2]     =new Array(oColours);
this.colour[3]     =new Array(oColours);
this.colour[4]     =new Array(oColours);
this.link          =new Array(oMax);
}

function TiaraData() {
this.Pamela_Bridal                  =new Object;
this.Pamela_Bridal.name             ="Pamela - Bridal";
this.Pamela_Bridal.description      ="Simple celtic arch design";
this.Pamela_Bridal.unitprice        ="57.50";
this.Pamela_Bridal.link             ="Pamela.htm";
this.Pamela_Flowergirl              =new Object;
this.Pamela_Flowergirl.name         ="Pamela - Flowergirl";
this.Pamela_Flowergirl.description  ="Simple celtic arch design";
this.Pamela_Flowergirl.unitprice    ="52.50";
this.Pamela_Flowergirl.link             ="Pamela.htm";
this.Pamela_Bridesmaid              =new Object;
this.Pamela_Bridesmaid.name         ="Pamela - Bridesmaid";
this.Pamela_Bridesmaid.description  ="Simple celtic arch design";
this.Pamela_Bridesmaid.unitprice    ="52.50";
this.Pamela_Bridesmaid.link         ="Pamela.htm";
this.Xeron                   =new Object;
this.Xeron.name              ="Xeron";
this.Xeron.description       ="Clear crystal and pearl on wire mesh";
this.Xeron.unitprice         ="87.50";
this.Xeron.link              ="xeron.htm";
this.Yonah                   =new Object;
this.Yonah.name              ="Yonah";
this.Yonah.description       ="Variety of beads on gold wire stems";
this.Yonah.unitprice         ="77.50";
this.Yonah.link              ="yonah.htm";
this.Kate                    =new Object;
this.Kate.name               ="Kate";
this.Kate.description        ="Pearl construct designed on gold band base";
this.Kate.unitprice          ="77.50";
this.Kate.link               ="kate.htm";
this.Claire                  =new Object;
this.Claire.name             ="Claire";
this.Claire.description      ="Luxurious gold and pearl tiara with Swarovski Crystal centre mount";
this.Claire.unitprice        ="87.50";
this.Claire.link             ="claire.htm";
this.Tamara                  =new Object;
this.Tamara.name             ="Tamara";
this.Tamara.description      ="Gold bead clusters on Scottish heather-like stems";
this.Tamara.unitprice        ="67.50";
this.Tamara.link             ="tamara.htm";
this.Iona                    =new Object;
this.Iona.name               ="Iona";
this.Iona.description        ="Ivory pearl twist toped with pearl and gold bead headworks";
this.Iona.unitprice          ="87.50";
this.Iona.link               ="iona.htm";
this.Hazel                   =new Object;
this.Hazel.name              ="Hazel";
this.Hazel.description       ="Designed to match colours of National Tartan set in silver band and wire work. Also available in Pride of Scotland or tartan of your choice.";
this.Hazel.unitprice         ="87.50";
this.Hazel.link              ="hazel.htm";
this.Debbie                  =new Object;
this.Debbie.name             ="Debbie";
this.Debbie.description      ="Heather-like pearl clusters with large coloured beads";
this.Debbie.unitprice        ="67.50";
this.Debbie.link             ="debbie.htm";
this.Cats                    =new Object;
this.Cats.name               ="Cats' Whiskers";
this.Cats.description        ="Sprays of oval pearl on individual stems.";
this.Cats.unitprice          ="67.50";
this.Cats.link               ="cats.htm";
this.Inspiration             =new Object;
this.Inspiration.name        ="Inspiration";
this.Inspiration.description ="A lavish collection of Austrian crystals.";
this.Inspiration.unitprice   ="187.50";
this.Inspiration.link        ="inspiration.htm";
this.Morven                  =new Object;
this.Morven.name             ="Morven";
this.Morven.description      ="Arches formed with Swarovski Crystals and Rhinestone Roundelles";
this.Morven.unitprice        ="115.50";
this.Morven.link             ="morven.htm";

for (i=0; i<12; i++ ) {
eval('this.Barbara'+i+'= new Object;');
eval('this.Barbara'+i+'.name="Barbara";');
eval('this.Barbara'+i+'.unitprice="87.50";');
eval('this.Barbara'+i+'.link="barbara.htm";');
}


this.Barbara0.description    ="AB (clear) and light Saphire crystal clusters";
this.Barbara1.description    ="AB (clear) and dark Amethest crystal clusters";
this.Barbara2.description    ="AB (clear) and Topaz crystal clusters";
this.Barbara3.description    ="AB (clear) and Emerald crystal clusters";
this.Barbara4.description    ="AB (clear) and dark Saphire crystal clusters";
this.Barbara5.description    ="AB (clear) and Rose Quartz crystal clusters";
this.Barbara6.description    ="AB (clear), light and dark Saphire crystal clusters";
this.Barbara7.description    ="AB (clear), light and dark Amethest crystal clusters";
this.Barbara8.description    ="AB (clear), Topaz and Primrose crystal clusters";
this.Barbara9.description    ="AB (clear), Emerald and Perdoit crystal clusters";
this.Barbara10.description   ="AB (clear),light Saphire and Aqua crystal clusters";
this.Barbara11.description   ="AB (clear), Ruby and Rose Quartz crystal clusters";
}



//                                                                                           UPDATE DATABASE

function UpdateDatabase(Product,gold,silver,num) {

if(oNum<oMax) {                 // is there any room in the cart?
oNum++;

CurrentOrder.name[oNum]                    =eval("Tiara."+Product+".name");
CurrentOrder.quantity[oNum]                =num;
if(gold==1) {CurrentOrder.goldsilver[oNum]    ="gold"; }
if(silver==1) {CurrentOrder.goldsilver[oNum]  ="silver"; }
CurrentOrder.description[oNum]             =eval("Tiara."+Product+".description");
CurrentOrder.unitprice[oNum]               =eval("Tiara."+Product+".unitprice");
CurrentOrder.link[oNum]                    =eval("Tiara."+Product+".link");
} else {alert("Shopping Cart full."); } }

function UK() {
mCurrentrate=mSterling; dCurrentsymbol=dSterling;
alert('Prices will now be displayed in UK Sterling');
parent.main.location.href=parent.main.location.href;
}

function US() {
mCurrentrate=mDollar; dCurrentsymbol=dDollar;
alert('Prices will now be displayed in US Dollars');
parent.main.location.href=parent.main.location.href;
}


