1. Valeriy Yatsko
  2. bitrix-aqualogo

Commits

Valeriy Yatsko  committed 5c8c159

Portfolio.

  • Participants
  • Parent commits 0f04af8
  • Branches default

Comments (0)

Files changed (1)

File _include_areas_/portfolio.php

View file
  • Ignore whitespace
 
 	$("#portfolio-level1-1").click(function(){
 		refresh_gallery_level2(1);
-		var target = $("#level2-prev");
-
-
-		if(cur2_offset - 1 < 0){
-			if(!target.hasClass('year-left-inactive'))
-				target.addClass('year-left-inactive');
-		} else {
-			if(target.hasClass('year-left-inactive'))
-				target.removeClass('year-left-inactive');
-		}
-
-		target = $("#level2-next");
-		
-		if(cur2_offset + 1 >= gallery_level2.length){
-			if(!target.hasClass('year-right-inactive'))
-				target.addClass('year-right-inactive');
-		} else {
-			if(target.hasClass('year-right-inactive'))
-				target.removeClass('year-right-inactive');
-		}
+		refresh_years_level2();
 		
 		$("#eskizy").removeClass('vkladka-inactive');
 		$("#3dproject").addClass('vkladka-inactive');
 	});
 	$("#portfolio-level1-2").click(function(){
 		refresh_gallery_level2(2);
-		var target = $("#level2-prev");
-
-
-		if(cur2_offset - 1 < 0){
-			if(!target.hasClass('year-left-inactive'))
-				target.addClass('year-left-inactive');
-		} else {
-			if(target.hasClass('year-left-inactive'))
-				target.removeClass('year-left-inactive');
-		}
-
-		target = $("#level2-next");
-		
-		if(cur2_offset + 1 >= gallery_level2.length){
-			if(!target.hasClass('year-right-inactive'))
-				target.addClass('year-right-inactive');
-		} else {
-			if(target.hasClass('year-right-inactive'))
-				target.removeClass('year-right-inactive');
-		}
+		refresh_years_level2();
 		
 		$("#eskizy").removeClass('vkladka-inactive');
 		$("#3dproject").addClass('vkladka-inactive');
 	});
 	$("#portfolio-level1-3").click(function(){
 		refresh_gallery_level2(3);
-		var target = $("#level2-prev");
-
-
-		if(cur2_offset - 1 < 0){
-			if(!target.hasClass('year-left-inactive'))
-				target.addClass('year-left-inactive');
-		} else {
-			if(target.hasClass('year-left-inactive'))
-				target.removeClass('year-left-inactive');
-		}
-
-		target = $("#level2-next");
-		
-		if(cur2_offset + 1 >= gallery_level2.length){
-			if(!target.hasClass('year-right-inactive'))
-				target.addClass('year-right-inactive');
-		} else {
-			if(target.hasClass('year-right-inactive'))
-				target.removeClass('year-right-inactive');
-		}
+		refresh_years_level2();
 		
 		$("#eskizy").removeClass('vkladka-inactive');
 		$("#3dproject").addClass('vkladka-inactive');
 	});
 	$("#portfolio-level1-4").click(function(){
 		refresh_gallery_level2(4);
-		var target = $("#level2-prev");
-
-
-		if(cur2_offset - 1 < 0){
-			if(!target.hasClass('year-left-inactive'))
-				target.addClass('year-left-inactive');
-		} else {
-			if(target.hasClass('year-left-inactive'))
-				target.removeClass('year-left-inactive');
-		}
-
-		target = $("#level2-next");
-		
-		if(cur2_offset + 1 >= gallery_level2.length){
-			if(!target.hasClass('year-right-inactive'))
-				target.addClass('year-right-inactive');
-		} else {
-			if(target.hasClass('year-right-inactive'))
-				target.removeClass('year-right-inactive');
-		}
+		refresh_years_level2();
 		
 		$("#eskizy").removeClass('vkladka-inactive');
 		$("#3dproject").addClass('vkladka-inactive');
 		cur2_offset = 0;
 		$("#portfolio-bigpic").attr('src', gallery_level2[0][2]);
 
+		refresh_years_level2();
+
 		return false;
 	});
 	
 		cur2_offset = 0;
 		$("#portfolio-bigpic").attr('src', gallery_level2[0][2]);
 
+		refresh_years_level2();
+
 		return false;
 	});
 	
 		cur2_offset = 0;
 		$("#portfolio-bigpic").attr('src', gallery_level2[0][2]);
 
+		refresh_years_level2();
+
 		return false;
 	});