// do something with the returned data
function handleRequest(req) {
	var writeroot = document.getElementById('content_popular');
	writeroot.innerHTML = req.responseText;
    initalizetooltip();
}

// update data based on DROP-DOWN
function getNewPopular(){
    var sWhat = document.getElementById('selectPopular').value;
    sendRequest('/include/getPopular.php?node='+sWhat,handleRequest);
}

// update data based on PAGE selection
function getMorePopular(iPage){
    var sWhat = document.getElementById('selectPopular').value;
    sendRequest('/include/getPopular.php?node='+sWhat+'&pg='+iPage,handleRequest);
}

function displayPopular(){
    if(document.getElementById('content_popular')){
        // make initial call to script to get all data
        sendRequest('/include/getPopular.php?node='+defaultPopular,handleRequest);
    }
}

window.onload = displayPopular;