﻿$(function() {
    var offset = $("#box2").offset();
    var topPadding = 5;
    $(window).scroll(function() {
        if ($(window).scrollTop() > offset.top) {
            $("#box2").stop().animate({
                marginTop: $(window).scrollTop() - offset.top + topPadding
            });
        } else {
            $("#box2").stop().animate({
                marginTop: 0
            });
        };
    });
});

$(function() {
    var offset = $("#box").offset();
    var topPadding = 5;
    $(window).scroll(function() {
        if ($(window).scrollTop() > offset.top) {
            $("#box").stop().animate({
                marginTop: $(window).scrollTop() - offset.top + topPadding
            });
        } else {
            $("#box").stop().animate({
                marginTop: 0
            });
        };
    });
});

function changeClass(ResimId, Tip) {
    if (Tip == 1) {
        ResimId.className = 'bannerAktif';
    }
    else {
        ResimId.className = 'bannerPasif';
    }
}


//ekran kordinat bulma
var IE = document.all ? true : false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY2;

function getMouseXY2(e) {
    var size = 1000;
    if (document.body.offsetWidth != null) {
        size = document.body.offsetWidth;
    }
    var solmenu = document.getElementById("ctl00_uc_SagBanner1_UPBanner");
    var sagmenu = document.getElementById("ctl00_uc_SolBanner1_UPBanner");
    var solmenu2 = document.getElementById("box2");
    var sagmenu2 = document.getElementById("box");
    if (size < 1259) {
        if (solmenu != null) {
            solmenu.setAttribute('class', 'gizli');
        }
        if (sagmenu != null) {
            sagmenu.setAttribute('class', 'gizli');
        }
        if (solmenu2 != null) {
            solmenu2.style.display = 'none';
        }
        if (sagmenu2 != null) {
            sagmenu2.style.display = 'none';
        }
    }
    if (size >= 1259) {
        if (solmenu != null) {
            solmenu.setAttribute('class', 'goster');
        }
        if (sagmenu != null) {
            sagmenu.setAttribute('class', 'goster');
        }
        if (solmenu2 != null) {
            solmenu2.style.display = 'block';
        }
        if (sagmenu2 != null) {
            sagmenu2.style.display = 'block';
        }
    }
    return true;
}
