function CreateTransparentControl(l, a, k, j, f, h, c, e) {
    var g = document.getElementById(l);
    var b = "<object classid=" + a + " id=" + k + " width=" + j + " height=" + f + ' codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/armani/flash/swflash.cab#version=7,0,0,0">';
    b = b + '<param name="allowScriptAccess" value="sameDomain">';
    b = b + '<param name="movie" value=' + h + ">";
    b = b + '<param name="FlashVars" value=' + c + ">";
    b = b + '<param name="quality" value="high">';
    b = b + '<param name="autoStart" value=' + e + "/>";
    b = b + '<param name="wmode" value="transparent" />';
    b = b + '<embed wmode="transparent" src="' + h + '" flashVars="' + c + '" quality="high" bgcolor="#000000" width="' + j + '" height="' + f + '" name="main" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
    b = b + "</object>";
    g.innerHTML = b
}
function SetLogin(c) {
    var b = GetMainFormName();
    if (b == null) {
        return
    }
    var a = GetElementName("hidden_login", b);
    if (a != null) {
        document.forms[b].elements[a].value = c
    }
}
function MM_preloadImages() {
    var f = document;
    if (f.images) {
        if (!f.MM_p) {
            f.MM_p = new Array()
        }
        var e, c = f.MM_p.length,
        b = MM_preloadImages.arguments;
        for (e = 0; e < b.length; e++) {
            if (b[e].indexOf("#") != 0) {
                f.MM_p[c] = new Image;
                f.MM_p[c++].src = b[e]
            }
        }
    }
}
function MM_swapImgRestore() {
    var d, b, c = document.MM_sr;
	// for (d = 0; c && d < c.length && (b = c[d]) && b.oSrc; d++) 
    for (d = 0; c && d < c.length && (b = c[d]); d++) {
        //b.src = b.oSrc
		//alert(b.oSrc);
		//b.style.backgroundImage=b.oSrc;
		b.style.background="none";
		b.style.color="#ccc";
		
	}
}

function MM_findObj(f, e) {
    var c, b, a;
    if (!e) {
        e = document
    }
    if ((c = f.indexOf("?")) > 0 && parent.frames.length) {
        e = parent.frames[f.substring(c + 1)].document;
        f = f.substring(0, c)
    }
    if (! (a = e[f]) && e.all) {
        a = e.all[f]
    }
    for (b = 0; ! a && b < e.forms.length; b++) {
        a = e.forms[b][f]
    }
    for (b = 0; ! a && e.layers && b < e.layers.length; b++) {
        a = MM_findObj(f, e.layers[b].document)
    }
    if (!a && e.getElementById) {
        a = e.getElementById(f)
    }
    return a
}
function MM_swapImage() {
	
    var e, d = 0,
    b, c = MM_swapImage.arguments;

    document.MM_sr = new Array;
    for (e = 0; e < (c.length - 2); e += 3) {
        if ((b = MM_findObj(c[e])) != null) {
            document.MM_sr[d++] = b;
            if (!b.oSrc) {
                //b.oSrc = b.src
				//b.oSrc=b.style.backgroundImage;
			}
            //b.src = c[e + 2];
			//b.style.backgroundImage="url("+(c[e + 2])+")";
			
			b.style.backgroundColor="#fff";
			b.style.color="#000";
		}
    }
}
function MM_showHideMenuLayers() {
    var i, p, v, obj, args = MM_showHideMenuLayers.arguments;
    for (i = 0; i < (args.length - 2); i += 3) {
        with(document) {
            if (getElementById && ((obj = getElementById(args[i])) != null)) {
                v = args[i + 2];
                if (obj.style) {
                    obj = obj.style;
                    v = (v == "show") ? "visible": (v == "hide") ? "hidden": v
                }
                obj.visibility = v
            }
        }
    }
}
function isEnter(a) {
    if (a.keyCode == 13) {
        gosearch()
    }
    return true
}
function gosearch() {
    var a = GetMainFormName();
    if (a == null) {
        return
    }
    var b = document.getElementById("SearchKeywords").value;
    b = b.toLowerCase();
    if (b != "search") {
        document.forms[a].action = "/Armani/_zh/_cn/search/index.aspx?SearchKeywords=" + b;
        document.forms[a].submit()
    }
}
function DoAlternate(c, a, b) {
    var d = document.getElementById(a);
    if (typeof(b) != "undefined") {
        if (b == "show") {
            c.src = "/Armani/IMG/ICN_Mns.gif";
            d.style.display = "block"
        } else {
            if (b == "hide") {
                c.src = "/Armani/IMG/ICN_Pls.gif";
                d.style.display = "none"
            }
        }
    } else {
        if (c.src.indexOf("/Armani/IMG/ICN_Pls.gif") != -1) {
            c.src = "/Armani/IMG/ICN_Mns.gif"
        } else {
            c.src = "/Armani/IMG/ICN_Pls.gif"
        }
        if (d.style.display == "block") {
            d.style.display = "none"
        } else {
            d.style.display = "block"
        }
    }
}
function AdjustHeights() {
    var a = document.getElementById("LeftNavContainer");
    var c = document.getElementById("RightContainer");
    var b = 0;
    if (a != null && c != null) {
        if (a.offsetHeight) {
            b = Math.max(a.offsetHeight, c.offsetHeight)
        } else {
            if (a.style.pixelHeight) {
                b = Math.max(a.style.pixelHeight, c.style.pixelHeight)
            }
        }
        a.style.height = b + "px";
        c.style.height = b + "px"
    }
}
function ResetHeights() {
    var a = document.getElementById("LeftNavContainer");
    var c = document.getElementById("RightContainer");
    var b = 0;
    if (a != null && c != null) {
        a.style.height = "";
        c.style.height = ""
    }
}
if ((AJAX_IsIE6()) || (window.location.href.indexOf(".htm") != -1 && window.attachEvent)) {
    window.MM_showHideMenuLayers = function() {
        args = MM_showHideMenuLayers.arguments;
        for (i = 0; i < (args.length - 2); i += 3) {
            with(document) {
                if (getElementById && getElementById(args[i])) {
                    MM_showHideMenuLayers_callback(args[i], args[i + 1], args[i + 2])
                }
            }
        }
    };
    function MM_showHideMenuLayers_callback(e, b, d, a) {
        a = a || false;
        el = document.getElementById(e);
        over = d == "show" ? true: false;
        if (!a && !over) {
            setTimeout(function() {
                MM_showHideMenuLayers_callback(e, b, "hide", true)
            },
            100);
            el.setAttribute("sameAttribute", 1);
            return
        } else {
            if (!over && el.getAttribute("sameAttribute") == 0) {
                return
            }
        }
        el.setAttribute("sameAttribute", 0);
        if (el.style) {
            el.style.visibility = (d == "show") ? "visible": (d == "hide") ? "hidden": d;
            if (AJAX_IsIE6()) {
                var c = (d == "show") ? "hidden": "visible";
                ToggleDropDowns(c)
            }
        }
    }
    window.MM_swapImage = function() {
		
        args = MM_swapImage.arguments;
        var a = 0;
        document.MM_sr = new Array;
        for (var b = 0; b < (args.length - 2); b += 3) {
            if (MM_findObj(args[b])) {
                MM_swapImage_callback(args[b], args[b + 1], args[b + 2]);
                document.MM_sr.push(MM_findObj(args[b]))
            }
        }
    };
    function MM_swapImage_callback(c, b, a) {
        el = MM_findObj(c);
        el.setAttribute("sameAttributeSwap", 0);
        /*if (!el.oSrc) {
            el.oSrc = el.src;
            el.src = a
        } else {
            el.src = a
        }*/
		el.style.backgroundColor="#fff";
		el.style.color="#000";
    }

    window.MM_swapImgRestore = function() {
        var d, b, c = document.MM_sr;
		//for (d = 0; c && d < c.length && (b = c[d]) && b.oSrc; d++) 
        for (d = 0; c && d < c.length && (b = c[d]) ; d++) {
            MM_swapImgRestore_callback(b)
        }

    };
    function MM_swapImgRestore_callback(b, a) {
        a = a || false;
        if (!a) {
            setTimeout(function() {
                MM_swapImgRestore_callback(b, true)
            },
            100);
            b.setAttribute("sameAttributeSwap", 1);
            return
        } else {
            if (b.getAttribute("sameAttributeSwap") == 0) {
                return
            }
        }
		
        b.setAttribute("sameAttributeSwap", 0);
        b.src = b.oSrc
		b.style.background="none";
		b.style.color="#ccc";
    }
}
function AJAX_IsIE6() {
    if (navigator.appName == "Microsoft Internet Explorer") {
        if (navigator.appVersion.indexOf("MSIE 6.0") != -1) {
            return true
        }
    }
    return false
}
function ToggleDropDowns(e) {
    var d = GetMainFormName();
    var b = document.getElementById("varlist");
    if (b != null) {
        b.style.visibility = e
    }
    var c = GetElementID("QtyList", d);
    var a = document.getElementById(c);
    if (a != null) {
        a.style.visibility = e
    }
}
function CenterAbsoluteDiv(c) {
    var b = document.getElementById(c);
    if (b != null) {
        var f = 0;
        var a = 0;
        var e = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft: document.body.scrollLeft);
        var d = (document.documentElement.scrollTop ? document.documentElement.scrollTop: document.body.scrollTop);
        if (window.innerWidth) {
            f = (window.__safari ? window.innerWidth: Math.min(window.innerWidth, document.documentElement.clientWidth))
        } else {
            f = document.documentElement.clientWidth
        }
        if (window.innerHeight) {
            a = (window.__safari ? window.innerHeight: Math.min(window.innerHeight, document.documentElement.clientHeight))
        } else {
            a = document.documentElement.clientHeight
        }
        b.style.display = "block";
        if (b != null) {
            b.style.left = e + ((f - b.offsetWidth) / 2) + "px";
            if (this._IsforegroundElementLarge == true) {
                b.style.top = d + ((a - b.offsetHeight) / 4) + "px"
            } else {
                b.style.top = d + ((a - b.offsetHeight) / 2) + "px"
            }
            b.style.display = "none"
        }
    }
}
var cssdropdown = {
    disappeardelay: 250,
    disablemenuclick: false,
    enableswipe: 1,
    dropmenuobj: null,
    ie: document.all,
    firefox: document.getElementById && !document.all,
    swipetimer: undefined,
    bottomclip: 0,
    dropmenuimg: null,
    ie: document.all,
    firefox: document.getElementById && !document.all,
    swipetimer: undefined,
    bottomclip: 0,
    getposOffset: function(d, c) {
        var b = 0;
		if(d!=null){
			var a = d.offsetParent;
			if (a != null) {
				b = (c == "left") ? b + a.offsetLeft: b + a.offsetTop
			} else {
				var b = (c == "left") ? d.offsetLeft: d.offsetTop
			}
			if (c != "left" && this.ie) {
				b = b - 1
			}
		}
        return b
    },
    swipeeffect: function() {
        if (this.bottomclip < parseInt(this.dropmenuobj.offsetHeight)) {
            this.bottomclip += 10 + (this.bottomclip / 10);
            this.dropmenuobj.style.clip = "rect(0 auto " + this.bottomclip + "px 0)"
        } else {
            return
        }
        this.swipetimer = setTimeout("cssdropdown.swipeeffect()", 10)
    },
    showhide: function(c, b) {
        try {
            _QuickShop_Class.Hide()
        } catch(a) {}
        if (this.ie || this.firefox) {
            this.dropmenuobj.style.left = this.dropmenuobj.style.top = "-500px"
        }
        if (b.type == "click" && c.visibility == hidden || b.type == "mouseover") {
            this.swapimage(this.dropmenuimg, "on");
            if (this.enableswipe == 1) {
                if (typeof this.swipetimer != "undefined") {
                    clearTimeout(this.swipetimer)
                }
                c.clip = "rect(0 auto 0 0)";
                this.bottomclip = 0;
                this.swipeeffect()
            }
            c.visibility = "visible"
        } else {
            if (b.type == "click") {
                this.swapimage(this.dropmenuimg, "off");
                c.visibility = "hidden"
            }
        }
    },
    iecompattest: function() {
        return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement: document.body
    },
    clearbrowseredge: function(e, c) {
        var b = 0;
        if (c == "rightedge") {
            var d = this.ie && !window.opera ? this.iecompattest().scrollLeft + this.iecompattest().clientWidth - 15 : window.pageXOffset + window.innerWidth - 15;
            this.dropmenuobj.contentmeasure = this.dropmenuobj.offsetWidth;
            if (d - this.dropmenuobj.x < this.dropmenuobj.contentmeasure) {
                b = this.dropmenuobj.contentmeasure - e.offsetWidth
            }
        } else {
            var a = this.ie && !window.opera ? this.iecompattest().scrollTop: window.pageYOffset;
            var d = this.ie && !window.opera ? this.iecompattest().scrollTop + this.iecompattest().clientHeight - 15 : window.pageYOffset + window.innerHeight - 18;
            this.dropmenuobj.contentmeasure = this.dropmenuobj.offsetHeight;
            if (d - this.dropmenuobj.y < this.dropmenuobj.contentmeasure) {
                b = this.dropmenuobj.contentmeasure + e.offsetHeight;
                if ((this.dropmenuobj.y - a) < this.dropmenuobj.contentmeasure) {
                    b = this.dropmenuobj.y + e.offsetHeight - a
                }
            }
        }
        return b
    },
    dropit: function(g, f, a, b) {
        if (this.dropmenuobj != null) {
            this.dropmenuobj.style.visibility = "hidden";
            var d = this.dropmenuimg.getAttribute("keepOn");
            if (d == null) {
                this.swapimage(this.dropmenuimg, "off")
            }
        }
        try {
            ToggleDropDowns("hidden")
        } catch(c) {}
        this.clearhidemenu();
        if (this.ie || this.firefox) {
            g.onmouseout = function() {
                cssdropdown.delayhidemenu()
            };
            g.onclick = function() {
                return ! cssdropdown.disablemenuclick
            };
            this.dropmenuobj = document.getElementById(a);
            this.dropmenuimg = document.getElementById(b);
            this.dropmenuobj.onmouseover = function() {
                cssdropdown.clearhidemenu()
            };
            this.dropmenuobj.onmouseout = function(h) {
                cssdropdown.dynamichide(h)
            };
            this.dropmenuobj.onclick = function() {
                cssdropdown.delayhidemenu()
            };
            this.showhide(this.dropmenuobj.style, f);
            this.dropmenuobj.x = this.getposOffset(this.dropmenuimg, "left");
            this.dropmenuobj.y = this.getposOffset(this.dropmenuimg, "top");
            this.dropmenuobj.style.left = this.dropmenuobj.x - this.clearbrowseredge(g, "rightedge") + "px";
            this.dropmenuobj.style.top = this.dropmenuobj.y - this.clearbrowseredge(g, "bottomedge") + g.offsetHeight + 1 + "px"
        }
    },
    contains_firefox: function(d, c) {
        while (c.parentNode) {
            if ((c = c.parentNode) == d) {
                return true
            }
        }
        return false
    },
    dynamichide: function(b) {
        var a = window.event ? window.event: b;
        if (this.ie && !this.dropmenuobj.contains(a.toElement)) {
            this.delayhidemenu()
        } else {
            if (this.firefox && b.currentTarget != a.relatedTarget && !this.contains_firefox(a.currentTarget, a.relatedTarget)) {
                this.delayhidemenu()
            }
        }
    },
    delayhidemenu: function() {
        var c = this.dropmenuimg.getAttribute("keepOn");
        var a = "";
        if (c == null) {
            a = this.getswapimagesrc(this.dropmenuimg, "off")
        } else {
            a = this.getswapimagesrc(this.dropmenuimg, "on")
        }
        var d = "cssdropdown.dropmenuimg.src='" + a + "';cssdropdown.dropmenuobj.style.visibility='hidden'";
        this.delayhide = setTimeout(d, this.disappeardelay);
        try {
            ToggleDropDowns("visible")
        } catch(b) {}
    },
    swapimage: function(a, b) {
        a.src = this.getswapimagesrc(a, b)
    },
    getswapimagesrc: function(c, e) {
        var g = "";
        if (c != null) {
            var d = "_on.";
            var a = "_off.";
            g = c.src;
            var f = g.slice(0, g.lastIndexOf(".") + 1);
            var b = g.slice(g.lastIndexOf(".") + 1, g.length);
            if (f.indexOf(d) > 0 && e == "off") {
                g = f.slice(0, f.indexOf(d)) + a + b
            }
            if (f.indexOf(a) > 0 && e == "on") {
                g = f.slice(0, f.indexOf(a)) + d + b
            }
        }
        return g
    },
    clearhidemenu: function() {
        if (this.delayhide != "undefined") {
            clearTimeout(this.delayhide)
        }
    },
    startchrome: function() {
        for (var d = 0; d < arguments.length; d++) {
            var e = document.getElementById(arguments[d]).getElementsByTagName("a");
            for (var c = 0; c < e.length; c++) {
                if (e[c].getAttribute("rel")) {
                    var a = e[c].getAttribute("rel");
                    var b = e[c].getAttribute("imgID");
                    e[c].onmouseover = function(g) {
                        var f = typeof g != "undefined" ? g: window.event;
                        cssdropdown.dropit(this, f, this.getAttribute("rel"), this.getAttribute("imgID"))
                    }
                }
            }
        }
    }
};
function swipeDown(c, a) {
    var b = document.getElementById(c);
    a = parseInt(a);
    if (a < parseInt(b.offsetHeight)) {
        a += 10 + (a / 10);
        b.style.clip = "rect(0 auto " + a + "px 0)"
    } else {
        return
    }
    setTimeout("swipeDown('" + c + "', '" + a + "')", 10)
}
function swipeUp(c, a) {
    var b = document.getElementById(c);
    a = parseInt(a);
    if (a > 0) {
        a -= 10 + (a / 10);
        b.style.clip = "rect(0 auto " + a + "px 0)"
    } else {
        return
    }
    setTimeout("swipeUp('" + c + "', '" + a + "')", 10)
}
function showFSBanner(e, c, a) {
    var d = document.getElementById(e);
    var b = document.getElementById(c);
    cssdropdown.dropmenuobj = d;
    cssdropdown.dropmenuimg = b;
    d.x = cssdropdown.getposOffset(b, "left");
    d.y = cssdropdown.getposOffset(b, "top");
    d.style.left = d.x - cssdropdown.clearbrowseredge(d.style, "rightedge") + "px";
    d.style.top = d.y - cssdropdown.clearbrowseredge(d.style, "bottomedge") + b.offsetHeight + 1 + "px";
    d.style.clip = "rect(0 auto 0 0)";
    d.style.visibility = "visible";
    swipeDown(e, "0");
    if (a != null) {
        setTimeout("swipeUp('" + e + "', '" + d.offsetHeight + "')", 10000)
    }
}
function hideFSBanner(b) {
    var a = document.getElementById(b);
    swipeUp(b, a.offsetHeight)
}
function getswapimagesrc(c, e) {
    var g = "";
    if (c != null) {
        var d = "_on.";
        var a = "_off.";
        g = c.src;
        var f = g.slice(0, g.lastIndexOf(".") + 1).toLowerCase();
        var b = g.slice(g.lastIndexOf(".") + 1, g.length);
        if (f.indexOf(d) > 0 && e == "off") {
            g = f.slice(0, f.indexOf(d)) + a + b
        }
        if (f.indexOf(a) > 0 && e == "on") {
            g = f.slice(0, f.indexOf(a)) + d + b
        }
    }
    c.src = g
}
var IsAjaxLibraryLoaded = true;
function ToggleDropDowns(a) {}
function hpSwipeDown(c, a) {
    var b = document.getElementById(c);
    a = parseInt(a);
    if (a < parseInt(b.offsetHeight)) {
        a += 10 + (a / 10);
        b.style.clip = "rect(0 auto " + a + "px 0)"
    } else {
        return
    }
    setTimeout("hpSwipeDown('" + c + "', '" + a + "')", 10)
}
function hpSwipeUp(c, a) {
    var b = document.getElementById(c);
    a = parseInt(a);
    if (a > 0) {
        a -= 10 + (a / 10);
        b.style.clip = "rect(0 auto " + a + "px 0)"
    } else {
        return
    }
    setTimeout("hpSwipeUp('" + c + "', '" + a + "')", 10)
}
function hpShowFSBanner(e, c, a) {
    var d = document.getElementById(e);
    var b = document.getElementById(c);
    cssdropdown.dropmenuobj = d;
    cssdropdown.dropmenuimg = b;
    d.x = cssdropdown.getposOffset(b, "left");
    d.y = cssdropdown.getposOffset(b, "top");
    d.style.left = d.x - cssdropdown.clearbrowseredge(d, "rightedge") + "px";
    d.style.top = d.y - cssdropdown.clearbrowseredge(d, "bottomedge") + b.offsetHeight + 1 + "px";
    d.style.clip = "rect(0 auto 0 0)";
    d.style.visibility = "visible";
    swipeDown(e, "0");
    if (a != null) {
        setTimeout("hpSwipeUp('" + e + "', '" + d.offsetHeight + "')", 5000)
    }
}
function CloseHomePageBannerID() {
    var a = document.getElementById("HomePageBannerID");
    if (a != null) {
        a.style.visibility = "hidden"
    }
}
function gosearchHeader() {
    var b = GetMainFormName();
    if (b == null) {
        return
    }
    var a = document.forms[b].elements.SearchKeywords.value;
    a = a.toLowerCase();
    document.forms[b].action = "/Armani/_zh/_cn/search/index.aspx?SearchKeywords=" + a;
    document.forms[b].submit()
}
function isHeaderEnter(a) {
    if (a.keyCode == 13) {
        gosearchHeader()
    }
    return true
}
var bubble_reg_id = "LOGIN_DIALOG_BUBBLE";
var headerobjDummyID = "HeaderLoginDummy1";
function ShowLoginBubble() {
    var c = document.getElementById(bubble_reg_id);
    if (c != null) {
        c.style.visibility = "visible";
        c.style.display = ""
    }
    _CoreModalPopUp._PopupControlID = headerobjDummyID;
    _CoreModalPopUp.ShowModal();
    _CoreModalPopUp._PopupControlID = bubble_reg_id;
    var b = document.getElementById(headerobjDummyID);
    if (b != null) {
        var a = b.style.top;
        var d = b.style.left;
        if (c != null) {
            c.style.top = a;
            c.style.left = d
        }
    }
}
function HideLoginBubble() {
    var a = document.getElementById(bubble_reg_id);
    if (a != null) {
        a.style.visibility = "hidden";
        a.style.display = "none";
        _CoreModalPopUp._PopupControlID = headerobjDummyID;
        _CoreModalPopUp.ShowModal();
        _CoreModalPopUp.Hide()
    }
}
function DoShowQuickShop(b) {
    if (b != null) {
        list = b.getElementsByTagName("img");
        for (var a = 0; a < list.length; a++) {
            if (list[a].id == "quickshop") {
                list[a].style.display = ""
            }
        }
    }
}
function DoShowQuickShopWithRelativeObject(e, b, d, g) {
    if (b != null) {
        var f = parseInt(findPosX(e));
        var a = parseInt(findPosY(e));
        if (!isNaN(g)) {
            f = parseInt(f) + parseInt(g)
        }
        if (!isNaN(d)) {
            a = parseInt(a) + parseInt(d)
        }
        list = b.getElementsByTagName("img");
        for (var c = 0; c < list.length; c++) {
            if (list[c].id == "quickshop") {
                list[c].style.display = "";
                list[c].style.position = "absolute";
                list[c].style.top = a + "px";
                list[c].style.left = f + "px"
            }
        }
    }
}
function DoHideQuickShop(b) {
    if (b != null) {
        list = b.getElementsByTagName("img");
        for (var a = 0; a < list.length; a++) {
            if (list[a].id == "quickshop") {
                list[a].style.display = "none"
            }
        }
    }
};


