var sdkl = (function(){
        var d = {
            css3: null,
            sd: null,
            timer: null,
            noshowCallback: function(){
				callback();
                d.sd.fadeOut();
            	clearTimeout(d.timer);
            },
            triggerno: null
        }, a = document.body.style;
        if ("WebkitTransition" in a || "MozTransition" in a || "OTransition" in a || "Transition" in a) {
            d.css3 = true
        }
        function e(){
          //  d.sd.fadeOut();
		   if (d.css3) {
                d.sd.css("top", -600)
            }
            else {
                d.sd.animate({
                    top: "-600"
                }, 2000)
            }
            clearTimeout(d.timer)
        }
        function c(g){
            var b = d.triggerno;
            b.css("display") == "block" ? b.css("display", "none") : b.css("display", "block");
            if (g) {
                g()
            }
        }
        function f(){
            d.sd = $("#sdkl");
            d.triggerno = d.sd.find(".s");
            if (d.css3) {
                d.sd.css("top", 120)
            }
            else {
                d.sd.animate({
                    top: "120"
                }, 2000)
            }
           
            d.sd.find(".close").click(function(){
                c(d.noshowCallback)
            });
            d.triggerno.click(function(){
                c(d.noshowCallback)
            });
            d.timer = setTimeout(e, 10000)
        }
        return {
            start: function(b){
                var g = "<a target='_blank' href='http://www.eefocus.com/activity/2012-renew.php'><img src='http://www.eefocus.com/images/activity/2011renew/newyear2012.png' alt='' width='900' height='450' /></a><p class='clearfix'><a href='javascript:void(0)' class='close'>\u00d7</a></p>", h = document.createElement("div");
                h.innerHTML = g;
                h.id = "sdkl";
                document.body.appendChild(h);
                setTimeout(f, b || 2000)
            }
        }
		
    })();
    var getCookie = function(c_name){
        if (document.cookie.length > 0) {
            c_start = document.cookie.indexOf(c_name + "=")
            if (c_start != -1) {
                c_start = c_start + c_name.length + 1
                c_end = document.cookie.indexOf(";", c_start)
                if (c_end == -1) 
                    c_end = document.cookie.length
                return unescape(document.cookie.substring(c_start, c_end))
            }
        }
        return ""
    };
	 var callback = function () {
	 	var name='adclosed';
		var value='1';
 
        if (getCookie(name) != value) {
            var exp = new Date(); //new Date("December 31, 9998");
            exp.setTime(exp.getTime() + 24 * 60 * 60 * 1000);
            document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
            
        }
        };
		
		if((getCookie('adstatus')!='1') && (getCookie('adclosed')!='1')){
					
					sdkl.start(10);
				}	

       
		
