﻿
/// <reference path="Scroll.js" />

function LoadLeft(Width, Height, ImgUrl, Link) { 

    var Html = "<div style='display:none' id='DivCouLeft'><a href='javascript:void(0)' onclick='CouClose()'><img src='/Scripts/Images/Coupletclose.gif'></a><br><a href='" + Link + "' target='_blank'><img Width='" + Width + "' height='" + Height + "' src='" + ImgUrl + "'></a></div>";
    document.write(Html);

    var ObjDiv = document.getElementById("DivCouLeft");
    var b = true;
    window.setInterval(function () {

        var scrollTop = window.pageYOffset
                || document.documentElement.scrollTop
                || document.body.scrollTop
                || 0;

        ObjDiv.style.position = "absolute"

        ObjDiv.style.top = 150 + scrollTop;
        ObjDiv.style.left = 10;
        if (b) {
            ObjDiv.style.display = "";
            b = false;
        }
    }, 100);
}
function LoadRight(Width, Height, ImgUrl, Link) {

    var Html = "<div style='display:none' id='DivCouRight'><a href='javascript:void(0)' onclick='CouClose()'><img src='/Scripts/Images/Coupletclose.gif'></a><br><a href='" + Link + "' target='_blank'><img Width='" + Width + "' height='" + Height + "' src='" + ImgUrl + "'></a></div>";
    document.write(Html);

    var ObjDiv = document.getElementById("DivCouRight");
    var b = true;
    window.setInterval(function () {

        var scrollTop = window.pageYOffset
                || document.documentElement.scrollTop
                || document.body.scrollTop
                || 0;

        ObjDiv.style.position = "absolute"

        ObjDiv.style.top = 150 + scrollTop;
        ObjDiv.style.left = document.documentElement.clientWidth - Width - 10;
        if (b) {
            ObjDiv.style.display = "";
            b = false;
        }
    }, 100);
}

function CouClose() {

    document.getElementById("DivCouLeft").style.display = "none";
    document.getElementById("DivCouRight").style.display="none";
}

