// JavaScript Document

$(document).ready(function(){
	 $("#middlebigpic").attr("src",$(".bottom-pic img:eq(0)").attr("rel")).show('slow');
	 $(".little-title").html($(".bottom-pic img:eq(0)").attr("alt")).show('slow');
	 var index = 0;
	 $('.bottom-pic li img').hover(function(){
			  if(MyTime){
				 clearInterval(MyTime);
				 $(".bottom-pic img").css({"border":"#330000 solid 0px"});
				 $(this).css({"border":"#fff solid 1px"});
				 $("#middlebigpic").attr("src",$(this).attr("rel")).show('slow');
				 $(".little-title").html($(this).attr("alt")).show('slow');
				 $('#middlebigpic').stop();
			  }
	 },function(){
				MyTime = setInterval(function(){
				ShowjQueryFlash(index);
				index++;
				if(index==5){index=0;}
			  } , 10000);
	 });
	var MyTime = setInterval(function(){
		ShowjQueryFlash(index);
		index++;
		if(index==5){index=0;}
	} , 10000);
		
       $("#header_div a").hover(function(){
	      $(".top_menu ul").addClass("menu");
		  $(".top_menu ul:eq("+$(this).attr("rel")+")").removeClass();},
		  function(){
		   $(".top_menu ul").addClass("menu"); 
		   $(".top_menu ul:eq("+$(this).attr("rel")+")").removeClass();
		  });
});
	    
	  						   



function ShowjQueryFlash(i) {
    $("#middlebigpic").attr("src",$(".bottom-pic img:eq("+i+")").attr("rel")).show('slow');
	$(".little-title").html($(".bottom-pic img:eq("+i+")").attr("alt")).show('slow');
   // $("#middle-big-pic").animate({opacity: 1},1000).css({"z-index": "1"}).siblings().animate({opacity: 0},1000).css({"z-index": "0"});
    $(".bottom-pic img").css({"border":"#330000 solid 0px"});
	$(".bottom-pic img").eq(i).css({"border":"#fff solid 1px"});
    if(i>5){
		$(".nav-span li").append($(".bottom-pic li").eq(0));		
		$(".bottom-pic li").append($(".nav-span li").eq(0));		
   }
   //alert($(".nav-span").html());
  // alert($(".nav-span").html());
}