function pagerOvers(cls){
$('.'+cls+' li').hover(function(){ $(this).addClass('over'); },function(){ $(this).removeClass('over'); });
}

function checkPos(id){
var pnlpos = $("#"+id+"-panel").css('left');

if(parseInt(pnlpos) > 0){
$("#"+id+"-panel").animate({"left": "0px"}, 600, "easeOutExpo", function(){checkPos(id);});
}

if(parseInt(pnlpos) < -1832){
$("#"+id+"-panel").animate({"left": "-1832px"}, 600, "easeOutExpo", function(){checkPos(id);});
}

if(pnlpos== '0px' || pnlpos===undefined){
$("#"+id+" .leftarrow").hide();
$("#"+id+"-pnl-a").attr('class','act');
} else {
$("#"+id+" .leftarrow").show();
$("#"+id+"-pnl-a").removeClass('act');
}

if(pnlpos== '-916px'){ $("#"+id+"-pnl-b").addClass('act'); } else { $("#"+id+"-pnl-b").removeClass('act'); }

if(pnlpos== '-1832px'){
$("#"+id+" .rightarrow").hide();
$("#"+id+"-pnl-c").addClass('act');
} else {
$("#"+id+" .rightarrow").show();
$("#"+id+"-pnl-c").removeClass('act');
}

}

$(document).ready(function(){
pagerOvers('sect-pager');

$("#news .rightarrow").click(function(){ $("#news-panel").animate({"left": "-=916px"}, 600, "easeOutExpo", function(){checkPos('news');}); return false; });
$("#news .leftarrow").click(function(){ $("#news-panel").animate({"left": "+=916px"}, 600, "easeOutExpo", function(){checkPos('news');}); return false; });
$("#news-pnl-a").click(function(){ $("#news-panel").animate({"left": "0px"}, 600, "easeOutExpo", function(){checkPos('news');}); return false; });
$("#news-pnl-b").click(function(){ $("#news-panel").animate({"left": "-916px"}, 600, "easeOutExpo", function(){checkPos('news');}); return false; });
$("#news-pnl-c").click(function(){ $("#news-panel").animate({"left": "-1832px"}, 600, "easeOutExpo", function(){checkPos('news');}); return false; });

$("#tweets .rightarrow").click(function(){ $("#tweets-panel").animate({"left": "-=916px"}, 600, "easeOutExpo", function(){checkPos('tweets');}); return false; });
$("#tweets .leftarrow").click(function(){ $("#tweets-panel").animate({"left": "+=916px"}, 600, "easeOutExpo", function(){checkPos('tweets');}); return false; });
$("#tweets-pnl-a").click(function(){ $("#tweets-panel").animate({"left": "0px"}, 600, "easeOutExpo", function(){checkPos('tweets');}); return false; });
$("#tweets-pnl-b").click(function(){ $("#tweets-panel").animate({"left": "-916px"}, 600, "easeOutExpo", function(){checkPos('tweets');}); return false; });
$("#tweets-pnl-c").click(function(){ $("#tweets-panel").animate({"left": "-1832px"}, 600, "easeOutExpo", function(){checkPos('tweets');}); return false; });

$("#news .leftarrow").hide();
$("#tweets .leftarrow").hide();

$("#news-panel-wrapper").touchwipe({
 wipeLeft: function() { $("#news-panel").animate({"left": "-=916px"}, 600, "easeOutExpo", function(){checkPos('news');}); },
 wipeRight: function() { $("#news-panel").animate({"left": "+=916px"}, 600, "easeOutExpo", function(){checkPos('news');}); },
 min_move_x: 20,
     preventDefaultEvents: true
});

$("#tweets-panel-wrapper").touchwipe({
 wipeLeft: function() { $("#tweets-panel").animate({"left": "-=916px"}, 600, "easeOutExpo", function(){checkPos('tweets');}); },
 wipeRight: function() { $("#tweets-panel").animate({"left": "+=916px"}, 600, "easeOutExpo", function(){checkPos('tweets');}); },
 min_move_x: 20,
     preventDefaultEvents: true
});

    $("blockquote").each(function(){
     var bq = $(this).html();
     $(this).html('<span class="bq-wrap">'+bq+'</span>');
    });


});


