﻿        /**
         * Copyright (C) Danat
         * 
         * Revision: 0.1
         * 
         * Purpose: Handles the display and hiding for the confirmation bar
         * 
         * -=[ Revision History ]=-
         * ** Rev. 0.1 
         * - Created scripts
         * 
         * -=[ Notes ]=-
         * *Date: 22-MAY-08
         * Test with Firefox and Opera
         */
        var isAlertShown = false;
        
        function showAlert(aTxt) {
            if (!isAlertShown) {
                var nitinAlerter = document.getElementById('nitinAlerter');
                nitinAlerter.innerHTML = aTxt;
                nitinAlerter.style.display='block';
                setTimeout('hideAlert(100)', 5000);
                isAlertShown = true;
            } else {
                setTimeout('showAlert(' + aTxt + ')', 5000);
            }
        }
        
        function hideAlert(currOpacity) {
            if (isAlertShown) {                                            
                var nitinAlerter = document.getElementById('nitinAlerter');
                if (currOpacity) {
                    nitinAlerter.style.opacity = currOpacity/100;
                    nitinAlerter.style.filter = 'alpha(opacity=' + currOpacity + ')';
                }
                if (currOpacity <= 0) {
                    nitinAlerter.innerHTML = '';
                    nitinAlerter.style.display='none';
                    isAlertShown = false;
                }
                currOpacity -= 10;
                setTimeout('hideAlert(' + currOpacity + ')', 100);
            }
        }    
