
            
        function init ()
        {
            /*
            blockStep = Math.round((maxBound-minBound)/5);
            smallStep = 1;
            lastValue = 0;
            releaseTimer = null;
            changeTimer = null;
            firstRun = 0;
            
            bb1;
            bb2;
            bbContainer1 = document.getElementById('rbbel1');
            bbContainer2 = document.getElementById('rbbel2');
            bbMask = document.getElementById('rbbm');
            bbsHtml = "";
            changeTime = (new Date).getTime();
            */
            
            if (betweenBound < minBound || betweenBound > maxBound) {
                betweenBound = defTime;
                BDP.setCookie('randomInterval', betweenBound, 3600*24*365*10);
            }
            
            s = new Slider(document.getElementById("slider-1"), document.getElementById("slider-input-1"));
            s.setMinimum(minBound);
            s.setMaximum(maxBound);
            s.setBlockIncrement(blockStep);
            s.setUnitIncrement(smallStep);
            s.setValue(maxBound-betweenBound+minBound);
            changeTimer = setTimeout("randomize()", betweenBound*1000);
          	s.onchange = function ()
          	{
            	document.getElementById("h-value").value = s.getMaximum()-s.getValue()+s.getMinimum();
            	detectChange();
            }
        }
        
        function detectChange ()
        {
            currentValue = document.getElementById("h-value").value;
            if (lastValue == 0 || lastValue != currentValue) {
                clearTimeout(releaseTimer);
                releaseTimer = setTimeout("detectChange()", 2000);
                lastValue = currentValue;
            } else {
                //alert('saving now');
                BDP.setCookie('randomInterval', currentValue, 3600*24*365*10);
                lastValue = 0;
                clearTimeout(changeTimer);
                betweenBound = currentValue;
                changeTimer = setTimeout("randomize()", betweenBound*1000);
            }
        }
        
        function randomize ()
        {
            // init getNext Jsr (global)
            if (typeof(oJsr_getNext) == "undefined") {
                oJsr_getNext = new Jsr();
            }
            
            // onload - result
            oJsr_getNext.onresults = function (oThis) {
                if (oThis.results.getNext) {
                    //alert('getNext OK');
                    bbsHtml = oJsr_getNext.results.getNext;
                    bbsChange();
                    changeTimer = setTimeout("randomize()", betweenBound*1000);
                } else {
                    BDP.error('Can not get next unseen buzzbites');
                }
            };
        
            // call
            oJsr_getNext.call('buzzbite', 'getNext', {'BBS_application': 'category', 'count': 2, 'w_C_ids': w_C_ids, 'exclude_BB_ids': exclude_BB_ids});
        }
        
        function onShow()
        {
            bb1_BB_id = getBB_id(bbContainer1);
            bb2_BB_id = getBB_id(bbContainer2);
            bb1 = new BuzzBite(bb1_BB_id);
            bb2 = new BuzzBite(bb2_BB_id);
        }
        function onHide()
        {
            if (firstRun == 0) {
                firstRun = 1;
                BuzzBite.Destroy(bb1_BB_id);
                BuzzBite.Destroy(bb2_BB_id);
            } else {
                bb1.destroy();
                bb2.destroy();
            }
            bbContainer1.innerHTML = bbsHtml[0];
            bbContainer2.innerHTML = bbsHtml[1];
            bbsHtml = "";

            // show buzzbites
            toAlpha(bbMask, 0, onShow);
        }
        function bbsChange()
        {
            if (changeTimer === false) {
                return;
            }
            // hide buzzbites
            toAlpha(bbMask, 100, onHide);
        }
        function getBB_id(elContainer)
        {
            var els = elContainer.getElementsByTagName("div");
            for (i=0; i<els.length; i++) {
                if (els[i].id && els[i].id.indexOf('bb_') == 0) {
                    return els[i].id.substr(3);
                }
            }
        }
            
        
   // share popup pause
	BuzzBite.SharePopup.onshow = function ()
	{
        if (window.changeTimer === undefined) return;
        if (BuzzBite.SharePopup.BB_id == bb1_BB_id || BuzzBite.SharePopup.BB_id == bb2_BB_id) {
            clearTimeout(changeTimer);
            changeTimer = false;
        }
	}
	BuzzBite.SharePopup.onclose = function ()
	{
		if (window.changeTimer === undefined) return;
	    if (window.changeTimer === false) {
	       changeTimer = window.setTimeout(randomize, betweenBound*1000);
	    }
	}