﻿var c, tid, lm;

function $(i) {
    return document.getElementById(i);
}

function initPartnerScroller() {
    var ct = $('partners-container');
    if (ct == null)
        return;
    $('left-scroller').onmouseover = function() { sm(1); };
    $('right-scroller').onmouseover = function() { sm(-1); };
    $('right-scroller').onmouseout = $('left-scroller').onmouseout = km;
    c = $('partners-content');
    lm = ct.offsetWidth - c.offsetWidth;
    c.style.left = c.offsetLeft + 'px';
}

function sm(inc) {
    c.style.left = (inc < 0 ? Math.max(lm, (parseInt(c.style.left) - 2)) : Math.min(0, (parseInt(c.style.left) + 2))) + 'px';
    tid = setTimeout('sm(' + inc + ')', 20);
}

function km() {
    if (tid >= 0)
        clearTimeout(tid);
    tid = -1;
}
var __pw = new Array();
function opu(u,w,h){var pw = __pw[u];if(pw!=null){if(pw.closed){pw = null;}}if(pw==null){pw=window.open(u,'','scrollbars=no,width='+w+',height='+h+',status=no,toolbar=no,location=no',true);__pw[u] = pw;}if(window.focus){pw.focus();}}

function showDirectScreenshot() {
    opu('/protect/Enlarged.html', 600, 325);
    return false;
}

function showInspectScreenshot() {
    opu('/inspect/Enlarged.html', 475, 558);
    return false;
}

function initNewsVideo()
{
    var element = document.getElementById('watchVideo');
    
    if (element) {
        element.onclick = function() {
            opu('/inspect/video.html', 505, 240);
            return false;
        };
    }
}

runOnLoad(initPartnerScroller);
runOnLoad(initNewsVideo);