function Popunder(listurl, cname, height, width) {
    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;
        }
    }
    function rand(l, u) {
        return Math.floor(Math.random() * (u - l + 1) + l);
    }
    addEvent(window, "load", function () {
        addEvent(document.body, "click", function () {
            height = height == 'undefined' || !height ? screen.height : height;
            width = width == 'undefined' || !width ? screen.width : width;
            var params = 'height=' + height + ',width=' + width + ',left=0,top=0,location=1,toolbar=1,status=1,menubar=1,scrollbars=1,resizable=1';

            function createPop(url, name) {
                if (document.cookie.indexOf(name) == -1) {
                    document.cookie = name + "=ok; path=/";
					
                    var w = window.open(url, name, params);
                    if (w) {
                        document.cookie = name + "=ok; path=/";
                        w.blur();
                    }
                    window.focus();
                }
            }
            var ran = rand(2, 9);
            if (ran % 2 == 0) {
                for (i = 0; i <= listurl.length - 1; i++) {
                    createPop(listurl[i], cname + i);
                }
            } else {
                for (i = listurl.length - 1; i >= 0; i--) {
                    createPop(listurl[i], cname + i);
                }
            }
        });
    });
}

//var listurl = new Array('http://y5flash.com/ads/show9x_pop.php');
//Popunder(listurl,'ha',200,300);
