﻿hou = 0;
min = 0;
sec = 59;
function gettime() {
    Btntime = document.getElementById("Btntime");
    t = Btntime.getAttribute("value");
    h = t[0] + t[1];
    m = t[3] + t[4];
    s = t[6] + t[7];
    hou = h;
    min = m;
    sec = s;
    if (sec < 59) {
        sec++;
    }
    else {
        sec = 0;
        if (min < 59) {
            min++;
        }
        else {
            min = 0;
            if (hou < 24) {
                hou++;
            }
            else {
                hou = 0;
            }
        }
    }

    if (hou.toString().length < 2) h = "0" + hou;
    else h = hou;
    if (min.toString().length < 2) m = "0" + min;
    else m = min;
    if (sec.toString().length < 2) s = "0" + sec;
    else s = sec;

    document.getElementById("Btntime").setAttribute("value", h + ":" + m + ":" + s);
    window.setTimeout("gettime()", 1000);
}

//////////////////////////////
$(document).ready(function () {

    var fadeval = false;

    ///////////// ------------------------ magazine ------------------------ /////////////
    $('#magazine').stop(true, true).bind('mouseenter mouseleave', function () {
        $(this).children('.magazine').stop(true, true).slideToggle('slow', function () {
            fadeval = !fadeval;
            $(this).children('.more').stop(true, true).fadeTo('slow', fadeval);
        });
    });

    ///////////// ------------------------ newstab ------------------------ /////////////
    $('#newstab div.newssection , #newstab div.newssection .newsbody .newscontent').hide();
    $('#newstab .active').next().slideDown('slow');
    $('#newstab li .tab').click(function () {
        if (!$(this).hasClass('active')) {
            $('#newstab div.newssection').slideUp();
            $('#newstab .active').removeClass('active');
            $(this).addClass('active').next('div.newssection').slideDown('slow');
            return false;
        }
    });

    ///////////// ------------------------ newssection ------------------------ /////////////
    $('.newssection .newsbody .newstitle').click(function () {
        $('.newssection .newsbody .newscontent').slideUp();
        if (!$(this).hasClass('active')) {
            $('.newssection .newsbody .newstitle').removeClass('active');
            $(this).addClass('active').next('div.newscontent').append('<span class="clear"></span>').slideDown();
            return false;
        }
        $('.newssection .newsbody .newstitle').removeClass('active');
        return false;
    });

    ///////////// ------------------------ toprequest ------------------------ /////////////
    $("a[rel = DivIframe]").click(function () {
        $("#modal").slideDown('fast');
    $(".DivIframe").load($(this).attr('href') + ' #GeustPageContent', function () {
        $(".ModalBox").animate({
            "height": "toggle", "width": "toggle", "opacity": "toggle"
                                }, "slow");
                });
                return false;
            });

            $('a.removeModalBox').click(function () {
                $(".ModalBox").animate({
                    "height": "toggle", "width": "toggle", "opacity": "toggle"
                }, "slow");
                $("#modal").delay('300').slideUp('fast');
                return false;
            });

            ///////////// ------------------------ slidebox ------------------------ /////////////
            $('.login_title,.LoginCancel').bind('click', function () {
                $('.loginbox .loginform').animate({
                    "width": "toggle", "opacity": "toggle"
                }, "slow");
                return false;
            });
            $("h5.PanelTitle").click(function () {
                $(this).next('.BoxToggle').slideToggle();
            });

    ///////////// ------------------------ Load Other Scripts ------------------------ /////////////
    gettime();
});
