var period=5
var imgX=180, imgY=122
// *************************
$(document).ready(function(){setInterval(show_next, period*1000);});

function show_next(arg){
  var s='fade normal up up2 down left right center show'.split(' ')
  for(var i=0; i<s.length; i++){

    if(s[i].match(/normal$|show$|fade$|up2$/gim)) var el=$('#show_'+s[i]+' img:first').hide();
    if(s[i]=='left')  var el=$('#show_left img:first').css({left:(-imgX)+'px'});
    if(s[i]=='right') var el=$('#show_right img:first').css({left:(imgX)+'px'});
    if(s[i]=='up')    var el=$('#show_up img:first').css({top:(-imgY)+'px'});
    if(s[i]=='down')  var el=$('#show_down img:first').css({top:(imgY)+'px'});
    if(s[i]=='center')var el=$('#show_center img:first').css({left:(imgX/2)+'px',top:(imgY/2)+'px',width:'1px',height:'1px',opacity:'0'});

    $('#show_'+s[i]).append(el)
    var newel=$('#show_'+s[i]+' img:last')

    if(s[i]=='normal') newel.show();
    if(s[i]=='show')   newel.show('slow');
    if(s[i]=='fade')   newel.fadeIn('slow');
    if(s[i]=='up2')    newel.slideDown()
    if(s[i].match(/up$|down$|left$|right$/gim)) newel.animate({top: "0",left: "0"}, 500)
    if(s[i]=='center') newel.animate({top: "0",left: "0",width: imgX+'px', height:imgY+'px',opacity:'1'}, 500)
  }
};
