﻿function LoadPictures() {
    MM_preloadImages('images/menu-1-over.gif', 'images/menu-2-over.gif', 'images/menu-3-over.gif','images/menu-4-over.gif', 'images/menu-5-over.gif' ,'images/menu-6-over.gif', 'images/menu-7-over.gif', 'images/quick-1-over.gif', 'images/quick-2-over.gif', 'images/quick-3-over.gif', 'images/quick-4-over.gif', 'images/quick-5-over.gif', 'images/quick-6-over.gif', 'images/quick-7-over.gif');
}

$(document).ready(
    function() {
        $('#fisheye').Fisheye(
	        {
	            maxWidth: 55,
	            items: 'a',
	            itemsText: 'span',
	            container: '.fisheyeContainter',
	            itemWidth: 42,
	            proximity: 80,
	            alignment: 'left',
	            valign: 'bottom',
	            halign: 'center'
	        }
        )
    }
);

function stopTimer() {
    document.getElementById('IndexNews1_no_rotate_1126').value = 1;
}

function changePic(Val) {
    var a = document.getElementById('ImageNews');
    var b = document.getElementById('Srt_PicId_' + Val);
    if (a.getAttribute("src") != b.getAttribute("src")) {
        $("#ImageNews").animate({ opacity: 0 }, 0);
        a.setAttribute("src", b.getAttribute("src"));
        $("#ImageNews").animate({ opacity: 1 }, 750);
        $("#DivNews").animate({ opacity: 0 }, 0);
        document.getElementById('DivNews').innerHTML = document.getElementById('Div_' + Val).innerHTML;
        $("#DivNews").animate({ opacity: 1 }, 750);
        $("#DivHeadline").animate({ opacity: 0 }, 0);
        document.getElementById('DivHeadline').innerHTML = document.getElementById('Div_Headline_' + Val).innerHTML;
        $("#DivHeadline").animate({ opacity: 1 }, 750);
    }
}

function FirstNews(Val) {
    if (document.getElementById('IndexNews1_no_rotate_1126').value != "1") {
        var a = document.getElementById('NewsFlowIds_1126');
        var b;
        var blength;
        b = a.value.split(",");
        blength = b.length - 1;
        if (Val > blength) {
            changePic(b[0]);
            Val = 0;
        } else {
            changePic(b[Val]);
            Val = Val + 1;
        }
        setTimeout("FirstNews(" + Val + ")", 4000);
    }
}
