$().ready(function(){
PEPS.rollover.init();
$('.item .inner').biggerlink();
$('.rankBox').biggerlink();


//.itemを3ごとにクリア ////////////////////////////////////////
$('#main .container').each(function(){
var cols = 3;
var i=0;
$(this).children().children('.item').each(function(){
if(i%cols == 0){
$(this).before('<div style="clear:left; height:1px; font-size:1px; position:relative;"></div>');
}
i++;
});
});

//.itemを4ごとにクリア ////////////////////////////////////////
$('#mainWide').each(function(){
var cols = 4;
var i=0;
$(this).children().children('.item').each(function(){
if(i%cols == 0){
$(this).before('<div style="clear:left; height:1px; font-size:1px; position:relative;"></div>');
}
i++;
});
});


//End of doccument ready ////////////////////////////////////////
});




// Roll over ////////////////////////////////////////
PEPS = {};
PEPS.rollover = {
init: function(){
this.preload();
$(".over").hover(
function () { $(this).attr( 'src', PEPS.rollover.newimage($(this).attr('src')) ); },
function () { $(this).attr( 'src', PEPS.rollover.oldimage($(this).attr('src')) ); }
);},
preload: function(){
$(window).bind('load', function() {
$('.over').each( function( key, elm ) { $('<img>').attr( 'src', PEPS.rollover.newimage( $(this).attr('src') ) ); });
});},
newimage: function( src ){
return src.substring( 0, src.search(/(\.[a-z]+)$/) ) + '_over' + src.match(/(\.[a-z]+)$/)[0];
},
oldimage: function( src ){
return src.replace(/_over\./, '.');
}
};
// Roll over end ////////////////////////////////////////