$(function(){
	$("#SlideShow").cycle({ 
	    fx:    	'fade', 
	    speed:  2000,
	    timeout:9000
	 });
	 
	 
	 $("#dPhotoGal").unbind().mousemove(function(e){
		var p = ($("span",this).width()-$(this).width()) / 100;
		if(p>0){
			var c = ((e.pageX - $(this).offset().left) / $(this).width())*100;
			$("span",this).stop().animate({"left":"-" + (p * c) + "px"},"slow","easeOutExpo");
		}
		var p = ($("span",this).height()-$(this).height()) / 100;
		if(p>0){
			var c = ((e.pageY - $(this).offset().top) / $(this).height())*100;
			$("span",this).stop().animate({"top":"-" + (p * c) + "px"},"slow","easeOutExpo");
		}
	});
	
	$("img").each(function(e){
		if($(this).attr("rel") == "lightbox"){
			var p = $(this).parent("a");
			p.attr("href",$(this).attr("src").replace(/(s_images)|(m_images)/gi,"l_images"));
			p.attr("title",$(this).attr("alt").replace(/(click\sto\sview\slarger\simage)|(\s-\s)/gi,""));
			p.addClass("propImages");
		}
	});
	$("a.propImages").lightBox();
	
	//Menu Code
	$("#sideMenu").each(function(){
		$("li",this).hover(function(){ 
			$(">ul", this).fadeIn("fast"); 
		}, function(){
			$(">ul", this).fadeOut("fast"); 
		});
	});
	
	//Home Buttons
	$("#homebuttons a").hover(function(){ 
		$(this).animate({opacity: 0.8}, 200 );
	}, function(){
		$(this).animate({opacity: 1}, 200 );
	});
});
