	
	var basePrice=0;
	var totalPrice=0;
	var baseDelivery=0;
	var depositW=0;
	var rate1 = 0.04116;
	var baseSetup = 0;	
	var itemPrices = new Array();
	
	function showDMenu (id) {
		if (tE(id)) {
			document.getElementById(id).style.display='block';	
			document.getElementById(id + 'Button').style.backgroundImage = 'url(img/menu.background.highlight.gif)';
		}
	}
	
	function hideDMenu (id) {
		if (tE(id)) {
			document.getElementById(id).style.display='none';
			document.getElementById(id + 'Button').style.backgroundImage = 'url(img/menu.background.jpg)';
		}
	}
	
	function showSMenu (id) {
		if (tE('side' + id)) {
			document.getElementById('side' + id).style.display='block';	
			document.getElementById('link' + id).style.background = '#B82535';
			document.getElementById('link' + id).style.color = '#fff';
			document.getElementById('link' + id).style.borderTop = '1px solid #D32A38';
			document.getElementById('link' + id).style.borderBottom = '1px solid #8D2721';
		}
	}
	
	function hideSMenu (id) {
		if (tE('side' + id)) {
			document.getElementById('side' + id).style.display='none';
			document.getElementById('link' + id).style.background = '';
			document.getElementById('link' + id).style.color = '#000';
			document.getElementById('link' + id).style.borderTop = '1px solid #ccc';
			document.getElementById('link' + id).style.borderBottom = '1px solid #999';
		}
	}
	
	function tE (id) {
		if (document.getElementById(id)) {
			return true;	
		}
		else
		{
			return false;	
		}
	}
	
	
	function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}
	
	function qupdatePrice () {
		setTimeout('updatePrice()', 100);
	}
	
	
	
	function updatePrice () {
		totalPrice = 0;
		
		var oF = findObj('customForm');
		for (var i=0; i<oF.length; i++) {
			if (oF[i].type == "radio") {	
				if (oF[i].checked) {
					totalPrice = totalPrice + parseFloat(itemPrices[oF[i].id]);
				}
			}
		}
		
		
		totalPrice = (totalPrice + basePrice);
		
		//totalPrice = Math.round(totalPrice*100)/100;
		//totalPrice = totalPrice.toFixed(2);
		//totalPrice = totalPrice;
		
		fullTotal = (totalPrice + baseDelivery + baseSetup);
		
		depositRun = (fullTotal * depositW);
		
				
		document.getElementById('price').innerHTML = '&pound;' + totalPrice + '.00';
		document.getElementById('priceBottom').innerHTML = '&pound;' + totalPrice + '.00';


		myRun = (fullTotal - depositRun);
		
		runningRate = (rate1 * myRun);
		roundedNumber = roundNumber(runningRate,2);
		document.getElementById('price2').innerHTML = roundedNumber;
	}

	function findObj (n, d) {
	  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=findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
function FormatNumber(num, decpoint, sep) {
  // check for missing parameters and use defaults if so
  if (arguments.length == 2) {
    sep = ",";
  }
  if (arguments.length == 1) {
    sep = "";
    decpoint = ".";
  }
  // need a string for operations
  num = num.toString();
  // separate the whole number and the fraction if possible
  a = num.split(decpoint);
  x = a[0]; // decimal
  y = a[1]; // fraction
  z = "";


  if (typeof(x) != "undefined") {
    // reverse the digits. regexp works from left to right.
    for (i=x.length-1;i>=0;i--)
      z += x.charAt(i);
    // add seperators. but undo the trailing one, if there
    z = z.replace(/(\d{3})/g, "$1" + sep);
    if (z.slice(-sep.length) == sep)
      z = z.slice(0, -sep.length);
    x = "";
    // reverse again to get back the number
    for (i=z.length-1;i>=0;i--)
      x += z.charAt(i);
    // add the fraction back in, if it was there
    if (typeof(y) != "undefined" && y.length > 0)
      x += decpoint + y;
  }
  
  if (x.substr((x.length-3), 3)=='.00') {
  	return x;
  }
  else
  {
	return x + '.00';  
  }
}

	function resizeBox () {
		var x,y;
		if (self.innerHeight) // all except Explorer
		{
			x = self.innerWidth;
			y = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight)
			// Explorer 6 Strict Mode
		{
			x = document.documentElement.clientWidth;
			y = document.documentElement.clientHeight;
		}
		else if (document.body) // other Explorers
		{
			x = document.body.clientWidth;
			y = document.body.clientHeight;
		}
		
		if (x < 1100) {
			document.getElementById('main').style.width='600px';	
		}
		else
		{
			document.getElementById('main').style.width='900px';	
		}
	}
	
	function qtoggleDelivery () {
		setTimeout ('toggleDelivery()', 200);
	}
	
	function toggleDelivery () {
		if (document.getElementById('deliveryAddress').checked) {
			document.getElementById('deliveryAddress').style.display = 'none';
		}
		else
		{
			document.getElementById('deliveryAddress').style.display = 'block';
		}
	}
	
	var curHigh = 1;
	var resetTimer;
	
	function homepage () {
		Effect.Appear('highlight1', {duration:1});
		setTimeout('homepageRotate()', 7000);
	}
	
	function homepageRotate () {
		newHigh = curHigh + 1;
		if (!document.getElementById('highlight' + newHigh)) {
			newHigh=1;		
		}
		
		if (resetTimer) {
			resetTimer = false;
			setTimeout('homepageRotate()', 7000);
		}
		else
		{
			showHighlight (newHigh, false);
			setTimeout('homepageRotate()', 7000);
		}
	}
	
	function showHighlight (id, c) {
		if (c) {
			resetTimer=true;	
		}
		Effect.Fade('highlight' + curHigh, {duration:1});
		setTimeout("Effect.Appear('highlight" + id +"', {duration:1});", 800);
		curHigh=id;
	}
	
	
	setTimeout('window.onresize=resizeBox;', 1000);
	