// hashslider v0.9 by manuel huegel, copyright 2010
// mgoys.com

$(document).ready(function(){var wrapperwidth=$('#actus_previously').width()*$('#actus_previously ul > li').size();$('#actus_previously ul').css('width',wrapperwidth);var wrapperheight=$('#actus_previously').height();$('#actus_previously ul').css('height',wrapperheight);var width=$('#actus_previously').width();$('#actus_previously ul li').css('width',width);var counter=$('#actus_previously ul > li').size();var decount=1;var autocount=1;var createNum=1;$('#numbers_prev li:first-child').html(createNum).addClass('activenum').attr('id','id1');while(createNum!=counter){$('#numbers_prev li:last-child').after('<li>  </li>');createNum++;$('#numbers_prev li:last-child').html(createNum);$('#numbers_prev li:last-child').attr('id','id'+createNum);}
var numwidth=$('#numbers_prev li:first-child').width()*$('#numbers_prev li').size();$('#numbers_prev').css('width',numwidth);function goNext(){if(decount!=counter){$('#actus_previously ul').animate({left:'-='+$('#actus_previously').width()},400,'swing',function(){});$('#numbers_prev .activenum').removeClass('activenum').next().addClass('activenum');decount++;window.location.hash=decount;}}
function goBack(){if(decount!=1){$('#actus_previously ul').animate({left:'+='+$('#actus_previously').width()},400,'swing',function(){});$('#previously .activenum').removeClass('activenum').prev().addClass('activenum');decount--;window.location.hash=decount;}}
$("#numbers_prev li").click(function(){var clickednum=$(this).html()*-$('#actus_previously').width()+$('#actus_previously').width();$('#actus_previously ul').animate({left:clickednum},400,'swing',function(){});$('#numbers_prev .activenum').removeClass('activenum');$(this).addClass('activenum');decount=$(this).html();window.location.hash=$(this).html();});if(window.location.hash!=''){var hashnum=window.location.hash.substr(1)*-$('#actus_previously').width()+$('#actus_previously').width();$('#actus_previously ul').animate({left:hashnum},0,function(){});decount=window.location.hash.substr(1);$('#numbers_prev .activenum').removeClass('activenum');var hashname=window.location.hash.substr(1);$('#id'+hashname).addClass('activenum');}
$("#previously #right_prev").click(function(){goNext();});$("#previously #left_prev").click(function(){goBack();});/*$("#actus_previously ul").mousewheel(function(event,delta){if(delta>0){goBack();event.stopPropagation();event.preventDefault();}});$("#actus_previously ul").mousewheel(function(event,delta){if(delta<0){goNext();event.stopPropagation();event.preventDefault();}});*/});
