function rotateBack(x) {
		$(".jcarousel-next").append("<span></span>");
		var i=1;
		$(".jcarousel-next").click(function () { 
			i++;	
			if(i%x==0){			    
			  $(this).removeClass('jcarousel-next-horizontal');
			  $(this).addClass('jcarousel-last-horizontal');	  
			} else {
			  $(this).removeClass('jcarousel-last-horizontal');
			  if(!$(this).hasClass('jcarousel-next-horizontal')) { $(this).addClass('jcarousel-next-horizontal'); }  
			}
		});
		$(".jcarousel-prev").click(function () { 
			i--;
			 $(".jcarousel-next").removeClass('jcarousel-last-horizontal');
			 $(".jcarousel-next").addClass('jcarousel-next-horizontal');			 
		});	 
		

        
		



		
}



function clothesShow(){ 
  $("#text").show();
  $("#btn1 div, #btn2 div, #btn3 div").animate({ 
        opacity: 0
      }, 200);
  $(this).children().animate({ 
        opacity: 1
      }, 500);
  var theID = this.id;
  if(theID=="btn1") {
	  $("#text .issues").hide(); 
	  $("#text .issueItem1").show();
  } 
  if(theID=="btn2") {
	  $("#text .issues").hide(); 
	  $("#text .issueItem2").show();
  } 
  if(theID=="btn3") {
	  $("#text .issues").hide(); 
	  $("#text .issueItem3").show();
  }   
  
}	
function clothesHide(){
  
/*  $(this).children().animate({ 
        opacity: 0
      }, 500);*/
}
function show1(){
	 $("#btn1").children().animate({ 
        opacity: 1
      }, 1000);
}
function hide1(){
	 $("#btn1").children().animate({ 
        opacity: 0
      }, 500);
}
function show2(){
	 $("#btn2").children().animate({ 
        opacity: 1
      }, 1000);
}
function hide2(){
	 $("#btn2").children().animate({ 
        opacity: 0
      }, 500);
}
function show3(){
	 $("#btn3").children().animate({ 
        opacity: 1
      }, 1000);
}
function hide3(){
	 $("#btn3").children().animate({ 
        opacity: 0
      }, 500);
}

function hideCover(){
	 $("#coverAll").hide();
}
function showPop(){
	 $(this).next().show();
	 $(this).parent().addClass('open');
}
function hidePop(){
	 //$(this).next().hide();
}
function hideAll(){
	 $("#bgSkyInner").hide();
}
function showAll(){
	 $("#bgSkyInner").show();
}


$(document).ready(function () {
    setTimeout ( "hideAll()", 1 );
    setTimeout ( "show1()", 2 );
    setTimeout ( "hide1()", 3 );
    setTimeout ( "show2()", 4 );
    setTimeout ( "hide2()", 5 );
    setTimeout ( "show3()", 6 );
    setTimeout ( "hide3()", 7 );	
    setTimeout ( "showAll()", 1500 );	
    setTimeout ( "show1()", 1500 );
    setTimeout ( "hide1()", 2000 );
    setTimeout ( "show2()", 3000 );
    setTimeout ( "hide2()", 3500 );
    setTimeout ( "show3()", 4500 );
    setTimeout ( "hide3()", 5000 );
    setTimeout ( "hideCover()", 5000 );	
  //  setTimeout ( "showDuvet()", 5000 );	

 $("#btn1, #btn2, #btn3").hoverIntent({	
				sensitivity: 5,
				interval: 100, 
				over: clothesShow, 
				timeout: 250, 
				out: clothesHide
	});
 
 

 

$("#yearNav img").hover(
      function () {
	 $(this).next().show();
	 $(this).parent().addClass('open');
      }, 
      function () {

      }
    );

$("#yearNav .pop").hover(
      function () {

      }, 
      function () {
            $(this).parent().removeClass('open');
			$(this).hide();
      }
    );



 
});
