(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

jQuery.preLoadImages("images/aboutus-robeks-hover.png", "images/robeks-menu-hover.png","images/franchise-hover.png", "images/locations-hover.png","images/buy-products-hover.png", "images/latest-news-hover.png","images/contact-us-hover.png");

$(document).ready(function(){
//Larger thumbnail preview 
$("ul.thumb li").hover(function() {
	
	$(this).css({'z-index' : '10'});
	var temp=$(this).find('img').attr("src");
	$(this).find('img').attr("src",$(this).find('img').attr("rel"));
	$(this).find('img').attr("rel",temp);
	$(this).find('img').addClass("hover").stop()
		.animate({
			marginTop: '-80px', 
			marginLeft: '-120px', 
			top: '50%', 
			left: '50%', 
			width: '239px', 
			height: '152px'
		}, 200);
	
	} , function() {
	$(this).css({'z-index' : '0'});
	var temp1=$(this).find('img').attr("src");
	$(this).find('img').attr("src",$(this).find('img').attr("rel"));
	$(this).find('img').attr("rel",temp1);
	//var temp1=$(this).find('img').attr("src");
//	$(this).find('img').attr("src")=$(this).find('img').attr("rel");
	//$(this).find('img').attr("rel")=temp1;
	$(this).find('img').removeClass("hover").stop()
		.animate({
			marginTop: '0', 
			marginLeft: '0',
			top: '0', 
			left: '0', 
			width: '193px', 
			height: '77px'
		}, 400);
});
 
});

