﻿var CacheManager = {
    cache_ : {},
    
    Put : function(id, html)
    {
        CacheManager.cache_[id] = html;
    },
    
    Get : function(id)
    {
        if (CacheManager.IsCached(id)) {
            return CacheManager.cache_[id];
        }
        else
        {
            return null;
        }
    },
    
    IsCached : function(id)
    {   
        if (CacheManager.cache_[id] != null) 
        {   
            return true;
        }
        else
        {
            return false;
        }        
    },
    
    Remove: function(id)
    {
        CacheManager.cache_[id] = null;
    },
    
    RemoveAll : function()
    {
        for (i in CacheManager.cache_)
        {
            delete CacheManager.cache_[i];
        }
    }
}
