
// Top Level Rollover Nav
$(document).ready(function() {

	$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag

	$("#topnav li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the <a> tag
		$(this).find("span").show().html(linkText); //Add the text in the <span> tag
	}); 

	$("#topnav li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({
			marginTop: "-40" //Find the <span> tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0"  //Move the <span> back to its original state (0px)
		}, 250);
	});

});

// Rollover Button Fade
$(document).ready(function() {
	$('.fadeThis').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(500, 1);
	  }, function () {
	    $span.stop().fadeTo(500, 0);
	  });
	});
});

// <![CDATA[
    var timeout    = 0;
    var closetimer = 0;
    var ddmenuitem = 0;
 
    function ddmenu_open(){
        ddmenu_canceltimer();
           ddmenu_close();
           ddmenuitem = $(this).find('ul').css('visibility', 'visible');
    }
 
    function ddmenu_close(){
        if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
    }
 
    function ddmenu_timer(){
        closetimer = window.setTimeout(ddmenu_close, timeout);
    }
 
    function ddmenu_canceltimer(){
        if(closetimer){
            window.clearTimeout(closetimer);
                closetimer = null;
    }}
 
    $(document).ready(function(){
        $('#topnav > li').bind('mouseover', ddmenu_open)
        $('#topnav > li').bind('mouseout',  ddmenu_timer)
    });
 
    document.onclick = ddmenu_close;
// ]]>

$(document).ready(function(){ 
	$(document).pngFix(); 
}); 

// Slideshow
var slideShow = new Array()
slideShow[0] = "images/slideshow/frame1s.jpg";
slideShow[1] = "images/slideshow/frame2s.jpg";
slideShow[2] = "images/slideshow/frame3s.jpg";


function startSlideshow()
{
	  processSlideshow(".homePhoto", slideShow, 5000, 1000);
}

$(document).ready(startSlideshow);

