﻿// ## INIT FRONTPAGE FLASH
var fvars = {};
fvars.status = 'online';
var params = {};
//params.base = '/design/horesta/flash/';
params.wmode = 'transparent';

function pageSelector(id,type,url) {
    var e = document.getElementById(id);
    var u = url;
    if (e != null) {
        var v = null;
        if (type == 'ddl') {
            v = e.options[e.selectedIndex].value;
            
        }
        else if (type == 'txt') {
            v = e.value;
        }

        if (v != '' && v != null) {
            if (u != null && u != '') {
                window.location.href = u + '' + v;
            }
            else {
                window.location.href = v;
            }
        }
    }
}
(function ($) {
    $(function () {
        var spots = $(".newsBox");
        var count = spots.length;
        var next = 0;
        var slidetime = 1000;
        var waittime = 6000;
        var fade = "normal";

        var turnspot = function () {
            if (next >= count) {
                next = 0;
            }
            var spot = spots.eq(next);

            spots.eq(next).children(".news:visible").fadeOut(fade, function () {
                $(this).next().fadeIn(fade, function () {
                    $(this).removeClass("hide");

                    next++;
                    setTimeout(turnspot, (next >= count ? waittime : slidetime));

                }).end().insertAfter(spot.children(".news:last"));

            });

        };
        setTimeout(turnspot, waittime);

    });

})(jQuery);
