/**
 * jquery.timer.js
 *
 * Copyright (c) 2011 Jason Chavannes <jason.chavannes@gmail.com>
 *
 * http://jchavannes.com/jquery-timer
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

;(function($){$.timer=function(func,time,autostart){this.set=function(func,time,autostart){this.init=true;if(typeof func=='object'){var paramList=['autostart','time'];for(var arg in paramList){if(func[paramList[arg]]!=undefined){eval(paramList[arg]+" = func[paramList[arg]]")}};func=func.action}if(typeof func=='function'){this.action=func}if(!isNaN(time)){this.intervalTime=time}if(autostart&&!this.active){this.active=true;this.setTimer()}return this};this.once=function(time){var timer=this;if(isNaN(time)){time=0}window.setTimeout(function(){timer.action()},time);return this};this.play=function(reset){if(!this.active){if(reset){this.setTimer()}else{this.setTimer(this.remaining)}this.active=true}return this};this.pause=function(){if(this.active){this.active=false;this.remaining-=new Date()-this.last;this.clearTimer()}return this};this.stop=function(){this.active=false;this.remaining=this.intervalTime;this.clearTimer();return this};this.toggle=function(reset){if(this.active){this.pause()}else if(reset){this.play(true)}else{this.play()}return this};this.reset=function(){this.active=false;this.play(true);return this};this.clearTimer=function(){window.clearTimeout(this.timeoutObject)};this.setTimer=function(time){var timer=this;if(typeof this.action!='function'){return}if(isNaN(time)){time=this.intervalTime}this.remaining=time;this.last=new Date();this.clearTimer();this.timeoutObject=window.setTimeout(function(){timer.go()},time)};this.go=function(){if(this.active){this.action();this.setTimer()}};if(this.init){return new $.timer(func,time,autostart)}else{this.set(func,time,autostart);return this}}})(jQuery);

//------ Footer rotations
$(document).ready(function(){$("#pageresource .col1>ul li:lt(3)").css("opacity","1");$("#pageresource .col2>ul li:lt(3)").css("opacity","1");$("#pageresource .col3>ul li:lt(3)").css("opacity","1");$("#pageresource .col1>ul li:lt(3)").css("display","block");$("#pageresource .col2>ul li:lt(3)").css("display","block");$("#pageresource .col3>ul li:lt(3)").css("display","block");var a=$.timer(function(){if($("#pageresource .col1>ul li").length>3){$("#pageresource .col1>ul").prepend($("#pageresource .col1>ul li").last());$("#pageresource .col1>ul li").first().css("display","block");$("#pageresource .col1>ul li").first().stop(true,true).animate({opacity:"1"},300);$("#pageresource .col1>ul li:visible:last").stop(true,true).delay(300).animate({opacity:"0"},300,function(){$(this).css("display","none")})}if($("#pageresource .col2>ul li").length>3){$("#pageresource .col2>ul").prepend($("#pageresource .col2>ul li").last());$("#pageresource .col2>ul li").first().css("display","block");$("#pageresource .col2>ul li").first().stop(true,true).animate({opacity:"1"},300);$("#pageresource .col2>ul li:visible:last").stop(true,true).delay(300).animate({opacity:"0"},300,function(){$(this).css("display","none")})}if($("#pageresource .col3>ul li").length>3){$("#pageresource .col3>ul").prepend($("#pageresource .col3>ul li").last());$("#pageresource .col3>ul li").first().css("display","block");$("#pageresource .col3>ul li").first().stop(true,true).animate({opacity:"1"},300);$("#pageresource .col3>ul li:visible:last").stop(true,true).delay(300).animate({opacity:"0"},300,function(){$(this).css("display","none")})}});a.set({time:5e3,autostart:false});a.play();$("#pageresource ul li").hover(function(){a.pause()},function(){a.play()});$("#accolades li:first").css("opacity","1");$("#accolades li:first").css("display","block");var b=$.timer(function(){$("#accolades ul").prepend($("#accolades li").last());$("#accolades li:visible").stop(true,true).animate({opacity:"0"},300,function(){$(this).css("display","none");$("#accolades li").first().css("display","block")});$("#accolades li").first().stop(true,true).delay(300).animate({opacity:"1"},300)});b.set({time:5e3,autostart:false});b.play();$("#accolades li").hover(function(){b.pause()},function(){b.play()})

//------ interior rotations
$(".left-nav-item ul").find("li").css("opacity","1");
$(".left-nav-item ul").find("li").css("display","block");
$(".left-nav-item ul").find("li").each(function(index) {
    $(this).css("left",205)
});
$(".left-nav-item ul").find("li:lt(1)").css("left","0");

function MoveItem(a,b){var c=a;if(c.find("li").length>1){c.prepend(c.find("li").last());c.find("li").first().delay(b).animate({left:"0"},300);c.find("li:eq(1)").animate({left:"-205px"},300,function(){$(this).css("left","205px")})}}var c=$.timer(function(){MoveItem($(".left-nav-item ul").eq(0),0)});c.set({time:5e3,autostart:false});c.play();$(".left-nav-item ul").eq(0).hover(function(){c.pause()},function(){c.play()});var d=$.timer(function(){MoveItem($(".left-nav-item ul").eq(1),0)});d.set({time:5e3,autostart:false});d.play();$(".left-nav-item ul").eq(1).hover(function(){d.pause()},function(){d.play()});var e=$.timer(function(){MoveItem($(".left-nav-item ul").eq(2),0)});e.set({time:5e3,autostart:false});e.play();$(".left-nav-item ul").eq(2).hover(function(){e.pause()},function(){e.play()});var f=$.timer(function(){MoveItem($(".left-nav-item ul").eq(3))});f.set({time:5e3,autostart:false});f.play();$(".left-nav-item ul").eq(3).hover(function(){f.pause()},function(){f.play()})


})
