/*
 
Places and resizes clickable left- and right banner

*/

function WallpaperSetup(BodyWidth, EnableTowerLeft, EnableTowerRight)
{
    // Get banner sizes incl. padding, marrgin ect.
    var AdLeftSize = EnableTowerLeft.toString() == "True" ? AdLeftSize = document.getElementById("adssV").offsetWidth + 3 : 0;
    var AdRightSize = EnableTowerRight.toString() == "True" ? AdRightSize = document.getElementById("adss").offsetWidth + 3 : 0;
    var BannerPosition
    
    // Calculate DIV tags positions
    if (EnableTowerLeft.toString() == "True" && EnableTowerRight.toString() == "True")
    {
        BannerPosition = AdLeftSize;
    }
    if (EnableTowerLeft.toString() == "False" && EnableTowerRight.toString() == "True")
    {
        BannerPosition = 96;
        AdLeftSize = AdLeftSize + 26;
        AdRightSize = AdRightSize - 26;
    }
    if (EnableTowerLeft.toString() == "True" && EnableTowerRight.toString() == "False")
    {
        BannerPosition = 26;
        AdLeftSize = AdLeftSize - 26;
    }
    if (EnableTowerLeft.toString() == "False" && EnableTowerRight.toString() == "False")
    {
        AdRightSize = 0;
        BannerPosition = 0;
    }
    
    if (navigator.appVersion.indexOf("opera") == -1)
    {
        // Setup general values
        var ContentWidth = BodyWidth;
        var AdWidth = (document.body.scrollWidth - ContentWidth) / 2;
        var ContentHeight = window.document.body.scrollHeight;

        // Setup left banner div
        if(document.getElementById('imgDotClearLeft') != null)
        {
            document.getElementById('imgDotClearLeft').width = AdWidth - AdLeftSize;
            document.getElementById('imgDotClearLeft').height = ContentHeight;
        }

        // Setup right banner div
        if(document.getElementById('imgDotClearRight') != null)
        {
            document.getElementById('divRightAd').style.left = ContentWidth + AdWidth + BannerPosition + 'px';
            document.getElementById('imgDotClearRight').width = AdWidth - AdRightSize;
            document.getElementById('imgDotClearRight').height = ContentHeight;
        }
    }
}        

function ClickAd(url)
{
  window.open(url,"ClickAd","");
}
