/* homepage.js - source at http://www.pcc.edu/_source/scripts/homepage.source.js */
var photoWidth=470;var current=0;var photoAmount;$(document).ready(function(){$("#feature-animated").load("/news/read_homeFeature.html",function(){featureSetup()});hoverSetup();});function featureSetup(){photoAmount=$("#profile-slider img").length;$("#profile-slider a, #profile-select a").hover(function(){$(this).addClass("over");},function(){$(this).removeClass("over");});$("#profile-select a").click(function(){var thisNum=$("#profile-select a").index(this);animateTo(thisNum);return false;});animateTo(current);}function animateTo(num){if(num>=0&&num<photoAmount){var offset=num*photoWidth;$("#profile-slider").stop().animate({left:"-"+offset+"px"},"fast","swing",function(){afterAnimate(num)});}}function afterAnimate(num){current=num;$("#profile-select a").removeClass("current");$("#profile-select a:eq("+current+")").addClass("current");}function hoverSetup(){$("#snav div.audience, #promo").hover(function(){$(this).addClass("over");},function(){$(this).removeClass("over");});$("#snav div.audience,#promo").click(function(){window.location=$(this).find("a").attr("href");});}
