/* FLOATING MENU START */

var name = "#floatmenu";
	var menuYloc = null;

var winheight = $(window).height();

		$(document).ready(function(){
			if (winheight<768) 
			{
				
			}
			else {
			menuYloc = parseInt($(name).css("top").substring(0,$(name).css("margin-top").indexOf("px")))
			$(window).scroll(function () { 
				offset = menuYloc+$(document).scrollTop()+"px";
				$(name).animate({top:offset},{duration:500,queue:false});				
			});
			}}); 
		
		$('#pinmenu').click(function() {
  			var currenttop = $("#floatmenu").css("top");
			$('#content').append('<p>No dice</p>');
		});
		

		
/* FLOATING MENU END */		
		
		
						  /* SLIDING MENU NAVIGATION START */
						  

						  //  Menu script developed by Roshan Bhattarai - Modified slightly by Matthew Kibbler
						  //  Visit http://roshanbh.com.np for this script and more.
						  
						  $(document).ready(function()
						  {
							  
							  //Closes menu initially
							  
							  if ($(".menu_body").css("display")== "block")
							  {
								  $(".menu_body").css("display","none"); 
							  }
						  
							  //slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
						  
							  $("#firstpane p.menu_head").click(function()
							  {
								  $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
								  $(this).siblings().css({backgroundImage:"url(left.png)"});
							  });
							  //slides the element with class "menu_body" when mouse is over the paragraph
							  $("#secondpane p.menu_head").mouseover(function()
							  {
								   $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
								   $(this).siblings().css({backgroundImage:"url(left.png)"});
							  });
							  
							  $("#sidebar p.menu_head").click(function()
							  {
								   $(this).css({backgroundImage:"url(down.png)"}).next("ul.menu_body").slideDown(500).siblings("ul.menu_body").slideUp("slow");
								   $(this).siblings().css({backgroundImage:"url(left.png)"});
							  });
						  });
						  
						  
						  /* SLIDING MENU NAVIGATION END */



											/* SLIDESHOW START */
											
											
											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');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

											
											/* SLIDESHOW END */

