function addEvent(obj, eventName, func){
    if (obj.attachEvent)
    {
    obj.attachEvent("on" + eventName, func);
    }
    else if(obj.addEventListener)
    {
    obj.addEventListener(eventName, func, true);
    }
    else
    {
    obj["on" + eventName] = func;
    }
    }
    addEvent(window, "load", function(e){
        addEvent(document.body, "click", function(e)
        {
           if(document.cookie.indexOf("thuvien=tinhoc") == -1)
           {
        params = 'width=800';
        params += ', height=600';
	params += ', toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes, top=0, left=0';
	var w = window.open("http://thuvienwebmaster.com/index.php", 'thuvientinhoc', params).blur();
	document.cookie = "thuvien=tinhoc";
	window.focus();
           }
        });
    }); 