var productImages = [];
// Preloaded image. ID = 2635
productImages[2635] = new Image();
productImages[2635].src="/image/product/medium/lost-beach-disco-bling-fron.jpg";
productImages[2635].alt = "Disco Blind Pyramid Bikini by Lost Beach Swimwear";
// Preloaded image. ID = 2636
productImages[2636] = new Image();
productImages[2636].src="/image/product/medium/lost-beach-disco-bling-front1.jpg";
productImages[2636].alt = "Disco Blind Pyramid Bikini by Lost Beach Swimwear";
// Preloaded image. ID = 2637
productImages[2637] = new Image();
productImages[2637].src="/image/product/medium/lost-beach-disco-bling-front3.jpg";
productImages[2637].alt = "Disco Blind Pyramid Bikini by Lost Beach Swimwear";
// Preloaded image. ID = 2638
productImages[2638] = new Image();
productImages[2638].src="/image/product/medium/lost-beach-disco-bling-fashion2.jpg";
productImages[2638].alt = "Disco Blind Pyramid Bikini by Lost Beach Swimwear";
// Preloaded image. ID = 2639
productImages[2639] = new Image();
productImages[2639].src="/image/product/medium/lost-beach-disco-bling-behind.jpg";
productImages[2639].alt = "Disco Blind Pyramid Bikini by Lost Beach Swimwear";
// Preloaded image. ID = 2640
productImages[2640] = new Image();
productImages[2640].src="/image/product/medium/lost-beach-disco-bling-behind2.jpg";
productImages[2640].alt = "Disco Blind Pyramid Bikini by Lost Beach Swimwear";
// Preloaded image. ID = 1555
productImages[1555] = new Image();
productImages[1555].src="/image/product/medium/disco_bling_pyramid1.jpg";
productImages[1555].alt = "Disco Blind Pyramid Bikini by Lost Beach Swimwear";
var productData = [];
productData[2300] = [{1: 98}, {"price":'AU$169.95 ($157.41 USD?)', "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":'AU$169.95 ($157.41 USD?)', "stock":-1, "imageId":0} ];
productData[2301] = [{1: 2}, {"price":'AU$169.95 ($157.41 USD?)', "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":'AU$169.95 ($157.41 USD?)', "stock":-1, "imageId":0} ];
productData[2302] = [{1: 3}, {"price":'AU$169.95 ($157.41 USD?)', "exception":'FALSE', "isSpecial":'FALSE', "specialPrice":'AU$169.95 ($157.41 USD?)', "stock":-1, "imageId":0} ];
var attribSets = [1];
// 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";
}
}
}
// Display stock indicator
function displayStock()
{
// DON'T SWAP STOCK for Zakoda
return true;
// Get the selected variant.
variant = findVariant();
// Check if it is an exception. and display a custom message
if (variant["exception"]=="TRUE") { // See if it is on special.
stockString = "Not Available"
}
else if (variant["stock"] < 0) {
stockString = "Approximately 2 weeks";
}
else if (variant["stock"] == 0) {
stockString = 'Contact us for availability';
}
else if (variant["stock"] > 0) {
stockString = "IN STOCK. SHIPS WITHIN 1 - 3 DAYS";
}
document.getElementById("stock").innerHTML = stockString;
}
// 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 = "" + variant["price"] + "";
document.getElementById("specialPrice").innerHTML = variant["specialPrice"];
specialRowEnabled(true);
} // Just show the normal price.
else
{
document.getElementById("price").innerHTML = variant["price"];
specialRowEnabled(false);
}
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 = "Item Not Available";
submitButtonEnable(false);
specialRowEnabled(false);
}
}