var chartData = null;
var monthlyData = null;

/**
 * Retrieves the HTML tag chart and displays it.
 * @todo needs to work out a way to parameterize some of this.
 */
function show_tag_chart(height,width)
{
    if(chartData == null)
    {
        var req = new XMLHttpRequest();
        var link = "http://www.raditha.com/blog/wp-content/plugins/tagchart/innerhtml.php?what=tags";
        link += "&height="+ height;
        link += "&width="+ width;
        link +="&bada";

        req.open("GET", link ,false);
        req.send(null);
        var chartData = document.getElementById('tag_chart');
        chartData.innerHTML = req.responseText;
    }
    document.getElementById('tag_cloud').style.display='none';
    chartData.style.display ='';
    

}

function show_monthly_chart(height,width)
{
    
    if(monthlyData == null)
    {
        var req = new XMLHttpRequest();
        var link = "/blog/wp-content/plugins/tagchart/innerhtml.php?what=monthly";
        link += "&height="+ height;
        link += "&width="+ width;
        link +="&bada";
        
        req.open("GET", link ,false);
        req.send(null);
        var monthlyData = document.getElementById('monthly_chart');
        monthlyData.innerHTML = req.responseText;
    }
}


function show_tag_cloud()
{

    document.getElementById('tag_chart').style.display='none';
    document.getElementById('tag_cloud').style.display='';


}