﻿/*

	This file contains a majority of the Javascript
	used on the Penned Web Design site. It should be 
	called just prior to the </body> tag.
	
	Created By: Eddie Giese
	03.24.10
	
*/
/*
	jQuery minor enhancements
*/
$(document).ready(function(){
	//define animation speed
	var speed = 300;
	var currOpacity = 0.7;
	
	//animate opacity on h3 elements
	$('#results, #forged, #everypixel').hover(function() {
	  $(this).stop().animate({opacity:1}, 'speed');
	}, function() {
	  $(this).stop().animate({opacity:0.7}, 'speed');
	});
	
	//animate opacity on img elements in the portfolio grid and photos		
	$('#about img, #portfolio-grid img').hover(function() {
	  $(this).stop().animate({opacity:1}, 'speed');
	}, function() {
	  $(this).stop().animate({opacity: currOpacity}, 'speed');
	});
	
	//animate links with the .fade class and other targeted links
	$('.fade, #footer-nav li a').hover(function() {
		$(this).stop().animate({opacity:0.7}, 'speed');
	}, function() {
		$(this).stop().animate({opacity:1}, 'speed');
	});		
	
	//animate hover sprites
	//$('#contact-nav li a').append('<span class="hover"></span>');
	//$('#contact-nav li a').hover(function(){
	//	$('.hover', this).stop().animate({opacity:1}, 'speed');
	//}, function() {
	//	$('.hover', this).stop().animate({opacity:0}, 'speed');
	//});	
	
	//animate hover of #skinny
	$('#skinny').css({backgroundPosition: "0 0"})
		.mouseover(function(){
			$(this).stop().css('background-position',"0 -100px").animate(
				{opacity:1},
				{duration:'speed'})
			})
		.mouseout(function(){
			$(this).stop().css('background-position',"0 0").animate(
				{opacity:0.7},
				{duration:'speed'})
			})
});

/*
	jQuery - Toggle div on/off
*/
  $('a.load-more').click(function() {
    $(this).next('div').slideToggle('speed');
    //$('.load-more').css('margin-left','320');
    return false;
  });

/*
	jQuery - Lazy Load Plugin
*/
  $("img").lazyload({
		placeholder : "images/ph.png",
		effect: "fadeIn"
	});
  
/*
	END OF FILE
*/
