// Preload image function
var myimages=new Array()
function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
		myimages[i]=new Image()
		myimages[i].src=preloadimages.arguments[i]
	}
}

$(document).ready(function(){

	$('.thumb a').cycle({
		speed:   300,
		timeout: 3000,
		next:   '.thumb a',
		pause:   1
	});

    $(".thumb a").hover(function(){
		var aHref = $(this).attr('href');  //get the src of the thumbnail

		var imgHref = $("img",this).attr('src');

		$(".thumb a").removeClass("selected");  //remove .selected class from all other links
		$(this).addClass("selected");  //add .selected class to current link
		$(".big").stop();
		$(".big").stop().fadeTo(300, 0, function() {  //fade image out
    		$('.big').attr('src',imgHref);  //give new image a src attribute
			}).fadeTo("slow", 1);  //fade the image in
		},function(){    //for onmouseout not used here
		});
});