var B = "block";
var N = "none";
var T = "true";
var F = "false";
var rba = "searchResultButonApplied";
var rbaa = "searchResultButonAppliedActive";
var rb = "searchResultButon";
var Prototype = {
    Version: "1.4.0",
    ScriptFragment: "(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)",
    emptyFunction: function() { },
    K: function(b) {
        return b
    }
};
var Class = {
    create: function() {
        return function() {
            this.initialize.apply(this, arguments)
        }
    }
};
var Abstract = new Object();
Object.extend = function(d, c) {
    for (property in c) {
        d[property] = c[property]
    }
    return d
};
Object.inspect = function(d) {
    try {
        if (d == undefined) {
            return "undefined"
        }
        if (d == null) {
            return "null"
        }
        return d.inspect ? d.inspect() : d.toString()
    } catch (c) {
        if (c instanceof RangeError) {
            return "..."
        }
        throw c
    }
};
Function.prototype.bind = function() {
    var e = this,
    f = $A(arguments),
    d = f.shift();
    return function() {
        return e.apply(d, f.concat($A(arguments)))
    }
};
Function.prototype.bindAsEventListener = function(c) {
    var d = this;
    return function(a) {
        return d.call(c, a || window.event)
    }
};
Object.extend(Number.prototype, {
    toColorPart: function() {
        var b = this.toString(16);
        if (this < 16) {
            return "0" + b
        }
        return b
    },
    succ: function() {
        return this + 1
    },
    times: function(b) {
        $R(0, this, true).each(b);
        return this
    }
});
var Try = {
    these: function() {
        var h;
        for (var e = 0; e < arguments.length; e++) {
            var f = arguments[e];
            try {
                h = f();
                break
            } catch (g) { }
        }
        return h
    }
};
var PeriodicalExecuter = Class.create();
PeriodicalExecuter.prototype = {
    initialize: function(c, d) {
        this.callback = c;
        this.frequency = d;
        this.currentlyExecuting = false;
        this.registerCallback()
    },
    registerCallback: function() {
        setInterval(this.onTimerEvent.bind(this), this.frequency * 1000)
    },
    onTimerEvent: function() {
        if (!this.currentlyExecuting) {
            try {
                this.currentlyExecuting = true;
                this.callback()
            } finally {
                this.currentlyExecuting = false
            }
        }
    }
};
function $() {
    var f = new Array();
    for (var d = 0; d < arguments.length; d++) {
        var e = arguments[d];
        if (typeof e == "string") {
            e = ge(e)
        }
        if (arguments.length == 1) {
            return e
        }
        f.push(e)
    }
    return f
}
Object.extend(String.prototype, {
    stripTags: function() {
        return this.replace(/<\/?[^>]+>/gi, "")
    },
    stripScripts: function() {
        return this.replace(new RegExp(Prototype.ScriptFragment, "img"), "")
    },
    extractScripts: function() {
        var c = new RegExp(Prototype.ScriptFragment, "img");
        var d = new RegExp(Prototype.ScriptFragment, "im");
        return (this.match(c) || []).map(function(a) {
            return (a.match(d) || ["", ""])[1]
        })
    },
    evalScripts: function() {
        return this.extractScripts().map(eval)
    },
    escapeHTML: function() {
        var c = document.createElement("div");
        var d = document.createTextNode(this);
        c.appendChild(d);
        return c.innerHTML
    },
    unescapeHTML: function() {
        var b = document.createElement("div");
        b.innerHTML = this.stripTags();
        return b.childNodes[0] ? b.childNodes[0].nodeValue : ""
    },
    toQueryParams: function() {
        var b = this.match(/^\??(.*)$/)[1].split("&");
        return b.inject({},
        function(e, a) {
            var f = a.split("=");
            e[f[0]] = f[1];
            return e
        })
    },
    toArray: function() {
        return this.split("")
    },
    camelize: function() {
        var l = this.split("-");
        if (l.length == 1) {
            return l[0]
        }
        var f = this.indexOf("-") == 0 ? l[0].charAt(0).toUpperCase() + l[0].substring(1) : l[0];
        for (var m = 1, g = l.length; m < g; m++) {
            var h = l[m];
            f += h.charAt(0).toUpperCase() + h.substring(1)
        }
        return f
    },
    inspect: function() {
        return "'" + this.replace("\\", "\\\\").replace("'", "\\'") + "'"
    }
});
String.prototype.parseQuery = String.prototype.toQueryParams;
var $break = new Object();
var $continue = new Object();
var Enumerable = {
    each: function(d) {
        var e = 0;
        try {
            this._each(function(b) {
                try {
                    d(b, e++)
                } catch (a) {
                    if (a != $continue) {
                        throw a
                    }
                }
            })
        } catch (f) {
            if (f != $break) {
                throw f
            }
        }
    },
    all: function(c) {
        var d = true;
        this.each(function(a, b) {
            d = d && !!(c || Prototype.K)(a, b);
            if (!d) {
                throw $break
            }
        });
        return d
    },
    any: function(c) {
        var d = true;
        this.each(function(a, b) {
            if (d = !!(c || Prototype.K)(a, b)) {
                throw $break
            }
        });
        return d
    },
    collect: function(c) {
        var d = [];
        this.each(function(a, b) {
            d.push(c(a, b))
        });
        return d
    },
    detect: function(c) {
        var d;
        this.each(function(a, b) {
            if (c(a, b)) {
                d = a;
                throw $break
            }
        });
        return d
    },
    findAll: function(c) {
        var d = [];
        this.each(function(a, b) {
            if (c(a, b)) {
                d.push(a)
            }
        });
        return d
    },
    grep: function(f, d) {
        var e = [];
        this.each(function(a, b) {
            var c = a.toString();
            if (c.match(f)) {
                e.push((d || Prototype.K)(a, b))
            }
        });
        return e
    },
    include: function(d) {
        var c = false;
        this.each(function(a) {
            if (a == d) {
                c = true;
                throw $break
            }
        });
        return c
    },
    inject: function(d, c) {
        this.each(function(a, b) {
            d = c(d, a, b)
        });
        return d
    },
    invoke: function(c) {
        var d = $A(arguments).slice(1);
        return this.collect(function(a) {
            return a[c].apply(a, d)
        })
    },
    max: function(c) {
        var d;
        this.each(function(a, b) {
            a = (c || Prototype.K)(a, b);
            if (a >= (d || a)) {
                d = a
            }
        });
        return d
    },
    min: function(c) {
        var d;
        this.each(function(a, b) {
            a = (c || Prototype.K)(a, b);
            if (a <= (d || a)) {
                d = a
            }
        });
        return d
    },
    partition: function(f) {
        var d = [],
        e = [];
        this.each(function(a, b) {
            ((f || Prototype.K)(a, b) ? d : e).push(a)
        });
        return [d, e]
    },
    pluck: function(c) {
        var d = [];
        this.each(function(a, b) {
            d.push(a[c])
        });
        return d
    },
    reject: function(c) {
        var d = [];
        this.each(function(a, b) {
            if (!c(a, b)) {
                d.push(a)
            }
        });
        return d
    },
    sortBy: function(b) {
        return this.collect(function(d, a) {
            return {
                value: d,
                criteria: b(d, a)
            }
        }).sort(function(a, g) {
            var h = a.criteria,
            l = g.criteria;
            return h < l ? -1 : h > l ? 1 : 0
        }).pluck("value")
    },
    toArray: function() {
        return this.collect(Prototype.K)
    },
    zip: function() {
        var d = Prototype.K,
        e = $A(arguments);
        if (typeof e.last() == "function") {
            d = e.pop()
        }
        var f = [this].concat(e).map($A);
        return this.map(function(a, b) {
            d(a = f.pluck(b));
            return a
        })
    },
    inspect: function() {
        return "#<Enumerable:" + this.toArray().inspect() + ">"
    }
};
Object.extend(Enumerable, {
    map: Enumerable.collect,
    find: Enumerable.detect,
    select: Enumerable.findAll,
    member: Enumerable.include,
    entries: Enumerable.toArray
});
var $A = Array.from = function(f) {
    if (!f) {
        return []
    }
    if (f.toArray) {
        return f.toArray()
    } else {
        var d = [];
        for (var e = 0; e < f.length; e++) {
            d.push(f[e])
        }
        return d
    }
};
Object.extend(Array.prototype, Enumerable);
Array.prototype._reverse = Array.prototype.reverse;
Object.extend(Array.prototype, {
    _each: function(c) {
        for (var d = 0; d < this.length; d++) {
            c(this[d])
        }
    },
    clear: function() {
        this.length = 0;
        return this
    },
    first: function() {
        return this[0]
    },
    last: function() {
        return this[this.length - 1]
    },
    compact: function() {
        return this.select(function(b) {
            return b != undefined || b != null
        })
    },
    flatten: function() {
        return this.inject([],
        function(c, d) {
            return c.concat(d.constructor == Array ? d.flatten() : [d])
        })
    },
    without: function() {
        var b = $A(arguments);
        return this.select(function(a) {
            return !b.include(a)
        })
    },
    indexOf: function(d) {
        for (var c = 0; c < this.length; c++) {
            if (this[c] == d) {
                return c
            }
        }
        return -1
    },
    reverse: function(b) {
        return (b !== false ? this : this.toArray())._reverse()
    },
    shift: function() {
        var d = this[0];
        for (var c = 0; c < this.length - 1; c++) {
            this[c] = this[c + 1]
        }
        this.length--;
        return d
    },
    inspect: function() {
        return "[" + this.map(Object.inspect).join(", ") + "]"
    }
});
var Hash = {
    _each: function(e) {
        for (key in this) {
            var d = this[key];
            if (typeof d == "function") {
                continue
            }
            var f = [key, d];
            f.key = key;
            f.value = d;
            e(f)
        }
    },
    keys: function() {
        return this.pluck("key")
    },
    values: function() {
        return this.pluck("value")
    },
    merge: function(b) {
        return $H(b).inject($H(this),
        function(a, d) {
            a[d.key] = d.value;
            return a
        })
    },
    toQueryString: function() {
        return this.map(function(b) {
            return b.map(encodeURIComponent).join("=")
        }).join("&")
    },
    inspect: function() {
        return "#<Hash:{" + this.map(function(b) {
            return b.map(Object.inspect).join(": ")
        }).join(", ") + "}>"
    }
};
function $H(d) {
    var c = Object.extend({},
    d || {});
    Object.extend(c, Enumerable);
    Object.extend(c, Hash);
    return c
}
ObjectRange = Class.create();
Object.extend(ObjectRange.prototype, Enumerable);
Object.extend(ObjectRange.prototype, {
    initialize: function(f, e, d) {
        this.start = f;
        this.end = e;
        this.exclusive = d
    },
    _each: function(d) {
        var c = this.start;
        do {
            d(c);
            c = c.succ()
        }
        while (this.include(c))
    },
    include: function(b) {
        if (b < this.start) {
            return false
        }
        if (this.exclusive) {
            return b < this.end
        }
        return b <= this.end
    }
});
var $R = function(f, e, d) {
    return new ObjectRange(f, e, d)
};
var Ajax = {
    getTransport: function() {
        return Try.these(function() {
            return new ActiveXObject("Msxml2.XMLHTTP")
        },
        function() {
            return new ActiveXObject("Microsoft.XMLHTTP")
        },
        function() {
            return new XMLHttpRequest()
        }) || false
    },
    activeRequestCount: 0
};
Ajax.Responders = {
    responders: [],
    _each: function(b) {
        this.responders._each(b)
    },
    register: function(b) {
        if (!this.include(b)) {
            this.responders.push(b)
        }
    },
    unregister: function(b) {
        this.responders = this.responders.without(b)
    },
    dispatch: function(g, e, h, f) {
        this.each(function(b) {
            if (b[g] && typeof b[g] == "function") {
                try {
                    b[g].apply(b, [e, h, f])
                } catch (a) { }
            }
        })
    }
};
Object.extend(Ajax.Responders, Enumerable);
Ajax.Responders.register({
    onCreate: function() {
        Ajax.activeRequestCount++
    },
    onComplete: function() {
        Ajax.activeRequestCount--
    }
});
Ajax.Base = function() { };
Ajax.Base.prototype = {
    setOptions: function(b) {
        this.options = {
            method: "post",
            asynchronous: true,
            parameters: ""
        };
        Object.extend(this.options, b || {})
    },
    responseIsSuccess: function() {
        return this.transport.status == undefined || this.transport.status == 0 || (this.transport.status >= 200 && this.transport.status < 300)
    },
    responseIsFailure: function() {
        return !this.responseIsSuccess()
    }
};
Ajax.Request = Class.create();
Ajax.Request.Events = ["Uninitialized", "Loading", "Loaded", "Interactive", "Complete"];
Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
    initialize: function(c, d) {
        this.transport = Ajax.getTransport();
        this.setOptions(d);
        this.request(c)
    },
    request: function(e) {
        var h = this.options.parameters || "";
        if (h.length > 0) {
            h += "&_="
        }
        try {
            this.url = e;
            if (this.options.method == "get" && h.length > 0) {
                this.url += (this.url.match(/\?/) ? "&" : "?") + h
            }
            Ajax.Responders.dispatch("onCreate", this, this.transport);
            this.transport.open(this.options.method, this.url, this.options.asynchronous);
            if (this.options.asynchronous) {
                this.transport.onreadystatechange = this.onStateChange.bind(this);
                setTimeout((function() {
                    this.respondToReadyState(1)
                }).bind(this), 10)
            }
            this.setRequestHeaders();
            var f = this.options.postBody ? this.options.postBody : h;
            this.transport.send(this.options.method == "post" ? f : null)
        } catch (g) {
            this.dispatchException(g)
        }
    },
    setRequestHeaders: function() {
        var c = ["X-Requested-With", "XMLHttpRequest", "X-Prototype-Version", Prototype.Version];
        if (this.options.method == "post") {
            c.push("Content-type", "application/x-www-form-urlencoded");
            if (this.transport.overrideMimeType) {
                c.push("Connection", "close")
            }
        }
        if (this.options.requestHeaders) {
            c.push.apply(c, this.options.requestHeaders)
        }
        for (var d = 0; d < c.length; d += 2) {
            this.transport.setRequestHeader(c[d], c[d + 1])
        }
    },
    onStateChange: function() {
        var b = this.transport.readyState;
        if (b != 1) {
            this.respondToReadyState(this.transport.readyState)
        }
    },
    header: function(d) {
        try {
            return this.transport.getResponseHeader(d)
        } catch (c) { }
    },
    evalJSON: function() {
        try {
            return eval(this.header("X-JSON"))
        } catch (e) { }
    },
    evalResponse: function() {
        try {
            return eval(this.transport.responseText)
        } catch (e) {
            this.dispatchException(e)
        }
    },
    respondToReadyState: function(g) {
        var m = Ajax.Request.Events[g];
        var h = this.transport,
        e = this.evalJSON();
        if (m == "Complete") {
            try {
                (this.options["on" + this.transport.status] || this.options["on" + (this.responseIsSuccess() ? "Success" : "Failure")] || Prototype.emptyFunction)(h, e)
            } catch (l) {
                this.dispatchException(l)
            }
            if ((this.header("Content-type") || "").match(/^text\/javascript/i)) {
                this.evalResponse()
            }
        }
        try {
            (this.options["on" + m] || Prototype.emptyFunction)(h, e);
            Ajax.Responders.dispatch("on" + m, this, h, e)
        } catch (l) {
            this.dispatchException(l)
        }
        if (m == "Complete") {
            this.transport.onreadystatechange = Prototype.emptyFunction
        }
    },
    dispatchException: function(b) {
        (this.options.onException || Prototype.emptyFunction)(this, b);
        Ajax.Responders.dispatch("onException", this, b)
    }
});
Ajax.Updater = Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
    initialize: function(f, h, e) {
        this.containers = {
            success: f.success ? $(f.success) : $(f),
            failure: f.failure ? $(f.failure) : (f.success ? null : $(f))
        };
        this.transport = Ajax.getTransport();
        this.setOptions(e);
        var g = this.options.onComplete || Prototype.emptyFunction;
        this.options.onComplete = (function(a, b) {
            this.updateContent();
            g(a, b)
        }).bind(this);
        this.request(h)
    },
    updateContent: function() {
        var c = this.responseIsSuccess() ? this.containers.success : this.containers.failure;
        var d = this.transport.responseText;
        if (!this.options.evalScripts) {
            d = d.stripScripts()
        }
        if (c) {
            if (this.options.insertion) {
                new this.options.insertion(c, d)
            } else {
                Element.update(c, d)
            }
        }
        if (this.responseIsSuccess()) {
            if (this.onComplete) {
                setTimeout(this.onComplete.bind(this), 10)
            }
        }
    }
});
Ajax.PeriodicalUpdater = Class.create();
Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
    initialize: function(e, f, d) {
        this.setOptions(d);
        this.onComplete = this.options.onComplete;
        this.frequency = (this.options.frequency || 2);
        this.decay = (this.options.decay || 1);
        this.updater = {};
        this.container = e;
        this.url = f;
        this.start()
    },
    start: function() {
        this.options.onComplete = this.updateComplete.bind(this);
        this.onTimerEvent()
    },
    stop: function() {
        this.updater.onComplete = undefined;
        clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments)
    },
    updateComplete: function(b) {
        if (this.options.decay) {
            this.decay = (b.responseText == this.lastText ? this.decay * this.options.decay : 1);
            this.lastText = b.responseText
        }
        this.timer = setTimeout(this.onTimerEvent.bind(this), this.decay * this.frequency * 1000)
    },
    onTimerEvent: function() {
        this.updater = new Ajax.Updater(this.container, this.url, this.options)
    }
});
document.getElementsByClassName = function(f, e) {
    var d = ($(e) || document.body).getElementsByTagName("*");
    return $A(d).inject([],
    function(b, a) {
        if (a.className.match(new RegExp("(^|\\s)" + f + "(\\s|$)"))) {
            b.push(a)
        }
        return b
    })
};
if (!window.Element) {
    var Element = new Object()
}
Object.extend(Element, {
    visible: function(b) {
        return $(b).style.display != N
    },
    toggle: function() {
        for (var c = 0; c < arguments.length; c++) {
            var d = $(arguments[c]);
            Element[Element.visible(d) ? "hide" : "show"](d)
        }
    },
    hide: function() {
        for (var c = 0; c < arguments.length; c++) {
            var d = $(arguments[c]);
            d.style.display = N
        }
    },
    show: function() {
        for (var c = 0; c < arguments.length; c++) {
            var d = $(arguments[c]);
            d.style.display = ""
        }
    },
    remove: function(b) {
        b = $(b);
        b.parentNode.removeChild(b)
    },
    update: function(c, d) {
        $(c).innerHTML = d.stripScripts();
        setTimeout(function() {
            d.evalScripts()
        },
        10)
    },
    getHeight: function(b) {
        b = $(b);
        return b.offsetHeight
    },
    classNames: function(b) {
        return new Element.ClassNames(b)
    },
    hasClassName: function(d, c) {
        if (!(d = $(d))) {
            return
        }
        return Element.classNames(d).include(c)
    },
    addClassName: function(d, c) {
        if (!(d = $(d))) {
            return
        }
        return Element.classNames(d).add(c)
    },
    removeClassName: function(d, c) {
        if (!(d = $(d))) {
            return
        }
        return Element.classNames(d).remove(c)
    },
    cleanWhitespace: function(d) {
        d = $(d);
        for (var e = 0; e < d.childNodes.length; e++) {
            var f = d.childNodes[e];
            if (f.nodeType == 3 && !/\S/.test(f.nodeValue)) {
                Element.remove(f)
            }
        }
    },
    empty: function(b) {
        return $(b).innerHTML.match(/^\s*$/)
    },
    scrollTo: function(d) {
        d = $(d);
        var e = d.x ? d.x : d.offsetLeft,
        f = d.y ? d.y : d.offsetTop;
        window.scrollTo(e, f)
    },
    getStyle: function(e, h) {
        e = $(e);
        var g = e.style[h.camelize()];
        if (!g) {
            if (document.defaultView && document.defaultView.getComputedStyle) {
                var f = document.defaultView.getComputedStyle(e, null);
                g = f ? f.getPropertyValue(h) : null
            } else {
                if (e.currentStyle) {
                    g = e.currentStyle[h.camelize()]
                }
            }
        }
        if (window.opera && ["left", "top", "right", "bottom"].include(h)) {
            if (Element.getStyle(e, "position") == "static") {
                g = "auto"
            }
        }
        return g == "auto" ? null : g
    },
    setStyle: function(d, c) {
        d = $(d);
        for (name in c) {
            d.style[name.camelize()] = c[name]
        }
    },
    getDimensions: function(g) {
        g = $(g);
        if (Element.getStyle(g, "display") != N) {
            return {
                width: g.offsetWidth,
                height: g.offsetHeight
            }
        }
        var h = g.style;
        var m = h.visibility;
        var o = h.position;
        h.visibility = "hidden";
        h.position = "absolute";
        h.display = "";
        var l = g.clientWidth;
        var n = g.clientHeight;
        h.display = N;
        h.position = o;
        h.visibility = m;
        return {
            width: l,
            height: n
        }
    },
    makePositioned: function(d) {
        d = $(d);
        var c = Element.getStyle(d, "position");
        if (c == "static" || !c) {
            d._madePositioned = true;
            d.style.position = "relative";
            if (window.opera) {
                d.style.top = 0;
                d.style.left = 0
            }
        }
    },
    undoPositioned: function(b) {
        b = $(b);
        if (b._madePositioned) {
            b._madePositioned = undefined;
            b.style.position = b.style.top = b.style.left = b.style.bottom = b.style.right = ""
        }
    },
    makeClipping: function(b) {
        b = $(b);
        if (b._overflow) {
            return
        }
        b._overflow = b.style.overflow;
        if ((Element.getStyle(b, "overflow") || "visible") != "hidden") {
            b.style.overflow = "hidden"
        }
    },
    undoClipping: function(b) {
        b = $(b);
        if (b._overflow) {
            return
        }
        b.style.overflow = b._overflow;
        b._overflow = undefined
    }
});
var Toggle = new Object();
Toggle.display = Element.toggle;
Abstract.Insertion = function(b) {
    this.adjacency = b
};
Abstract.Insertion.prototype = {
    initialize: function(e, d) {
        this.element = $(e);
        this.content = d.stripScripts();
        if (this.adjacency && this.element.insertAdjacentHTML) {
            try {
                this.element.insertAdjacentHTML(this.adjacency, this.content)
            } catch (f) {
                if (this.element.tagName.toLowerCase() == "tbody") {
                    this.insertContent(this.contentFromAnonymousTable())
                } else {
                    throw f
                }
            }
        } else {
            this.range = this.element.ownerDocument.createRange();
            if (this.initializeRange) {
                this.initializeRange()
            }
            this.insertContent([this.range.createContextualFragment(this.content)])
        }
        setTimeout(function() {
            d.evalScripts()
        },
        10)
    },
    contentFromAnonymousTable: function() {
        var b = document.createElement("div");
        b.innerHTML = "<table><tbody>" + this.content + "</tbody></table>";
        return $A(b.childNodes[0].childNodes[0].childNodes)
    }
};
var Insertion = new Object();
Insertion.Before = Class.create();
Insertion.Before.prototype = Object.extend(new Abstract.Insertion("beforeBegin"), {
    initializeRange: function() {
        this.range.setStartBefore(this.element)
    },
    insertContent: function(b) {
        b.each((function(a) {
            this.element.parentNode.insertBefore(a, this.element)
        }).bind(this))
    }
});
Insertion.Top = Class.create();
Insertion.Top.prototype = Object.extend(new Abstract.Insertion("afterBegin"), {
    initializeRange: function() {
        this.range.selectNodeContents(this.element);
        this.range.collapse(true)
    },
    insertContent: function(b) {
        b.reverse(false).each((function(a) {
            this.element.insertBefore(a, this.element.firstChild)
        }).bind(this))
    }
});
Insertion.Bottom = Class.create();
Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion("beforeEnd"), {
    initializeRange: function() {
        this.range.selectNodeContents(this.element);
        this.range.collapse(this.element)
    },
    insertContent: function(b) {
        b.each((function(a) {
            this.element.appendChild(a)
        }).bind(this))
    }
});
Insertion.After = Class.create();
Insertion.After.prototype = Object.extend(new Abstract.Insertion("afterEnd"), {
    initializeRange: function() {
        this.range.setStartAfter(this.element)
    },
    insertContent: function(b) {
        b.each((function(a) {
            this.element.parentNode.insertBefore(a, this.element.nextSibling)
        }).bind(this))
    }
});
Element.ClassNames = Class.create();
Element.ClassNames.prototype = {
    initialize: function(b) {
        this.element = $(b)
    },
    _each: function(b) {
        this.element.className.split(/\s+/).select(function(a) {
            return a.length > 0
        })._each(b)
    },
    set: function(b) {
        this.element.className = b
    },
    add: function(b) {
        if (this.include(b)) {
            return
        }
        this.set(this.toArray().concat(b).join(" "))
    },
    remove: function(b) {
        if (!this.include(b)) {
            return
        }
        this.set(this.select(function(a) {
            return a != b
        }).join(" "))
    },
    toString: function() {
        return this.toArray().join(" ")
    }
};
Object.extend(Element.ClassNames.prototype, Enumerable);
var Field = {
    clear: function() {
        for (var b = 0; b < arguments.length; b++) {
            $(arguments[b]).value = ""
        }
    },
    focus: function(b) {
        $(b).focus()
    },
    present: function() {
        for (var b = 0; b < arguments.length; b++) {
            if ($(arguments[b]).value == "") {
                return false
            }
        }
        return true
    },
    select: function(b) {
        $(b).select()
    },
    activate: function(b) {
        b = $(b);
        b.focus();
        if (b.select) {
            b.select()
        }
    }
};
var Form = {
    serialize: function(l) {
        var h = Form.getElements($(l));
        var m = new Array();
        for (var f = 0; f < h.length; f++) {
            var g = Form.Element.serialize(h[f]);
            if (g) {
                m.push(g)
            }
        }
        return m.join("&")
    },
    getElements: function(e) {
        e = $(e);
        var h = new Array();
        for (tagName in Form.Element.Serializers) {
            var g = e.getElementsByTagName(tagName);
            for (var f = 0; f < g.length; f++) {
                h.push(g[f])
            }
        }
        return h
    },
    getInputs: function(n, r, q) {
        n = $(n);
        var l = n.getElementsByTagName("input");
        if (!r && !q) {
            return l
        }
        var m = new Array();
        for (var o = 0; o < l.length; o++) {
            var h = l[o];
            if ((r && h.type != r) || (q && h.name != q)) {
                continue
            }
            m.push(h)
        }
        return m
    },
    disable: function(h) {
        var g = Form.getElements(h);
        for (var e = 0; e < g.length; e++) {
            var f = g[e];
            f.blur();
            f.disabled = T
        }
    },
    enable: function(h) {
        var g = Form.getElements(h);
        for (var e = 0; e < g.length; e++) {
            var f = g[e];
            f.disabled = ""
        }
    },
    findFirstElement: function(b) {
        return Form.getElements(b).find(function(a) {
            return a.type != "hidden" && !a.disabled && ["input", "select", "textarea"].include(a.tagName.toLowerCase())
        })
    },
    focusFirstElement: function(b) {
        Field.activate(Form.findFirstElement(b))
    },
    reset: function(b) {
        $(b).reset()
    }
};
Form.Element = {
    serialize: function(e) {
        e = $(e);
        var g = e.tagName.toLowerCase();
        var h = Form.Element.Serializers[g](e);
        if (h) {
            var f = encodeURIComponent(h[0]);
            if (f.length == 0) {
                return
            }
            if (h[1].constructor != Array) {
                h[1] = [h[1]]
            }
            return h[1].map(function(a) {
                return f + "=" + encodeURIComponent(a)
            }).join("&")
        }
    },
    getValue: function(e) {
        e = $(e);
        var f = e.tagName.toLowerCase();
        var d = Form.Element.Serializers[f](e);
        if (d) {
            return d[1]
        }
    }
};
Form.Element.Serializers = {
    input: function(b) {
        switch (b.type.toLowerCase()) {
            case "submit":
            case "hidden":
            case "password":
            case "text":
                return Form.Element.Serializers.textarea(b);
            case "checkbox":
            case "radio":
                return Form.Element.Serializers.inputSelector(b)
        }
        return false
    },
    inputSelector: function(b) {
        if (b.checked) {
            return [b.name, b.value]
        }
    },
    textarea: function(b) {
        return [b.name, b.value]
    },
    select: function(b) {
        return Form.Element.Serializers[b.type == "select-one" ? "selectOne" : "selectMany"](b)
    },
    selectOne: function(h) {
        var g = "",
        e,
        f = h.selectedIndex;
        if (f >= 0) {
            e = h.options[f];
            g = e.value;
            if (!g && !("value" in e)) {
                g = e.text
            }
        }
        return [h.name, g]
    },
    selectMany: function(m) {
        var l = new Array();
        for (var f = 0; f < m.length; f++) {
            var g = m.options[f];
            if (g.selected) {
                var h = g.value;
                if (!h && !("value" in g)) {
                    h = g.text
                }
                l.push(h)
            }
        }
        return [m.name, l]
    }
};
var $F = Form.Element.getValue;
Abstract.TimedObserver = function() { };
Abstract.TimedObserver.prototype = {
    initialize: function(e, d, f) {
        this.frequency = d;
        this.element = $(e);
        this.callback = f;
        this.lastValue = this.getValue();
        this.registerCallback()
    },
    registerCallback: function() {
        setInterval(this.onTimerEvent.bind(this), this.frequency * 1000)
    },
    onTimerEvent: function() {
        var b = this.getValue();
        if (this.lastValue != b) {
            this.callback(this.element, b);
            this.lastValue = b
        }
    }
};
Form.Element.Observer = Class.create();
Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
    getValue: function() {
        return Form.Element.getValue(this.element)
    }
});
Form.Observer = Class.create();
Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
    getValue: function() {
        return Form.serialize(this.element)
    }
});
Abstract.EventObserver = function() { };
Abstract.EventObserver.prototype = {
    initialize: function(d, c) {
        this.element = $(d);
        this.callback = c;
        this.lastValue = this.getValue();
        if (this.element.tagName.toLowerCase() == "form") {
            this.registerFormCallbacks()
        } else {
            this.registerCallback(this.element)
        }
    },
    onElementEvent: function() {
        var b = this.getValue();
        if (this.lastValue != b) {
            this.callback(this.element, b);
            this.lastValue = b
        }
    },
    registerFormCallbacks: function() {
        var c = Form.getElements(this.element);
        for (var d = 0; d < c.length; d++) {
            this.registerCallback(c[d])
        }
    },
    registerCallback: function(b) {
        if (b.type) {
            switch (b.type.toLowerCase()) {
                case "checkbox":
                case "radio":
                    Event.observe(b, "click", this.onElementEvent.bind(this));
                    break;
                case "password":
                case "text":
                case "textarea":
                case "select-one":
                case "select-multiple":
                    Event.observe(b, "change", this.onElementEvent.bind(this));
                    break
            }
        }
    }
};
Form.Element.EventObserver = Class.create();
Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
    getValue: function() {
        return Form.Element.getValue(this.element)
    }
});
Form.EventObserver = Class.create();
Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
    getValue: function() {
        return Form.serialize(this.element)
    }
});
if (!window.Event) {
    var Event = new Object()
}
Object.extend(Event, {
    KEY_BACKSPACE: 8,
    KEY_TAB: 9,
    KEY_RETURN: 13,
    KEY_ESC: 27,
    KEY_LEFT: 37,
    KEY_UP: 38,
    KEY_RIGHT: 39,
    KEY_DOWN: 40,
    KEY_DELETE: 46,
    element: function(b) {
        return b.target || b.srcElement
    },
    isLeftClick: function(b) {
        return (((b.which) && (b.which == 1)) || ((b.button) && (b.button == 1)))
    },
    pointerX: function(b) {
        return b.pageX || (b.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft))
    },
    pointerY: function(b) {
        return b.pageY || (b.clientY + (document.documentElement.scrollTop || document.body.scrollTop))
    },
    stop: function(b) {
        if (b.preventDefault) {
            b.preventDefault();
            b.stopPropagation()
        } else {
            b.returnValue = false;
            b.cancelBubble = true
        }
    },
    findElement: function(f, d) {
        var e = Event.element(f);
        while (e.parentNode && (!e.tagName || (e.tagName.toUpperCase() != d.toUpperCase()))) {
            e = e.parentNode
        }
        return e
    },
    observers: false,
    _observeAndCache: function(g, h, e, f) {
        if (!this.observers) {
            this.observers = []
        }
        if (g.addEventListener) {
            this.observers.push([g, h, e, f]);
            g.addEventListener(h, e, f)
        } else {
            if (g.attachEvent) {
                this.observers.push([g, h, e, f]);
                g.attachEvent("on" + h, e)
            }
        }
    },
    unloadCache: function() {
        if (!Event.observers) {
            return
        }
        for (var b = 0; b < Event.observers.length; b++) {
            Event.stopObserving.apply(this, Event.observers[b]);
            Event.observers[b][0] = null
        }
        Event.observers = false
    },
    observe: function(g, h, e, f) {
        var g = $(g);
        f = f || false;
        if (h == "keypress" && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || g.attachEvent)) {
            h = "keydown"
        }
        this._observeAndCache(g, h, e, f)
    },
    stopObserving: function(g, h, e, f) {
        var g = $(g);
        f = f || false;
        if (h == "keypress" && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || g.detachEvent)) {
            h = "keydown"
        }
        if (g.removeEventListener) {
            g.removeEventListener(h, e, f)
        } else {
            if (g.detachEvent) {
                g.detachEvent("on" + h, e)
            }
        }
    }
});
Event.observe(window, "unload", Event.unloadCache, false);
var Position = {
    includeScrollOffsets: false,
    prepare: function() {
        this.deltaX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
        this.deltaY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0
    },
    realOffset: function(d) {
        var e = 0,
        f = 0;
        do {
            e += d.scrollTop || 0;
            f += d.scrollLeft || 0;
            d = d.parentNode
        }
        while (d);
        return [f, e]
    },
    cumulativeOffset: function(d) {
        var e = 0,
        f = 0;
        do {
            e += d.offsetTop || 0;
            f += d.offsetLeft || 0;
            d = d.offsetParent
        }
        while (d);
        return [f, e]
    },
    positionedOffset: function(d) {
        var e = 0,
        f = 0;
        do {
            e += d.offsetTop || 0;
            f += d.offsetLeft || 0;
            d = d.offsetParent;
            if (d) {
                p = Element.getStyle(d, "position");
                if (p == "relative" || p == "absolute") {
                    break
                }
            }
        }
        while (d);
        return [f, e]
    },
    offsetParent: function(b) {
        if (b.offsetParent) {
            return b.offsetParent
        }
        if (b == document.body) {
            return b
        }
        while ((b = b.parentNode) && b != document.body) {
            if (Element.getStyle(b, "position") != "static") {
                return b
            }
        }
        return document.body
    },
    within: function(d, e, f) {
        if (this.includeScrollOffsets) {
            return this.withinIncludingScrolloffsets(d, e, f)
        }
        this.xcomp = e;
        this.ycomp = f;
        this.offset = this.cumulativeOffset(d);
        return (f >= this.offset[1] && f < this.offset[1] + d.offsetHeight && e >= this.offset[0] && e < this.offset[0] + d.offsetWidth)
    },
    withinIncludingScrolloffsets: function(e, f, g) {
        var h = this.realOffset(e);
        this.xcomp = f + h[0] - this.deltaX;
        this.ycomp = g + h[1] - this.deltaY;
        this.offset = this.cumulativeOffset(e);
        return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + e.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + e.offsetWidth)
    },
    overlap: function(c, d) {
        if (!c) {
            return 0
        }
        if (c == "vertical") {
            return ((this.offset[1] + d.offsetHeight) - this.ycomp) / d.offsetHeight
        }
        if (c == "horizontal") {
            return ((this.offset[0] + d.offsetWidth) - this.xcomp) / d.offsetWidth
        }
    },
    clone: function(d, f) {
        d = $(d);
        f = $(f);
        f.style.position = "absolute";
        var e = this.cumulativeOffset(d);
        f.style.top = e[1] + "px";
        f.style.left = e[0] + "px";
        f.style.width = d.offsetWidth + "px";
        f.style.height = d.offsetHeight + "px"
    },
    page: function(g) {
        var f = 0,
        h = 0;
        var e = g;
        do {
            f += e.offsetTop || 0;
            h += e.offsetLeft || 0;
            if (e.offsetParent == document.body) {
                if (Element.getStyle(e, "position") == "absolute") {
                    break
                }
            }
        }
        while (e = e.offsetParent);
        e = g;
        do {
            f -= e.scrollTop || 0;
            h -= e.scrollLeft || 0
        }
        while (e = e.parentNode);
        return [h, f]
    },
    clone: function(o, m) {
        var h = Object.extend({
            setLeft: true,
            setTop: true,
            setWidth: true,
            setHeight: true,
            offsetTop: 0,
            offsetLeft: 0
        },
        arguments[2] || {});
        o = $(o);
        var n = Position.page(o);
        m = $(m);
        var l = [0, 0];
        var g = null;
        if (Element.getStyle(m, "position") == "absolute") {
            g = Position.offsetParent(m);
            l = Position.page(g)
        }
        if (g == document.body) {
            l[0] -= document.body.offsetLeft;
            l[1] -= document.body.offsetTop
        }
        if (h.setLeft) {
            m.style.left = (n[0] - l[0] + h.offsetLeft) + "px"
        }
        if (h.setTop) {
            m.style.top = (n[1] - l[1] + h.offsetTop) + "px"
        }
        if (h.setWidth) {
            m.style.width = o.offsetWidth + "px"
        }
        if (h.setHeight) {
            m.style.height = o.offsetHeight + "px"
        }
    },
    absolutize: function(g) {
        g = $(g);
        if (g.style.position == "absolute") {
            return
        }
        Position.prepare();
        var n = Position.positionedOffset(g);
        var l = n[1];
        var m = n[0];
        var o = g.clientWidth;
        var h = g.clientHeight;
        g._originalLeft = m - parseFloat(g.style.left || 0);
        g._originalTop = l - parseFloat(g.style.top || 0);
        g._originalWidth = g.style.width;
        g._originalHeight = g.style.height;
        g.style.position = "absolute";
        g.style.top = l + "px";
        g.style.left = m + "px";
        g.style.width = o + "px";
        g.style.height = h + "px"
    },
    relativize: function(e) {
        e = $(e);
        if (e.style.position == "relative") {
            return
        }
        Position.prepare();
        e.style.position = "relative";
        var f = parseFloat(e.style.top || 0) - (e._originalTop || 0);
        var d = parseFloat(e.style.left || 0) - (e._originalLeft || 0);
        e.style.top = f + "px";
        e.style.left = d + "px";
        e.style.height = e._originalHeight;
        e.style.width = e._originalWidth
    }
};
if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
    Position.cumulativeOffset = function(d) {
        var e = 0,
        f = 0;
        do {
            e += d.offsetTop || 0;
            f += d.offsetLeft || 0;
            if (d.offsetParent == document.body) {
                if (Element.getStyle(d, "position") == "absolute") {
                    break
                }
            }
            d = d.offsetParent
        }
        while (d);
        return [f, e]
    }
}
var varAddressId = "-1";
var varProductListControlId = "ctl00_CP_PCC_ucAllProducts";
var bookmarksControlID = "ctl00_UserWebShopContentControl1_HistoryAndBookmarksControl1";
var NaviWebLightBox = {
    hideAll: function() {
        lboxes = document.getElementsByClassName("lbox");
        lboxes.each(function(a) {
            Element.hide(a)
        });
        if ($("NaviWeboverlay")) {
            Element.remove("NaviWeboverlay")
        }
    }
};
function pageLoad(b, a) {
    var c = $find("CompleteExtender");
    c._popupBehavior._element.style.zIndex = 6000
}
NaviWebLightBox.base = Class.create();
NaviWebLightBox.base.prototype = {
    initialize: function(b, a) {
        HA();
        this.element = $(b);
        this.options = Object.extend({
            lightboxClassName: "lightbox",
            closeOnOverlayClick: false,
            externalControl: false
        },
        a || {});
        new Insertion.Before(this.element, "<div id='NaviWeboverlay' style='display:none;'></div>");
        Element.addClassName(this.element, this.options.lightboxClassName);
        Element.addClassName(this.element, "lbox");
        if (this.options.closeOnOverlayClick) {
            Event.observe($("NaviWeboverlay"), "click", this.hideBox.bindAsEventListener(this))
        }
        if (this.options.externalControl) {
            Event.observe($(this.options.externalControl), "click", this.hideBox.bindAsEventListener(this))
        }
        this.showBox()
    },
    showBox: function() {
        Element.show("NaviWeboverlay");
        this.center();
        Element.show(this.element);
        return false
    },
    hideBox: function(a) {
        Element.removeClassName(this.element, this.options.lightboxClassName);
        Element.hide(this.element);
        Element.remove("NaviWeboverlay");
        return false
    },
    center: function() {
        var b = 0;
        var c = 0;
        if (typeof (window.innerWidth) == "number") {
            b = window.innerWidth;
            c = window.innerHeight
        } else {
            if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                b = document.documentElement.clientWidth;
                c = document.documentElement.clientHeight
            } else {
                if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    b = document.body.clientWidth;
                    c = document.body.clientHeight
                }
            }
        }
        this.element.style.position = "absolute";
        this.element.style.zIndex = 1001;
        var d = 0;
        if (document.documentElement && document.documentElement.scrollTop) {
            d = document.documentElement.scrollTop
        } else {
            if (document.body && document.body.scrollTop) {
                d = document.body.scrollTop
            } else {
                if (window.pageYOffset) {
                    d = window.pageYOffset
                } else {
                    if (window.scrollY) {
                        d = window.scrollY
                    }
                }
            }
        }
        var a = Element.getDimensions(this.element);
        var f = (b - a.width) / 2;
        var e = (c - a.height) / 2 + d;
        f = (f < 0) ? 0 : f;
        e = (e < 0) ? 0 : e;
        this.element.style.left = f + "px";
        this.element.style.top = e + "px"
    }
};
function LoadHistoryAndBookmarks(b) {
    if (b == true) {
        LoadBrowsingLog(WishListBehaviourId);
        ge("dvHistoryAndBookmarks").style.display = B
    } else {
        ge("dvHistoryAndBookmarks").style.display = N
    }
}
function RemoveItemFromBrowsingLog(a, b) {
    ShowWishListLoader();
    Anthem_InvokeControlMethod(bookmarksControlID, "RemoveItemFromBrowsingLog", [a],
    function(c) {
        var f = new Array(3);
        f = c.value;
        try {
            if (f[0] == T) {
                var d = "anchBookMark_" + b;
                var g = "divBookMark_" + b;
                if (ge(d) != null && ge(g) != null) {
                    ge(d).title = f[1];
                    ge(g).className = f[2]
                }
                HideWishListLoader()
            } else {
                if (f[0] == F) { HideWishListLoader(); }
            }
        } catch (e) { HideWishListLoader(); }
    })
}
function HideButtons() {
    ge("divRemoveSelected").style.display = N;
    ge("divAddSelected").style.display = N
}
function HideBanner() {
    ge("banner").style.display = N
}
function ShowCart(a) {
    if (a == T) {
        ge("divAddSelected").style.display = B
    } else {
        ge("divAddSelected").style.display = N
    }
}
function ShowButtons() {
    ge("divRemoveSelected").style.display = B;
    ge("divAddSelected").style.display = B
}
function RemoveSelectedProducts() {
    var g = "";
    var f = "";
    try {
        var e = document.forms[0].checkProducts;
        if (e.length) {
            for (var h = 0; h < e.length; h++) {
                if (e[h].checked) {
                    g += e[h].value.split("_")[1] + ",";
                    f += e[h].value.split("_")[0] + ","
                }
            }
        } else {
            if (e.checked) {
                g += e.value.split("_")[1] + ",";
                f += e.value.split("_")[0] + ","
            }
        }
        g = g.substring(0, g.length - 1);
        f = f.substring(0, f.length - 1);
        if (f != "") {
            ShowWishListLoader();
            Anthem_InvokeControlMethod(bookmarksControlID, "RemoveSelectedItemsFromCart", [g],
            function(a) {
                var m = new Array(3);
                m = a.value;
                try {
                    if (m[0] == T) {
                        for (var b = 0; b < f.split(",").length; b++) {
                            var c = "anchBookMark_" + f.split(",")[b];
                            var n = "divBookMark_" + f.split(",")[b];
                            if (ge(c) != null && ge(n) != null) {
                                ge(c).title = m[1];
                                ge(n).className = m[2]
                            }
                        }
                        HideWishListLoader()
                    } else {
                        if (m[0] == F) { }
                    }
                } catch (l) { }
                HideWishListLoader()
            })
        } else { }
    } catch (d) { } finally {
        HA()
    }
}
function AddSelectedItemsToShoppingCart() {
    var e = document.forms[0].checkProducts;
    var l = "";
    var d = "";
    if (e.length) {
        for (var c = 0; c < e.length; c++) {
            if (e[c].checked) {
                var f = e[c].value.split("_")[0];
                var h = "anchBrowsingAddToCart_" + f;
                var g = "divBrowsingAddToCart_" + f;
                if (ge(h) != null && ge(g) != null) {
                    if (ge(g).className != "itemInCart") {
                        l += f + "." + ge(f).value + ",";
                        d += f + "."
                    }
                }
            }
        }
    } else {
        if (e.checked) {
            var f = e.value.split("_")[0];
            l += f + "." + ge(f).value + ",";
            d += f + "."
        }
    }
    l = l.substring(0, l.length - 1);
    d += d.substring(0, d.length - 1);
    if (d != "") {
        ShowWishListLoader();
        Anthem_InvokeControlMethod(bookmarksControlID, "AddSelectedItemsToShoppingCart", [l],
        function(a) {
            var n = new Array(3);
            n = a.value;
            try {
                if (n[0] == T) {
                    for (var b = 0; b < d.split(".").length; b++) {
                        ChangeDivClass(d.split(".")[b], n[1], n[2])
                    }
                } else { }
            } catch (m) { }
            HideWishListLoader()
        })
    } else { }
}
function GetLocalisedText(b) {
    Anthem_InvokeControlMethod(ProductsListControlClientId, "GetLocalisedText", [b],
    function(a) {
        var d = a.value
    })
}
function LoadBrowsingLog(b) {
    if (b == HistoryBehaviourId) {
        if (ge("ctl00_UserWebShopContentControl1_HistoryAndBookmarksControl1_divHistory") != null) {
            ge("ctl00_UserWebShopContentControl1_HistoryAndBookmarksControl1_divHistory").className = "select"
        }
        ge("divBookmarks").className = "selectActv"
    } else {
        if (b == WishListBehaviourId) {
            ge("divBookmarks").className = "select";
            if (ge("ctl00_UserWebShopContentControl1_HistoryAndBookmarksControl1_divHistory") != null) {
                ge("ctl00_UserWebShopContentControl1_HistoryAndBookmarksControl1_divHistory").className = "selectActv"
            }
        }
    }
    ShowWishListLoader();
    Anthem_InvokeControlMethod(bookmarksControlID, "LoadHistoryAndBookmarks", [b, true],
    function(a) {
        HideWishListLoader()
    })
}
function HideSelectAndDeselectInBookmark() {
    ge("divBookmarkSelectAll").style.display = N;
    ge("divBookmarkUnSelectAll").style.display = N
}
function ShowSelectAndDeselectInBookmark() {
    ge("divBookmarkSelectAll").style.display = B;
    ge("divBookmarkUnSelectAll").style.display = B
}
function HideMyaccountDiv(a) {
    if (a != "") {
        var b = "";
        b = a.split(",");
        if (b.length > 0) {
            for (i = 0; i < b.length; i++) {
                if ((typeof (b[i]) != "undefined") && (ge(b[i]) != null)) {
                    ge(b[i]).style.display = N
                }
            }
        }
    }
}
function LoadAccountDetails(a) {
    if (a == dvOrdersClientId) {
        ge(a).className = "buttonActv";
        ge("divOrders").style.display = B;
        ge("dvordersht").style.display = B;
        if (ge(dvAccountInformationClientId) != null) {
            ge(dvAccountInformationClientId).className = "buttonInActv";
            ge("dvaccountinformationht").style.display = N;
            ge("divAccountInformation").style.display = N
        }
        if (ge(dvManageAddressClientId) != null) {
            ge(dvManageAddressClientId).className = "buttonInActv";
            ge("dvmanageaddressht").style.display = N;
            ge("divManageAddress").style.display = N
        }
        if (ge(dvChangePasswordClientId) != null) {
            ge(dvChangePasswordClientId).className = "buttonInActv";
            ge("dvchangepasswordht").style.display = N;
            ge("divChangePassword").style.display = N
        }
        if (ge(dvAlternateLoginClientId) != null) {
            ge(dvAlternateLoginClientId).className = "buttonInActv";
            ge("dvAlternateLoginht").style.display = N;
            ge("divAlternateLogin").style.display = N
        }
    } else {
        if (a == dvAccountInformationClientId) {
            ge(a).className = "buttonActv";
            ge("dvaccountinformationht").style.display = B;
            ge("divAccountInformation").style.display = B;
            if (ge(dvManageAddressClientId) != null) {
                ge(dvManageAddressClientId).className = "buttonInActv";
                ge("dvmanageaddressht").style.display = N;
                ge("divManageAddress").style.display = N
            }
            if (ge(dvChangePasswordClientId) != null) {
                ge(dvChangePasswordClientId).className = "buttonInActv";
                ge("dvchangepasswordht").style.display = N;
                ge("divChangePassword").style.display = N
            }
            if (ge(dvOrdersClientId) != null) {
                ge(dvOrdersClientId).className = "buttonInActv";
                ge("dvordersht").style.display = N;
                ge("divOrders").style.display = N
            }
            if (ge(dvAlternateLoginClientId) != null) {
                ge(dvAlternateLoginClientId).className = "buttonInActv";
                ge("dvAlternateLoginht").style.display = N;
                ge("divAlternateLogin").style.display = N
            }
            SetDefaultFocus()
        } else {
            if (a == dvManageAddressClientId) {
                ge(a).className = "buttonActv";
                ge("dvmanageaddressht").style.display = B;
                ge("divManageAddress").style.display = B;
                if (ge(dvAccountInformationClientId) != null) {
                    ge(dvAccountInformationClientId).className = "buttonInActv";
                    ge("dvaccountinformationht").style.display = N;
                    ge("divAccountInformation").style.display = N
                }
                if (ge(dvOrdersClientId) != null) {
                    ge(dvOrdersClientId).className = "buttonInActv";
                    ge("dvordersht").style.display = N;
                    ge("divOrders").style.display = N
                }
                if (ge(dvChangePasswordClientId) != null) {
                    ge(dvChangePasswordClientId).className = "buttonInActv";
                    ge("dvchangepasswordht").style.display = N;
                    ge("divChangePassword").style.display = N
                }
                if (ge(dvAlternateLoginClientId) != null) {
                    ge(dvAlternateLoginClientId).className = "buttonInActv";
                    ge("dvAlternateLoginht").style.display = N;
                    ge("divAlternateLogin").style.display = N
                }
            } else {
                if (a == dvChangePasswordClientId) {
                    if (ge(dvChangePasswordClientId) != null) {
                        ge(a).className = "buttonActv";
                        ge("dvchangepasswordht").style.display = B;
                        ge("divChangePassword").style.display = B
                    }
                    if (ge(dvAccountInformationClientId) != null) {
                        ge(dvAccountInformationClientId).className = "buttonInActv";
                        ge("dvaccountinformationht").style.display = N;
                        ge("divAccountInformation").style.display = N
                    }
                    if (ge(dvManageAddressClientId) != null) {
                        ge(dvManageAddressClientId).className = "buttonInActv";
                        ge("dvmanageaddressht").style.display = N;
                        ge("divManageAddress").style.display = N
                    }
                    if (ge(dvOrdersClientId) != null) {
                        ge(dvOrdersClientId).className = "buttonInActv";
                        ge("dvordersht").style.display = N;
                        ge("divOrders").style.display = N
                    }
                    if (ge(dvAlternateLoginClientId) != null) {
                        ge(dvAlternateLoginClientId).className = "buttonInActv";
                        ge("dvAlternateLoginht").style.display = N;
                        ge("divAlternateLogin").style.display = N
                    }
                    ge("ctl00_CP_MyAccountContentControl1_ChangePassword_txtoldpassword").focus()
                } else {
                    if (a == dvAlternateLoginClientId) {
                        if (ge(dvChangePasswordClientId) != null) {
                            ge(a).className = "buttonActv";
                            ge("dvAlternateLoginht").style.display = B;
                            ge("divAlternateLogin").style.display = B
                        }
                        if (ge(dvAccountInformationClientId) != null) {
                            ge(dvAccountInformationClientId).className = "buttonInActv";
                            ge("dvaccountinformationht").style.display = N;
                            ge("divAccountInformation").style.display = N
                        }
                        if (ge(dvManageAddressClientId) != null) {
                            ge(dvManageAddressClientId).className = "buttonInActv";
                            ge("dvmanageaddressht").style.display = N;
                            ge("divManageAddress").style.display = N
                        }
                        if (ge(dvChangePasswordClientId) != null) {
                            ge(dvChangePasswordClientId).className = "buttonInActv";
                            ge("dvchangepasswordht").style.display = N;
                            ge("divChangePassword").style.display = N
                        }
                        if (ge(dvOrdersClientId) != null) {
                            ge(dvOrdersClientId).className = "buttonInActv";
                            ge("dvordersht").style.display = N;
                            ge("divOrders").style.display = N
                        }
                    }
                }
            }
        }
    }
}
function SetDefaultFocus() {
    ge("ctl00_CP_MyAccountContentControl1_MyAccountInformation_txtFirstName").focus()
}
function ClearAccountInformation(a) {
    if (a == "dvaccountinformation") {
        ge("ctl00_CP_MyAccountContentControl1_MyAccountInformation_txtFirstName").value = "";
        ge("ctl00_CP_MyAccountContentControl1_MyAccountInformation_txtLastName").value = "";
        ge("ctl00_CP_MyAccountContentControl1_MyAccountInformation_txtEmail").value = ""
    } else {
        ge("ctl00_CP_MyAccountContentControl1_ChangePassword_txtoldpassword").value = "";
        ge("ctl00_CP_MyAccountContentControl1_ChangePassword_txtnewpassword").value = "";
        ge("ctl00_CP_MyAccountContentControl1_ChangePassword_txtConfirmPassword").value = ""
    }
}
function DeleteAddress() {
    SL();
    Anthem_InvokeControlMethod(AddressDetailsControlClientId, "DeleteAddress", [varAddressId],
    function(a) {
        HA()
    })
}
function SetDeleteAddress(a) {
    varAddressId = a;
    new NaviWebLightBox.base("dvDelete")
}
function SetThisAddressAsDefault(a) {
    SL();
    Anthem_InvokeControlMethod(AddressDetailsControlClientId, "SetThisAddressAsDefault", [a],
    function(b) {
        HL()
    })
}
function LoadEditAddressDetails(a) {
    SL();
    Anthem_InvokeControlMethod(EditAddressDetailsControlClientId, "SetAddressDetails", [a],
    function(b) {
        new NaviWebLightBox.base("dvEditAddressDetails");
        ge(FirstNameTextBoxClientId).focus();
        ge(FirstNameTextBoxClientId).select()
    })
}
function SetImage(a) {
    ge("mainImage").src = a
}
function GetLocalisedText(a) {
    Anthem_InvokeControlMethod(ProductDetailsClientId, "GetLocalisedText", [a],
    function(b) {
        var c = b.value
    })
}
function LoadSpecifications(a) {
    if (a == "divReviews") {
        ge(a).className = "featureButtonActv";
        ge("reviews").style.display = B;
        if (ge("divMoviews") != null) {
            ge("divMoviews").className = "featureButton";
            ge("divfilms").style.display = N
        }
        if (ge("divspecifications") != null) {
            ge("divfeatures").style.display = N;
            ge("divspecifications").className = "featureButton"
        }
    } else {
        if (a == "divMoviews") {
            ge(a).className = "featureButtonActv";
            ge("divfilms").style.display = B;
            if (ge("divspecifications") != null) {
                ge("divspecifications").className = "featureButton";
                ge("divfeatures").style.display = N
            }
            if (ge("divReviews") != null) {
                ge("divReviews").className = "featureButton";
                ge("reviews").style.display = N
            }
        } else {
            ge(a).className = "featureButtonActv";
            ge("divfeatures").style.display = B;
            if (ge("divMoviews") != null) {
                ge("divMoviews").className = "featureButton";
                ge("divfilms").style.display = N
            }
            if (ge("divReviews") != null) {
                ge("divReviews").className = "featureButton";
                ge("reviews").style.display = N
            }
        }
    }
}
function ClearReview() {
    ge("ctl00_CP_ProductDetails_txtTitle").value = "";
    ge("ctl00_CP_ProductDetails_txtbody").value = ""
}
function GetLocalisedText(a) {
    Anthem_InvokeControlMethod(ProductsListControlClientId, "GetLocalisedText", [a],
    function(b) {
        var c = b.value
    })
}
function RegisterNewUser() {
    ge(txtFirstName).value = "";
    ge(txtLastName).value = "";
    ge(txtFullName).value = "";
    ge(txtEmailAddress).value = "";
    ge(txtpassword).value = "";
    ge(txtConfirmPassword).value = "";
    if (ge(btnRedirectTOLogin)) {
        ge(btnRedirectTOLogin).style.visibility = "hidden"
    }
    ge("divRegisterScreen").style.display = B;
    ge("divMessageSector").className = "";
    try {
        new NaviWebLightBox.base("divRegister");
        ge(txtFirstName).focus()
    } catch (a) { }
}
function PasswordRecovery() {
    ge(txtDisplayName).value = "";
    ge("divPasswordRecover").style.display = B;
    try {
        new NaviWebLightBox.base("divPasswordRecover");
        ge(txtDisplayName).focus()
    } catch (a) { }
}
function HA() {
    NaviWebLightBox.hideAll()
}
function OnSuccess() {
    ge("divRegisterScreen").style.display = N;
    ge("divMessageSector").className = "successMessage"
}
function GetLocalisedText(a) {
    Anthem_InvokeControlMethod(ProductsListControlClientId, "GetLocalisedText", [a],
    function(b) {
        var c = b.value
    })
}
function ShowRelatedProducts(a,b) {
    SL();
    // ShowRelatedProductsLoader();
    Anthem_InvokeControlMethod(RelatedProductsControlClientId, "BindRelatedProducts", [a, "ShoppingCart", defaultNumberOfRelatedProducts, b],
    function(b) {
        // HideRelatedProductsLoader()

        if (ge("ctl00_CP_ShoppingCartContentControl_CartRelatedProducts_hdnmessgae").value == "false") {

            ge("divBox").style.display = "none";
            ge("Cartheader").style.display = "none";

        }
        else {
            ge("divBox").style.display = "block";
            ge("Cartheader").style.display = "block";
        }

        HL();
    })
    
}
function ShowAllRelatedProducts(a) {
    if (a == "ProductDetailsPage") {
        SL();
        Anthem_InvokeControlMethod(ProductDetailsClientId, "BindAllRelatedProducts", [],
        function(b) {
            HL()
        })
    } else {
        SL();
        Anthem_InvokeControlMethod(RelatedProductsControlClientId, "BindAllRelatedProducts", [],
        function(b) {
            HL()
        })
    }
}
function DeleteShoppingCartItem(c, a) {
    var b = "divListViewAddToCart_" + a;
    SL();

    //ShowShoppingCartLoader();
    Anthem_InvokeControlMethod(ShoppingCartContentControlClientId, "DeleteShoppingCartId", [c],
    function(d) {

        if (typeof (ge("ctl00_CP_ShoppingCartContentControl_CartRelatedProducts_hdnmessgae")) != "undefined") {
            if (ge("ctl00_CP_ShoppingCartContentControl_CartRelatedProducts_hdnmessgae").value == "false") {

                ge("divBox").style.display = "none";


            }
            else {
                ge("divBox").style.display = "block";

            }

        }

        var f = new Array(4);
        f = d.value;
        try {
            if (f[0] == T) {
                ChangeDivClass(a, f[1], f[2]);
                if (typeof (ge(b) != "undefined")) {
                    if (ge(b) != null) {
                        ge(b).className = "listviewaddcartbg"
                    }
                }
                if (f[3] == "CartEmpty") {
                    ge("divBox").style.display = "none";
                    ge("Cartheader").style.display = "none";

                }
                //HideShoppingCartLoader()
                HL();
            } else {
                if (f[0] == F) { HL(); }
            }
        } catch (e) { HL(); }
    })
}

function DeleteShoppingCartItemForMatrix(c, a) {
    var b = "divListViewAddToCart_" + a;
    SL();

    //ShowShoppingCartLoader();
    Anthem_InvokeControlMethod(ShoppingCartContentControlClientId, "DeleteShoppingCartIdForMatrix", [c, a],
    function(d) {

        if (typeof (ge("ctl00_CP_ShoppingCartContentControl_CartRelatedProducts_hdnmessgae")) != "undefined") {
            if (ge("ctl00_CP_ShoppingCartContentControl_CartRelatedProducts_hdnmessgae").value == "false") {

                ge("divBox").style.display = "none";


            }
            else {
                ge("divBox").style.display = "block";

            }

        }

        var f = new Array(4);
        f = d.value;
        try {
            if (f[0] == T) {
                ChangeDivClass(a, f[1], f[2]);
                if (typeof (ge(b) != "undefined")) {
                    if (ge(b) != null) {
                        ge(b).className = "listviewaddcartbg"
                    }
                }
                if (f[3] == "CartEmpty") {
                    ge("divBox").style.display = "none";
                    ge("Cartheader").style.display = "none";

                }
                //HideShoppingCartLoader()
                HL();
            } else {
                if (f[0] == F) { HL(); }
            }
        } catch (e) { HL(); }
    })
}

function SelectedCartItems(d) {
    var b = ge("ctl00_CP_ShoppingCartContentControl_ShoppingCart_hfSelectedCartItems");
    var a = ge("ctl00_CP_ShoppingCartContentControl_ShoppingCart_hfSelectedProducts");
    b.value = "";
    a.value = "";
    var c = document.forms[0].elements;
    for (i = 0; i < c.length; i++) {
        if (c[i].type == "checkbox" && c[i].name == "chkbx") {
            if (d == "check" && c[i].checked == true) {
                b.value += c[i].value + ",";
                a.value += c[i].parentNode.id + ","
            }
        }
    }
}
function ActiveCartProduct(a) {
    try {

        selectedCartItem = ge(hdnFirstCartItemIdClientId).value;
        if (selectedCartItem != "") {
            ge(selectedCartItem).className = "shoppingCartitem"
        }
        ge(a).className = "shoppingCartitemActv";
        ge(hdnFirstCartItemIdClientId).value = a


    } catch (b) { }

}

function ActiveCartProductForVariantMatrix(a) {
    try {

        selectedCartItem = ge("firstSelectedProduct").value;
        if (selectedCartItem != "") {
            ge(selectedCartItem).className = "shoppingCartitem"
        }
        ge(a).className = "shoppingCartitemActv";
        ge("firstSelectedProduct").value = a


    } catch (b) { }

}

function SetFirstCartItemId(a) {

    ge(hdnFirstCartItemIdClientId).value = a;
}

function UpdateCart(a) {
    Anthem_InvokeControlMethod(UserWebShopContentControlClientId, "UpdateCartItems", [a],
    function(b) { });
    HA()
}
function UpdateCartItems(a) {
    Anthem_InvokeControlMethod(LoginControlClientId, "UpdateCartItems", [a],
    function(b) { });
    HA()
}
function GetSearch(c, a) {
    try {
        var d = ge(hfSearchClientId).value;
        ge(hfSearchClientId).value = a.get_value();
        if (ge(hfSearchClientId).value != "") {
            Anthem_InvokeControlMethod(SearchControlClientId, "Search", [],
            function(e) { })
        }
    } catch (b) { }
}
function DisableShoppingcartCheckoutButton() { }
function HideSelectAndDeselectInCheckout() { }
function ShowSelectAndDeselectInCheckout() {
    ge("divCheckoutSelectAll").style.display = B;
    ge("divCheckoutUnselectAll").style.display = B
}
function LoadCartList() {
    if (ge(ViewCartClientId).className == "viewCart") {
        HL();
        ShowCartEmptyErrorMessage(ge(HiddenFieldCartMessageClientId).value)
    } else {
        if (ge(ViewCartClientId).className == "viewCarthighlight") {
            window.location.href = ge("ctl00_ucAuthenticatedUser_hdSiteRoot").value + "Cart.aspx"
        }
    }
}
function ShowCompareDiv() {
    ge("divCompareDown").style.display = B
}
function DeleteCompareProduct(a) {
    if (a != "" && a != null) {
        Anthem_InvokeControlMethod(ProductsCompareContentControlClientId, "DeleteCompareProduct", [a],
        function(b) {
            var d = ge("Inner");
            var c = ge(ProductsCompareHiddenFieldControlId).value.split(",");
            d.style.width = c.length * 200 + 300 + "px"
        })
    }
}
function HideProductCompare() {
    HA()
}
function DeleteAllCompareProduct() {
    Anthem_InvokeControlMethod(ProductsCompareContentControlClientId, "DeleteAllCompareProduct", [],
    function(a) {
        HideProductCompare()
    })
}
function CheckCompareCheckBoxes() {
    if (ge(hfCompareProductIdsClientId) == null) {
        hfCompareProductIdsClientId = "ctl00_CP_PCC_ucAllProducts_PHC_hfCompareProductIds"
    }
    if (ge(hfCompareProductIdsClientId).value != "") {
        var a = "";
        a = ge(hfCompareProductIdsClientId).value.split(",");
        if (a.length > 0) {
            for (i = 0; i < a.length; i++) {
                if ((typeof (a[i]) != "undefined") && (ge(a[i]) != null) && (ge(a[i]).type == "checkbox")) {
                    ge(a[i]).checked = true
                }
            }
        }
    }
}
function LoadProductCompareContentFromProductList() {
    var CompareHiddenId = 'ctl00_CP_PCC_ucFilters_PHC_ucProductsCompareContentControl_hdnCompareProductId';
    SL();
    Anthem_InvokeControlMethod(ProductsCompareContentControlClientId, "BindCompareProductsFromProductList", [ge(hfCompareProductIdsClientId).value, false],
    function(a) {
        var d = a.value;
        if (d == T) {
            var c = ge("Inner");
            var b = ge(CompareHiddenId).value.split(",");
            c.style.width = b.length * 200 + 300 + "px";
            new NaviWebLightBox.base("dvProductsCompareContentControl");
            ge("divNaviWebLoader").style.display = N
        } else {
            HL()
        }
    })
}
function LoadProductCompareContentFromProductDetails(a) {
    if (a != "" && a != null) {
        SL();
        Anthem_InvokeControlMethod(ProductsCompareContentControlClientId, "BindCompareProductsFromProductDetails", [a, false],
        function(b) {
            var d = ge("Inner");
            var c = ge("ctl00_CP_ucProductDetails_ucProductsCompareContentControl_hdnCompareProductId").value.split(",");
            d.style.width = c.length * 200 + 300 + "px";
            new NaviWebLightBox.base("dvProductsCompareContentControl");
            ge("divNaviWebLoader").style.display == N
        })
    }
}
function LoadProductCompareSpecifications(a) {
    ge("hdnShowAllSpecifications").value = a;
    Anthem_InvokeControlMethod(ProductsCompareContentControlClientId, "BindCompareProducts", [a],
    function(b) {
        var d = ge("Inner");
        var c = ge(ProductsCompareHiddenFieldControlId).value.split(",");
        d.style.width = c.length * 200 + 300 + "px";
        if (a == "true") {
            ge("spnAllSpecifications").className = "allSpecificationsTxt";
            ge("spnMatchingSpecifications").className = "matchingSpecificationsTxt"
        }
        if (a == "false") {
            ge("spnAllSpecifications").className = "matchingSpecificationsTxt";
            ge("spnMatchingSpecifications").className = "allSpecificationsTxt"
        }
        new NaviWebLightBox.base("dvProductsCompareContentControl")
    })
}
function UncheckCompareCheckbox(a) {
    if (ge(a) != null) {
        if ((ge(a).type == "checkbox") && (ge(a).checked == true)) {
            ge(a).checked = false
        }
    }
    if (typeof (hfCompareProductIdsClientId) != "undefined") {
        if ((ge(hfCompareProductIdsClientId) != null) && (ge(hfCompareProductIdsClientId).value != null) && (ge(hfCompareProductIdsClientId).value != "")) {
            ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.replace(a, "");
            ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.replace(",,", ",");
            ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.replace(", ,", ",");
            if (ge(hfCompareProductIdsClientId).value.startsWith(",")) {
                ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.substring(1)
            }
            if (ge(hfCompareProductIdsClientId).value.endsWith(",")) {
                ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.substring(0, ge(hfCompareProductIdsClientId).value.length - 1)
            }
        }
    }
}
function UpdateCompareProductIds(a) {
    if (ge(hfCompareProductIdsClientId) == null) {
        hfCompareProductIdsClientId = "ctl00_CP_PCC_ucAllProducts_PHC_hfCompareProductIds"
    }
    if (a != null) {
        if ((ge(a).type == "checkbox") && (ge(a).checked == true)) {
            if ((ge(a).value != null) && (ge(a).value != "")) {
                if ((ge(hfCompareProductIdsClientId).value != null) && (ge(hfCompareProductIdsClientId).value != "")) {
                    ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value + "," + ge(a).value
                } else {
                    ge(hfCompareProductIdsClientId).value = ge(a).value
                }
            }
        } else {
            if ((ge(a).type == "checkbox") && (ge(a).checked == false)) {
                if ((ge(hfCompareProductIdsClientId).value != null) && (ge(hfCompareProductIdsClientId).value != "")) {
                    ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.replace(ge(a).value, "");
                    ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.replace(",,", ",");
                    ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.replace(", ,", ",");
                    if (ge(hfCompareProductIdsClientId).value.startsWith(",")) {
                        ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.substring(1)
                    }
                    if (ge(hfCompareProductIdsClientId).value.endsWith(",")) {
                        ge(hfCompareProductIdsClientId).value = ge(hfCompareProductIdsClientId).value.substring(0, ge(hfCompareProductIdsClientId).value.length - 1)
                    }
                }
                Anthem_InvokeControlMethod(ProductsCompareContentControlClientId, "RemoveProductIdFromSession", [ge(a).value],
                function(b) { })
            }
        }
    }
}
function ShowCartEmptyErrorMessage(a) {
    ge("lblNaviWebErrorMessage").innerHTML = a;
    new NaviWebLightBox.base("divNaviWebErrorMessage")
}
function RedirectToCheckOut(b) {
    var a = ge(b).className;
    if (a == "button") {
        SL();
        Anthem_InvokeControlMethod(ShoppingCartClientId, "RedirectToCheckOut", [],
        function(c) { })
    }
}
function isLoggedIn(a) {
    if ((a == "MyAccount") || (a == "Any")) {
        SL()
    }
    Anthem_InvokeControlMethod(AuthenticateduserControlClientId, "IsLoggedIn", [a],
    function(b) {
        try {
            var d = new Array(2);
            d = b.value;
            if (d[0] == T) {
                window.location.href = ge("ctl00_ucAuthenticatedUser_hdSiteRoot").value + "myaccount.aspx";
                return false
            } else {
                if (d[0] == F) {
                    window.location.href = ge("ctl00_ucAuthenticatedUser_hdSiteRoot").value + "login.aspx"
                } else {
                    if (d[0] == "error") {
                        SE(d[1])
                    }
                }
            }
        } catch (c) { }
    })
}
function PreviousPage() {
    history.back(1)
}
function UserLogin(a, b) {
    if (b == "ButtonClick") {
        ShowLogInLoader();
        Anthem_InvokeControlMethod(LoginControlClientId, "UserLogin", [],
        function(c) {
            HideLogInLoader()
        })
    } else {
        if (a.which || a.keyCode) {
            if ((a.which == 13) || (a.keyCode == 13)) {
                ShowLogInLoader();
                Anthem_InvokeControlMethod(LoginControlClientId, "UserLogin", [],
                function(c) {
                    HideLogInLoader()
                })
            }
        }
    }
}
function ValidateSelection() {
    try {
        var b = ge(hfSelectedCartItemsClientId).value;
        if (b == "") {
            return false
        } else {
            SL();
            return true
        }
    } catch (a) { }
}
function ChangeAddToCartButtonStyle(a, d, c) {
    try {
        a = a.substring(0, a.length - 1);
        var b = a.split(",");
        var g = 0;
        for (g = 0; g < b.length; g++) {
            var e = "divListViewAddToCart_" + b[g];
            ChangeDivClass(b[g], d, c);
            if (ge(e) != null) {
                ge(e).className = "listviewaddcartbg"
            }
        }
    } catch (f) { }
}
function LoadCompareFreeItems(a) {
    Anthem_InvokeControlMethod(FreeItemsControlClientId, "LoadFreeItems", [a],
    function(b) {
        ge("divCompareFreeItems").style.display = B
    })
}
function LoadFreeItems(a) {
    SL();
    Anthem_InvokeControlMethod(FreeItemsControlClientId, "LoadFreeItems", [a],
    function(b) {
        HL();
        new NaviWebLightBox.base("dvFreeItems")
    })
}
function LoadStocks(a) {
    Anthem_InvokeControlMethod(StocksControlClientId, "LoadStocks", [a],
    function(b) { })
}
function SL() {
    new NaviWebLightBox.base("divNaviWebLoader");
    ge("divNaviWebLoader").style.display = B
}
function HL() {
    if (ge("divNaviWebLoader").style.display == B) {
        HA()
    }
}
function ShowCheckoutLoader() {
    new NaviWebLightBox.base("divCheckoutLoader");
    ge("divCheckoutLoader").style.display = B
}
function HideCheckoutLoader() {
    if (ge("divCheckoutLoader").style.display == B) {
        HA()
    }
    ge("divCheckoutLoader").style.display = N
}
function ShowShoppingCartLoader() {
    ge("divShoppingCartLoader").style.display = B
}
function HideShoppingCartLoader() {
    HL();
}
function ShowRelatedProductsLoader() {
    ge("divRelatedProductsLoader").style.display = B
}
function HideRelatedProductsLoader() {
    ge("divRelatedProductsLoader").style.display = N
}
function ShowWishListLoader() {
    ge("divWishListLoader").style.display = B
}
function HideWishListLoader() {
    ge("divWishListLoader").style.display = N
}
function ShowPagingLoader() {
    if (ge("divPagingLoader") != null) {
        ge("divPagingLoader").style.display = B
    }
}
function HidePagingLoader() {
    if (ge("divPagingLoader") != null) {
        ge("divPagingLoader").style.display = N
    }
}
function ShowBottomPagingLoader() {
    if (ge("divBottomPagingLoader") != null) {
        ge("divBottomPagingLoader").style.display = B
    }
}
function HideBottomPagingLoader() {
    if (ge("divBottomPagingLoader") != null) {
        ge("divBottomPagingLoader").style.display = N
    }
}
function ShowLogInLoader() {
    ge("divLogInLoader").style.display = B
}
function HideLogInLoader() {
    ge("divLogInLoader").style.display = N
}
function ShowBuyNowLoader() {
    ge("divBuyNowLoader").style.display = B
}
function HideBuyNowLoader() {
    ge("divBuyNowLoader").style.display = N
}
function ShowPasswordRecoveryLoader() {
    ge("divPasswordRecoveryLoader").style.display = B
}
function HidePasswordRecoveryLoader() {
    ge("divPasswordRecoveryLoader").style.display = N
}
function ShowSignUpLoader() {
    ge("divSignUpLoader").style.display = B
}
function HideSignUpLoader() {
    ge("divSignUpLoader").style.display = N;
    TrackPageView("/RegisterNewUser")
}
function ShowManageAddressLoader() {
    ge("divManageAddressLoader").style.display = B
}
function HideManageAddressLoader() {
    ge("divManageAddressLoader").style.display = N
}
function SE(a) {
    HL();
    new NaviWebLightBox.base("divNaviWebErrorMessage")
}
function HideNaviWebErrorMessage() {
    HA()
}
function IsDigit(b, d) {
    try {
        var a = (b.which) ? b.which : event.keyCode;
        if ((a > 47 && a < 58) || (a == 8)) {
            if (d.value == "" && a == 48) {
                return false
            } else {
                return true
            }
        } else {
            return false
        }
    } catch (c) { }
}
function PageChanged(b, d) {
    try {
        var a = (b.which) ? b.which : event.keyCode;
        if (a == 13) {
            if (d.value != "") {
                return true
            } else {
                return false
            }
        } else {
            if ((a > 47 && a < 58) || (a == 8)) {
                if (d.value == "" && a == 48) {
                    return false
                } else {
                    return true
                }
            } else {
                return false
            }
        }
    } catch (c) { }
}
function goToTop() {
    location.href = "#top"
}
function TransferCartItems(a) {
    Anthem_InvokeControlMethod(UserWebShopContentControlClientId, "UpdateCartItems", [a],
    function(b) { });
    HA()
}
function GoToCheckOut() {
    if (ge(QuantityTextBoxClientId).value == "") {
        ge("lblQuantityRequiredMsg").style.display = B
    } else {
        ShowBuyNowLoader();
        ge("lblQuantityRequiredMsg").style.display = N;
        Anthem_InvokeControlMethod(BuyNowControlClientId, "GoToCheckOut", [],
        function(a) {
            HideBuyNowLoader()
        })
    }
}
function CancelPayment() {
    Anthem_InvokeControlMethod(CheckOutItemsControlClientId, "CancelPayment", [],
    function(a) { })
}
function ShowBuyNowMessage() {
    ge("lblQuantityRequiredMsg").style.display = B;
    HideBuyNowLoader()
}
function setProductDetails(a, b) {
    Anthem_InvokeControlMethod(AuthenticateduserControlClientId, "SetProductDetails", [a, b],
    function(c) { })
}
function LoadBuyNowPopup(b, a) {
    if (b == true) {
        ge("lblQuantityRequiredMsg").style.display = N;
        new NaviWebLightBox.base("dvBuyNow");
        ge(QuantityTextBoxClientId).focus();
        Anthem_InvokeControlMethod(BuyNowControlClientId, "SetProductDetails", [a],
        function(c) { })
    } else {
        ge("dvBuyNow").style.display = N
    }
    return false
}
function BuyNowFromProductList(a) {
    var b = "divProductsListBuyNow_" + a;
    if (ge(b) != null) {
        if (ge(b).className != "itemInCart") {
            if (a != null) {
                Anthem_InvokeControlMethod(ProductsListControlClientId, "BuyNowFromProductList", [a],
                function(c) { })
            }
        }
    }
}
function BuyNowFromPromotionalProduct(a, b) {
    SelectedQty();
    var c = "divProductsListBuyNow_" + a;
    if (ge(c) != null) {
        if (a != null) {
            Anthem_InvokeControlMethod(FreeItemsControlClientId, "BuyNowFromFreeItemsControl", [a, ge(b).value],
            function(d) { })
        }
    }
}
function BuyNowFromProductDetails(a, b) {
    if (ge("divProductDetailsBuyNow") != null) {
        if (ge("divProductDetailsBuyNow").className != "itemInCart") {
            if (a != null) {
                Anthem_InvokeControlMethod(ProductDetailsClientId, "BuyNowFromProductDetails", [a, ge(b).value],
                function(c) { })
            }
        }
    }
}
function BuyNowFromHistoryAndBookmarks(a) {
    var b = "divBrowsingBuyNow_" + a;
    if (ge(b) != null) {
        if (ge(b).className != "itemInCart") {
            if (a != null) {
                Anthem_InvokeControlMethod(bookmarksControlID, "BuyNowFromHistoryAndBookmarks", [a, ge(a).value],
                function(c) { })
            }
        }
    }
}
function SetButtonText(a) {
    ge("anchorContinueShopping").innerHTML = a
}
function HideMessage() {
    HA()
}
function isNumberKey(a) {
    var b = (window.event) ? a.keyCode : a.which;
    if ((b > 47 && b < 58) || b == 8 || b == 0) {
        return true
    } else {
        return false
    }
}
function OnClickBookMark(a) {
    var b = "anchBookMark_" + a;
    var c = "divBookMark_" + a;
    if (ge(b) != null && ge(c) != null) {
        if (ge(c).className != "markhighlight") {
            SL();
            Anthem_InvokeControlMethod(ProductsListControlClientId, "AddToBookMark", [a],
            function(d) {
                try {
                    var f = new Array(3);
                    f = d.value;
                    if (f[0] == T) {
                        ge(b).title = f[1];
                        ge(c).className = f[2];
                        ge("divwishList").className = "wishListhighlight"
                    } else {
                        if (f[0] == "error") {
                            SE(f[1])
                        }
                    }
                } catch (e) { }
                HL()
            })
        }
    }
}
function GetLocalisedText(a) {
    Anthem_InvokeControlMethod(ProductsListControlClientId, "GetLocalisedText", [a],
    function(b) {
        var c = b.value
    })
}
function AddToCart(a, c, b, e, d) {
    if (e == 'Compare' && ge(b).className != 'listviewcartbg') {
        ShowLoderOnly();
        Anthem_InvokeControlMethod(AddToCartProductDetailsClientId, "AddToShoppingCart", [a],
       function(result) {
           var R = new Array(3);
           R = result.value;
           if (R[0] == "true") {

               ChangeDivClass(a, R[1], R[2]);
               ge(b).className = 'listviewcartbg';
               ge(b).title = R[1];
           }
           HideLoaderOnly();
       });
     }
    else {
        var f = "1";
        if ((b == "") || ge(b) != null) {
            if ((b == "") || (ge(b).className != "itemInCart" && ge(b).className != "listviewcartbg")) {
                if (e == "page") {
                    SL()
                } else {
                    if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                        if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                            SL()
                        } else {
                            if (typeof (RelatedProductsControlClientId) != "undefined" && e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                                SL()
                            } else {
                                if (e == bookmarksControlID) {
                                    SL()
                                } else {
                                    if (typeof (RelatedProductsControlClientId) != "undefined" && e == RelatedProductsControlClientId) {
                                        ge("divShoppingCartLoader").style.display = B
                                    } else {
                                        if (e == ProductsCompareContentControlClientId) {
                                            ge("divNaviWebLoader").style.display == B
                                        } else {
                                            SL()
                                        }
                                    }
                                }
                            }
                        }
                    }
                }               

                if (!isNaN(d)) {
                    f = ge(d).value;
                }
                else {
                    f = ge(d).value;

                    if (f == "" || parseInt(f) <= 0) {
                        f = "1";
                    }
                }
                if (e != "page") {
                    Anthem_InvokeControlMethod(e, "AddToShoppingCart", [a, f],
                function(g) {
                    var l = new Array(3);
                    l = g.value;
                    try {
                        if (l[0] == "true") {
                            if (e == "page") {
                                HL()
                            } else {
                                if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                                    if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                                        HL()
                                    } else {
                                        if (e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                                            HL()
                                        } else {
                                            if (e == bookmarksControlID) {
                                                HL()
                                            } else {
                                                if (e == RelatedProductsControlClientId) {
                                                    ge("divShoppingCartLoader").style.display = N
                                                } else {
                                                    if (e == ProductsCompareContentControlClientId) {
                                                        ge("divNaviWebLoader").style.display == N
                                                    } else {
                                                        HL()
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            ChangeDivClass(a, l[1], l[2])
                        } else {
                            ActiveCartProduct(a)
                        }
                    } catch (h) { }
                    HL();
                })
                } else {
                Anthem_InvokePageMethod("AddToShoppingCart", [a, f],
                function(g) {
                    var l = new Array(3);
                    l = g.value;
                    try {
                        if (l[0] == "true") {
                            ChangeDivClass(a, l[1], l[2]);
                            if (e == "page") {
                                HL()
                            } else {
                                if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                                    if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                                        HL()
                                    } else {
                                        if (e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                                            HL()
                                        } else {
                                            if (e == bookmarksControlID) {
                                                HL()
                                            } else {
                                                if (e == RelatedProductsControlClientId) {
                                                    ge("divShoppingCartLoader").style.display = N
                                                } else {
                                                    if (e == ProductsCompareContentControlClientId) {
                                                        ge("divNaviWebLoader").style.display == N
                                                    } else {
                                                        HL()
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    } catch (h) { }
                   
                })
                }
            }
        }
    }
}
function MyQtyRdbFocus() {
    ge("rdbQuantity").checked = true
}
function SelectedQty() {
    if (ge("rdbQuantity").checked == true) {
        ge("hidQty").value = ge("txtquantity").value
    } else {
        for (i = 0; i < document.aspnetForm.rdbtn.length; i++) {
            if (document.aspnetForm.rdbtn[i].checked == true) {
                ge("hidQty").value = document.aspnetForm.rdbtn[i].value
            }
        }
    }
}
function AddToCart_MultiProduct(pid, src, did, qty, lbl, gid) {    
    SL();
    var cid;
    var sPath = window.location.pathname;
    var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
    if (sPage.toLowerCase() == 'cart.aspx') {
        cid = 'ctl00_CP_ShoppingCartContentControl_ShoppingCart';
    }
    else {
        cid = 'ctl00_ucFreeItems';
    }
    var qtyCheck
    if (src == "cpo") {
      
        qtyCheck = GetCartUpdateStatusCPO(pid, qty, gid);
    }
    else {
       
        qtyCheck = GetCartUpdateStatusFI(pid, qty, gid, src);
    }

    if (qtyCheck == 'true') {
        if (ge('hidProducts') != null) {

            var hdProducts = ge('hidProducts').value;
            
            if (hdProducts.length > 0) {
                if (src == "cpo") {

                    Anthem_InvokeControlMethod(cid, "AddMultipleProductsToShoppingCart", [hdProducts, '1'],
                 function(g) { HL(); });
                }
                else {

                    Anthem_InvokeControlMethod(cid, "AddMultipleProductsToShoppingCart", [hdProducts, '1'],
                 function(g) {
                     if (src == "fi") {

                         if (sPage.toLowerCase() == 'p' + pid + '.aspx') {
                             SL();
                             Anthem_InvokeControlMethod('ctl00_CP_ucProductDetails', "BindProductDetails", [pid],
                             function(g) { HL(); });

                         } if (sPage.toLowerCase() != 'cart.aspx' && sPage.toLowerCase() != 'p' + pid + '.aspx') {
                                 SetOderButtonClass(hdProducts, lbl);
                             }
                     }
                     if (did = 'divProductsListAddToCart') {

                         var R = new Array(3);
                         R = g.value;

                         if (R[0] == "true") {
                             a = R[1].split(",");
                             for (i = 0; i < a.length; i++) {
                                 if (a[i] != "") { }
                             }
                         }

                     } HL();

                 });
                }
            }
        }
        if (src == "pdfi") {
            SL();      
            Anthem_InvokeControlMethod('ctl00_CP_ucProductDetails', "BindProductDetails", [pid],
             function(g) {HL();});
        }
    }  
}
function SetOderButtonClass(PrdStatus, lbl) {
    var a = PrdStatus.split(",");
    for (i = 0; i < a.length; i++) {
        if (a[i] != "") {
            var b = a[i].split(":");
            if (b[1] == 1) {
                var divId = "divProductsListAddToCart_" + b[0];
                var ancId = "anchProductsListAddToCart_" + b[0];

                ge(ancId).innerHTML = lbl + '<div class="cart-default"></div>';
                ge(divId).className = "itemInCart"

            }
        }

    }
}
function GetCartUpdateStatusCPO(pid, minQty, gid) {
    if (ge('hidProducts') != null) {
        var hdProducts = ge('hidProducts');
        var prdCnt = 1;

        hdProducts.value = pid + ":1" + ",";

        var c = document.forms[0].elements;
        for (i = 0; i < c.length; i++) {
            if (c[i].type == "checkbox") {
                if (c[i].name == "checkProducts1") {
                    a = c[i].id.split("_");

                    if (a.length == 4) {
                        var test1 = c[i].id;
                        var test2 = "checkProducts_" + pid;

                        if (a[1] == pid) {
                            if (a[3] == gid) {
                                if (c[i].checked == true) {
                                    hdProducts.value = hdProducts.value + c[i].value + ":1" + ",";

                                    prdCnt = prdCnt + 1;

                                }
                                else {
                                    hdProducts.value = hdProducts.value + c[i].value + ":0" + ",";
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    for (i = 0; i < c.length; i++) {
        if (c[i].type == "checkbox") {
            if (c[i].name == "checkProducts1") {
                a = c[i].id.split("_");

                if (a.length == 4) {
                    if (a[1] == pid) {
                        if (prdCnt < minQty) {
                            var errMsg1 = ge('errMsg1_' + pid + '_' + gid);
                            if (errMsg1 != null) {
                                errMsg1.style.display = 'block'
                            }
                            var errMsg2 = ge('errMsg2_' + pid + '_' + gid);
                            if (errMsg2 != null) {
                                errMsg2.style.display = 'block'
                            }
                            var errMsg3 = ge('errMsg3_' + pid + '_' + gid);
                            if (errMsg3 != null) {
                                errMsg3.style.display = 'block'
                            }
                        }
                        else {
                            var errMsg1 = ge('errMsg1_' + pid + '_' + gid);
                            if (errMsg1 != null) {
                                errMsg1.style.display = 'none'
                            }
                            var errMsg2 = ge('errMsg2_' + pid + '_' + gid);
                            if (errMsg2 != null) {
                                errMsg2.style.display = 'none'
                            }
                            var errMsg3 = ge('errMsg3_' + pid + '_' + gid);
                            if (errMsg3 != null) {
                                errMsg3.style.display = 'none'
                            }
                        }
                    }
                }
            }
        }
    }

    if (prdCnt < minQty)
        return 'false'
    else
        return 'true'
}
function GetCartUpdateStatusFI(pid, minQty, gid, src) {
    if (ge('hidProducts') != null) {
        var hdProducts = ge('hidProducts');
        var prdCnt = 1;

        hdProducts.value = pid + ":1" + ",";

        var c = document.forms[0].elements;
        for (i = 0; i < c.length; i++) {
            if (c[i].type == "checkbox") {
                if (c[i].name == "checkProducts1") {
                    a = c[i].id.split("_");
                    if (a.length == 3) {
                        if (a[2] == gid) {
                            if (c[i].checked == true) {
                                hdProducts.value = hdProducts.value + c[i].value + ":1" + ",";

                                prdCnt = prdCnt + 1;
                            }
                            else {
                                hdProducts.value = hdProducts.value + c[i].value + ":0" + ",";
                            }
                        }
                    }


                }
            }
        }
    }
    for (i = 0; i < c.length; i++) {
        if (c[i].type == "checkbox") {
            if (c[i].name == "checkProducts1") {
                a = c[i].id.split("_");
                if (a.length == 3) {
                    if (a[2] == gid) {
                        if (prdCnt < minQty) {
                            if (src == "fi") {
                                var errMsg1 = ge('fi_promttionErrorMsg1_' + gid);
                                if (errMsg1 != null) {
                                    errMsg1.style.display = 'block'
                                }
                                var errMsg2 = ge('fi_promttionErrorMsg2_' + gid);
                                if (errMsg2 != null) {
                                    errMsg2.style.display = 'block'
                                }
                                var errMsg3 = ge('fi_promttionErrorMsg3_' + gid);
                                if (errMsg3 != null) {
                                    errMsg3.style.display = 'block'
                                }
                            }
                            else {
                                var errMsg1 = ge('promttionErrorMsg1_' + gid);
                                if (errMsg1 != null) {
                                    errMsg1.style.display = 'block'
                                }
                                var errMsg2 = ge('promttionErrorMsg2_' + gid);
                                if (errMsg2 != null) {
                                    errMsg2.style.display = 'block'
                                }
                                var errMsg3 = ge('promttionErrorMsg3_' + gid);
                                if (errMsg3 != null) {
                                    errMsg3.style.display = 'block'
                                }
                            }

                        }
                        else {
                            if (src == "fi") {
                                var errMsg1 = ge('fi_promttionErrorMsg1_' + gid);
                                if (errMsg1 != null) {
                                    errMsg1.style.display = 'none'
                                }
                                var errMsg2 = ge('fi_promttionErrorMsg2_' + gid);
                                if (errMsg2 != null) {
                                    errMsg2.style.display = 'none'
                                }
                                var errMsg3 = ge('fi_promttionErrorMsg3_' + gid);
                                if (errMsg3 != null) {
                                    errMsg3.style.display = 'none'
                                }
                            }
                            else {
                                var errMsg1 = ge('promttionErrorMsg1_' + gid);
                                if (errMsg1 != null) {
                                    errMsg1.style.display = 'none'
                                }
                                var errMsg2 = ge('promttionErrorMsg2_' + gid);
                                if (errMsg2 != null) {
                                    errMsg2.style.display = 'none'
                                }
                                var errMsg3 = ge('promttionErrorMsg3_' + gid);
                                if (errMsg3 != null) {
                                    errMsg3.style.display = 'none'
                                }
                            }

                        }
                    }
                }
            }
        }
    }
    if (prdCnt < minQty)
        return 'false'
    else
        return 'true'
}
function GetCartUpdateStatus(pid, minQty) {
    if (ge('hidProducts') != null) {
        var hdProducts = ge('hidProducts');
        var prdCnt = 1;

        hdProducts.value = pid + ":1" + ",";

        var c = document.forms[0].elements;
        for (i = 0; i < c.length; i++) {
            if (c[i].type == "checkbox") {
                if (c[i].name == "checkProducts1") {
                    if (c[i].checked == true) {
                        hdProducts.value = hdProducts.value + c[i].value + ":1" + ",";

                        prdCnt = prdCnt + 1;
                    }
                    else {

                        hdProducts.value = hdProducts.value + c[i].value + ":0" + ",";
                    }
                }
            }
        }
    }

    if (prdCnt < minQty)
        return 'false'
    else
        return 'true'
}
function AddToCart_MultiQuantity(a, c, b, e, d) {
    SelectedQty();
    if (ge("hidQty").value != "" || ge("hidQty").value != "") {
        if ((b == "") || ge(b) != null) {
            if (e == "page") {
                SL()
            } else {
                if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                    if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                        SL()
                    } else {
                        if (e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                            SL()
                        } else {
                            if (e == bookmarksControlID) {
                                SL()
                            } else {
                                if (e == RelatedProductsControlClientId) {
                                    ge("divShoppingCartLoader").style.display = B
                                } else {
                                    if (e == ProductsCompareContentControlClientId) {
                                        ge("divNaviWebLoader").style.display == B
                                    } else {
                                        SL()
                                    }
                                }
                            }
                        }
                    }
                }
            }
            quantity = parseInt(ge(d).value);
            if (quantity == "" || parseInt(ge(d).value) <= 0) {
                quantity = "1"
            }
            if (e != "page") {
                var cid;
                var sPath = window.location.pathname;
                var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
                if (sPage.toLowerCase() == 'cart.aspx') {
                    cid = 'ctl00_CP_ShoppingCartContentControl_ShoppingCart';
                }
                else {
                    cid = 'ctl00_ucFreeItems';
                }
                Anthem_InvokeControlMethod(cid, "AddToShoppingCart", [a, quantity],
                function(f) {
                    var h = new Array(3);
                    h = f.value;
                    try {
                        if (h[0] == "true") {
                            if (e == "page") {
                                HL()
                            } else {
                                if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                                    if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                                        HL()
                                    } else {
                                        if (e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                                            HL()
                                        } else {
                                            if (e == bookmarksControlID) {
                                                HL()
                                            } else {
                                                if (e == RelatedProductsControlClientId) {
                                                    ge("divShoppingCartLoader").style.display = N
                                                } else {
                                                    if (e == ProductsCompareContentControlClientId) {
                                                        ge("divNaviWebLoader").style.display == N
                                                    } else {
                                                        HL()
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            ChangeDivClass(a, h[1], h[2])
                        } else {
                            ActiveCartProduct(a)
                        }
                    } catch (g) { }
                })
            } else {
                Anthem_InvokePageMethod("AddToShoppingCart", [a, quantity],
                function(f) {
                    var h = new Array(3);
                    h = f.value;
                    try {
                        if (h[0] == "true") {
                            ChangeDivClass(a, h[1], h[2]);
                            if (e == "page") {
                                HL()
                            } else {
                                if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                                    if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                                        HL()
                                    } else {
                                        if (e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                                            HL()
                                        } else {
                                            if (e == bookmarksControlID) {
                                                HL()
                                            } else {
                                                if (e == RelatedProductsControlClientId) {
                                                    ge("divShoppingCartLoader").style.display = N
                                                } else {
                                                    if (e == ProductsCompareContentControlClientId) {
                                                        ge("divNaviWebLoader").style.display == N
                                                    } else {
                                                        HL()
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    } catch (g) { }
                })
            }
        }
        if (ge("txtmyquantity") != null) {
            ge("txtmyquantity").value = ge("hidQty").value
        }
    }
}
function AddToCartFromProdDetail_MultiQuantity(a, c, b, e, d) {
    if ((b == "") || ge(b) != null) {
        if ((b == "") || (ge(b).className != "itemInCart" && ge(b).className != "listviewcartbg")) {
            if (e == "page") {
                SL()
            } else {
                if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                    if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                        SL()
                    } else {
                        if (e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                            SL()
                        } else {
                            if (e == bookmarksControlID) {
                                SL()
                            } else {
                                if (e == RelatedProductsControlClientId) {
                                    ge("divShoppingCartLoader").style.display = B
                                } else {
                                    if (e == ProductsCompareContentControlClientId) {
                                        ge("divNaviWebLoader").style.display == B
                                    } else {
                                        SL()
                                    }
                                }
                            }
                        }
                    }
                }
            }
            quantity = parseInt(ge(d).value);
            if (ge(d).value == "" || ge(d).value == null) {
                quantity = "1"
            }
            if (e != "page") {
                Anthem_InvokeControlMethod(e, "AddToShoppingCart", [a, quantity],
                function(f) {
                    var h = new Array(3);
                    h = f.value;
                    try {
                        if (h[0] == "true") {
                            if (e == "page") {
                                HL()
                            } else {
                                if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                                    if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                                        HL()
                                    } else {
                                        if (e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                                            HL()
                                        } else {
                                            if (e == bookmarksControlID) {
                                                HL()
                                            } else {
                                                if (e == RelatedProductsControlClientId) {
                                                    ge("divShoppingCartLoader").style.display = N
                                                } else {
                                                    if (e == ProductsCompareContentControlClientId) {
                                                        ge("divNaviWebLoader").style.display == N
                                                    } else {
                                                        HL()
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            ChangeDivClass(a, h[1], h[2])
                        } else {
                            ActiveCartProduct(a)
                        }
                    } catch (g) { }
                })
            } else {
                Anthem_InvokePageMethod("AddToShoppingCart", [a, quantity],
                function(f) {
                    var h = new Array(3);
                    h = f.value;
                    try {
                        if (h[0] == "true") {
                            ChangeDivClass(a, h[1], h[2]);
                            if (e == "page") {
                                HL()
                            } else {
                                if ((typeof (UserWebShopContentControlClientId) != "undefined" && e == UserWebShopContentControlClientId)) { } else {
                                    if ((typeof (CheckOutItemsControlClientId) != "undefined" && e == CheckOutItemsControlClientId)) {
                                        HL()
                                    } else {
                                        if (e == RelatedProductsControlClientId && b == "divDetailsRelatedProductsAddToCart_" + a) {
                                            HL()
                                        } else {
                                            if (e == bookmarksControlID) {
                                                HL()
                                            } else {
                                                if (e == RelatedProductsControlClientId) {
                                                    ge("divShoppingCartLoader").style.display = N
                                                } else {
                                                    if (e == ProductsCompareContentControlClientId) {
                                                        ge("divNaviWebLoader").style.display == N
                                                    } else {
                                                        HL()
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    } catch (g) { }
                })
            }
        }
    }
}
function ChangeDivClass(n, b, x) {
    var f = "divContentPageBuyNow_" + n;
    var s = "divContentPageAddToCart_" + n;
    var g = "anchContentPageAddToCart_" + n;
    var l = "divProductsListBuyNow_" + n;
    var a = "divBrowsingBuyNow_" + n;
    var m = "anchProductsListAddToCart_" + n;
    var h = "divProductsListAddToCart_" + n;
    var t = "anchProductDetailsAddToCart_" + n;
    var w = "divProductDetailsAddToCart_" + n;
    var r = "anchPromotionsAddToCart_" + n;
    var o = "divPromotionsAddToCart_" + n;
    var q = "anchRelatedProductsAddToCart_" + n;
    var u = "divRelatedProductsAddToCart_" + n;
    var e = "anchBrowsingAddToCart_" + n;
    var d = "divBrowsingAddToCart_" + n;
    var c = "anchDetailsRelatedProductsAddToCart_" + n;
    var v = "divDetailsRelatedProductsAddToCart_" + n;
    if (ge(l) != null) {
        ge(l).className = "buy"
    }
    if (ge(a) != null) {
        ge(a).className = "buy"
    }
    if (ge(f) != null) {
        ge(f).className = "buy"
    }
    if (ge("divProductDetailsBuyNow") != null) {
        ge("divProductDetailsBuyNow").className = "buy"
    }
    if (ge(h) != null) {
        ge(m).innerHTML = b;
        ge(h).className = x;
        ge(m).title = b
    }
    if (ge(s) != null) {
        ge(g).innerHTML = b;
        ge(s).className = x;
        ge(g).title = b
    }
    if (ge(w) != null) {
        ge(t).innerHTML = b;
        ge(w).className = x;
        ge(t).title = b
    }
    if (ge(o) != null) {
        ge(r).innerHTML = b;
        ge(o).className = x;
        ge(r).title = b
    }
    if (ge(u) != null) {
        ge(q).innerHTML = b;
        ge(u).className = x;
        ge(q).title = b
    }
    if (ge(d) != null) {
        ge(e).innerHTML = b;
        ge(d).className = x;
        ge(e).title = b
    }
    if (ge(v) != null) {
        ge(c).innerHTML = b;
        ge(v).className = x;
        ge(c).title = b
    }
}
var isadvancedSearchVisible;
var advancedSearchDivID;
function ChangeSearchCategoryCheckboxStatus(e, a, f, d) {
    var g = "";
    var h = document.forms[0].elements;
    for (i = 0; i < h.length; i++) {
        if (h[i].type == "checkbox" && h[i].name == a) {
            if (e == "CheckAll") {
                h[i].checked = true;
                g += h[i].value + ",";
                var b = document.forms[0].elements;
                for (j = 0; j < b.length; j++) {
                    if (b[j].type == "checkbox" && b[j].name == f) {
                        b[j].checked = true
                    }
                }
            } else {
                if (e == "UnCheckAll") {
                    h[i].checked = false;
                    g = "";
                    if (d == "true") {
                        var b = document.forms[0].elements;
                        for (j = 0; j < b.length; j++) {
                            if (b[j].type == "checkbox" && b[j].name == f) {
                                b[j].checked = false
                            }
                        }
                    }
                } else {
                    if (e == "CheckMe" && h[i].checked == true) {
                        g += h[i].value + ","
                    }
                }
            }
        }
    }
    var h = document.forms[0].elements;
    for (i = 0; i < h.length; i++) {
        if (h[i].type == "checkbox" && h[i].name == f) {
            if (h[i].checked) {
                g += h[i].value + ","
            }
        }
    }
    g = g.substring(0, g.length - 1);
    var c = ge(hdnSelectedCatagoryIdsClientId);
    c.value = "";
    c.value = g
}
function ChangeFilterCheckboxStatus(g, a) {
    var f = ge(g);
    if (f.type == "checkbox" && f.name == a && f.checked == true && f.value == "0") {
        var e = document.forms[0].elements;
        for (i = 0; i < e.length; i++) {
            if (e[i].type == "checkbox" && e[i].name == a && e[i].value != "0") {
                e[i].checked = false
            }
        }
    }
    if (f.type == "checkbox" && f.name == a && f.checked == true && f.value != "0") {
        var e = document.forms[0].elements;
        for (i = 0; i < e.length; i++) {
            if (e[i].type == "checkbox" && e[i].name == a && e[i].value == "0") {
                e[i].checked = false
            }
        }
    }
    if (f.type == "checkbox" && f.name == a && f.checked == false && f.value != "0") {
        var e = document.forms[0].elements;
        for (i = 0; i < e.length; i++) {
            if (e[i].type == "checkbox" && e[i].name == a && e[i].value == "0") {
                if (e[i].checked == true) {
                    var c = ge("0");
                    if (c.type == "checkbox" && c.name == a) {
                        c.checked = false
                    }
                }
            }
        }
    }
    var d = "";
    var b = document.forms[0].elements;
    for (i = 0; i < b.length; i++) {
        if (b[i].type == "checkbox" && b[i].name == "FilterStocks" && b[i].checked == true) {
            d += b[i].value + ","
        }
    }
    //ChangeStyle(d, "divAnchFilterByStock")
}
function ChangeCheckboxStatus(e, a) {
    var f = "";
    var h = document.forms[0].elements;
    for (i = 0; i < h.length; i++) {
        if (h[i].type == "checkbox" && h[i].name == a) {
            if (e == "CheckAll") {
                h[i].checked = true;
                f += h[i].value + ","
            } else {
                if (e == "UnCheckAll") {
                    h[i].checked = false;
                    f = ""
                } else {
                    if (e == "CheckMe" && h[i].checked == true) {
                        var b;
                        if (a == "FilterPrice") {
                            f += h[i].value + ","
                        }
                        if (a == "FilterStocks") { } else {
                            f += h[i].value + ","
                        }
                    } else {
                        if (e == "FeatureCheckMe" && h[i].checked == true) {
                            f += h[i].value + ","
                        }
                    }
                }
            }
        }
    }
    f = f.substring(0, f.length - 1);
    if (a == "FilterManufacturers") {
        var g = ge("hdnFilterManufacturerIds");
        g.value = "";
        g.value = f;
        ChangeStyle(f, "divAnchFilterByManufacturer")
    } else {
        if (a == "FilterCatagories") {
            var d = ge("hdnFilterCatagoryIds");
            d.value = "";
            d.value = f;
            ChangeStyle(f, "divAnchFilterByCategory")
        } else {
            if (a == "FilterSubCatagories") {
                ChangeStyle(f, "divAnchFilterBySubCategory")
            } else {
                if (a == "FilterStocks") {
                    //ChangeStyle(f, "divAnchFilterByStock")
                } else {
                    if (a == "FilterPrice") {
                        ChangeStyle(f, "divAnchSortByPrice")
                    } else {
                        var c = ge("hdnFilterFeatureIds");
                        c.value = f;
                        ChangeStyle(f, "divFeatureFilter_" + a)
                    }
                }
            }
        }
    }
}
function ChangeStyle(b, a) {
    if (b == "") {
        ge(a).className = "disableUpdate"
    } else {
        ge(a).className = "update"
    }
}
function Show(a) {
    if (ge(a) != null) {
        if (ge(a).style.display != B) {
            ge(a).style.display = B
        }
    }
}
function Hide(a) {
    if (ge(a) != null) {
        if (ge(a).style.display != N) {
            ge(a).style.display = N
        }
    }
}
function ShowAdvancedSearch(b, e) {
    if ((b.which == 13) || (b.keyCode == 13)) {
        return true
    } else {
        var f = ge(txtSearchTermsClientId).value;
        var d = ge("hdnDefaultSearchText").value;
        if ((b.which == 27) || (b.keyCode == 27)) {
            if (f == d) {
                ge(txtSearchTermsClientId).value = ""
            }
        } else {
            if (f.length > 2 && f != d) {
                Hide(e)
            } else {
                Show(e)
            }
            isadvancedSearchVisible = true;
            advancedSearchDivID = e;
            document.onclick = HideAdvancedSearch
        }
    }
    var c = ge(hdnSelectedCatagoryIdsClientId);
    if (c.value == null) {
        c.value = ""
    }
    var a = $find("CompleteExtender");
    a.set_contextKey(c.value)
}
function HideAdvancedSearch() {
    if (!isadvancedSearchVisible) {
        Hide(advancedSearchDivID)
    } else {
        isadvancedSearchVisible = false
    }
}
function FireSearchClickEvent(a) {
    fireEvent(ge(a), "click")
}
function fireEvent(c, a) {
    var d = c;
    if (document.createEvent) {
        var b = document.createEvent("MouseEvents");
        b.initEvent(a, true, false);
        d.dispatchEvent(b)
    } else {
        if (document.createEventObject) {
            d.fireEvent("on" + a)
        }
    }
}
function WatermarkFocus(c) {
    var a = c.id;
    var b = ge("hdnDefaultSearchText").value;
    if (ge(a).value == b) {
        ge(a).value = ""
    }
    ge(a).className = "searchTextActive"
}
function WatermarkBlur(c) {
    var a = c.id;
    var b = ge("hdnDefaultSearchText").value;
    if (ge(a).value == "") {
        ge(a).className = "searchTextInActive";
        ge(a).value = b
    }
}
function Validation(b, e) {
    try {
        if (e == "ButtonClick") {
            var f = ge(txtSearchTermsClientId).value.trim();
            var d = ge("hdnDefaultSearchText").value;
            if (f == "" || f == d) {
                return false
            } else {
                return true
            }
        } else {
            if (e == "KeyPress") {
                var a = (b.which) ? b.which : event.keyCode;
                if ((a == 60) || (a == 62)) {
                    return false
                } else {
                    return true
                }
            }
        }
    } catch (c) { }
}
function LoadBrands(c) {

    var e = "searchResultButonActv";
    var a = ge("hdnFilter");
    var b = ge("hdnpopoutFilter");


    if (a.value != "") {


        if ((ge(a.value).className != rba) && (ge(a.value).className != rbaa)) {
            ge(a.value).className = rb
        }
        else {
            if (ge(a.value).className = rbaa) {
                ge(a.value).className = rba
            }
        }
        ge(b.value).style.display = N
    }
    if (c == "dvBrands") {
        if (ge(c).className == rb) {
            ge(c).className = e
        }
        else {
            if (ge(c).className == rba) {
                ge(c).className = rbaa
            }
        }
        ge("dvmanufacturespopOut").style.display = B;
        ge("dvcategoriespopOut").style.display = N;
        ge("dvSortByPricepopOut").style.display = N;
        ge("dvPricepopOut").style.display = N;
        ge("dvstockspopOut").style.display = N;

        if (ge("dvCategories") != null) {
            if ((ge("dvCategories").className == rbaa) || (ge("dvCategories").className == rba)) {
                ge("dvCategories").className = rba
            }
            else {
                ge("dvCategories").className = rb
            }

        }

        if (ge("dvPrice") != null) {
            if ((ge("dvPrice").className != rba) && (ge("dvPrice").className != rbaa)) {
                ge("dvPrice").className = rb
            }
            else {
                if (ge("dvPrice").className = rbaa) {
                    ge("dvPrice").className = rba
                }
            }

        }
        if (ge("dvStocks") != null) {
            if ((ge("dvStocks").className == rbaa) || (ge("dvStocks").className == rba)) {
                ge("dvStocks").className = rba
            }
            else {
                ge("dvStocks").className = rb
            }
        }
    }
    else {
        if (c == "dvCategories") {
            if (ge(c).className == rb) {
                ge(c).className = e
            }
            else {
                if (ge(c).className == rba) {
                    ge(c).className = rbaa
                }
            }
            ge("dvmanufacturespopOut").style.display = N;
            ge("dvcategoriespopOut").style.display = B;
            ge("dvSortByPricepopOut").style.display = N;
            ge("dvPricepopOut").style.display = N;
            ge("dvstockspopOut").style.display = N;

            if (ge("dvBrands") != null) {
                if ((ge("dvBrands").className != rba) && (ge("dvBrands").className != rbaa)) {
                    ge("dvBrands").className = rb
                }
                else {
                    if (ge("dvBrands").className = rbaa) {
                        ge("dvBrands").className = rba
                    }
                }
            }

            if (ge("dvPrice") != null) {
                if ((ge("dvPrice").className != rba) && (ge("dvPrice").className != rbaa)) {
                    ge("dvPrice").className = rb
                }
                else {
                    if (ge("dvPrice").className = rbaa) {
                        ge("dvPrice").className = rba
                    }
                }
            }

            if (ge("dvStocks") != null) {
                if ((ge("dvStocks").className == rbaa) || (ge("dvStocks").className == rba)) {
                    ge("dvStocks").className = rba
                }
                else {
                    ge("dvStocks").className = rb
                }
            }
        }


        else {
            if (c == "dvStocks") {
                if (ge(c).className == rb) {
                    ge(c).className = e
                } else {
                    if (ge(c).className == rba) {
                        ge(c).className = rbaa
                    }
                }
                ge("dvmanufacturespopOut").style.display = N;
                ge("dvcategoriespopOut").style.display = N;
                ge("dvSortByPricepopOut").style.display = N;
                ge("dvPricepopOut").style.display = N;
                ge("dvstockspopOut").style.display = B;


                if (ge("dvBrands") != null) {
                    if ((ge("dvBrands").className != rba) && (ge("dvBrands").className != rbaa)) {
                        ge("dvBrands").className = rb
                    } else {
                        if (ge("dvBrands").className = rbaa) {
                            ge("dvBrands").className = rba
                        }
                    }
                }
                if (ge("dvPrice") != null) {
                    if ((ge("dvPrice").className != rba) && (ge("dvPrice").className != rbaa)) {
                        ge("dvPrice").className = rb
                    } else {
                        if (ge("dvPrice").className = rbaa) {
                            ge("dvPrice").className = rba
                        }
                    }
                }
                if (ge("dvCategories") != null) {
                    if ((ge("dvCategories").className == rbaa) || (ge("dvCategories").className == rba)) {
                        ge("dvCategories").className = rba
                    } else {
                        ge("dvCategories").className = rb
                    }
                }
            }
            else {
                if (c == "dvSortByPrice") {
                    ge(c).className = e;
                    ge("dvmanufacturespopOut").style.display = N;
                    ge("dvcategoriespopOut").style.display = N;
                    ge("dvSortByPricepopOut").style.display = B
                } else {
                    if (c == "dvPrice") {
                        if (ge(c).className == rb) {
                            ge(c).className = e
                        } else {
                            if (ge(c).className == rba) {
                                ge(c).className = rbaa
                            }
                        }
                        ge("dvmanufacturespopOut").style.display = N;
                        ge("dvcategoriespopOut").style.display = N;
                        ge("dvPricepopOut").style.display = B;
                        ge("dvstockspopOut").style.display = N;


                        if (ge("dvBrands") != null) {
                            if ((ge("dvBrands").className != rba) && (ge("dvBrands").className != rbaa)) {
                                ge("dvBrands").className = rb
                            } else {
                                if (ge("dvBrands").className = rbaa) {
                                    ge("dvBrands").className = rba
                                }
                            }
                        }

                        if (ge("dvCategories") != null) {
                            if ((ge("dvCategories").className != rba) && (ge("dvCategories").className != rbaa)) {
                                ge("dvCategories").className = rb
                            } else {
                                if (ge("dvCategories").className = rbaa) {
                                    ge("dvCategories").className = rba
                                }
                            }
                        }
                        if (ge("dvStocks") != null) {
                            if ((ge("dvStocks").className == rbaa) || (ge("dvStocks").className == rba)) {
                                ge("dvStocks").className = rba
                            } else {
                                ge("dvStocks").className = rb
                            }
                        }
                    }
                    else {
                        var d = c + "_popout";
                        a.value = c;
                        b.value = d;
                        if (ge(c).className != rba) {
                            ge(c).className = e
                        } else {
                            ge(c).className = rbaa
                        }
                        ge(d).style.display = B;
                        ge("dvmanufacturespopOut").style.display = N;
                        ge("dvcategoriespopOut").style.display = N;
                        ge("dvSortByPricepopOut").style.display = N;
                        ge("dvPricepopOut").style.display = N;
                        ge("dvstockspopOut").style.display = N;

                        if (ge("dvBrands") != null) {
                            if ((ge("dvBrands").className != rba) && (ge("dvBrands").className != rbaa)) {
                                ge("dvBrands").className = rb
                            } else {
                                if (ge("dvBrands").className = rbaa) {
                                    ge("dvBrands").className = rba
                                }
                            }
                        }

                        if (ge("dvCategories") != null) {

                            if ((ge("dvCategories").className != rba) && (ge("dvCategories").className != rbaa)) {
                                ge("dvCategories").className = rb
                            } else {
                                if (ge("dvCategories").className = rbaa) {
                                    ge("dvCategories").className = rba
                                }
                            }
                        }

                        if (ge("dvPrice") != null) {
                            if ((ge("dvPrice").className != rba) && (ge("dvPrice").className != rbaa)) {
                                ge("dvPrice").className = rb
                            } else {
                                if (ge("dvPrice").className = rbaa) {
                                    ge("dvPrice").className = rba
                                }
                            }
                        }
                        ge("dvSortByPrice").className = rb;
                        if (ge("dvStocks") != null) {
                            if ((ge("dvStocks").className == rbaa) || (ge("dvStocks").className == rba)) {
                                ge("dvStocks").className = rba
                            }
                            else {
                                ge("dvStocks").className = rb
                            }
                        }
                    }
                }
            }
        }
    }
}
function LoadSearchCategories(c) {
    if (c != "") {
        var b = "";
        var a;
        a = c.split(",");
        for (i = 0; i < a.length; i++) {
            var d = document.forms[0].elements;
            for (j = 0; j < d.length; j++) {
                k = i;
                if (d[j].type == "checkbox" && d[j].name == "SearchCatagories") {
                    if (d[j].value == a[i]) {
                        d[j].checked = true
                    } else {
                        if (k == 0) {
                            d[j].checked = false
                        }
                    }
                }
            }
        }
    }
}
function CloseFilter(a, b) {
    Hide(a);
    if (ge(b).className == rbaa) {
        ge(b).className = rba
    } else {
        ge(b).className = rb
    }
}
function StartFiltering(q, f, g, s, e, r, h, b) {

    var m = "";
    var o = document.forms[0].elements;
    for (i = 0; i < o.length; i++) {
        if (o[i].type == "checkbox" && o[i].name == s) {
            var a;
            if (g == "CheckMe" && o[i].checked == true) {
                if (s == "FilterPrice") {
                    m += o[i].value + ","
                } else {
                    if (s == "FilterSubCatagories") {
                        m += o[i].value + ","
                    } else {
                        if (s == "FilterStocks") {
                            m += o[i].value + ",";
                            if (o[i].value == "0") {
                                s = "changed";
                                m = "0"
                            }
                        } else {
                            m += o[i].value + ","
                        }
                    }
                }
            } else {
                if (g == "FeatureCheckMe" && o[i].checked == true) {
                    m += o[i].value + "F##F"
                }
                else if (g == "FeatureGroupCheckMe" && o[i].checked == true) {

                    m += o[i].value + "F##F"
                }
            }
        }
    }
    var d = "";
    var l;
    var c;
    if (q == "Manufacturer") {
        d = m
    } else {
        if (q == "Category") {
            d = m
        } else {
            if (q == "Price") {
                d = GetCurrentSortOption()
            } else {
                if (q == "Stock") { }
                else {
                    if (q == "FeatureFilter") {
                        d = m
                    }
                    else if (q == "FeatureGroupFilter") {
                        d = m
                    }
                }
            }
        }
    }
    if (q == "FeatureFilter" || q == "Pricing" || q == "FeatureGroupFilter") {
        m = m + ",";
        m = m.replace("F##F,", "")
    } else {
        if (m != "1" && m != "" && m != "0") {
            m = m.substring(0, m.length - 1)
        }
    }
    d = m;
    var n;
    if (d == "" && q == "Stock") {
        d = -1;
    }
    if ((d != "") && (d != ",")) {
        if (e == "DefaultPage") {
            n = "ctl00_CP_PCC_ucFilters"
        } else {
            n = "ctl00_CP_PCC_ucProductsList"
        }
        SL();
        Anthem_InvokeControlMethod(n, "FilterResults", [d, q, f, "", e, h],
        function(u) {
            try {
                Hide(b);
                var w = new Array(2);
                w = u.value;
                if (w[0] == T) {
                    var t = ge("hdnFilter");
                    t.value = "";
                    HL();
                    goToTop()
                } else {
                    if (w[0] == F) {
                        SE(w[1])
                    }
                }
            } catch (v) { }
        });
        ShowOrHideAllProducts(T)
    }
}
function SetProductListControlId(a) {
    if (varProductListControlId != "ctl00_CP_PCC_ucProductsList") {
        varProductListControlId = a
    }
}
function SortListView(a, b) {
    SL();

    Anthem_InvokeControlMethod(varProductListControlId, "SortListView", [a, b],
    function(c) {
        if (c.value == T) {
            HL()
        }
    })
}
function SetSortClass(m) {
    var n = "divProductNameUp";
    var h = "divProductNameDown";
    var b = "divProductBrandUp";
    var l = "divProductBrandDown";
    var d = "divProductPriceUp";
    var a = "divProductPriceDown";
    var c = "ListViewArrowImgASC";
    var f = "ListViewBlackDownArrowImg";
    var e = "ListViewArrowImgDESC";
    var g = "ListViewBlackUpArrowImg";
    if ((ge(n) != null) && (ge(h) != null) && (ge(b) != null) && (ge(l) != null) && (ge(d) != null) && (ge(a) != null)) {
        if (m == "ProductName ASC") {
            ge(n).className = e;
            ge(h).className = g;
            ge(b).className = e;
            ge(l).className = c;
            ge(d).className = e;
            ge(a).className = c
        }
        if (m == "ProductName DESC") {
            ge(h).className = c;
            ge(n).className = f;
            ge(b).className = e;
            ge(l).className = c;
            ge(d).className = e;
            ge(a).className = c
        }
        if (m == "ManufacturerName ASC") {
            ge(b).className = e;
            ge(l).className = g;
            ge(n).className = e;
            ge(h).className = c;
            ge(d).className = e;
            ge(a).className = c
        }
        if (m == "ManufacturerName DESC") {
            ge(l).className = c;
            ge(b).className = f;
            ge(n).className = e;
            ge(h).className = c;
            ge(d).className = e;
            ge(a).className = c
        }
        if (m == "Price ASC") {
            ge(d).className = e;
            ge(a).className = g;
            ge(n).className = e;
            ge(h).className = c;
            ge(b).className = e;
            ge(l).className = c
        }
        if (m == "Price DESC") {
            ge(a).className = c;
            ge(d).className = f;
            ge(n).className = e;
            ge(h).className = c;
            ge(b).className = e;
            ge(l).className = c
        }
    }
}
function GetCurrentSortOption() {
    try {
        if (ge("rdbSortByPriceAscending").checked) {
            return ge("rdbSortByPriceAscending").value
        } else {
            return ge("rdbSortByPriceDescending").value
        }
    } catch (a) { }
}
function ClearingFilter(c, e, b, a, d) {
    if (b == "DefaultPage") {
        cid = "ctl00_CP_PCC_ucFilters"
    } else {
        cid = "ctl00_CP_PCC_ucProductsList"
    }
    SL();
    Anthem_InvokeControlMethod(cid, "FilterResults", ["", c, e, "Clear", b],
    function(g) {
        try {
            Hide(d);
            var l = new Array(2);
            l = g.value;
            if (l[0] == T) {
                var f = ge("hdnFilter");
                f.value = "";
                if (c != "Stock") {
                    ge(a).className = rb
                }
                HL();
                goToTop()
            } else {
                if (l[0] == F) {
                    SE(l[1])
                }
            }
            ge("ctl00_CP_PCC_ucFilters_PHC_PH_pnlAppliedFilters").style.display = N
        } catch (h) { }
    })
}
function ShowOrHideAllProducts(a) {
    try {
        if ((a == T) || (a == "True")) {
            ge("divUcAllProducts").style.display = N
        } else {
            ge("divUcAllProducts").style.display = B
        }
    } catch (b) { }
}
function ShowOrderDetails(a) {
    if (ge(a).style.display != B) {
        ge(a).style.display = B
    } else {
        ge(a).style.display = N
    }
}
function ShowOrderPrint(a) {
    window.open(ge("ctl00_CP_hdnSiteRoot").value + "SSL/OrderPrint.aspx?OrderId=" + a + "", "", "width=850, height=550, left=65, top=35, scrollbars=yes, menubar=no,resizable=no,directories=no,location=no")
}
function ge(a) {
    if (document.getElementById(a) != null) {
        return document.getElementById(a)
    }
}
function SearchFunction() {
    varProductListControlId = "ctl00_CP_PCC_ucProductsList";
    hfCompareProductIdsClientId = "ctl00_CP_PCC_ucProductsList_PHC_hfCompareProductIds";
    ProductsCompareContentControlClientId = "ctl00_CP_PCC_ucProductsList_PHC_ucProductsCompareContentControl";
    ProductsCompareHiddenFieldControlId = "ctl00_CP_PCC_ucProductsList_PHC_ucProductsCompareContentControl_hdnCompareProductId"
}
function PrintProductCompare() {
    var a = ge("hdnShowAllSpecifications").value;
    window.open(ge("ctl00_CP_hdnSiteRoot").value + "ProductComparePrint.aspx?showAllSpecs=" + a + "", "", "width=800, height=550, left=120, top=50, scrollbars=yes, menubar=no,resizable=no,directories=no,location=no")
}
function OnProductDetailsClickBookMark(a) {
    var b = "anchBookMark_" + a;
    var c = "divBookMark_" + a;
    if (ge(b) != null && ge(c) != null) {
        if (ge(c).className != "markhighlight") {
            SL();
            Anthem_InvokeControlMethod(ProductDetailsClientId, "AddToBookMark", [a],
            function(d) {
                try {
                    var f = new Array(3);
                    f = d.value;
                    if (f[0] == T) {
                        ge(b).title = f[1];
                        ge(c).className = f[2];
                        ge("divwishList").className = "wishListhighlight"
                    } else {
                        if (f[0] == "error") {
                            SE(f[1])
                        }
                    }
                } catch (e) { }
                HL()
            })
        }
    }
}
function ChangeDivClass(o, b, z) {
    var g = "divContentPageBuyNow_" + o;
    var t = "divContentPageAddToCart_" + o;
    var h = "anchContentPageAddToCart_" + o;
    var m = "divProductsListBuyNow_" + o;
    var a = "divBrowsingBuyNow_" + o;
    var n = "anchProductsListAddToCart_" + o;
    var l = "divProductsListAddToCart_" + o;
    var v = "anchProductDetailsAddToCart_" + o;
    var y = "divProductDetailsAddToCart_" + o;
    var s = "anchPromotionsAddToCart_" + o;
    var q = "divPromotionsAddToCart_" + o;
    var r = "anchRelatedProductsAddToCart_" + o;
    var w = "divRelatedProductsAddToCart_" + o;
    var e = "anchBrowsingAddToCart_" + o;
    var d = "divBrowsingAddToCart_" + o;
    var c = "anchDetailsRelatedProductsAddToCart_" + o;
    var x = "divDetailsRelatedProductsAddToCart_" + o;
    var u = "divListViewAddToCart_" + o;
    var f = "divCompareAddToCart_" + o;
    if (ge(m) != null) {
        ge(m).className = "buy"
    }
    if (ge(a) != null) {
        ge(a).className = "buy"
    }
    if (ge(g) != null) {
        ge(g).className = "buy"
    }
    if (ge("divProductDetailsBuyNow") != null) {
        ge("divProductDetailsBuyNow").className = "buy"
    }
    if (ge(u) != null) {
        ge(u).className = "listviewcartbg";
        ge(u).title = b
    }
    if (ge(f) != null) {
        ge(f).className = z;
        ge(f).title = b
    }
    if (ge(l) != null) {
        ge(n).innerHTML = b + '<div class="cart-default"></div>';
        ge(l).className = z;
        ge(n).title = b
    }
    if (ge(t) != null) {
        ge(h).innerHTML = b + '<div class="cart-default"></div>';
        ge(t).className = z;
        ge(h).title = b
    }
    if (ge(y) != null) {
        ge(v).innerHTML = b + '<div class="cart-default"></div>';
        ge(y).className = "itemInCart";
        ge(v).title = b
    }
    if (ge(q) != null) {
        ge(s).innerHTML = b;
        ge(q).className = z;
        ge(s).title = b
    }
    if (ge(w) != null) {
        ge(r).innerHTML = b;
        ge(w).className = z;
        ge(r).title = b
    }
    if (ge(d) != null) {
        ge(e).innerHTML = b + '<div class="related-cart-default"></div>';
        ge(d).className = z;
        ge(e).title = b
    }
    if (ge(x) != null) {
        ge(c).innerHTML = b + '<div class="related-cart-default"></div>';
        ge(x).className = z;
        ge(c).title = b
    }
}
function GetLocalisedText(a) {
    Anthem_InvokeControlMethod(ProductDetailsClientId, "GetLocalisedText", [a],
    function(b) {
        var c = b.value
    })
}
function UpdateReview() {
    var b = ge(txtTitleClientId).value;
    var a = ge(txtBodyClientId).value;
    if (b != "" && a != "") {
        SL();
        ge("divReviewErrorMessage").style.display = N;
        Anthem_InvokeControlMethod(ProductDetailsClientId, "UpdateReview", [],
        function(c) {
            try {
                var e = new Array(2);
                e = c.value;
                if (e[0] == T) {
                    ge("divReviews").className = "featureButtonActv";
                    ge("reviews").style.display = B;
                    ge("divfeatures").style.display = N;
                    ge("divspecifications").className = "featureButton";
                    ge("divReviewUpdatedMessage").style.display = B;
                    HL()
                } else {
                    if (e[0] == F) {
                        SE(e[1])
                    }
                }
            } catch (d) { }
        })
    } else {
        ge("divReviewUpdatedMessage").style.display = N;
        ge("divReviewErrorMessage").style.display = B
    }
}
function LoadSpecifications(a) {
    if (a == "divReviews") {
        ge(a).className = "featureButtonActv";
        ge("reviews").style.display = B;
        if (ge("divMoviews") != null) {
            ge("divMoviews").className = "featureButton";
            ge("divfilms").style.display = N
        }
        if (ge("divspecifications") != null) {
            ge("divfeatures").style.display = N;
            ge("divspecifications").className = "featureButton"
        }
    } else {
        if (a == "divMoviews") {
            ge(a).className = "featureButtonActv";
            ge("divfilms").style.display = B;
            if (ge("divspecifications") != null) {
                ge("divspecifications").className = "featureButton";
                ge("divfeatures").style.display = N
            }
            if (ge("divReviews") != null) {
                ge("divReviews").className = "featureButton";
                ge("reviews").style.display = N
            }
        } else {
            ge(a).className = "featureButtonActv";
            ge("divfeatures").style.display = B;
            if (ge("divMoviews") != null) {
                ge("divMoviews").className = "featureButton";
                ge("divfilms").style.display = N
            }
            if (ge("divReviews") != null) {
                ge("divReviews").className = "featureButton";
                ge("reviews").style.display = N
            }
        }
    }
}
function ClearReview() {
    ge(txtTitleClientId).value = "";
    ge(txtBodyClientId).value = ""
}
function PrintProductDetails(a, b) {
    window.open(ge("ctl00_CP_hdnSiteRoot").value + b + "/" + "ProductDetailsPrint.aspx?pid=" + a + "", "", "width=960, height=550, left=30, top=50, scrollbars=yes, menubar=no,resizable=no,directories=no,location=no")

}
function BuyNowFromContentPage(a) {
    var b = "divContentPageBuyNow_" + a;
    if (ge(b) != null) {
        if (ge(b).className != "itemInCart") {
            if (a != null) {
                Anthem_InvokePageMethod("BuyNowFromContentPage", [a],
                function(c) { })
            }
        }
    }
}
function OnClickBookMarkFromContentPage(a) {
    var b = "anchBookMark_" + a;
    var c = "divBookMark_" + a;
    if (ge(b) != null && ge(c) != null) {
        if (ge(c).className != "markhighlight") {
            SL();
            Anthem_InvokePageMethod("AddToBookMark", [a],
            function(d) {
                try {
                    var f = new Array(3);
                    f = d.value;
                    if (f[0] == T) {
                        ge(b).title = f[1];
                        ge(c).className = f[2];
                        ge("divwishList").className = "wishListhighlight"
                    } else {
                        if (f[0] == "error") {
                            SE(f[1])
                        }
                    }
                } catch (e) { }
                HL()
            })
        }
    }
}
function TrackPageView(a) {
    pageTracker._trackPageview(a)
}
function LoadContent(a) {
    if (a == "reviews") {
        ge("reviews").style.display = B;
        ge("divReviews").className = "featureButtonActv"
    } else {
        if (a == "divfilms") {
            ge("divfilms").style.display = B;
            ge("divMoviews").className = "featureButtonActv"
        }
    }
}
function LoadAddToCart(Id, divId) {
    var div = divId + '_' + Id;
    var product = "MainProduct";
    var variantId = "0";

    if (ge(div).className == "add" || ge(div).className == "listviewaddcartbg" || ge(div).className == "addCartPage") {
        SL();
        var isRelatedProduct;
        //This is for card related product style change to item in cart.
        if (divId == 'divRelatedProductsAddToCart') {
            product = "divRelatedProductsAddToCart";
            isRelatedProduct = true;
        }
        
        var sPath = window.location.pathname;
        var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

        if (sPage.toLowerCase() == 'p' + Id + '.aspx' || sPage.toLowerCase() == "default.aspx") 
        {
            var ctrlMatrix = ge('ProductVariantId_' + Id); 
            var ctrl = ge('variantId_' + Id);           
            if(ctrl != null && ctrl != "undefined")
            {              
               var IndexValue = ge('variantId_' + Id).selectedIndex;
               variantId = ge('variantId_' + Id).options[IndexValue].value;
               var variant= ge('variantId_' + Id).options[IndexValue].text;
               var variantType= ge('variantType_' + Id).innerHTML;
               LightBoxAddToCartWithVariant(Id, product, variantId, variant, variantType);
            }
            if (ctrlMatrix != null && ctrlMatrix != "undefined") {
               //var IndexValue = ge('variantId_' + Id).selectedIndex;
               var variant = ge('ProductVariantName_' + Id).innerHTML;
               variantId = ge('ProductVariantId_' + Id).value;
               var variantType = ge('ProductVariantTypeName_' + Id).innerHTML;
               LightBoxAddToCartWithVariant(Id, product, variantId, variant, variantType);
            }
            else
            {
                LightBoxAddToCart(Id, product);
            }
        }
        else
        {
            LightBoxAddToCart(Id, product);
        }
        if (sPage.toLowerCase() == 'cart.aspx') {
            Anthem_InvokeControlMethod(ShoppingCartClientId, "RebindCartList", [isRelatedProduct],
                    function(g) { });
        }
        Anthem_InvokeControlMethod(AddToCartProductDetailsClientId, "LoadAddToCart", [Id],
        function(result) {
        
        new NaviWebLightBox.base("divAddToCart");
        });
    }
}
function LightBoxAddToCart(pId, product) {   
    if (product == 'RelatedProduct') {
        ge("divPagingLoader").style.display = B;
    }
    Anthem_InvokeControlMethod(AddToCartProductDetailsClientId, "AddToShoppingCart", [pId],
    function(result) {
        var R = new Array(3);
        R = result.value;
        try {
            if (R[0] == "true") {
                if (product == 'MainProduct') {
                    ChangeDivClass(pId, R[1], R[2]);
                }
                else if (product == 'RelatedProduct') {
                    ge(product + "_" + pId).className = "listviewcartbg";
                    ge(product + "_" + pId).style.cursor = "text";
                    ge(product + "_" + pId).title = R[1];
                    ge("divPagingLoader").style.display = N;
                }
                else if (product == 'divRelatedProductsAddToCart') {
                ge(product + "_" + pId).className = "listviewcartbg";
                    ge("anchRelatedProductsAddToCart_" + pId).innerHTML = R[1];
                }
            }
        }
        catch (ex)
        { }
    });
}

function AddToCartCompareProducts(pId) {   
    Anthem_InvokeControlMethod('ctl00_CP_ucAddToCart', "AddToShoppingCart", [pId],
    function(result) {
        var R = new Array(3);
        R = result.value;
        try {
            if (R[0] == "true") {
                 var f = "divCompareAddToCart_" + pId;           
                 ge(f).className = "listviewcartbg";
                 ge(f).title =R[1];
                 // ChangeDivClass(pId, R[1], R[2]);
            }
        }
        catch (ex)
        { }
    });
}

function LightBoxAddToCartWithVariant(pId, product, vId, variant, variantType) {   
    if (product == 'RelatedProduct') {
        ge("divPagingLoader").style.display = B;
    }
    Anthem_InvokeControlMethod(AddToCartProductDetailsClientId, "AddToShoppingCartWithVariant", [pId, vId, variant, variantType],
    function(result) {
        var R = new Array(3);
        R = result.value;
        try {
        
            if (R[0] == "true") {
                if (product == 'MainProduct') {
                    ChangeProductDetailDivClass(pId, R[1], R[2]);
                }
                else if (product == 'RelatedProduct') {
                    ge(product + "_" + pId).className = "listviewcartbg";
                    ge(product + "_" + pId).style.cursor = "text";
                    ge(product + "_" + pId).title = R[1];
                    ge("divPagingLoader").style.display = N;
                }
                else if (product == 'divRelatedProductsAddToCart') {
                ge(product + "_" + pId).className = "listviewcartbg";
                    ge("anchRelatedProductsAddToCart_" + pId).innerHTML = R[1];
                }


            }
           
        }
        catch (ex)
        { }
        HidePagingLoader();
    });
}

function AddProductComment() {
    if (ge('txtComment').value != '') {
        SL();
        var cartId = ge('shoppingCartId').value;
        var pId = ge('productId').value;
        var comment = ge('txtComment').value;
        Anthem_InvokeControlMethod(ShoppingCartClientId, "AddProductComment", [cartId, pId, comment],
    function(result) {
        HL();
    });
    }
    else {
        ge('txtErrorMessage').style.display = B;
    }
}

function LoadCommentLightBox(cartId, productId, bEdit) {
    ge('txtErrorMessage').style.display = N;
    ge('shoppingCartId').value = cartId;
    ge('productId').value = productId;
    if (bEdit == 'true') {
        var vComment = ge('Comment_' + productId).innerHTML;
        ge('txtComment').value = vComment;
    }
    new NaviWebLightBox.base("divAddProductComment");
}
function ClearErrorMessge() {
    ge('txtErrorMessage').style.display = N;
}

function backbtnforDetailsPage() {

    Anthem_InvokeControlMethod(ProductDetailsClientId, "onBtnBackClick", [], function(c) { });

}

function AddToCartFromCartPromotion(a, e, b) {
    SL();
    Anthem_InvokeControlMethod(e, "AddToShoppingCart", [a, b],
                function(g) {
                    HL();
                });
}

function SelectAllDeselectAll(d, e) { var f = document.forms[0].elements; for (i = 0; i < f.length; i++) { if (f[i].type == "checkbox" && f[i].name == e) { if (d == "CheckAll") { f[i].checked = true } else { if (d == "UnCheckAll") { f[i].checked = false } } } } }

function HidePromotion(pID) {
    var Promotion = "Promotion_" + pID;
    var Hide = "Hide_" + pID;
    var Show = "Show_" + pID;
    ge(Promotion).style.display = 'none';
    ge(Hide).style.display = 'none';
    ge(Show).style.display = 'block';
}
function ShowPromotion(pID) {
    var Promotion = "Promotion_" + pID;
    var Hide = "Hide_" + pID;
    var Show = "Show_" + pID;
    ge(Promotion).style.display = 'block';
    ge(Hide).style.display = 'block';
    ge(Show).style.display = 'none';
}

function AddVariantTypeToCart(pId, index, iProductid) {
    var ctrl = ge('variantId_' + pId);
    var ctrlAddBtnDiv = ge('divProductDetailsAddToCart_' + pId);
    var condition = true; 
    
    
    if(ctrlAddBtnDiv != null && ctrlAddBtnDiv != "undefined") {
        if (ge('divAddToCart').style.display == 'add') {
            condition = true;
        }
        else if (ctrlAddBtnDiv.className != "itemInCart") {
        condition = false;
        }
        
    }
    if (ctrl != null && ctrl != "undefined" && condition)
    {
        var varItem = ge('variantId_' + pId).options[index].text;
        var variantId = ge('variantId_' + pId).options[index].value;
        var variantType= ge('variantType_' + pId).innerHTML;
        var sPath = window.location.pathname;
        var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
        if ((sPage.toLowerCase() == 'cart.aspx' || sPage.toLowerCase() == 'p' + pId + '.aspx')) {
            if (condition = false)
            SL();
        }
        else
        { ge('divPagingLoader').style.display = 'block'; }
        var ctrlID;
        if (sPage.toLowerCase() == 'cart.aspx') {
            ctrlID = ShoppingCartClientId
        }
        else
        {
            ctrlID = 'ctl00_CP_ucAddToCart';
        }
        Anthem_InvokeControlMethod(ctrlID, "UpdateVariant", [pId, variantId, varItem, variantType, iProductid],
        function(g) {
            if (sPage.toLowerCase() == 'cart.aspx' || sPage.toLowerCase() == 'p' + pId + '.aspx') {
                if (sPage.toLowerCase() == 'cart.aspx') {
                    Anthem_InvokeControlMethod(ShoppingCartClientId, "RebindCartList", [],
                    function(g) { });
                }
                HL();
            }
            else {
                ge('divPagingLoader').style.display = 'none';
            }
        });
    }
}

function AddVariantTypeToCart_VariantOFF(pId, index) {
    var ctrl = ge('variantId_' + pId);
    var ctrlAddBtnDiv = ge('divProductDetailsAddToCart_' + pId);
    var condition = true;


    if (ctrlAddBtnDiv != null && ctrlAddBtnDiv != "undefined") {
        if (ge('divAddToCart').style.display == 'block') {
            condition = true;
        }
        else if (ctrlAddBtnDiv.className != "itemInCart") {
            condition = false;
        }

    }
    if (ctrl != null && ctrl != "undefined" && condition) {
        var varItem = ge('variantId_' + pId).options[index].text;
        var variantId = ge('variantId_' + pId).options[index].value;
        var variantType = ge('variantType_' + pId).innerHTML;
        var sPath = window.location.pathname;
        var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
        if (sPage.toLowerCase() == 'cart.aspx' || sPage.toLowerCase() == 'p' + pId + '.aspx') {
            if (condition = false)
            SL();
        }
        else
        { ge('divPagingLoader').style.display = 'block'; }

        Anthem_InvokeControlMethod('ctl00_CP_ucAddToCart', "UpdateVariant", ['', variantId, varItem, variantType, pId],
        function(g) {
            if (sPage.toLowerCase() == 'cart.aspx' || sPage.toLowerCase() == 'p' + pId + '.aspx') {
                HL();
            }
            else {
                ge('divPagingLoader').style.display = 'none';
            }
        });
    }
}


function ChangeProductDetailDivClass(pid, text,cssClass) {
    var t = "anchProductDetailsAddToCart_" + pid;
    var w = "divProductDetailsAddToCart_" + pid;
    ge(t).innerHTML = text + '<div class="cart-default"></div>';
    ge(w).className = cssClass;
    ge(h).title = text
}
function HideLoaderOnly() {
    ge('divNaviWebLoader').style.display = 'none';   
}
function ShowLoderOnly() {
    ge('divNaviWebLoader').style.display = 'block';
}

function AddToCartCompareProducts(pId) {
    Anthem_InvokeControlMethod('ctl00_CP_ucAddToCart', "AddToShoppingCart", [pId],
    function(result) {
        var R = new Array(3);
        R = result.value;
        try {
            if (R[0] == "true") {
                var f = "divCompareAddToCart_" + pId;
                ge(f).className = "listviewcartbg";
                ge(f).title = R[1];
                // ChangeDivClass(pId, R[1], R[2]);
            }
        }
        catch (ex)
        { }
    });
}
function UpdateShoppingCartItemQty(shoppingCartItemId, qty,ctrlID) {
    SL();
    Anthem_InvokeControlMethod(ctrlID, "UpdateShoppingCartItemQty", [shoppingCartItemId, qty],
    function(result) {
        HL();
    });


    HL();
}

function ReloadShoppingCartFromCartRelated() {
    SL();
    Anthem_InvokeControlMethod(ShoppingCartClientId, "ReloadShoppingCartFromCartRelated", [],
                    function(g) { HL(); });


}



function UpdateQuantityAndPrice(a,Id,VariantId) {
    var variant = ge('ProductVariantName_' + VariantId).innerHTML;
    var variantType = ge('ProductVariantTypeName_' + VariantId).innerHTML;
    var product = '';
    var Quantity = a.value;

     numcheck = /\d/


     if (numcheck.test(Quantity)) {
         VariantId = ge('ProductVariantId_' + VariantId).value + '_' + Quantity;
         var sPath = window.location.pathname;
         var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

         if (sPage.toLowerCase() == "cart.aspx") {
             SL();
             Anthem_InvokeControlMethod("ctl00_CP_ShoppingCartContentControl", "BindCartListForVariantMatrix", [Id, VariantId, variant, variantType],
    function(result) {
        HL();
    });

         }
         else {
             ShowPagingLoader();
             LightBoxAddToCartWithVariant(Id, product, VariantId, variant, variantType);

         }
     }
}
