var ANSVerificationURL = "//verify.authorize.net/anetseal/";
var AuthorizeNetSeal = {
    verification_parameters: "",
    id_parameter_name: "pid",
    url_parameter_name: "rurl",
    seal_image_file: ("/skin1/images/seals_auth.gif"),
    seal_width: "80",
    seal_height: "64",
    seal_alt_text: "Authorize.Net Merchant - Click to Verify",
    display_url: "//www.authorize.net/",
    text_color: "black",
    text_size: "0px",
    line_spacing: "0px",
    new_window_height: "430",
    new_window_width: "600",
    current_url: "",
    display_location: true,
    no_click: false,
    debug: false
};
document.writeln('<style type="text/css">');
document.writeln("div.AuthorizeNetSeal{text-align:center;margin:0;padding:0;width:" + AuthorizeNetSeal.seal_width + "px;font:normal " + AuthorizeNetSeal.text_size + " arial,helvetica,san-serif;line-height:" + AuthorizeNetSeal.line_spacing + ";}");
document.writeln("div.AuthorizeNetSeal a{text-decoration:none;color:" + AuthorizeNetSeal.text_color + ";}");
document.writeln("div.AuthorizeNetSeal a:visited{color:" + AuthorizeNetSeal.text_color + ";}");
document.writeln("div.AuthorizeNetSeal a:active{color:" + AuthorizeNetSeal.text_color + ";}");
document.writeln("div.AuthorizeNetSeal a:hover{text-decoration:underline;color:" + AuthorizeNetSeal.text_color + ";}");
document.writeln("div.AuthorizeNetSeal a img{border:0px;margin:0px;text-decoration:none;}");
document.writeln("</style>");
if (window.ANS_customer_id) {
    AuthorizeNetSeal.verification_parameters = "?" + AuthorizeNetSeal.id_parameter_name + "=" + escape(ANS_customer_id);
    if (window.location.href) {
        AuthorizeNetSeal.current_url = window.location.href
    } else {
        if (document.URL) {
            AuthorizeNetSeal.current_url = document.URL
        }
    }
    if (AuthorizeNetSeal.current_url) {
        AuthorizeNetSeal.verification_parameters += "&" + AuthorizeNetSeal.url_parameter_name + "=" + escape(AuthorizeNetSeal.current_url)
    }
    if (!AuthorizeNetSeal.no_click) {
        document.write("<a ");
        document.write('href="' + ANSVerificationURL + AuthorizeNetSeal.verification_parameters + '" ');
        if (!AuthorizeNetSeal.debug) {
            document.write("onMouseOver=\"window.status='" + AuthorizeNetSeal.display_url + "'; return true;\" ");
            document.write("onMouseOut=\"window.status=''; return true;\" ");
            document.write("onClick=\"window.open('" + ANSVerificationURL + AuthorizeNetSeal.verification_parameters + "','AuthorizeNetVerification','");
            document.write("width=" + AuthorizeNetSeal.new_window_width);
            document.write(",height=" + AuthorizeNetSeal.new_window_height);
            document.write(",dependent=yes,resizable=yes,scrollbars=yes");
            document.write(",menubar=no,toolbar=no,status=no,directories=no");
            if (AuthorizeNetSeal.display_location) {
                document.write(",location=yes")
            }
            document.write("'); return false;\" ")
        }
        document.write('target="_blank"');
        document.writeln(">")
    }
    document.writeln('<img src="' + AuthorizeNetSeal.seal_image_file + '" width="' + AuthorizeNetSeal.seal_width + '" height="' + AuthorizeNetSeal.seal_height + '" border="0" alt="' + AuthorizeNetSeal.seal_alt_text + '">');
    if (!AuthorizeNetSeal.no_click) {
        document.writeln("</a>")
    }
}
var localIsDOM = document.getElementById ? true : false;
var localIsJava = navigator.javaEnabled();
var localIsStrict = document.compatMode == "CSS1Compat";
var localPlatform = navigator.platform;
var localVersion = "0";
var localBrowser = "";
var localBFamily = "";
var isHttps = false;
if (window.opera && localIsDOM) {
    localBFamily = localBrowser = "Opera";
    if (navigator.userAgent.search(/^.*Opera.([\d.]+).*$/) != -1) {
        localVersion = navigator.userAgent.replace(/^.*Opera.([\d.]+).*$/, "$1")
    } else {
        if (window.print) {
            localVersion = "6"
        } else {
            localVersion = "5"
        }
    }
} else {
    if (document.all && document.all.item) {
        localBFamily = localBrowser = "MSIE"
    }
}
if (navigator.appName == "Netscape") {
    localBFamily = "NC";
    if (!localIsDOM) {
        localBrowser = "Netscape";
        localVersion = navigator.userAgent.replace(/^.*Mozilla.([\d.]+).*$/, "$1");
        if (localVersion != "") {
            localVersion = "4"
        }
    } else {
        if (navigator.userAgent.indexOf("Safari") >= 0) {
            localBrowser = "Safari"
        } else {
            if (navigator.userAgent.indexOf("Netscape") >= 0) {
                localBrowser = "Netscape"
            } else {
                if (navigator.userAgent.indexOf("Firefox") >= 0) {
                    localBrowser = "Firefox"
                } else {
                    localBrowser = "Mozilla"
                }
            }
        }
    }
}
if (navigator.userAgent.indexOf("MSMSGS") >= 0) {
    localBrowser = "WMessenger"
} else {
    if (navigator.userAgent.indexOf("e2dk") >= 0) {
        localBrowser = "Edonkey"
    } else {
        if (navigator.userAgent.indexOf("Gnutella") + navigator.userAgent.indexOf("Gnucleus") >= 0) {
            localBrowser = "Gnutella"
        } else {
            if (navigator.userAgent.indexOf("KazaaClient") >= 0) {
                localBrowser = "Kazaa"
            }
        }
    }
}
if (localVersion == "0" && localBrowser != "") {
    var rg = new RegExp("^.*" + localBrowser + ".([\\d.]+).*$");
    localVersion = navigator.userAgent.replace(rg, "$1")
}
var localIsCookie = ((localBrowser == "Netscape" && localVersion == "4") ? (document.cookie != "") : navigator.cookieEnabled);
if (document.location.protocol == "https:") {
    isHttps = true
}
function change_antibot_image(b) {
    var a = document.getElementById(b);
    if (a) {
        a.src = xcart_web_dir + "/antibot_image.php?tmp=" + Math.random() + "&section=" + b + "&regenerate=Y"
    }
}
function getElementsByClassName(e) {
    var a = new Array();
    var c = document.getElementsByTagName("*");
    for (var b, d = 0;
    (elem = c[d]); d++) {
        if (elem.className == e) {
            a[a.length] = elem
        }
    }
    return a
}
function visibleBox(d, b) {
    elm1 = document.getElementById("open" + d);
    elm2 = document.getElementById("close" + d);
    elm3 = document.getElementById("box" + d);
    if (!elm3) {
        return false
    }
    if (b) {
        elm3.style.display = (elm3.style.display == "") ? "none" : ""
    } else {
        if (elm1) {
            if (elm1.style.display == "") {
                elm1.style.display = "none";
                if (elm2) {
                    elm2.style.display = ""
                }
                elm3.style.display = "none";
                var a = getElementsByClassName("DialogBox");
                for (var c = 0; c < a.length; c++) {
                    a[c].style.height = "1%"
                }
            } else {
                elm1.style.display = "";
                if (elm2) {
                    elm2.style.display = "none"
                }
                elm3.style.display = ""
            }
        }
    }
}
function urlEncode(a) {
    return a.replace(/\s/g, "+").replace(/&/, "&amp;").replace(/"/, "&quot;")
}
function round(b, a) {
    if (isNaN(b)) {
        b = parseFloat(b)
    }
    if (!a || isNaN(a)) {
        return Math.round(b)
    }
    a = Math.pow(10, a);
    return Math.round(b * a) / a
}
function price_format(f, d, g, b) {
    var d = (arguments.length > 1 && d !== false) ? d : number_format_th;
    var g = (arguments.length > 2 && g !== false) ? g : number_format_dec;
    var b = (arguments.length > 3 && b !== false) ? b : number_format_point;
    if (b > 0) {
        b = Math.pow(10, b);
        f = Math.round(f * b) / b;
        var h = Math.floor(f);
        var c = Math.round((f - h) * b) + b
    } else {
        var h = Math.round(f);
        var c = 0
    }
    h = h + "";
    c = c + "";
    var e = 0;
    for (var a = h.length; a >= 0; a--) {
        if (e % 3 == 0 && e > 0 && a > 0) {
            h = h.substr(0, a) + d + h.substr(a, h.length)
        }
        e++
    }
    return (c > 0) ? (h + g + c.substr(1, c.length)) : h
}
function substitute(c) {
    var a, b;
    for (a = 1; a < arguments.length; a += 2) {
        if (arguments[a] && arguments[a + 1]) {
            b = new RegExp("\\{\\{" + arguments[a] + "\\}\\}", "gi");
            c = c.replace(b, arguments[a + 1]);
            b = new RegExp("~~" + arguments[a] + "~~", "gi");
            c = c.replace(b, arguments[a + 1])
        }
    }
    return c
}
function getWindowOutWidth(a) {
    if (!a) {
        a = window
    }
    if (localBFamily == "MSIE") {
        return a.document.body.clientWidth
    } else {
        return a.outerWidth
    }
}
function getWindowOutHeight(a) {
    if (!a) {
        a = window
    }
    if (localBFamily == "MSIE") {
        return a.document.body.clientHeight
    } else {
        return a.outerHeight
    }
}
function getWindowWidth(a) {
    if (!a) {
        a = window
    }
    if (localBFamily == "MSIE") {
        return a.document.body.clientWidth
    } else {
        return a.innerWidth
    }
}
function getWindowHeight(a) {
    if (!a) {
        a = window
    }
    if (localBFamily == "MSIE") {
        return a.document.body.clientHeight
    } else {
        return a.innerHeight
    }
}
function getDocumentHeight(a) {
    if (!a) {
        a = window
    }
    if (localBFamily == "MSIE" || (localBFamily == "Opera" && localVersion >= 7 && localVersion < 8)) {
        return isStrict ? a.document.documentElement.scrollHeight : a.document.body.scrollHeight
    }
    if (localBFamily == "NC") {
        return a.document.height
    }
    if (localBFamily == "Opera") {
        return a.document.body.style.pixelHeight
    }
}
function getDocumentWidth(a) {
    if (!a) {
        a = window
    }
    if (localBFamily == "MSIE" || (localBFamily == "Opera" && localVersion >= 7 && localVersion < 8)) {
        return isStrict ? a.document.documentElement.scrollWidth : a.document.body.scrollWidth
    }
    if (localBFamily == "NC") {
        return a.document.width
    }
    if (localBFamily == "Opera") {
        return a.document.body.style.pixelWidth
    }
}
function expandWindowX(b, f, a) {
    if (!b) {
        b = window
    }
    if (!f) {
        f = 10
    }
    var d = true;
    var c = 200;
    while (d && c--) {
        if (a && getWindowOutWidth() + f > a) {
            break
        }
        try {
            b.scrollTo(f, 0);
            d = (b.document.documentElement && b.document.documentElement.scrollLeft > 0) || (b.document.body && b.document.body.scrollLeft > 0);
            if (d) {
                b.resizeBy(f, 0)
            }
        } catch (g) {
            return false
        }
    }
    return true
}
function expandWindowY(b, f, a) {
    if (!b) {
        b = window
    }
    if (!f) {
        f = 10
    }
    var d = true;
    var c = 200;
    while (d && c--) {
        if (a && getWindowOutHeight() + f > a) {
            break
        }
        try {
            b.scrollTo(0, f);
            d = (b.document.documentElement && b.document.documentElement.scrollTop > 0) || (b.document.body && b.document.body.scrollTop > 0);
            if (d) {
                b.resizeBy(0, f)
            }
        } catch (g) {
            return false
        }
    }
    return true
}
function checkMarks(d, c, e) {
    var b = false;
    if (d.elements.length == 0) {
        return true
    }
    for (var a = 0; a < d.elements.length; a++) {
        if (d.elements[a].name.search(c) == 0 && d.elements[a].type == "checkbox" && !d.elements[a].disabled) {
            b = true;
            if (d.elements[a].checked) {
                return true
            }
        }
    }
    if (!b) {
        return true
    } else {
        if (e) {
            alert(e)
        } else {
            if (lbl_no_items_have_been_selected) {
                alert(lbl_no_items_have_been_selected)
            }
        }
    }
    return false
}
function submitForm(a, b) {
    if (!a) {
        return false
    }
    if (a.tagName != "FORM") {
        if (!a.form) {
            return false
        }
        a = a.form
    }
    if (a.mode) {
        a.mode.value = b
    }
    a.submit()
}
function sleep(a) {
    var b = new Date().getTime() + a;
    while (b >= new Date().getTime()) {}
}
function convert_number(a) {
    var b = new RegExp(reg_quote(number_format_dec), "gi");
    var d = new RegExp(reg_quote(number_format_th), "gi");
    var c = Math.pow(10, parseInt(number_format_point));
    a = parseFloat(a.replace(" ", "").replace(d, "").replace(b, "."));
    return Math.round(a * c) / c
}
function check_is_number(a) {
    var b = new RegExp(reg_quote(number_format_dec), "gi");
    var c = new RegExp(reg_quote(number_format_th), "gi");
    a = a.replace(" ", "").replace(c, "").replace(b, ".");
    return (a.search(/^[+-]?[0-9]+(\.[0-9]+)?$/) != -1)
}
function reg_quote(a) {
    return a.replace(/\./g, "\\.").replace(/\//g, "\\/").replace(/\*/g, "\\*").replace(/\+/g, "\\+").replace(/\[/g, "\\[").replace(/\]/g, "\\]")
}
function setCookie(c, d, g, b) {
    if (typeof (b) == "object") {
        try {
            var h = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
            var a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
            if (h[b.getDay()] && a[b.getMonth()]) {
                b = h[b.getDay()] + " " + b.getDate() + "-" + a[b.getMonth()] + "-" + b.getFullYear() + " " + b.getHours() + ":" + b.getMinutes() + ":" + b.getSeconds() + " GMT"
            }
        } catch (f) {}
    }
    if (typeof (b) != "string") {
        b = false
    }
    document.cookie = c + "=" + escape(d) + (b ? "; expires=" + b : "") + (g ? "; path=" + g : "")
}
function deleteCookie(a) {
    document.cookie = a + "=0; expires=Fri, 31 Dec 1999 23:59:59 GMT;"
}
function cloneObject(c) {
    var b = {};
    for (var a in c) {
        b[a] = c[a]
    }
    return b
}
function getFirstCB(c, b) {
    while (c.tagName && c.tagName.toUpperCase() != "FORM") {
        c = c.parentNode
    }
    if (!c.tagName || c.tagName.toUpperCase() != "FORM" || c.elements.length == 0) {
        return false
    }
    var d = false;
    for (var a = 0; a < c.elements.length; a++) {
        if (c.elements[a].name.search(b) == 0 && c.elements[a].type == "checkbox" && !c.elements[a].disabled && c.elements[a].checked) {
            d = c.elements[a];
            break
        }
    }
    if (!d) {
        if (lbl_no_items_have_been_selected) {
            alert(lbl_no_items_have_been_selected)
        }
        return false
    }
    return d
}
function _getById(c) {
    if (typeof (c) != "string" || !c) {
        return false
    }
    var b = document.getElementById(c);
    if (b && b.id != c) {
        b = false;
        for (var a = 0; a < document.all.length && b === false; a++) {
            if (document.all[a].id == c) {
                b = document.all[a]
            }
        }
    }
    return b
}
function isset(a) {
    return typeof (a) != "undefined" && a !== null
}
function isFunction(a) {
    return (typeof (a) == "function" || (typeof (a) == "object" && (a + "").search(/\s*function /) === 0))
}
function thisMovie(b) {
    var a = navigator.appName.indexOf("Microsoft") != -1;
    return (a) ? window[b] : document[b]
}
function setFlashHeight(b) {
    var a = b + "px";
    document.getElementById("flash_content").height = a
}
var switchcontent_ajax_msg = "<em>Loading Ajax content...</em>";
var switchcontent_ajax_bustcache = true;

function switchcontent(b, a) {
    this.className = b;
    this.collapsePrev = false;
    this.persistType = "none";
    this.filter_content_tag = (typeof a != "undefined") ? a.toLowerCase() : "";
    this.ajaxheaders = {}
}
switchcontent.prototype.setStatus = function (b, a) {
    this.statusOpen = b;
    this.statusClosed = a
};
switchcontent.prototype.setColor = function (a, b) {
    this.colorOpen = a;
    this.colorClosed = b
};
switchcontent.prototype.setPersist = function (a, b) {
    if (a == true) {
        if (typeof b == "undefined") {
            this.persistType = "session"
        } else {
            this.persistType = "days";
            this.persistDays = parseInt(b)
        }
    } else {
        this.persistType = "none"
    }
};
switchcontent.prototype.collapsePrevious = function (a) {
    this.collapsePrev = a
};
switchcontent.prototype.setContent = function (a, b) {
    this.ajaxheaders["header" + a] = b
};
switchcontent.prototype.sweepToggle = function (b) {
    if (typeof this.headers != "undefined" && this.headers.length > 0) {
        for (var a = 0; a < this.headers.length; a++) {
            if (b == "expand") {
                this.expandcontent(this.headers[a])
            } else {
                if (b == "contract") {
                    this.contractcontent(this.headers[a])
                }
            }
        }
    }
};
switchcontent.prototype.defaultExpanded = function () {
    var b = [];
    for (var a = 0;
    (!this.collapsePrev && a < arguments.length) || (this.collapsePrev && a == 0); a++) {
        b[b.length] = arguments[a]
    }
    this.expandedindices = b.join(",")
};
switchcontent.prototype.togglecolor = function (b, a) {
    if (typeof this.colorOpen != "undefined") {
        b.style.color = a
    }
};
switchcontent.prototype.togglestatus = function (b, a) {
    if (typeof this.statusOpen != "undefined") {
        b.firstChild.innerHTML = a
    }
};
switchcontent.prototype.contractcontent = function (b) {
    var a = document.getElementById(b.id.replace("-title", ""));
    a.style.display = "none";
    this.togglestatus(b, this.statusClosed);
    this.togglecolor(b, this.colorClosed)
};
switchcontent.prototype.expandcontent = function (b) {
    var a = document.getElementById(b.id.replace("-title", ""));
    if (b.ajaxstatus == "waiting") {
        switchcontent.connect(b.ajaxfile, b)
    }
    a.style.display = "block";
    this.togglestatus(b, this.statusOpen);
    this.togglecolor(b, this.colorOpen)
};
switchcontent.prototype.toggledisplay = function (b) {
    var a = document.getElementById(b.id.replace("-title", ""));
    if (a.style.display == "block") {
        this.contractcontent(b)
    } else {
        this.expandcontent(b);
        if (this.collapsePrev && typeof this.prevHeader != "undefined" && this.prevHeader.id != b.id) {
            this.contractcontent(this.prevHeader)
        }
    }
    if (this.collapsePrev) {
        this.prevHeader = b
    }
};
switchcontent.prototype.collectElementbyClass = function (c) {
    var d = new RegExp("(^|\\s+)" + c + "($|\\s+)", "i");
    this.headers = [], this.innercontents = [];
    if (this.filter_content_tag != "") {
        var b = document.getElementsByTagName(this.filter_content_tag)
    } else {
        var b = document.all ? document.all : document.getElementsByTagName("*")
    }
    for (var a = 0; a < b.length; a++) {
        if (typeof b[a].className == "string" && b[a].className.search(d) != -1) {
            if (document.getElementById(b[a].id + "-title") != null) {
                this.headers[this.headers.length] = document.getElementById(b[a].id + "-title");
                this.innercontents[this.innercontents.length] = b[a]
            }
        }
    }
};
switchcontent.prototype.init = function () {
    var b = this;
    this.collectElementbyClass(this.className);
    if (this.headers.length == 0) {
        return
    }
    if (this.persistType == "days" && (parseInt(switchcontent.getCookie(this.className + "_dtrack")) != this.persistDays)) {
        switchcontent.setCookie(this.className + "_d", "", -1)
    }
    var c = (this.persistType == "session" && switchcontent.getCookie(this.className) != "") ? "," + switchcontent.getCookie(this.className) + "," : (this.persistType == "days" && switchcontent.getCookie(this.className + "_d") != "") ? "," + switchcontent.getCookie(this.className + "_d") + "," : (this.expandedindices) ? "," + this.expandedindices + "," : "";
    for (var a = 0; a < this.headers.length; a++) {
        if (typeof this.ajaxheaders["header" + a] != "undefined") {
            this.headers[a].ajaxstatus = "waiting";
            this.headers[a].ajaxfile = this.ajaxheaders["header" + a]
        }
        if (typeof this.statusOpen != "undefined") {
            this.headers[a].innerHTML = '<span class="status"></span>' + this.headers[a].innerHTML
        }
        if (c.indexOf("," + a + ",") != -1) {
            this.expandcontent(this.headers[a]);
            if (this.collapsePrev) {
                this.prevHeader = this.headers[a]
            }
        } else {
            this.contractcontent(this.headers[a])
        }
        this.headers[a].onclick = function () {
            b.toggledisplay(this)
        }
    }
    switchcontent.dotask(window, function () {
        b.rememberpluscleanup()
    }, "unload")
};
switchcontent.prototype.rememberpluscleanup = function () {
    var b = new Array("none");
    for (var a = 0; a < this.innercontents.length; a++) {
        if (this.persistType != "none" && this.innercontents[a].style.display == "block" && (!this.collapsePrev || (this.collapsePrev && b.length < 2))) {
            b[b.length] = a
        }
        this.headers[a].onclick = null
    }
    if (b.length > 1) {
        b.shift()
    }
    if (typeof this.statusOpen != "undefined") {
        this.statusOpen = this.statusClosed = null
    }
    if (this.persistType == "session") {
        switchcontent.setCookie(this.className, b.join(","))
    } else {
        if (this.persistType == "days" && typeof this.persistDays == "number") {
            switchcontent.setCookie(this.className + "_d", b.join(","), this.persistDays);
            switchcontent.setCookie(this.className + "_dtrack", this.persistDays, this.persistDays)
        }
    }
};
switchcontent.dotask = function (b, c, a) {
    var a = (window.addEventListener) ? a : "on" + a;
    if (b.addEventListener) {
        b.addEventListener(a, c, false)
    } else {
        if (b.attachEvent) {
            b.attachEvent(a, c)
        }
    }
};
switchcontent.connect = function (a, f) {
    var d = false;
    var c = "";
    if (window.ActiveXObject) {
        try {
            d = new ActiveXObject("Msxml2.XMLHTTP")
        } catch (b) {
            try {
                d = new ActiveXObject("Microsoft.XMLHTTP")
            } catch (b) {}
        }
    } else {
        if (window.XMLHttpRequest) {
            d = new XMLHttpRequest()
        } else {
            return false
        }
    }
    d.onreadystatechange = function () {
        switchcontent.loadpage(d, f)
    };
    if (switchcontent_ajax_bustcache) {
        c = (a.indexOf("?") != -1) ? "&" + new Date().getTime() : "?" + new Date().getTime()
    }
    d.open("GET", a + c, true);
    d.send(null)
};
switchcontent.loadpage = function (c, b) {
    var a = document.getElementById(b.id.replace("-title", ""));
    a.innerHTML = switchcontent_ajax_msg;
    if (c.readyState == 4 && (c.status == 200 || window.location.href.indexOf("http") == -1)) {
        a.innerHTML = c.responseText;
        b.ajaxstatus = "loaded"
    }
};
switchcontent.getCookie = function (a) {
    var b = new RegExp(a + "=[^;]+", "i");
    if (document.cookie.match(b)) {
        return document.cookie.match(b)[0].split("=")[1]
    }
    return ""
};
switchcontent.setCookie = function (b, c, e) {
    if (typeof e != "undefined") {
        var a = new Date();
        var d = a.setDate(a.getDate() + e);
        document.cookie = b + "=" + c + "; expires=" + a.toGMTString()
    } else {
        document.cookie = b + "=" + c
    }
};

// For TABS Begin

$(function() {
	// setup ul.tabs to work as tabs for each div directly under div.panes
	$("ul.tabs").tabs("div.panes > div", {effect: 'fade',fadeInSpeed: 200});
});

// For TABS End
