function track(id) {
    if ( pageTracker != null ) pageTracker._trackPageview(id);  
}


function refresh(url) {
    if ( pageTracker != null ) pageTracker._trackPageview(url);  
    window.location.href=url;
}


function hideDiv(id) {
    var myDiv = document.getElementById(id);
    $(myDiv).animate({ height: 'hide', opacity: 'hide' }, 'normal');
}


function showDiv(id) {
    var myDiv = document.getElementById(id);
    $(myDiv).animate({ height: 'show', opacity: 'show' }, 'normal');
}

function toggleDiv(id) {
    var myDiv = document.getElementById(id);
    if ( myDiv.style.display == "block") {
        hideDiv(id);
    } else {
        showDiv(id);
        // track information what people watched/clicked
        var loc = window.location;
        var page = loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length); 
        track(page + "#" + id);  
    }
    return true;
}


