/**
  *	Pi Kappa Phi - Theta Mu Chapter
	*	University of Massachusetts Amherst
	*	Homepage Javascript functions
	*	Author: TJ Kelly, #016
	*	Info: http://www.tjkwebdesign.com
	*/

$(window).load(function(){

	// initiate innerfade
	$('#innerfade').addClass('js').append('<li><div class="innerfade_caption"><p><strong><a href="/charity/">Charity &amp; Philanthropy Work</a></strong><span class="hide">&#8212;</span><span>Pi Kappa Phi\'s &ldquo;Push America&rdquo; is a non-profit organization that was founded by members of Pi Kappa Phi in 1977. It is the exclusive service learning project of the fraternity, aiming to serve people with disabilities and instill lifelong service in all members of Pi Kappa Phi.</span><a href="/charity/" class="caption_more">more &raquo;</a></p></div><a href="/charity/"><img src="/wp/wp-content/uploads/pi-kappa-phi-umass-charity-push-america-350.jpg" alt="A photo of Pi Kappa Phi brothers and UMass Amherst mascot Sam the Minuteman." /></a></li><li><div class="innerfade_caption"><p><strong><a href="/about/">About Pi Kappa Phi</a></strong><span class="hide">&#8212;</span><span>Pi Kappa Phi is a first-class fraternity whose members firmly believe in the tenets of Character, Leadership, Academics, Sportsmanship, and Service. These principles are not only valued but instilled through leading-edge educational, service, and leadership opportunities.</span><a href="/about/" class="caption_more">more &raquo;</a></p></div><a href="/about/"><img src="/wp/wp-content/uploads/pi-kappa-phi-umass-chartering-banquet-350.jpg" alt="A photo of Pi Kappa Phi - Theta Mu\'s Chartering Banquet, held December 9th, 2006." /></a></li>').innerfade({
		animationtype:'fade', // Type of animation 'fade' or 'slide' (Default: 'fade')
		speed:'normal', // Fading-/Sliding-Speed in milliseconds or keywords (slow, normal or fast. Default: 'normal')
		timeout:'8000', // timeout: Time between the fades in milliseconds (Default: '2000'), 
		type:'sequence', // type: Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence')
		containerheight:'auto', // containerheight: Height of the containing element in any css-height-value (Default: 'auto'),
		runningclass:'innerfade', // runningclass: CSS-Class which the container get’s applied (Default: 'innerfade')
		children:'' // children: optional children selector (Default: null)
	});
	
	//
	var $div=$('div.hover_block');
	
	$div.live('mouseover',function(event){
		
		var id=$(this).attr('id');
		if(id!='more_posts_wrap'){
		
			// hover effect
			$(this).addClass('hover');
			
			// get URL and redirect page
			var url = $(this).children('div.post-content').children('h3').children('a').attr('href');
			$(this).click(function(){
				document.location.href=(url);
			});
		}
		
	});

	$div.live('mouseout',function(event){
		
		var id=$(this).attr('id');
		if(id!='more_posts_wrap'){
			$(this).removeClass('hover');
		}
		
	});
	
});
