﻿/* Copyright Designer-Websites.co.uk 2008 */
function TogglePreview(shape, colour, edgeColour, image, fringeColour, shapeName, baseUrl) {
var shapeIndex;
var colourIndex;
var edgeColourIndex;
var fringeColourIndex;

if (this.document.getElementById(shape)) {
shapeIndex = this.document.getElementById(shape).selectedIndex;
}

colourIndex = this.document.getElementById(colour).selectedIndex;

if (this.document.getElementById(edgeColour)) {
edgeColourIndex = this.document.getElementById(edgeColour).selectedIndex;
}

if (this.document.getElementById(fringeColour)) {
fringeColourIndex = this.document.getElementById(fringeColour).selectedIndex;
}

if (shapeName != "ArmBands" && shapeName != "Sashes"){
  shapeName =  this.returnShape(this.document.getElementById(shape).options[shapeIndex].text);
}

baseUrl = baseUrl + '?Shape=' + shapeName + '&Colour=' + this.document.getElementById(colour).options[colourIndex].text;

if (this.document.getElementById(edgeColour)) {
baseUrl = baseUrl + '&EdgeColour=' + this.document.getElementById(edgeColour).options[edgeColourIndex].text;
}

if (this.document.getElementById(fringeColour)) {
baseUrl = baseUrl + '&FringeColour=' + this.document.getElementById(fringeColour).options[fringeColourIndex].text;
}

this.document.getElementById(image).src = baseUrl;

}

function returnShape(selectedItem)
{
   selectedItem = selectedItem.split(" ");
   return selectedItem [0];
}

function GetPrice() {
    UseCallback();
}

function DisplayNewPrice(uiUnitPrice, context) {

   this.alert("done");

}

//<![CDATA[
  function load() {
  if (GBrowserIsCompatible()) {
  var map = new GMap2(document.getElementById("map"));
  map.setCenter(new GLatLng(51.52, -3.20), 15);
  map.openInfoWindowHtml(map.getCenter(), "Golden Finishes<br />4 Malvern Drive<br />Cardiff<br />CF14 5DR");
    }
}
//]]>