var linkUrl = new Array('http://pro.agm-tec.com/product_info.php?products_id=98',
                        'http://pro.agm-tec.com/product_info.php?products_id=98',
                        'http://pro.agm-tec.com/product_info.php?products_id=97',
                        'http://pro.agm-tec.com/product_info.php?products_id=95',
                        'http://pro.agm-tec.com/product_info.php?products_id=92',
                        'http://pro.agm-tec.com/index.php?cPath=26',
                        'http://pro.agm-tec.com/index.php?cPath=32',
                        'http://pro.agm-tec.com/index.php?cPath=23',
                        'http://pro.agm-tec.com/index.php?cPath=37',
                        'http://pro.agm-tec.com/index.php?cPath=37',
                        'http://pro.agm-tec.com/index.php?cPath=37'
                       );

$.preloadImages = function()
{
  for(var i = 0; i<arguments .length; i++)
  {
    img = new Image();
    img.src = arguments[i];
  }
}

$(document).ready(function(){
  var imagePath = "images/v1_1/header/";
  for (i=0; i<10; i++)
  {
    $.preloadImages(imagePath+'m04-'+i+'.jpg');
  }

  var refreshImage = setInterval(function() {
    randomnumber = Math.floor(Math.random()*10);
    $('#banner > img').hide();
    $('#banner').attr('href', linkUrl[randomnumber-1]);
    $('#banner > img').attr('src', imagePath+'m04-'+randomnumber+'.jpg').fadeIn('slow');
  }, 10000);
});