var productImages = []; // Preloaded image. ID = 344 productImages[344] = new Image(); productImages[344].src="/image/product/medium/carlton_sofa.jpg"; productImages[344].alt = ""; // Preloaded image. ID = 345 productImages[345] = new Image(); productImages[345].src="/image/product/medium/carlton.jpg"; productImages[345].alt = ""; // Preloaded image. ID = 346 productImages[346] = new Image(); productImages[346].src="/image/product/medium/weave_colours-1.jpg"; productImages[346].alt = ""; // Preloaded image. ID = 347 productImages[347] = new Image(); productImages[347].src="/image/product/medium/textile_colours.jpg"; productImages[347].alt = ""; var productData = []; productData[1188] = [{3: 70, 1: 186, 2: 193}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1189] = [{3: 71, 1: 186, 2: 193}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1190] = [{3: 70, 1: 186, 2: 194}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1191] = [{3: 71, 1: 186, 2: 194}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1192] = [{3: 70, 1: 186, 2: 195}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1193] = [{3: 71, 1: 186, 2: 195}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1194] = [{3: 70, 1: 186, 2: 196}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1195] = [{3: 71, 1: 186, 2: 196}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1196] = [{3: 70, 1: 186, 2: 197}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1197] = [{3: 71, 1: 186, 2: 197}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1198] = [{3: 70, 1: 186, 2: 198}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1199] = [{3: 71, 1: 186, 2: 198}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1200] = [{3: 70, 1: 187, 2: 193}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1201] = [{3: 71, 1: 187, 2: 193}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1202] = [{3: 70, 1: 187, 2: 194}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1203] = [{3: 71, 1: 187, 2: 194}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1204] = [{3: 70, 1: 187, 2: 195}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1205] = [{3: 71, 1: 187, 2: 195}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1206] = [{3: 70, 1: 187, 2: 196}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1207] = [{3: 71, 1: 187, 2: 196}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1208] = [{3: 70, 1: 187, 2: 197}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1209] = [{3: 71, 1: 187, 2: 197}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1210] = [{3: 70, 1: 187, 2: 198}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1211] = [{3: 71, 1: 187, 2: 198}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1212] = [{3: 70, 1: 188, 2: 193}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1213] = [{3: 71, 1: 188, 2: 193}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1214] = [{3: 70, 1: 188, 2: 194}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1215] = [{3: 71, 1: 188, 2: 194}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1216] = [{3: 70, 1: 188, 2: 195}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1217] = [{3: 71, 1: 188, 2: 195}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1218] = [{3: 70, 1: 188, 2: 196}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1219] = [{3: 71, 1: 188, 2: 196}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1220] = [{3: 70, 1: 188, 2: 197}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1221] = [{3: 71, 1: 188, 2: 197}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1222] = [{3: 70, 1: 188, 2: 198}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1223] = [{3: 71, 1: 188, 2: 198}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1224] = [{3: 70, 1: 189, 2: 193}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1225] = [{3: 71, 1: 189, 2: 193}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1226] = [{3: 70, 1: 189, 2: 194}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1227] = [{3: 71, 1: 189, 2: 194}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1228] = [{3: 70, 1: 189, 2: 195}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1229] = [{3: 71, 1: 189, 2: 195}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1230] = [{3: 70, 1: 189, 2: 196}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1231] = [{3: 71, 1: 189, 2: 196}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1232] = [{3: 70, 1: 189, 2: 197}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1233] = [{3: 71, 1: 189, 2: 197}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1234] = [{3: 70, 1: 189, 2: 198}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1235] = [{3: 71, 1: 189, 2: 198}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1236] = [{3: 70, 1: 190, 2: 193}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1237] = [{3: 71, 1: 190, 2: 193}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1238] = [{3: 70, 1: 190, 2: 194}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1239] = [{3: 71, 1: 190, 2: 194}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1240] = [{3: 70, 1: 190, 2: 195}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1241] = [{3: 71, 1: 190, 2: 195}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1242] = [{3: 70, 1: 190, 2: 196}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1243] = [{3: 71, 1: 190, 2: 196}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1244] = [{3: 70, 1: 190, 2: 197}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1245] = [{3: 71, 1: 190, 2: 197}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; productData[1246] = [{3: 70, 1: 190, 2: 198}, {"price":1095.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1095.00, "stock":0, "imageId":0} ]; productData[1247] = [{3: 71, 1: 190, 2: 198}, {"price":1700.00, "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":1700.00, "stock":0, "imageId":0} ]; var attribSets = [3, 1, 2]; // Find the variant selected. function findVariant() { found = false; // Found flag. variantIndex = 0; // The index of the found variant element. // This just scans for a match and if found it sets the flags and breaks. // If one mismatch is detected it just breaks the loop. for (variant in productData) // Loop through the variant array, called 'productData'. { for (set in attribSets) // Now loop through the sets. { // Get a refference to a attribute set select box. attrib = document.getElementById("attributes"+attribSets[set]); // Check to see if the value of that attribute select box is in the productData attribute array. if (productData[variant][0][attribSets[set]]==attrib.value) { found = true; } else { found = false; break; } } if (found==true) { variantIndex = variant; break; } } if (variantIndex!=0) { var data = productData[variantIndex][1]; data["var_id"] = variantIndex; return data; } else { return false; } } // This enables and disables the submit button. function submitButtonEnable(enabled) { if(enabled==false) { document.getElementById("submitButton").style.display="none"; // document.getElementById("submitButton").disabled = true; } else { document.getElementById("submitButton").style.display="block"; // document.getElementById("submitButton").disabled = false; } } function specialRowEnabled(enable) { var browserName=navigator.appName; if (enable==false) { document.getElementById("specialRow").style.display="none"; } else { // Use block for IE because table-row doesn't work if (browserName=="Microsoft Internet Explorer") { document.getElementById("specialRow").style.display="block"; } else { document.getElementById("specialRow").style.display="table-row"; } } } // This is the function that gets called when the user changes the selection. function changeVariant() { // Get the selected variant. variant = findVariant(); // Sort out the stock //displayStock(); // Check if it is an exception. if (variant["exception"]=="FALSE") { // See if it is on special. if (variant["isSpecial"]=="TRUE") { // Display the special price with the old price with strike through font. document.getElementById("price").innerHTML = "AU$" + variant["price"].toFixed(2) + ""; document.getElementById("specialPrice").innerHTML = "AU$" + variant["specialPrice"].toFixed(2); specialRowEnabled(true); } // Just show the normal price. else { if(variant["price"] == 0) { document.getElementById("price").innerHTML = "POA"; specialRowEnabled(false); } else { document.getElementById("price").innerHTML = "AU$" + variant["price"].toFixed(2); specialRowEnabled(false); } } if (variant["imageId"]!=0) { swapImage(variant["imageId"]); } submitButtonEnable(true); // Enable the submit button. } else { // Variant must be an exception so display some text and disable the submit button. document.getElementById("price").innerHTML = "Product combination is not available"; submitButtonEnable(false); specialRowEnabled(false); } } function swapImage(image) { document.prodImageMain.src = productImages[image].src; }