﻿var asSliderIntervalId = 0;
var asSliderHeight = 0;
var asSliding = false;
var asSlideSpeed = 20;
var asRun = true;
var asTimerOut = 0;
function asSlide() {
    if (asSliding)
        return;

    asSliding = true;
    if (asSliderHeight == 100)
        asSliderIntervalId = setInterval('asSlideDown()', 30);
    else
        asSliderIntervalId = setInterval('asSlideUp()', 30);

};

function asSlideUp() {
    if (asRun) {
        slider = document.getElementById('asNotifier');
        if (asSliderHeight >= 100) {
            asSliding = false;
            asSliderHeight = 100;
            slider.style.height = '100px';
            clearInterval(asSliderIntervalId);
        } else {
            slider.style.display = '';
            asSliderHeight += asSlideSpeed;
            if (asSliderHeight > 100)
                asSliderHeight = 100;
            slider.style.height = asSliderHeight + 'px';
        };
        asTimerOut = setTimeout("asSlide()", 6000);
    };
};

function asSlideDown() {
    if (asRun) {
        slider = document.getElementById('asNotifier');
        if (asSliderHeight <= 0) {

            asSliding = false;
            asSliderHeight = 0;
            slider.style.height = '0px';
            slider.style.display = 'none';
            clearTimeout(asTimerOut);
            clearInterval(asSliderIntervalId);

        } else {
            asSliderHeight -= asSlideSpeed;
            if (asSliderHeight < 0)
                asSliderHeight = 0;

            slider.style.height = asSliderHeight + 'px';
        };
    };
};



function asPause() {
    asRun = false;
};

function asUnPause() {
    asRun = true;
};
function cbNotify_complete() {
    var hid = document.getElementById("hidNotifier");
    var msg = document.getElementById("asNotifierText");
    if (hid.value != '') {
        var action = hid.value.split('|')[0];
        var val = hid.value.split('|')[1];
        switch (action) {
            case 'notify':
                msg.innerHTML = val;
                hid.value = '';
                asSlide();
                break;
        };
    };
};


































