// JavaScript Document

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 shipdiv(show)
{
	if (show == false)
	{
		document.getElementById("shipping_fields").style.visibility = 'hidden';
		document.getElementById("shipping_fields").style.display = 'none';
	}
	else
	{
		document.getElementById("shipping_fields").style.visibility = 'visible';
		document.getElementById("shipping_fields").style.display = '';
	}
}

function reveal_tile()
{
	
	if (document.getElementById("tr_04").style.visibility == 'hidden')
	{
		document.getElementById("tr_04").style.visibility = 'visible';
		document.getElementById("tr_04").style.display = '';
	}
	
	else if (document.getElementById("tr_05").style.visibility == 'hidden')
	{
		document.getElementById("tr_05").style.visibility = 'visible';
		document.getElementById("tr_05").style.display = '';
	}

	else if (document.getElementById("tr_06").style.visibility == 'hidden')
	{
		document.getElementById("tr_06").style.visibility = 'visible';
		document.getElementById("tr_06").style.display = '';
	}

	else if (document.getElementById("tr_07").style.visibility == 'hidden')
	{
		document.getElementById("tr_07").style.visibility = 'visible';
		document.getElementById("tr_07").style.display = '';	}

	else if (document.getElementById("tr_08").style.visibility == 'hidden')
	{
		document.getElementById("tr_08").style.visibility = 'visible';
		document.getElementById("tr_08").style.display = '';	}

	else if (document.getElementById("tr_09").style.visibility == 'hidden')
	{
		document.getElementById("tr_09").style.visibility = 'visible';
		document.getElementById("tr_09").style.display = '';	}

	else if (document.getElementById("tr_10").style.visibility == 'hidden')
	{
		document.getElementById("tr_10").style.visibility = 'visible';
		document.getElementById("tr_10").style.display = '';	}

	else if (document.getElementById("tr_10").style.visibility == 'hidden')
	{
		document.getElementById("tr_10").style.visibility = 'visible';
		document.getElementById("tr_10").style.display = '';	}

	else if (document.getElementById("tr_11").style.visibility == 'hidden')
	{
		document.getElementById("tr_11").style.visibility = 'visible';
		document.getElementById("tr_11").style.display = '';	}

	else if (document.getElementById("tr_12").style.visibility == 'hidden')
	{
		document.getElementById("tr_12").style.visibility = 'visible';
		document.getElementById("tr_12").style.display = '';	}
	
	else if (document.getElementById("tr_13").style.visibility == 'hidden')
	{
		document.getElementById("tr_13").style.visibility = 'visible';
		document.getElementById("tr_13").style.display = '';		document.getElementById("addbtn").style.visibility = 'hidden';
		document.getElementById("addbtn").style.display = 'none';
	}
}

function reveal_tile_brushout()
{
	
	if (document.getElementById("btr_04").style.visibility == 'hidden')
	{
		document.getElementById("btr_04").style.visibility = 'visible';
		document.getElementById("btr_04").style.display = '';
	}
	
	else if (document.getElementById("btr_05").style.visibility == 'hidden')
	{
		document.getElementById("btr_05").style.visibility = 'visible';
		document.getElementById("btr_05").style.display = '';
	}

	else if (document.getElementById("btr_06").style.visibility == 'hidden')
	{
		document.getElementById("btr_06").style.visibility = 'visible';
		document.getElementById("btr_06").style.display = '';
	}

	else if (document.getElementById("btr_07").style.visibility == 'hidden')
	{
		document.getElementById("btr_07").style.visibility = 'visible';
		document.getElementById("btr_07").style.display = '';	}

	else if (document.getElementById("btr_08").style.visibility == 'hidden')
	{
		document.getElementById("btr_08").style.visibility = 'visible';
		document.getElementById("btr_08").style.display = '';	}

	else if (document.getElementById("btr_09").style.visibility == 'hidden')
	{
		document.getElementById("btr_09").style.visibility = 'visible';
		document.getElementById("btr_09").style.display = '';	}

	else if (document.getElementById("btr_10").style.visibility == 'hidden')
	{
		document.getElementById("btr_10").style.visibility = 'visible';
		document.getElementById("btr_10").style.display = '';	}

	else if (document.getElementById("btr_10").style.visibility == 'hidden')
	{
		document.getElementById("btr_10").style.visibility = 'visible';
		document.getElementById("btr_10").style.display = '';	}

	else if (document.getElementById("btr_11").style.visibility == 'hidden')
	{
		document.getElementById("btr_11").style.visibility = 'visible';
		document.getElementById("btr_11").style.display = '';	}

	else if (document.getElementById("btr_12").style.visibility == 'hidden')
	{
		document.getElementById("btr_12").style.visibility = 'visible';
		document.getElementById("btr_12").style.display = '';	}
	
	else if (document.getElementById("btr_13").style.visibility == 'hidden')
	{
		document.getElementById("btr_13").style.visibility = 'visible';
		document.getElementById("btr_13").style.display = '';		document.getElementById("addbtnb").style.visibility = 'hidden';
		document.getElementById("addbtnb").style.display = 'none';
	}
}

/*
SELECT colours.name FROM colours WHERE colours.colour in ( SELECT product_colour.colour FROM product_colour WHERE product_colour.product = 7) AND colours.shop = 1 ORDER BY colours.name ASC
*/

function colcheck(source, target)
{
	//Updated from admin php script
	var aqua        = new Array('Bloom','Blush','Breathless','Celedon','Charcoal','Cinder','Cloud','Cocoa','Florence','Forget Me Not','Gypsy Brown','Harlequin','Havana','Jaffa','Lily','Lotus','Lumiere','Mother of Pearl','Opal','Petal','Phlox','Plum','Primrose','Ribbon','Sari','Shadow','Shimmer','Shine','Smudge','Soulful','Sultry','Tropical','Vanish','Voile');
	var bridge      = new Array('Brinjal','Carbon','Fog','Geo','Graphite','Hemp','Iron Oxide','Jute','Pavilion','Relic','Rusty','Titanium','Urban'); 
	var murowash    = new Array('Aegean','Alabaster','Alfalfa','Algiers','Almore','Alto','Angophora','Antelope','Aqua','Arezzo','Arizona','Arnhem','Arum','Ash','Aspen','Atlantic','Aubergine','Azure','Badger','Ballina','Ballina Blue','Balmoral stone','Balsa','Bamboo Shoot','Bandicoot','Banksia','Bark','Barkala','Barnacle','Bees Knees','Bennelong','Berry','Beyond','Birch','Biscotti','Blackberry','Block Brown','Block White','Blue ice','Bone','Bonsai','Bordeaux','Boysenberry','Breeze','Bristle','Bronze','Brown Bag','Brown Canvas','Burnt Chilli','Cactus','Calm','Camel','Camomile','Canvas','Carmine','Cascade','Cashmere','Celestial Blue','Chalk','Chameleon','Chartreuse','Chenille','Cherish','Cherry Red','Chino','Citron','Claret','Clay','Cliff','Clover','Cobalt','Cobble','Coora','Corfu','Corsica','Corsica 200%','Corsica 300%','Cracker','Cranberry','Crushed Shell','Crystal','Cyprus','Dark Chocolate','Desert','Dirty Camomile','Dirty Wombat','Donkeys Tail','Dovetail','Drab','Driftwood','Dry Stone','Ebony','Echo','Eggshell','Elderberry','Emerald','Espresso','Evangeline','Fantasy','Fez','Ficus','Flamingo','Flannel Flower','Flirtatious','Flourish','Fossil','French Rose','Fresco','Frond','Fudge','Garden Bench','Ghost','Glacier','Glammer Gold','Glamorous','Glisten','Golden sand','Gossamer','Grandtour','Grapevine','Green Apple','Green Tea','Greengrass','Grey day','Ground','Gum','Haigh Yarramalong','Harbour','Hawkesbury','Heather','Henna','Hessian','Hillend','Hillside','Indigo','Ink','Intoxicate','Ionian','Iris','Island Blue','Jewel','Just White','Kakadu','Kaldor','Kalgoorlie','Katherine Gorge','Kelp','Kohl','Lagoon','Lambs Ear','Leaf','Lemongrass','Lettuce Green','Lichen','Lilypond','Lime','Lime Putty','Lime Twist','Limestone','Linger','Lucky','Luminesque','Lupine','Lush','Lush Berry','Magenta','Marble','Marle','Marlin','Merlot','Metropolitan','Mineral','Mink','Mirage','Mist','Molasses','Mole','Mondo','Monet','Moorgate Green','Morocco','Moscow','Mud','Mulberry','Murobond Brown','Natural White','Nearly Slate','Nero','Newport','Nomad','Obelisk','Oberon','Obsidian','Ochre','Old White','Olive Tree','Opulence','Orange Peel','Organza','Oxide','Pacific','Paco','Paintbrush','Pale green','Papaya','Paper','Paperbark','Paprika','Paradise','Peppercorn','Pewter','Phoenix Red','Piliga','Pistachio','Pitch','Pitman Beige','Plump Plum','Pomegranite','Powder','Precious','Princess','Puddle','Pumice','Pumpernickle','Putty','Quarry','Raw Earth','Really red','Red Hot Poker','Reed','Regal','Relish','Rhodes','Ripple','Rope','Rosa','Rouge','Sabre','Saffron','Salt','Sand','Sapphire','Sasanqua','Saxon','Scarlet','Sepia','Shell','Shellstone','Silhouette','Simply White','Sisal','Slate','Smart White','Smoke','Smoked Trout','Snowdrop','Soft lime','Sorrel','Spice','Squid Ink','Stone','Storm','Suntan','Swallow','Syrup','Tamarillo','Tang','Tar','Tawny','Terracotta','Thread','Tranquil','Travertine','Tumbled Ivory','Tumbleweed','Turquoise','Tuscan','Twig','Twill','Twine','Umber','Urara','Velvet','Verve','Vesuvius','Vital','Watergreen','Waterlily','White wall','Willow','Wombat','Wood','Woodsmoke','Woven','Yanum','Yarramalong','Zing');
	var woodwash   = new Array('Whitewash', 'Blackwash', 'Brownwash', 'Emerald Woodwash', 'Syrup Woodwash', 'Linger Woodwash', 'Harbour Woodwash', 'Lilypond Woodwash', 'Papaya Woodwash');
	var otherpaint  = new Array('Aegean','Alabaster','Alfalfa','Algiers','Almore','Alto','Angophora','Antelope','Aqua','Arezzo','Arizona','Arnhem','Arum','Ash','Aspen','Atlantic','Aubergine','Azure','Badger','Ballina','Ballina Blue','Balmoral stone','Balsa','Bamboo Shoot','Bandicoot','Banksia','Bark','Barkala','Barnacle','Bennelong','Berry','Beyond','Birch','Biscotti','Blackberry','Block Brown','Block White','Blue ice','Bone','Bonsai','Bordeaux','Breeze','Bristle','Bronze','Brown Bag','Burnt Chilli','Cactus','Calm','Camel','Camomile','Canvas','Carmine','Cascade','Cashmere','Celestial Blue','Chalk','Chartreuse','Chenille','Cherish','Cherry Red','Chino','Claret','Clay','Cliff','Clover','Cobalt','Cobble','Coora','Corfu','Corsica','Corsica 200%','Corsica 300%','Cracker','Cranberry','Crushed Shell','Crystal','Cyprus','Dark Chocolate','Desert','Dirty Camomile','Dirty Wombat','Donkeys Tail','Dovetail','Driftwood','Dry Stone','Ebony','Echo','Eggshell','Elderberry','Emerald','Espresso','Fantasy','Fez','Ficus','Flamingo','Flannel Flower','Flirtatious','Flourish','Fossil','French Rose','Fresco','Frond','Fudge','Garden Bench','Ghost','Glacier','Glammer Gold','Glamorous','Glisten','Gossamer','Grandtour','Grapevine','Green Apple','Green Tea','Greengrass','Grey day','Ground','Gum','Haigh Yarramalong','Harbour','Hawkesbury','Heather','Henna','Hessian','Hillend','Hillside','Indigo','Ink','Intoxicate','Ionian','Iris','Island Blue','Jewel','Just White','Kakadu','Kaldor','Kalgoorlie','Katherine Gorge','Kelp','Kohl','Lagoon','Lambs Ear','Leaf','Lemongrass','Lettuce Green','Lichen','Lilypond','Lime','Lime Putty','Lime Twist','Limestone','Lucky','Luminesque','Lupine','Lush','Lush Berry','Marble','Marle','Marlin','Merlot','Metropolitan','Mineral','Mink','Mirage','Mist','Molasses','Mole','Mondo','Monet','Moorgate Green','Morocco','Mud','Mulberry','Murobond Brown','Natural White','Nearly Slate','Nero','Newport','Nomad','Obelisk','Oberon','Obsidian','Ochre','Old White','Olive Tree','Opulence','Organza','Oxide','Paco','Paintbrush','Pale green','Papaya','Paper','Paperbark','Paprika','Paradise','Peppercorn','Pewter','Phoenix Red','Piliga','Pistachio','Pitch','Pitman Beige','Powder','Precious','Princess','Puddle','Pumice','Pumpernickle','Putty','Quarry','Raw Earth','Reed','Regal','Relish','Rhodes','Ripple','Rope','Rosa','Rouge','Sabre','Saffron','Salt','Sand','Sapphire','Sasanqua','Saxon','Sepia','Shell','Shellstone','Silhouette','Simply White','Sisal','Slate','Smart White','Smoke','Smoked Trout','Snowdrop','Soft lime','Sorrel','Spice','Squid Ink','Stone','Storm','Suntan','Swallow','Syrup','Tamarillo','Tang','Tar','Tawny','Terracotta','Thread','Tranquil','Travertine','Tumbled Ivory','Tumbleweed','Turquoise','Tuscan','Twig','Twill','Twine','Umber','Urara','Velvet','Verve','Vesuvius','Vital','Watergreen','Waterlily','White wall','Willow','Wombat','Wood','Woodsmoke','Woven','Yanum','Yarramalong','Zing');
	var societyinc  = new Array ('Absinthe','Amulet','Anchorage','Aral Sea','Archer','Attar Of Rose','Bonesetter','Bookbinder','Boro 1','Boro 2','Burlap','Caravanserai','Chalk','Chimney Sweep ','Chinoiserie','Cracked Leather','Crepe Papier','Dark & Stormy','Darwin','Desert','Dusk','Falconer','Farrier','Felt','Galapagos','Galleon Manilla','Ghostly Passage','Gitane','Glassine','Gypsy Gold','Ikat','Indigo','Isla Negra','Jurates Castle','Loveletter','Miel','Montmarte','Moonshadow','Moontide','Moustache','Natura Morta','Nautilus','Nomad','Oasis','Oceanforest','Onionskin','Oyster Grey','Paperbag','Patternmaker','Pirate Black','Porcelain','Rami','Riverkeeper','Sailcloth','Salone 1887','Samarkand','Scrimshaw','Sea Urchin','Seadragon','Seaglass','Seagull','Serpent','Shabori','Ship Chandler','Ships In The Night','Singing Stones','Sirens Song','Soft Pewter','Stonecutter','Taboret','Talas','Tanguy','Tarnished Silver','Tattoo','Tempest','Ukiyo-E','Whalebone','Whisky','Whitehorses','Wind Djinn');

	if ( source.value == "Murothane" ) 
	{
		target.options.length = 0;
				
		var optn = document.createElement("OPTION");
		optn.text = source.value;
		optn.value = source.value;
		target.options.add(optn);
		
	}
	else if (source.value == "Choose") {} 
	else
	{ 
		var tokens;
		
		if (source.value == "Murowash") {tokens = murowash; }
		if (source.value == "Bridge Paint") {tokens = bridge; }
		if (source.value == "Aqua Glaze + Pearl") {tokens = aqua; }
		if (source.value == "Woodwash") {tokens = woodwash; }
		if (source.value == "Society") {tokens = societyinc; }
		if (source.value == "Other") {tokens = otherpaint; }
		
		target.options.length = 0;
		
		var optn = document.createElement("OPTION");
		optn.text = "Choose";
		optn.value = "Choose";
		target.options.add(optn);

		
		for (var i=0; i < tokens.length;++i)
		{
			var optn = document.createElement("OPTION");
			optn.text = tokens[i];
			optn.value = tokens[i];
			target.options.add(optn);
		}
	}
	

}
 //Rachel to change when new product
function order_calc()
{
	var subtotal = 0;
	var shiptotal = 0;
	var grandtotal = 0;
	
	// Update side totals
	
	//if ( document.getElementById("promocol1").value == "Choose" || document.getElementById("promopaint1").value == "Choose" )
	//{
	//	document.getElementById("promo_total").innerHTML = formatCurrency(0);
	//}
	//else
	//{
	//	document.getElementById("promo_total").innerHTML = formatCurrency(25);
	//}

	document.getElementById("total_samplecol01").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol01").value);
	document.getElementById("total_samplecol02").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol02").value);
	document.getElementById("total_samplecol03").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol03").value);
	document.getElementById("total_samplecol04").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol04").value);
	document.getElementById("total_samplecol05").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol05").value);
	document.getElementById("total_samplecol06").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol06").value);
	document.getElementById("total_samplecol07").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol07").value);
	document.getElementById("total_samplecol08").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol08").value);
	document.getElementById("total_samplecol09").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol09").value);
	document.getElementById("total_samplecol10").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol10").value);
	document.getElementById("total_samplecol11").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol11").value);
	document.getElementById("total_samplecol12").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol12").value);
	document.getElementById("total_samplecol13").innerHTML = formatCurrency(9 * document.getElementById("qty_samplecol13").value);

	document.getElementById("total_brushout01").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout01").value);
	document.getElementById("total_brushout02").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout02").value);
	document.getElementById("total_brushout03").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout03").value);
	document.getElementById("total_brushout04").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout04").value);
	document.getElementById("total_brushout05").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout05").value);
	document.getElementById("total_brushout06").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout06").value);
	document.getElementById("total_brushout07").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout07").value);
	document.getElementById("total_brushout08").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout08").value);
	document.getElementById("total_brushout09").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout09").value);
	document.getElementById("total_brushout10").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout10").value);
	document.getElementById("total_brushout11").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout11").value);
	document.getElementById("total_brushout12").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout12").value);
	document.getElementById("total_brushout13").innerHTML = formatCurrency(1.5 * document.getElementById("qty_brushout13").value);
	
	document.getElementById("total_societyinc").innerHTML = formatCurrency(45 * document.getElementById("qty_societyinc").value);
	
	document.getElementById("total_chalk_cherry_nose").innerHTML = formatCurrency(35 * document.getElementById("qty_chalk_cherry_nose").value);
	document.getElementById("total_chalk_cicada").innerHTML = formatCurrency(35 * document.getElementById("qty_chalk_cicada").value);
	document.getElementById("total_chalk_oceania").innerHTML = formatCurrency(35 * document.getElementById("qty_chalk_oceania").value);
	document.getElementById("total_chalk_whalebone").innerHTML = formatCurrency(35 * document.getElementById("qty_chalk_whalebone").value);
	document.getElementById("total_chalk_dragonfly").innerHTML = formatCurrency(35 * document.getElementById("qty_chalk_dragonfly").value);
	document.getElementById("total_chalk_pirate_black").innerHTML = formatCurrency(35 * document.getElementById("qty_chalk_pirate_black").value);
	
	document.getElementById("total_chalk_cherry_nose_500").innerHTML = formatCurrency(22 * document.getElementById("qty_chalk_cherry_nose_500").value);
	document.getElementById("total_chalk_cicada_500").innerHTML = formatCurrency(22 * document.getElementById("qty_chalk_cicada_500").value);
	document.getElementById("total_chalk_oceania_500").innerHTML = formatCurrency(22 * document.getElementById("qty_chalk_oceania_500").value);
	document.getElementById("total_chalk_whalebone_500").innerHTML = formatCurrency(22 * document.getElementById("qty_chalk_whalebone_500").value);
	document.getElementById("total_chalk_dragonfly_500").innerHTML = formatCurrency(22 * document.getElementById("qty_chalk_dragonfly_500").value);
	document.getElementById("total_chalk_pirate_black_500").innerHTML = formatCurrency(22 * document.getElementById("qty_chalk_pirate_black_500").value);

	
	document.getElementById("total_bk_essentiallyfrench").innerHTML = formatCurrency(49.95 * document.getElementById("qty_bk_essentiallyfrench").value);
	document.getElementById("total_bk_frenchcountry").innerHTML = formatCurrency(55.00 * document.getElementById("qty_bk_frenchcountry").value);
	document.getElementById("total_bk_tablestyle").innerHTML = formatCurrency(45.00 * document.getElementById("qty_bk_tablestyle").value);
	document.getElementById("total_bk_simplehome").innerHTML = formatCurrency(49.95 * document.getElementById("qty_bk_simplehome").value);
	document.getElementById("total_bk_homefamily").innerHTML = formatCurrency(59.95 * document.getElementById("qty_bk_homefamily").value);
	document.getElementById("total_bk_thingswelove").innerHTML = formatCurrency(59.95 * document.getElementById("qty_bk_thingswelove").value);
	document.getElementById("total_bk_Etcetera").innerHTML = formatCurrency(59.95 * document.getElementById("qty_bk_Etcetera").value);
	document.getElementById("total_bk_colournow").innerHTML = formatCurrency(24.95 * document.getElementById("qty_bk_colournow").value);
	document.getElementById("total_bk_WayweLive").innerHTML = formatCurrency(49.95 * document.getElementById("qty_bk_WayweLive").value);
	document.getElementById("total_bk_amsterdam").innerHTML = formatCurrency(32.95 * document.getElementById("qty_bk_amsterdam").value);
	document.getElementById("total_bk_homeheart").innerHTML = formatCurrency(49.95 * document.getElementById("qty_bk_homeheart").value);
	document.getElementById("total_bk_easyelegance").innerHTML = formatCurrency(49.95 * document.getElementById("qty_bk_easyelegance").value);
	
	document.getElementById("total_neutralfandeck").innerHTML = formatCurrency(10 * document.getElementById("qty_neutralfandeck").value);
	document.getElementById("total_foundation").innerHTML = formatCurrency(25 * document.getElementById("qty_foundation").value);
	document.getElementById("total_specifier").innerHTML = formatCurrency(37 * document.getElementById("qty_specifier").value);
	document.getElementById("total_specfound").innerHTML = formatCurrency(55 * document.getElementById("qty_specfound").value);
	
	//if (document.getElementById("promocode").value == 'CHRISTMAS' || document.getElementById("promocode").value == 'CHRISTMAS' || document.getElementById("promocode").value == 'CHRISTMAS')
	//{
	//	document.getElementById("total_neutralfandeck").innerHTML = formatCurrency(10 * document.getElementById("qty_neutralfandeck").value);
	//	document.getElementById("price_natfandeck").innerHTML = formatCurrency(10);
	//}
	//else
	//{
	//	document.getElementById("total_neutralfandeck").innerHTML = formatCurrency(20 * document.getElementById("qty_neutralfandeck").value);
	//	document.getElementById("price_natfandeck").innerHTML = formatCurrency(20);
	//}
	
	document.getElementById("total_alchfandeck").innerHTML = formatCurrency(20 * document.getElementById("qty_alchfandeck").value);
	
	document.getElementById("total_societyinc").innerHTML = formatCurrency(45 * document.getElementById("qty_societyinc").value);
	
	document.getElementById("total_MH_boxedset").innerHTML = formatCurrency(74 * document.getElementById("qty_MH_boxedset").value);
	document.getElementById("total_MH_soap").innerHTML = formatCurrency(21 * document.getElementById("qty_MH_soap").value);
	document.getElementById("total_MH_bagdrycleaning").innerHTML = formatCurrency(29 * document.getElementById("qty_MH_bagdrycleaning").value);
	document.getElementById("total_MH_bagironing").innerHTML = formatCurrency(29 * document.getElementById("qty_MH_bagironing").value);
	document.getElementById("total_MH_jutebag").innerHTML = formatCurrency(9.5 * document.getElementById("qty_MH_jutebag").value);
	

	if (document.getElementById("registered").checked == true)
	{
		document.getElementById("total_registered").innerHTML = formatCurrency(5.5);
	}
	else
	{
		document.getElementById("total_registered").innerHTML = formatCurrency(0);
	}
	
	// Determine Order Total
	
	//if ( document.getElementById("promocol1").value == "Choose" || document.getElementById("promopaint1").value == "Choose" )
	//{
	//	subtotal += 0;
	//}
	//else
	//{
	//	subtotal += 25;
	//}
	
	subtotal += 9 * document.getElementById("qty_samplecol01").value;
	subtotal += 9 * document.getElementById("qty_samplecol02").value;
	subtotal += 9 * document.getElementById("qty_samplecol03").value;
	subtotal += 9 * document.getElementById("qty_samplecol04").value;
	subtotal += 9 * document.getElementById("qty_samplecol05").value;
	subtotal += 9 * document.getElementById("qty_samplecol06").value;
	subtotal += 9 * document.getElementById("qty_samplecol07").value;
	subtotal += 9 * document.getElementById("qty_samplecol08").value;
	subtotal += 9 * document.getElementById("qty_samplecol09").value;
	subtotal += 9 * document.getElementById("qty_samplecol10").value;
	subtotal += 9 * document.getElementById("qty_samplecol11").value;
	subtotal += 9 * document.getElementById("qty_samplecol12").value;
	subtotal += 9 * document.getElementById("qty_samplecol13").value;
	
	subtotal += 1.5 * document.getElementById("qty_brushout01").value;
	subtotal += 1.5 * document.getElementById("qty_brushout02").value;
	subtotal += 1.5 * document.getElementById("qty_brushout03").value;
	subtotal += 1.5 * document.getElementById("qty_brushout04").value;
	subtotal += 1.5 * document.getElementById("qty_brushout05").value;
	subtotal += 1.5 * document.getElementById("qty_brushout06").value;
	subtotal += 1.5 * document.getElementById("qty_brushout07").value;
	subtotal += 1.5 * document.getElementById("qty_brushout08").value;
	subtotal += 1.5 * document.getElementById("qty_brushout09").value;
	subtotal += 1.5 * document.getElementById("qty_brushout10").value;
	subtotal += 1.5 * document.getElementById("qty_brushout11").value;
	subtotal += 1.5 * document.getElementById("qty_brushout12").value;
	subtotal += 1.5 * document.getElementById("qty_brushout13").value;
	
	subtotal += 45 * document.getElementById("qty_societyinc").value;
	
	subtotal += 35 * document.getElementById("qty_chalk_cherry_nose").value;
	subtotal += 35 * document.getElementById("qty_chalk_cicada").value;
	subtotal += 35 * document.getElementById("qty_chalk_oceania").value;
	subtotal += 35 * document.getElementById("qty_chalk_whalebone").value;
	subtotal += 35 * document.getElementById("qty_chalk_dragonfly").value;
	subtotal += 35 * document.getElementById("qty_chalk_pirate_black").value;
	
	subtotal += 22 * document.getElementById("qty_chalk_cherry_nose_500").value;
	subtotal += 22 * document.getElementById("qty_chalk_cicada_500").value;
	subtotal += 22 * document.getElementById("qty_chalk_oceania_500").value;
	subtotal += 22 * document.getElementById("qty_chalk_whalebone_500").value;
	subtotal += 22 * document.getElementById("qty_chalk_dragonfly_500").value;
	subtotal += 22 * document.getElementById("qty_chalk_pirate_black_500").value;


	
	subtotal += 49.95 * document.getElementById("qty_bk_essentiallyfrench").value;
	subtotal += 55.00 * document.getElementById("qty_bk_frenchcountry").value;
	subtotal += 45.00 * document.getElementById("qty_bk_tablestyle").value;
	subtotal += 49.95 * document.getElementById("qty_bk_simplehome").value;
	subtotal += 59.95 * document.getElementById("qty_bk_homefamily").value;
	subtotal += 59.95 * document.getElementById("qty_bk_thingswelove").value;
	subtotal += 59.95 * document.getElementById("qty_bk_Etcetera").value;
	subtotal += 24.95 * document.getElementById("qty_bk_colournow").value;
	subtotal += 49.95 * document.getElementById("qty_bk_WayweLive").value;
	subtotal += 32.95 * document.getElementById("qty_bk_amsterdam").value;
	subtotal += 49.95 * document.getElementById("qty_bk_homeheart").value;
	subtotal += 49.95 * document.getElementById("qty_bk_easyelegance").value;
	
	
	subtotal += 10 * document.getElementById("qty_neutralfandeck").value;
	subtotal += 25 * document.getElementById("qty_foundation").value;
	subtotal += 37 * document.getElementById("qty_specifier").value;
	subtotal += 55 * document.getElementById("qty_specfound").value;
	
	//if (document.getElementById("promocode").value == 'CHRISTMAS' || document.getElementById("promocode").value == 'CHRISTMAS' || document.getElementById("promocode").value == 'CHRISTMAS ')
	//{
	//	subtotal += 10 * document.getElementById("qty_neutralfandeck").value;
	//}
	//else
	//{
	//	subtotal += 20 * document.getElementById("qty_neutralfandeck").value;
	//}
	
	subtotal += 20 * document.getElementById("qty_alchfandeck").value;
	
	subtotal += 74 * document.getElementById("qty_MH_boxedset").value;
	subtotal += 21 * document.getElementById("qty_MH_soap").value;
	subtotal += 29 * document.getElementById("qty_MH_bagdrycleaning").value;
	subtotal += 29 * document.getElementById("qty_MH_bagironing").value;
	subtotal += 9.5 * document.getElementById("qty_MH_jutebag").value;
	
	
	// Shipping
	if (subtotal <= 5) { shiptotal = 3.5; }
	else if (subtotal <= 10) { shiptotal = 7.5; }
	else if (subtotal <= 50) { shiptotal = 12; }
	else if (subtotal <= 100) { shiptotal = 15; }
	else  { shiptotal = 20; }

	// Update final totals
	document.getElementById("order_total").innerHTML = formatCurrency(subtotal);
	document.getElementById("shiptotal").innerHTML = formatCurrency(shiptotal);
	
	document.getElementById("hidden_sub").value = subtotal;
	document.getElementById("hidden_ship").value = shiptotal;
	
	
	
	if (document.getElementById("registered").checked == true)
	{
		grandtotal += 5.5;
		document.getElementById("hidden_reg").value = 5.5;
	}
	
	grandtotal += subtotal + shiptotal;
	
	document.getElementById("hidden_grand").value = grandtotal;
	
	document.getElementById("grandtotal").innerHTML = formatCurrency(grandtotal);

	
}
