/*$(function(){
//selectors
var target = $(".imgWrapper");
var imgWrapper = $(".imglink li");

//first img
var imgSrc = imgWrapper.find('a',this).attr("href");
var image = '<img src="'+imgSrc+'" alt="" />';
target.html(image);

//function
imgWrapper.click(function(){
$(".imglink li").removeClass('active');
$(this).addClass('active');
var imgSrc = $("a",this).attr("href");
var image = '<img src="'+imgSrc+'" alt="" " />';
target.html(image);
return false;
});


});


$(function(){
    var next_total_click;
    var prev_total_click = 0;
	var items = $('.counter').text();
	if(prev_total_click <= 0)
	{
		$('.prev').hide();
	}
	next_total_click = items;
	
	//next counter
	$(".next").click(function(){  
		next_total_click = next_total_click - 1; 
		prev_total_click = prev_total_click + 1;
     //$("h1").text("Total Click: " + next_total_click);
     return false;  
     }); 
	
	   //prev counter
    $(".prev").click(function(){  
    	prev_total_click = prev_total_click - 1;
    	next_total_click = next_total_click + 1;
     //$("h1").text("prev: " + prev_total_click);
     return false;  
     }); 
	
	
	
	
	
	
	$('.next').click(function(){		
		$('#slide').stop(true, false).animate({ top: "-=460px", },500);

		$('.prev').show();
		if(next_total_click <= 1)
		{
			//$('#slide').stop().animate();
			$(this).hide();
			$('.prev').show();
		}
		return false;
	});

	
		
	$('.prev').click(function(){
		$('#slide').stop(true, false).animate({ top: "+=460px", },500);
		$('.next').show();
		if(prev_total_click <= 0)
		{
			//$('#slide').stop();
			$('.prev').hide();
			$('.next').show();
		}
		
		return false;
	});

});

*/

$(function(){
//selectors
var target = $(".imgWrapper");
var imgWrapper = $(".imglink li");

//first img
var imgSrc = imgWrapper.find('a',this).attr("href");
var image = '<img src="'+imgSrc+'" alt="" />';
target.html(image);

//function
imgWrapper.click(function(){
$(".imglink li").removeClass('active');
$(this).addClass('active');
var imgSrc = $("a",this).attr("href");
var image = '<img src="'+imgSrc+'" alt="" />';
target.html(image);
return false;
});


});


$(function(){
    var next_total_click;
    var prev_total_click = 1;
	var items = $('.counter').text();
	if(prev_total_click <= 1)
	{
		$('.prev').hide();
	}
	next_total_click = items;
	
	//next counter
	$('.next').click(function(){  
		next_total_click = next_total_click - 1; 
		prev_total_click = prev_total_click + 1;
    // $("h1").text("Total Click: " + next_total_click);
     return false;  
     }); 
	
	   //prev counter
    $('.prev').click(function(){  
    	prev_total_click = prev_total_click - 1;
    	next_total_click = next_total_click + 1;
    // $("h1").text("prev: " + prev_total_click);
     return false;  
     }); 
	
	
	
	
	
	
	$('.next').click(function(){		
		$('#slide').stop(true, false).animate({ top: "-=460px" },100);

		$('.prev').show();
		if(next_total_click <= 1)
		{
			//$('#slide').stop().animate();
			$(this).hide();
			$('.prev').show();
		}
		return false;
	});

	
		
	$('.prev').click(function(){
		$('#slide').stop(true, false).animate({ top: "+=460px" },100);
		$('.next').show();
		if(prev_total_click <= 1)
		{
			//$('#slide').stop();
			$(this).hide();
			$('.next').show();
		}
		
		return false;
	});

});

