var my_i2=0;
var jj=0;
var imageInterval;
$(document).ready(
    function()
    {
        $("#slideshow").click( function () { slide(); } );

        function mnuslideup()
        { 
            /*$("#menubg").animate({top:"-30px"},"slow");
            $("#menupanel").animate({top:"-140px"},"slow"); 
            var text=$(".show").attr("title");
			var id=$(".show").attr("itsid");
            text= "<a style='color:white;' href='../fa/LeaderSpeechView.html?LeaderSpeechID=6&SubLevelID=" + id + "'><p class='menucontent'>" + text + "</p></a>";
            $("#menupanel").html(text);*/

			$("#menubg").slideDown("slow");
            $("#menupanel").slideDown("slow");
            var text = $(".show").attr("title").replace(/[\s]{1,}/g, " ").replace(/<.*?>/g, "");
            $(".show").attr("title", text);
            var id = $(".show").attr("itsid");
            /*text = "<a style='color:white;' href='../fa/LeaderSpeechView.html?LeaderSpeechID=6&SubLevelID=" + id + "'><p class='menucontent'>" + text + "</p></a>";*/
            text = "<a style='color:white;'><p class='menucontent'>" + text + "</p></a>";
            $("#menupanel").html(text);
        }

        function ff() 
        {
        }

        function mnuslide() 
        {
            /*$("#menupanel").animate({top:"-30px"},"slow");
            $("#menubg").animate({top:"5px"},"slow");
            window.setTimeout(mnuslideup,1000);*/

			$("#menupanel").slideUp("slow");
            $("#menubg").slideUp("slow");
            $("#menupanel").hide();
            $("#menubg").hide();
            window.setTimeout(mnuslideup, 1000);
        }

        function slide()
        {
            var tagw=$(".show").attr("tag");
            if(tagw=="lasti")
            {
                my_i2=1;
            }
            if (my_i2 == 0) 
            {
                $(".show").attr("class", "noshow").fadeOut("slow").hide().next(".noshow").fadeIn(2000).attr("class", "show");
                mnuslide();
            }
            else
            {
                $(".noshow:first").attr("class", "show").fadeIn(3000).attr("class", "show");
                $(".show:last").attr("class", "noshow").fadeOut("slow").hide();
                mnuslide();
                my_i2=0;
            }	
        }
        mnuslide();
        imageInterval = window.setInterval(slide, 15000);
    }
);
