(function() {
    var a = function() {
        var b = this;
        this.dataUrl = "js/cfydataplus.js";
		//this.dataUrl = "cfydataplus.php";
        this.cache = {};
        this.firstRun = true;
        this.visiable = false;
        this.paddingTop = 50;
        this.css = '.cfy {width:0px;height:385px;margin:10px auto;display:block;z-index:888;position:fixed;right:0;top:50px;font-family:"\u5b8b\u4f53"}.cfy form {margin:0;padding:0;}.cfy ul,li {margin:0;padding:0;list-style:none;list-style-image:none;}.cfy a {color:#AB0101;text-decoration:none;}.cfy a:hover {text-decoration:underline;}.cfy h2 {margin:5px 0px;padding:0;font-size:18px;font-weight:normal;font-family:"\u9ed1\u4f53";text-align:center;overflow:hidden;}.cfy #jj_suggest_result {top:0!important;left:0!important;}.cfy_warp {width:309px;height:447px;display:block;background-image:url(images/Image/cfy_bg_n.png);}.cfy_sider {height:262px;width:75px;float:left;margin-top:0;}.cfy_main {height:420px;width:215px;float:right;overflow:hidden}.cfy_sider .cfy_eye {height:48px;cursor:pointer;}.cfy_sider ul {margin-left:10px;}.cfy_sider ul li {height:30px;margin-bottom:2px;padding-top:10px;padding-left:3px;font-size:10px;color:#fff;font-weight:bold;border:0 red solid;width:50px;border:0 red solid;padding-right:9px;cursor:pointer;line-height:16px;}.cfy_sider ul li.at {color:#F76384;}.cfy_sider .cfy_state {font-size:12px;color:#fff;padding: 0px 0 0 20px;}.cfy_state {cursor:pointer}.cfy_main .cfy_proc {height:30px;text-align:right;padding-right:10px;padding-top:5px;}.cfy_proc .cfy_goindex {float:left;padding-left:40px;}.cfy_proc .cfy_goindex a {color:#B91A02;text-decoration:underline;font-size:12px;}.cfy_main .cfy_proc img {margin-left:5px;}.cfy_main .cfy_content {height:380px;margin:20px 20px 0px 0px;}.cfy_main .cfy_content .cfy_inner ul li {height:21px;line-height:21px;font-size:12px;overflow:hidden;background:url(images/Image/cfy_dot.gif) no-repeat 2px 10px;padding-left:10px;}.cfy_main .cfy_content .cfy_inner ul li span.mdata {float:right;width:45px;color:#555;text-align:right;padding-right:5px;}.cfy_main .cfy_content .cfy_inner ul li span.red a {color:#ff0000;font-weight:normal}.cfy_main .cfy_content .cfy_inner ul.cfy_quickLink {display:block;height:120px;clear:both;margin:10px 0 0 10px;}.cfy_main .cfy_content .cfy_inner ul.cfy_quickLink li {height:20px;line-height:20px;font-size:12px;overflow:hidden;background:url(images/Image/cfy_toolBg.gif) no-repeat left top;border:1px #C0C0C0 solid;margin:0 7px 8px 0;float:left;padding:0px;width:58px;text-align:center;}.cfy_main .cfy_content .cfy_inner ul.cfy_quickLink li a {font-weight:normal;color:#111;}.cfy_splitline {border-top:1px dashed #555;height:0;overflow:hidden;margin:5px;}.cfy_moreCont {height:18px;line-height:18px;text-align:right;padding-right:5px;}.cfy_moreCont a{font-size:12px;}.cfy_searchCont {margin:0 5px;margin-top:10px;}.cfy_search {height:30px;display:block;position:relative;}.cfy_input {border:1px #6ca8cd solid;background:url(images/Image/cfy_s1.gif) no-repeat left 50%;padding-left:20px;width:130px;color:#555;float:left;padding-top:2px;font-size:13px;}.cfy_btn {border:1px #6ca8cd solid;height:18px;width:auto;float:left;margin-left:5px;cursor:pointer;}.cfy_btn b {float:left;border:1px #fff solid;height:16px;padding:0 5px;line-height:18px;width:auto;display:block;font-size:12px;background:url(images/Image/cfy_s2.gif) bottom;color:#555;}.cfy_itbull {padding:5px 0 10px 0px;height:88px;overflow:hidden;}.cfy_itbull .c_m_img {width:105px;float:left;overflow:hidden;}.cfy_itbull .c_m_img a {color:#fff;text-decoration:none;display:block;}.cfy_itbull .c_m_img a .c_m_t {text-decoration:underline;}.cfy_itbull .c_m_img a:hover {color:#ffa;}.cfy_itbull .c_m_img a img {border:1px #ccc solid;}.cfy_itbull .c_m_img a:hover img {border:1px #ffc133 solid;}.cfy_itbull .c_m_t {display:block;height:18px;padding:4px 0 0 0;font-size:12px;line-height:14px;overflow:hidden;background:#c00;cursor:pointer;text-align:center;}.cfy_itbull .c_m_t a {font-size:12px;}.cfy_itbull .c_m_txt {float:left;width:172px;overflow:hidden;}.cfy_main .cfy_content .cfy_inner .cfy_itbull .c_m_txt ul li {padding-left:4px;}.cfy_main .cfy_content .cfy_inner .cfy_itbull ul li {background:none;height:23px;line-height:23px;}. html,* html body  {background-image:url(about:blank);background-attachment:fixed;}*html .cfy  {position:absolute;z-index: 9999;right:0px;top:expression(eval((document.documentElement.scrollTop +' + this.paddingTop + ") > (document.body.clientHeight - document.documentElement.clientHeight) ? document.body.clientHeight - document.documentElement.clientHeight : document.documentElement.scrollTop +" + this.paddingTop + ')+"px");width:0px;height:620px;overflow:hidden;}';
        this.html = '<div id="cfy" class="cfy"><div class="cfy_warp" > <div class="cfy_sider" id="cfy_show"><div class="cfy_eye">&nbsp;</div><ul id="cfy_tab"><li class="at">Coupons</li><li>Campaign</li><li>Guide</li><li><span style="color:#0000">Reviews</span></li></ul><div class="cfy_state"><span id="cfy_state"><img src="images/Image/cr.gif" height="16" width="17" border="0"></span></div></div><div class="cfy_main" id="cfy_main"><div class="cfy_proc"><span class="cfy_goindex"><a href="http://www.miccostumes.com" target="_blank" title="Micostumes.com">Micostumes.com&gt;&gt;</a></span><span><img src="images/Image/cfy_hidden_n.gif" id="cfy_hidden" title="tuck up" style="cursor:pointer;"/></span></div><div class="cfy_content"><div class="cfy_inner" id="cfy_cont1"><div id="cfy_list0">loading...</div></div><div class="cfy_inner" id="cfy_cont2" style="display:none;"><div id="cfy_list1">loading...</div><div class="cfy_moreCont" style="margin-top:5px;"></div></div><div class="cfy_inner" id="cfy_cont3" style="display:none;"><div id="cfy_list2">loading...</div><div class="cfy_moreCont"></div></div><div class="cfy_inner" id="cfy_cont4" style="display:none;"><div id="cfy_list3">loading...</div><div class="cfy_splitline"></div><div class="cfy_moreCont"><a href="products_reviews.php"  target="_blank">More &gt;&gt;</a></div></div></div></div></div></div></div></div>'
	};
    a.prototype.builder = function() {
        this.loadImgs();
        this.builderCss();
        this.builderHtml();
        this.builderJavaScript()
    };
    a.prototype.$ = function(b) {
        return (typeof b == "string") ? document.getElementById(b) : b
    };
    a.prototype.$addEvent = function(f, c, d, b) {
        if (f.addEventListener) {
            f.addEventListener(c, d, b);
            return true
        } else {
            if (f.attachEvent) {
                var e = f.attachEvent("on" + c, d);
                return e
            } else {
                f["on" + c] = d
            }
        }
    };
    a.prototype.$e = function(b) {
        return (window.event) ? window.event.srcElement: b.target
    };
    a.prototype.$jsLoad = function(d, c, e) {
        var b = document.createElement("script");
        b.setAttribute("charset", c);
        b.setAttribute("type", "text/javascript");
        b.setAttribute("src", d);
        document.getElementsByTagName("head")[0].appendChild(b);
        b.onload = b.onreadystatechange = function() {
            if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") {
                e(b)
            }
        }
    };
    a.prototype.loadImgs = function() {
        var b = new Image();
        b[0] = "";
        b[0].src = "images/Image/cfy_bg.gif";
        b[1] = "";
        b[1].src = "images/Image/cfy_li_bg.png";
        b[2] = "";
        b[2].src = "images/Image/cfy_s1.gif";
        b[3] = "";
        b[3].src = "images/Image/cfy_s2.gif";
        b[4] = "";
        b[4].src = "images/Image/cfy_hidden.gif";

        b[5] = "";
        b[5].src = "images/Image/cfy_dot.gif";
        b[6] = "";
        b[6].src = "images/Image/cfy_refresh.gif"
    };
    a.prototype.slidingEventPlus = function(l, g, h, q, d, p, e, o) {
        var k = this;
        var f = {};
        var c = k.$(l).getElementsByTagName(g);
        var n = c[p];
        d = (d == null || d == 0) ? "mouseover": "click";
        var b = function(s, r) {
            var i = s;
            while (i.nodeName != g.toUpperCase()) {
                i = i.parentNode
            }
            if (f.obj != i) {
                f.obj.className = "";
                if (p) {
                    n.className = e
                }
                k.$(q + parseInt(f.id)).style.display = "none";
                k.$(q + parseInt(r)).style.display = "block";
                if (p == null || n != i) {
                    i.className = h
                } else {
                    i.className = o
                }
                f.obj = i;
                f.id = r
            }
        };
        for (var j = 0; j < c.length; j++) {
            var m = function(r, i) {
                b(r, parseInt(i) + 1)
            };
            k.$addEvent(c[j], d, m.bind(this, c[j], j), false);
            if (c[j].className == h) {
                f = {
                    obj: c[j],
                    id: parseInt(j) + 1
                }
            }
        }
    };
    a.prototype.builderCss = function() {
        var b = this.css;
        var d = document.createElement("style");
        document.getElementsByTagName("HEAD").item(0).appendChild(d);
        d.type = "text/css";
        if (d.styleSheet) {
            d.styleSheet.cssText = b
        } else {
            var c = document.createTextNode(b);
            d.appendChild(c)
        }
    };
    a.prototype.builderHtml = function() {
        var b = document.createElement("div");
        b.innerHTML += this.html;
        document.body.insertBefore(b, document.body.firstChild)
    };
    a.prototype.builderJavaScript = function() {
        var b = this;
        b.slidingEventPlus("cfy_tab", "li", "at", "cfy_cont");
        b.builderHiddenOrShow();
        b.builderUpdate()
    };
    a.prototype.builderSuggest = function() {
        var d = this;
        var c = {
            text: "\u8f93\u4ee3\u7801\u3001\u540d\u79f0\u6216\u62fc\u97f3", //"输代码、名称或拼音"
            autoSubmit: true,
            width: 202,
            header: ["\u9009\u9879", "\u4ee3\u7801", "\u540d\u79f0", "\u7c7b\u578b"],//"选项", "代码", "名称", "类型"
            body: [ - 1, 1, 4, -2],
            callback: function(e) {}
        };
        var b = function(g) {
            var e = g;
            var f = escape(e);
            if (e == "Lose code, name or pinyin" || e == "") {
                window.open("http://www.miccostumes.com/")
            } else {
                window.open("www.miccostumes.com/&q=" + f + "&t=body")
            }
        };
        d.$jsLoad("http://www.miccostumes.com/js/StockSuggest.js", "utf-8",
        function() {
            var e = new StockSuggest("cfy_searchCont", c);
            d.$addEvent(d.$("cfy_soquote"), "click",
            function() {
                e.Submit()
            },
            false);
            d.$addEvent(d.$("cfy_sonews"), "click",
            function() {
                b(d.$("cfy_searchCont").value)
            },
            false)
        })
    };
    a.prototype.builderUpdate = function() {
        var e = this;
        var d = function() {
            e.$jsLoad(e.dataUrl + "?rt=" + Math.random(), "utf-8",
            function(f) {
                if (typeof cfy_cont1 == "undefined" || cfy_cont1 == null || cfy_cont1 == "" || typeof cfy_cont2 == "undefined" || cfy_cont2 == null || cfy_cont2 == "" || typeof cfy_cont3 == "undefined" || cfy_cont3 == null || cfy_cont3 == "" || cfy_cont4 == null || cfy_cont4 == "") {} else {
                    e.cache.cfy_cont1 = cfy_cont1;
                    e.cache.cfy_cont2 = cfy_cont2;
                    e.cache.cfy_cont3 = cfy_cont3;
					e.cache.cfy_cont4 = cfy_cont4;
                    f.parentNode.removeChild(f);
                    c()
                }
            })
        };
        var c = function() {
            e.$("cfy_list0").innerHTML = e.cache.cfy_cont1;
            e.$("cfy_list1").innerHTML = e.cache.cfy_cont2;
            e.$("cfy_list2").innerHTML = e.cache.cfy_cont3;
			e.$("cfy_list3").innerHTML = e.cache.cfy_cont4;
            if (e.firstRun == true) {
                e.firstRun = false;
                e.fadeIn()
            }
        };
        var b = function() {
            d();
            setInterval(function() {
                d()
            },
            60000)
        };
        b()
    };
    a.prototype.fadeIn = function() {
        var g = this;
        var e = 401;
        var c = 42;
        var d = 0;
        var b = (c - d) / 10;
        if ("\v" == "v") {
            b = (c - d) / 5
        }
        g.$("cfy").style.width = d + "px";
        g.$("cfy").style.display = "block";
        var f = function(j, i) {
            i = i + b;
            i = (i > c) ? c: i;
            g.$("cfy").style.width = i + "px";
            if (i == c) {} else {
                setTimeout(function() {
                    f(j, i)
                },
                20)
            }
        };
        f(e, d)
    };
    a.prototype.builderHiddenOrShow = function() {
        var f = this;
        var j = false;
        var b = false;
        var g = 447;
        var h = 447;
        var c = 309;
        var e = 60;
        var k = (c - e) / 10;
        var d = function() {
            if (f.visiable == true && b == false) {
                f.visiable = false;
                f.$("cfy_state").innerHTML = "<img src='images/Image/cr.gif' height='16' width='17' border='0'>";
                b = true;
                var l = function(n, m) {
                    m = m - k;
                    m = (m < e) ? e: m;
                    f.$("cfy").style.width = m + "px";
                    if (m == e) {
                        f.visiabled = false;
                        b = false
                    } else {
                        setTimeout(function() {
                            l(n, m)
                        },
                        20)
                    }
                };
                l(g, c)
            }
        };
        var i = function() {
            if (f.visiable == false && b == false) {
                f.visiable = true;
                f.$("cfy_state").innerHTML = "<img src='images/Image/cr2.gif' height='16' width='17' border='0'>";
                b = true;
                var l = function(n, m) {
                    m = m + k;
                    m = (m > c) ? c: m;
                    f.$("cfy").style.width = m + "px";
                    if (m == c) {
                        f.visiabled = true;
                        b = false
                    } else {
                        setTimeout(function() {
                            l(n, m)
                        },
                        20)
                    }
                };
                l(h, e)
            }
        };
        f.$addEvent(f.$("cfy_show"), "click", i, false);
        f.$addEvent(f.$("cfy_hidden"), "click", d, false);
        f.$addEvent(f.$("cfy_state"), "click",
        function() {
            if (f.visiable == false && b == false) {
                i()
            } else {
                if (f.visiable == true && b == false) {
                    d()
                } else {
                    alert(wait)
                }
            }
        },
        false);
        f.$addEvent(document.body, "click",
        function(m) {
            var n = true;
            var l = f.$e(m);
           /* while (l.nodeName != "BODY") {
                if (l.className.indexOf("cfy_") > -1) {
                    n = false;
                    break
                }
                l = l.parentNode
            }*/
            if (n) {
                d()
            }
        },
        false)
    };
    a.prototype.init = function() {
        this.builder()
    };
    Function.prototype.bind = function() {
        var e = this,
        c = arguments[0],
        b = new Array();
        for (var d = 1; d < arguments.length; d++) {
            b.push(arguments[d])
        }
        return function() {
            return e.apply(c, b)
        }
    };
    window.cfy = new a();
    cfy.init()
})();
