$(document).ready(function(){

$('.feat-item h5').equalHeights();

$('#plist li a').equalHeights();

$('#plist li .title').equalHeights();

//$('#plist .image img').each(function(index){
//    var width = this.attr('');
//});

$('#plist .image img').click(function(){
    top.location=$(this).parent().parent().parent().attr('href');
});

$('#minithumbs li a').click(function() {
	    $('.mainimg').attr("src",$(this).attr("image"));
});

$('#banners').cycle({
    fx:      'turnDown',
    delay:   -4000
});

$('#featureimages').cycle();

if($('.blogpaging ul').length )
  {
    centerPagination();
}

if($('.newspage ul').length )
  {
    centerPagination2();
}
		
});

function centerPagination()
{
  width = 0;
  $('.blogpaging li').each( function(){ width += $(this).width(); } );
  width += 60; // (Mac Fix)
  if ( width < 300 )
  {
    $('.blogpaging ul').css('width',width+'px');
  }
}

function centerPagination2()
{
  width = 0;
  $('.newspage li').each( function(){ width += $(this).width(); } );
  width += 60;
  if ( width < 500 )
  {
    $('.newspage ul').css('width',width+'px');
  }
}