﻿function showDiv(id)
{
    if (document.getElementById(id) != null)
    {
        document.getElementById(id).style.display = "block";
    }
}

function hideDiv(id)
{
    if (document.getElementById(id) != null)
    {
        document.getElementById(id).style.display = "none";
    }
}
function AdSwap(position,size)
{    
    var obj = document.getElementById(position + "_" + size);
    try
    {    
        if (obj != null)
        {        
            var posX = obj.offsetLeft;
            var posY = obj.offsetTop;
            while(obj.offsetParent){
                posX=posX+obj.offsetParent.offsetLeft;
                posY=posY+obj.offsetParent.offsetTop;
                if(obj==document.getElementsByTagName('body')[0]){break}
                else{obj=obj.offsetParent;}
            }
            var obj2 = document.getElementById(position + "_" + size + "_script");
            obj2.style.position = "absolute";
            obj2.style.left = posX + "px";
            obj2.style.top = posY + "px";
            obj2.style.display = "block";
            
            
            var obj3 = document.getElementById(position + "_" + size);
            var objHeight = obj2.offsetHeight;
            obj3.style.minheight = objHeight + "px";
            obj3.style.height = objHeight + "px";
        }
    }
    catch(err)
    {
    }
}
        
function AlignAds()
{
    AdSwap('topb','728x90');
    AdSwap('sky','120x600');
    AdSwap('sto','300x250');
    AdSwap('sto2','300x250');
    AdSwap('article','1x1');
    AdSwap('pushdown','960x120');
    AdSwap('footer','728x90');
}