var colorViewsPlus = new Object();
colorViewsPlus.b1 = new Array();
colorViewsPlus.b2 = new Array();
colorViewsPlus.b3 = new Array();
colorViewsPlus.b4 = null;
colorViewsPlus.b5;
colorViewsPlus.b6;
colorViewsPlus.a1 = function() {
    colorViewsPlus.b3 = new Array();
    if (colorViewsPlus.b2.length == 1) {
        var a = document.getElementById(colorViewsPlus.b2[0]);
        colorViewsPlus.a8(a)
    } else {
        if (colorViewsPlus.b2.length > 1) {
            colorViewsPlus.a2()
        }
    }
};
colorViewsPlus.a8 = function(a) {
    colorViewsPlus.a9(a);
    if (!window.attachEvent) {
        a.addEventListener("change",
        function() {
            colorViewsPlus.a10(a)
        },
        false)
    } else {
        a.attachEvent("onchange",
        function() {
            colorViewsPlus.a10(a)
        })
    }
};
colorViewsPlus.a9 = function(a) {
    var b = "";
    b += "<ul>";
    for (i = 0; i < colorViewsPlus.b1.length; i++) {
        b += "<li><img src=\"" + colorViewsPlus.b1[i][colorViewsPlus.b1[i].length - 2] + "\" alt=\"" + colorViewsPlus.b1[i][0] + "\" title=\"" + colorViewsPlus.b1[i][0] + "\" onclick=\"colorViewsPlus.x1(this, '" + colorViewsPlus.b6 + "', '" + a.id + "', '" + colorViewsPlus.b1[i][0] + "', " + "colorViewsPlus.b1[" + i + "][" + (colorViewsPlus.b1[i].length - 1) + "]);" + "\" onmouseover=\"this.style.cursor='pointer'; colorViewsPlus.x2('color-views-tooltip', '" + colorViewsPlus.b1[i][0] + "')\" onmouseout=\"colorViewsPlus.y2('color-views-tooltip')\" height=\"60\" /></li>"
    }
    b += "</ul>";
    document.getElementById("color-views").innerHTML = b;
    document.getElementById("more-views2").innerHTML = ""
};
colorViewsPlus.a2 = function() {
    for (i = 0; i < colorViewsPlus.b2.length; i++) {
        dropDown = document.getElementById(colorViewsPlus.b2[i]);
        if (i < colorViewsPlus.b2.length - 2) {
            colorViewsPlus.a3(dropDown)
        } else {
            if (i == colorViewsPlus.b2.length - 2) {
                colorViewsPlus.a4(dropDown)
            } else {
                colorViewsPlus.a5(dropDown)
            }
        }
    }
};
colorViewsPlus.a3 = function(a) {
    if (!window.attachEvent) {
        a.addEventListener("change",
        function() {
            document.getElementById(colorViewsPlus.b6).src = colorViewsPlus.b5;
            document.getElementById("color-views").innerHTML = "";
            document.getElementById("more-views2").innerHTML = ""
        },
        false)
    } else {
        a.attachEvent("onchange",
        function() {
            document.getElementById(colorViewsPlus.b6).src = colorViewsPlus.b5;
            document.getElementById("color-views").innerHTML = "";
            document.getElementById("more-views2").innerHTML = ""
        })
    }
};
colorViewsPlus.a4 = function(a) {
    if (!window.attachEvent) {
        a.addEventListener("change",
        function() {
            document.getElementById("color-views").innerHTML = "";
            document.getElementById("more-views2").innerHTML = "";
            document.getElementById(colorViewsPlus.b6).src = colorViewsPlus.b5;
            colorViewsPlus.a6(a)
        },
        false)
    } else {
        a.attachEvent("onchange",
        function() {
            document.getElementById("color-views").innerHTML = "";
            document.getElementById("more-views2").innerHTML = "";
            document.getElementById(colorViewsPlus.b6).src = colorViewsPlus.b5;
            colorViewsPlus.a6(a)
        })
    }
};
colorViewsPlus.a5 = function(a) {
    if (!window.attachEvent) {
        a.addEventListener("change",
        function() {
            colorViewsPlus.a7(a)
        },
        false)
    } else {
        a.attachEvent("onchange",
        function() {
            colorViewsPlus.a7(a)
        })
    }
};
colorViewsPlus.a6 = function(a) {
    colorViewsPlus.b3 = new Array();
    var b = a.selectedIndex;
    if (b == 0) {
        document.getElementById("color-views").innerHTML = "&nbsp;";
        document.getElementById("more-views2").innerHTML = "&nbsp;"
    } else {
        var c = new Array();
        for (i = 0; i < colorViewsPlus.b2.length - 1; i++) {
            var b = document.getElementById(colorViewsPlus.b2[i]).selectedIndex;
            c[i] = document.getElementById(colorViewsPlus.b2[i]).options[b].text
        }
        var d = 0;
        for (i = 0; i < colorViewsPlus.b2.length; i++) {
            if (a.id == colorViewsPlus.b2[i]) {
                d = i;
                break
            }
        }
        var e = d + 1;
        var f = document.getElementById(colorViewsPlus.b2[colorViewsPlus.b2.length - 1]);
        var i = 0;
        colorViewsPlus.b3 = new Array();
        for (j = 0; j < colorViewsPlus.b1.length; j++) {
            var g = colorViewsPlus.b1[j];
            var h = false;
            var l;
            var m;
            var n;
            for (k = 0; k < c.length; k++) {
                l = c[k];
                m = l.lastIndexOf(" (");
                if (m == -1) {
                    m = l.lastIndexOf(" +");
                    if (m == -1) {
                        m = l.lastIndexOf(" -")
                    }
                }
                if (m == -1) {
                    n = l
                } else {
                    n = l.substring(0, m)
                }
                if (g[k] != n) {
                    h = false;
                    break
                }
                h = true
            }
            if (h == true) {
                colorViewsPlus.b3[i] = new Array();
                colorViewsPlus.b3[i] = g;
                i++
            }
        }
        var o = "";
        o += "<ul>";
        for (i = 0; i < colorViewsPlus.b3.length; i++) {
            o += "<li><img src=\"" + colorViewsPlus.b3[i][colorViewsPlus.b3[i].length - 2] + "\" alt=\"" + colorViewsPlus.b3[i][e] + "\" title=\"" + colorViewsPlus.b3[i][e] + "\" onclick=\"colorViewsPlus.x1(this, '" + colorViewsPlus.b6 + "', '" + f.id + "', '" + colorViewsPlus.b3[i][e] + "', " + "colorViewsPlus.b3[" + i + "][" + (colorViewsPlus.b3[i].length - 1) + "]);" + "\" onmouseover=\"this.style.cursor='pointer'; colorViewsPlus.x2('color-views-tooltip', '" + colorViewsPlus.b3[i][e] + "')\" onmouseout=\"colorViewsPlus.y2('color-views-tooltip')\" height=\"60\"  /></li>"
        }
        o += "</ul>";
        document.getElementById("color-views").innerHTML = o
    }
};
colorViewsPlus.a7 = function(a) {
    if (a.selectedIndex == 0) {
        document.getElementById(colorViewsPlus.b6).src = colorViewsPlus.b5;
        document.getElementById("more-views2").innerHTML = "";
        colorViewsPlus.x5(a, a.selectedIndex)
    } else {
        var myNewSelect = document.createElement("select");
        for (i = 0; i < a.length; i++)
        {
          if (!a.options[i].disabled)
          {
            myNewSelect.appendChild(a.options[i].cloneNode(true));
          }
        }
        for (i2 = 0; i2 < myNewSelect.length; i2++)
        {
          if (myNewSelect.options[i2].value == a.options[a.selectedIndex].value)
          {
            myNewSelect.selectedIndex = myNewSelect.options[i2].index;
          }
        }
        var i = myNewSelect.selectedIndex - 1;
        var l = new Array();
        l = colorViewsPlus.b3[myNewSelect.selectedIndex - 1];
        var j = l.length;
        var k = j - 1;
        var b = colorViewsPlus.b3[i][k][0];
        document.getElementById(colorViewsPlus.b6).src = b;
        var c = "";
        var d = colorViewsPlus.b3[myNewSelect.selectedIndex - 1][colorViewsPlus.b3[myNewSelect.selectedIndex - 1].length - 1];
        for (i = 1; i < d.length; i++) {
            c += "<div class=\"simple-img\" <li><img src=\"" + d[i] + "\" width=\"100\" onclick=\"colorViewsPlus.y4('" + d[i] + "', '" + colorViewsPlus.b6 + "')\" onmouseover=\"this.style.cursor='pointer'\" /></li></div>"
        }
        document.getElementById("more-views2").innerHTML = c;
        colorViewsPlus.x5(myNewSelect, myNewSelect.selectedIndex)
    }
};
colorViewsPlus.x1 = function(e, a, b, c, d) {
    if (colorViewsPlus.b4 != null) {
        colorViewsPlus.b4.className = ""
    }
    colorViewsPlus.b4 = e;
    colorViewsPlus.b4.className = "selected";
    document.getElementById(a).src = d[0];
    var f = "";
    for (i = 1; i < d.length; i++) {
        f += "<div class=\"simple-img\" <li><img src=\"" + d[i] + "\" onclick=\"colorViewsPlus.y4('" + d[i] + "', '" + a + "')\" onmouseover=\"this.style.cursor='pointer'\" /></li></div>"
    }
    document.getElementById("more-views2").innerHTML = f;
    this.z1(b, c)
};
colorViewsPlus.y4 = function(a, b) {
    document.getElementById(b).src = a
};
colorViewsPlus.z1 = function(a, b) {
    var c = 0;
    var d = document.getElementById(a);
    var e;
    var f;
    var g;
    for (i = 0; i < d.options.length; i++) {
        e = d.options[i].text;
        f = e.lastIndexOf(" (");
        if (f == -1) {
            f = e.lastIndexOf(" +");
            if (f == -1) {
                f = e.lastIndexOf(" -")
            }
        }
        if (f == -1) {
            g = e
        } else {
            g = e.substring(0, f)
        }
        if (g == b) {
            c = i;
            break
        }
    }
    document.getElementById(a).selectedIndex = c;
    spConfig.configureElement($(a))
};
colorViewsPlus.x2 = function(a, b) {
    document.getElementById(a).innerHTML = b
};
colorViewsPlus.y2 = function(a) {
    document.getElementById(a).innerHTML = "&nbsp;"
};
colorViewsPlus.x5 = function(a, b) {
    if (colorViewsPlus.b4 != null) {
        colorViewsPlus.b4.className = ""
    }
    if (b != 0) {
        colorViewsPlus.b4 = document.getElementById("color-views").getElementsByTagName("img")[b - 1];
        colorViewsPlus.b4.className = "selected"
    }
};
colorViewsPlus.a10 = function(a) {
    if (colorViewsPlus.b4 != null) {
        colorViewsPlus.b4.className = ""
    }
    var myNewSelect = document.createElement("select");
    for (i = 0; i < a.length; i++)
    {
      if (!a.options[i].disabled)
      {
        myNewSelect.appendChild(a.options[i].cloneNode(true));
      }
    }
    for (i2 = 0; i2 < myNewSelect.length; i2++)
    {
      if (myNewSelect.options[i2].value == a.options[a.selectedIndex].value)
      {
        myNewSelect.selectedIndex = myNewSelect.options[i2].index;
      }
    }
    var b = myNewSelect.selectedIndex;
    if (b == 0) {
        colorViewsPlus.b4 = null;
        document.getElementById(colorViewsPlus.b6).src = colorViewsPlus.b5;
        document.getElementById("more-views2").innerHTML = ""
    } else {
        if (b > 0) {
            colorViewsPlus.b4 = document.getElementById("color-views").getElementsByTagName("img")[b - 1];
            colorViewsPlus.b4.className = "selected";
            document.getElementById(colorViewsPlus.b6).src = colorViewsPlus.b1[b - 1][2][0];
            var c = "";
            var d = colorViewsPlus.b1[myNewSelect.selectedIndex - 1][colorViewsPlus.b1[myNewSelect.selectedIndex - 1].length - 1];
            for (i = 1; i < d.length; i++) {
                c += "<div class=\"simple-img\" <li><img src=\"" + d[i] + "\" width=\"100\" onclick=\"colorViewsPlus.y4('" + d[i] + "', '" + colorViewsPlus.b6 + "')\" onmouseover=\"this.style.cursor='pointer'\" /></li></div>"
            }
            document.getElementById("more-views2").innerHTML = c
        }
    }
};
