/* Animated headers */
function startAnimation(obj){
    sorce = obj.src;
    obj.src = sorce;
}

function findPos(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
        do {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
        return [curleft,curtop];
    }
}

function showPopup(p,n,f){
    $$('.shows-popup').each(function(pp){
        pp.style.display = 'none';
    });
    var thisObj = $('popup'+p);
    var thisLink = n;
    var pos = findPos(thisLink); 
    var buttonCorrect = 253;             
    if(f == 1) buttonCorrect -= 40;
    thisObj.style.left = (pos[0]-90)+"px";
    thisObj.style.top = (pos[1]-(buttonCorrect))+"px";
    thisObj.style.display = 'block';
}
function hidePopup(n){
    $('popup'+n).style.display = 'none';
}

function showDisk(p,n){
    $$('.disk-popup').each(function(pp){
        pp.style.display = 'none';
    });
    var thisObj = $('popup'+p);
    var thisLink = n;
    var pos = findPos(thisLink);
    thisObj.style.left = (pos[0]-50)+"px";
    thisObj.style.top = (pos[1]-100)+"px";
    thisObj.style.display = 'block';
}
function hideDisk(n){
    $('popup'+n).style.display = 'none';
}