$(document).ready(function() {				   
	// for lightbox
	if ($("a[rel^='prettyPhoto']").length) {
			$(document).ready(function() {
				// prettyPhoto
				$("a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_square'});
			});
	}
	// gallery1
	$('.gallery1 li a').hover(function(){
		$(this).find('img').stop().animate({opacity:'0.8',width:'120%', height:'120%', marginTop:'-10%', marginLeft:'-10%'},400)
	},function(){
		$(this).find('img').stop().animate({opacity:'1',width:'100%', height:'100%', marginTop:'0%', marginLeft:'0%'},400)
	})
	// menu
	$('ul#menu').superfish({
      delay:       600,
      animation:   {opacity:'show', height:'show'},
      speed:       400,
      autoArrows:  false,
      dropShadows: false
    });
	// gallery2
	var Img=$(".folio1 .active").attr('id')
	$(".folio1 dt img").css({opacity:'0'});
	$(".folio1 dt img.active").css({opacity:'1'});
	$(".folio1 ul li a").click(function(){
  	var ImgId = $(this).attr("href");
  	if (ImgId!=Img) {
		$(".folio1 .active").animate({ opacity: "0" }, 400,function(){
			 $(this).removeClass('active');
			 $(ImgId).animate({ opacity: "1" }, 400).addClass('active');
		})
	}
	Img=ImgId;
    return false;
   })
	// gallery3
	var Img=$(".folio2 .active").attr('id')
	$(".folio2 dt img").css({opacity:'0'});
	$(".folio2 dt img.active").css({opacity:'1'});
	$(".folio2 ul li a").click(function(){
  	var ImgId = $(this).attr("href");
  	if (ImgId!=Img) {
		$(".folio2 .active").animate({ opacity: "0" }, 400,function(){
			 $(this).removeClass('active');
			 $(ImgId).animate({ opacity: "1" }, 400).addClass('active');
		})
	}
	Img=ImgId;
    return false;
   })
	// gallery4
	var Img=$(".folio3 .active").attr('id')
	$(".folio3 dt img").css({opacity:'0'});
	$(".folio3 dt img.active").css({opacity:'1'});
	$(".folio3 ul li a").click(function(){
  	var ImgId = $(this).attr("href");
  	if (ImgId!=Img) {
		$(".folio3 .active").animate({ opacity: "0" }, 400,function(){
			 $(this).removeClass('active');
			 $(ImgId).animate({ opacity: "1" }, 400).addClass('active');
		})
	}
	Img=ImgId;
    return false;
   })
	// gallery5
	var Img=$(".folio4 .active").attr('id')
	$(".folio4 dt img").css({opacity:'0'});
	$(".folio4 dt img.active").css({opacity:'1'});
	$(".folio4 ul li a").click(function(){
  	var ImgId = $(this).attr("href");
  	if (ImgId!=Img) {
		$(".folio4 .active").animate({ opacity: "0" }, 400,function(){
			 $(this).removeClass('active');
			 $(ImgId).animate({ opacity: "1" }, 400).addClass('active');
		})
	}
	Img=ImgId;
    return false;
   })
	$('.gallery2 a, .gallery3 a, .gallery4 a, .gallery5 a').hover(function(){
		$(this).find('img').stop().animate({opacity:'0.8',width:'120%', height:'120%', marginTop:'-10%', marginLeft:'-10%'},400)
	},function(){
		$(this).find('img').stop().animate({opacity:'1',width:'100%', height:'100%', marginTop:'0%', marginLeft:'0%'},400)
	})
 });

$(window).load(function(){
	// scroll
	$('.scroll')._fw({
	   thumbvr:{
	   duration:1200,
	   easing:'easeOutCirc'
	  }
	});
});
