﻿function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ($active.length == 0) $active = $('#slideshow IMG:last');

    var $next = $active.next().length ? $active.next()
    : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({ opacity: 0.0 })
    .addClass('active')
    .animate({ opacity: 1.0 }, 1000, function() {
        $active.removeClass('active last-active');
    });
}

$(document).ready(
    function() {
        try {
            // sets up the rollover effect on the main nav buttons
            $(".button_main").hover(function() { $(this).addClass("button_main_hover"); }, function() { $(this).removeClass("button_main_hover"); });
            $(".button2_main").hover(function() { $(this).addClass("button2_main_hover"); },function() { $(this).removeClass("button2_main_hover"); });
            $(".button_action").hover(function() { $(this).addClass("button_action_hover"); },function() { $(this).removeClass("button_action_hover"); });
            $(".button_action_small").hover(function() { $(this).addClass("button_action_small_hover"); },function() { $(this).removeClass("button_action_small_hover"); });
            //$(".button2_main").hover(function() { $(this).attr("src", "theme/v2/button_main_rollover.jpg"); }, function() { $(this).attr("src", "theme/v2/button_main.jpg"); });

            $("#livebutton").hover(function() { $(this).attr("src", "theme/v2/button_login_syntermedlive_rollover.jpg"); }, function() { $(this).attr("src", "theme/v2/button_login_syntermedlive.jpg"); });

            $("#learnmorebutton1").hover(function() { $(this).attr("src","theme/v2/container_content1_button_rollover.jpg"); },function() { $(this).attr("src","theme/v2/container_content1_button.jpg"); });
            $("#learnmorebutton2").hover(function() { $(this).attr("src","theme/v2/container_content1_button_rollover.jpg"); },function() { $(this).attr("src","theme/v2/container_content1_button.jpg"); });
            
            // adds a drop shadow to the main frame of the page
            //$("#pageframe").dropShadow({ left: 0,top: 0,opacity: 1,blur: 8,color: "#CFD3D3" });

            // add ellipsis for news items
            //$(".text").ellipsis();

            // cycles through images in the flash container
            //setInterval("slideSwitch()", 10000);

            //cycles through images in the flash container using jquery.cycle
            //$('#pause').click(function() { $('#slideshow').cycle('pause'); return false; });
            //$('#play').click(function() { $('#slideshow').cycle('resume'); return false; });
            $('#slideshow').cycle({
                fx: 'fade',
                speed: 800,
                timeout: 7000,
                //next: '#next',
                //prev: '#prev',
                pause: 1
            });

        } catch (ex) { alert(ex) };
    }
);


