﻿function setNewsWaterMark(imageUrl)
{
    var check = imageUrl.split(' ').join('');
    if (check!="")
    {
        var oldOnload = window.onload;
        window.onload = function()
        {
            setNewsWaterMarkInternal(imageUrl)
            if (typeof(oldOnload)=="function")
            {
                oldOnload();
            }
        }
    }
}

function setNewsWaterMarkInternal(imageUrl)
{
    var item = document.getElementById('newsWatermark');
    if (item!=null)
    {
        item.style.display="inline";
        
        var imageItem = document.getElementById('newsWatermarkImage');
        if (imageItem!=null)
        {
           imageItem.src = imageUrl;
        }
    }
   
}



function setWaterMark(imageUrl,width,height,left)
{
    var oldOnload = window.onload;
    window.onload = function()
    {
        setWaterMarkInternal(imageUrl,width,height,left)
        if (typeof(oldOnload)=="function")
        {
            oldOnload();
        }
    }
}

function setWaterMarkInternal(imageUrl,width,height,left)
{
    var item = document.getElementById('watermark');
    if (item!=null)
    {
        item.src = imageUrl;
        item.style.display="inline";
        item.width = width;
        item.height= height;
        item.style.position="relative"
        item.style.top = -(height+3)+"px";
        item.style.marginBottom = -height+"px";
        if (left)
            item.style.left =left+"px";
    }
}
