$(document).ready(function() {
						   
	counter = 0;					   
						   
	$('#detailphotos img').each(function(index) {
			$("#detailphotos #href"+index).click(function () {
				
					$("#detailphotos img").hide();	
					$("#detailphotos li").removeClass();
					$("#detailphotos img#photo"+index).show();
					$(this).addClass("active");
					$("#photo0").stopTime();
			});
	
			//Default
			$("#detailphotos img").hide();	
			
			counter++;
	});
		
	$("#detailphotos img#photo0").show();
	$("#detailphotos li#href0").addClass("active");

	$("#photo0", $("#right2")).everyTime(2000,function(i) {
		var activeid = $("#detailphotos img:visible").attr("id");
		id = (activeid.replace('photo',''));
		id = parseInt(id)+1;
				
		if(id == counter){
			id = 0;
		}
		
		
		$("#detailphotos img").hide();
		$("#detailphotos li").removeClass();
		$("#detailphotos img#photo"+id).show();
		$("#detailphotos li#href"+id).addClass("active");	
		
	});

});

/*
$(document).ready(function() {
						   
	counter = 0;					   
						   
	$('#href_links a').each(function(index) {
			$("#href_"+index).click(function () {
					$("#slideContainer > div.top").hide();
					$("#href_links > a").removeClass();
					$("#slide"+index).show();
					$(this).addClass("active");

			});
	
			//Default
			$("#slideContainer > div.top").hide();	
			
			counter++;
	});
		
	$("#slide0").show();
	$("#href_0").addClass("active");

	$("#slide0", $("#slideContainer")).everyTime(2000,function(i) {
		var activeid = $("#slideContainer > div.top:visible").attr("id");
		id = (activeid.replace('slide',''));
		id = parseInt(id)+1;
				
		if(id == counter){
			id = 0;
		}
		
		
		
		$("#slideContainer > div.top").hide();
		$("#href_links > a").removeClass();
		$("#slide"+id).show();
		$("#href_"+id).addClass("active");	
		
	});

});
*/