 var colournames = new Array
 colournames["c"]="Colour"
 colournames["b"]="Black & White"
 colournames["cc"]="Double Sided Colour"
 colournames["bb"]="Double Sided Black & White"
 colournames["cb"]="Double Sided Colour & Black & White"

 init_fastquote();

  function init_fastquote(){
  // title
  document.getElementById('product_name').innerHTML=product_name + " Quotes";
  // size
  document.getElementById('product_size').innerHTML=product_size;

  // fill in stocks
  document.forms['fastquote'].stock.options.length = stocks.length

  for (i=0;i<stocks.length;i++) {
   document.forms['fastquote'].stock.options[i]= new Option (stocks[i],i)
  }
  // fill in quantity
  document.forms['fastquote'].quantity.options.length = quantities.length

  for (i=0;i<quantities.length;i++) {
   document.forms['fastquote'].quantity.options[i]= new Option (quantities[i],i)
  } 

 
  // hide or show the Back
  if (show_back != true) {
   document.getElementById('quote_back').style.display='none';
  }

  // hide or show the Order Splits
  if (show_splits != true) {
   document.getElementById('quote_splits').style.display='none';
  }

  recalculate(); 
  }


  function recalculate(){
	quantityindex=document.forms['fastquote'].quantity.value
	stockindex=document.forms['fastquote'].stock.value

	colours=""
	if (document.forms['fastquote'].front.value != null) {
		colours=colours+document.forms['fastquote'].front.value
	}
	if (document.forms['fastquote'].back.value != null) {
		colours=colours+document.forms['fastquote'].back.value
	}
	colours=colours.replace(/n/,'')
	if (colours == "bc") colours="cb"

 	
	order_split_price=0
	order_split_description=""
	if (document.forms['fastquote'].splits.value != null) {
		order_split_price=document.forms['fastquote'].splits.value * 18
		if (document.forms['fastquote'].splits.value > 0) {
			order_split_description=" with " + document.forms['fastquote'].splits.value + " Order Split"
			if (document.forms['fastquote'].splits.value > 1) order_split_description+="s"
		}
	}

	lineprice=parseInt(prices[colours][stockindex][quantityindex]) + order_split_price

	document.getElementById('tprice').innerHTML=lineprice

	linedescription=quantities[document.forms['fastquote'].quantity.value]+" x " + product_name_plural + " in " + colournames[colours] + " on "+ stocks[stockindex] +" Stock" + order_split_description

	document.getElementById('productname').innerHTML=linedescription

	message=escape("Hi, I&#39;m interested in  " +linedescription + " for " + lineprice+" &#43; GST")
	document.getElementById('enquire').innerHTML="<a href=\"/contact?message="+ message + "#form\"> <img src=\"/imgdir/continue-btn.jpg\" border=\"0\"></a>"
  }
