	
		$(function(){
				$('ul#before_gallery').galleria();
				$('li.page_item.page-item-4').addClass('current_page_item');
				
				$('a.left_title').removeClass('selected');
				$('a#before').addClass('selected');
			}
		);
		

    
    
    
  
    
	var selectedIndex = 0;    
	    
	$(document).ready(function(){
	
		$("h2").append('<em></em>')
		
		switchIt();
		
		$(".thumbs a").click(function(){
		
			selectedIndex = 100;
			var largePath = $(this).attr("href");
			var largeAlt = $(this).attr("title");
			
			$("#largeImg").attr({ src: largePath, alt: largeAlt });
			$("h2 em").html(" (" + largeAlt + ")"); return false;
		});
		
	});
	
	
	function switchIt()
	{
		
		
		//console.log("Doing : " + selectedIndex);
		var largePath = $(".thumbs a:eq("+selectedIndex+")").attr("href");
		var largeAlt = $(".thumbs a:eq("+selectedIndex+")").attr("title");
		
		if(selectedIndex == 100)
		{
			
		} else
		{
			$(".thumbs").animate({opacity:.5}, 5000, switchIt);
			if(selectedIndex+1 < $('.thumbs a').size())
			{
				selectedIndex = selectedIndex+1;
			}else
			{
				selectedIndex = 0;
			}
			$("#largeImg").attr({ src: largePath, alt: largeAlt });
			$("h2 em").html(" (" + largeAlt + ")"); return false;
		}
		
		
		return false;
		
		
		
		
		
	}
	
	function LinkUp()
	{
		window.location = 'http://downstatus.com/gallery/category/' + $('#DDlinks').val();
	}
		
	
    
       $(function() {
            $(".lavaLampNoImage").lavaLamp({
                fx: "backout",
                speed: 700,
                click: function(event, menuItem) {
                    return true;
                }
            });
        });
    	
 

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
	

        
$(document).ready(function(){
	
	
	$('#emailinput').click(function()
	{
		
		if($(this).val() == "Your Email")
		{
			$(this).val("").css('color','black');
		}
	});


	$("#contactLink").toggle(function(){
                
    	console.log('down');
    	$("#contactForm").slideDown("slow");
    	
    }, function()
    {
    	console.log('up');
    	$("#contactForm").slideUp("fast");
    });
  
            
        
   
    
});
            
            
            function closeForm(){
                $("#messageSent").show("slow");
                setTimeout('$("#messageSent").hide();$("#contactForm").slideUp("slow")', 2000);
           
           }
           
           	
