    var iCurrentPosition = 0;
    var oPopupObject = null;
    var oCurrInterval = null;
    var bIsBrowserIE = (navigator.appName == "Microsoft Internet Explorer"); 

    function startModalPopupAppearing(obj)
    {
        if(oCurrInterval)
        {
            clearInterval(oCurrInterval);
            oCurrInterval = null;
        }
        
        if(oPopupObject)
        {
            setModalPopupOpacity(1);
        }

        oPopupObject = obj;
        setModalPopupOpacity(0);
        
        iCurrentPosition = 10;
        
        oCurrInterval = setInterval('setModalPopupOpacity()', bIsBrowserIE ? 5 : 17);
    }
    
    function setModalPopupOpacity(value)
    {
        if(value == null)
        {
            iCurrentPosition -= (bIsBrowserIE ? 2 : 1);
            value = (10 - iCurrentPosition) / 10;
        }
        //alert(value);
        if(oPopupObject)
        {
            if(bIsBrowserIE)
                oPopupObject.style.filter = 'alpha(opacity=' + parseInt(value * 100) + ')';
            else
            {
                oPopupObject.style.MozOpacity = value;
                oPopupObject.style.opacity = value;
            }
        }
        
        if(iCurrentPosition <= 0)
        {
            iCurrentPosition = 0;
            clearInterval(oCurrInterval);
        }
    }
    
    function copyToClipboard(s)
    {
	    if( window.clipboardData && clipboardData.setData )
	    {
		    clipboardData.setData("Text", s);
	    }
	    else
	    {   
	        var flashcopier = 'flashcopier';
            if(!document.getElementById(flashcopier)) {
              var divholder = document.createElement('div');
              divholder.id = flashcopier;
              document.body.appendChild(divholder);
            }
            document.getElementById(flashcopier).innerHTML = '';
            var divinfo = '<embed src="/flash/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(s)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
            document.getElementById(flashcopier).innerHTML = divinfo;
   
	    }
    }
    
    function activateClickEvent(obj)
    {
        if(navigator.appName.indexOf("Microsoft") != -1)
        {
            obj.click();
        }
        else
        {
            var evt = document.createEvent("MouseEvents");
            evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
            
            obj.dispatchEvent(evt);
        }
    }
 
    function processEnter(event)
    {
        if(!event) event = window.event;
        if(!(event && event.keyCode == 13))
            return false;
        else
        {
            return true;
        }
    }
    function FormatNowTime()  
    {  
        var today = new Date();
        //return today;
        return FormatTime(today);
    }  
    
    function FormatTime(time)  
    {  
        //returns string from a Date object in the following format "2008-05-07 21:15" 
        var r = time.getFullYear() + '-' + AddLeadingZero(time.getMonth() + 1) + '-' + AddLeadingZero(time.getDate()) + ' ' + AddLeadingZero(time.getHours()) + ':' + AddLeadingZero(time.getMinutes()); 
        
        return r;
    } 
    function AddLeadingZero(num)  
    {
        if( num < 10)
        {
            return '0' + num;
        }
        
        return num;
    } 
    
function stop()
{
    var i = 5;
}
