function setActiveTab(current,id) {

    $play=0;
    var $sliderTop = $('#slider1top');
	var $active = $('#slideshow LI.active');
  
    if ( $active.length == 0 ) $active = $('#slideshow LI:last');
   
    var $selected = $('#slider' + id)
    

    $active.css({opacity: 1.0})
	    .attr("class", "last-active")
   	    .animate({opacity: 0.0}, 1000, function() {
	       
	    });
    
    
    $selected.css({opacity: 0.0})
    .attr("class", "active")
	.animate({opacity: 1.0}, 1000, function() {
    
	});


    if(current==1 ){
    	
    	$sliderTop.css({opacity: 1.0})
        .addClass('last-active')
        .animate({opacity: 0.0}, 1000, function() {
           
        });
    }
    if(id == 1){
    	$sliderTop.css({opacity: 0.0})
        .addClass('last-active')
        .animate({opacity: 1.0}, 1000, function() {
           
        });
    }
    
 
    
}

function slideSwitch() {
	
	
	
	if(typeof($play) == "undefined") $play=1;

	if($play==1){
	
		$begining = $('#slider1').attr('class');
	
	
		var $active = $('#slideshow LI.active');
		var $sliderTop = $('#slider1top');
	   
	    
	    if ( $active.length == 0 ) $active = $('#slideshow LI:last');
	   
	    var $next =  $active.next().length ? $active.next()
	        : $('#slideshow LI:first');
	   
	   

	    $active.css({opacity: 1.0})
	        .addClass('last-active')
	        .animate({opacity: 0.0}, 1000, function() {
	           
	        });
	    
	    
	    
	    $next.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0}, 1000, function() {
	            $active.removeClass('active last-active');
	        });
	   
	    
	    
	    $end = $('#slider1').attr('class');
	    
	    
	   
	    if($begining=="active" && $end=="active last-active"){
	    	$sliderTop.css({opacity: 1.0})
	        .addClass('last-active')
	        .animate({opacity: 0.0}, 1000, function() {
	           
	        });

	    }
	    
	    if($begining=="" && $end=="active"){
	    	$sliderTop.css({opacity: 0.0})
	        .addClass('last-active')
	        .animate({opacity: 1.0}, 1000, function() {
	           
	        });

	    }
	}
}

function slideSwitch2() {
	
		$('#slider-horizontal').animate({
		   
		    top: '-=421',
		   
		    
		  }, 5000, function() {
			  
			  $('#slider-horizontal').delay(1000).animate({
				   
				    top: '+=421',
				   
				    
			  }, 5000).delay(1000)
		    
		  });
	
	
	
	
	
		
	
    
}

$(function() {
    setInterval( "slideSwitch()", 6000 );
    slideSwitch2();
    setInterval( "slideSwitch2()", 14000 );
});
