
	$(document).ready( function() {
	
		var state = false;
		var right_pos = $(window).width() - $(".preview-videos").width() - 20;
		
		var hide_videos_num = $(".video-box").length - 1;
		var H = $(".video-box").height();
		var W = $(".video-box").width();
		var playVideoW = Math.round((W / 2)) - Math.round(($(".video-play-icon").width()  / 2));
		var playVideoH = Math.round(($(".video-thumb IMG").height() / 2)) - Math.round(($(".video-play-icon").height()  / 2));
		var additionalH = 0;
		var totalH = (H * hide_videos_num) + additionalH;
		
		$(".preview-videos").css ("right", "0");

		var video_top_pos = $(".footer").css("top");
		video_top_pos.replace("px");
		video_top_pos = parseInt(video_top_pos);
		video_top_pos -= Math.round(($(".footer").height() * 2) - 10);
		$(".preview-videos").css ("bottom", "-" + video_top_pos + "px");

		
		$(".video-box").slice(1).hide();
		$(".video-hide").hide();
		
		$(".video-play-icon").each(function() {
			 $(this).css({"top" : playVideoH + "px", "left" : playVideoW + "px"});
		});
		
		$(".see-all").click(function(e) {
			if (state == false) {
				$(".preview-videos").animate({"height": "+=" + totalH + "px"}, 500);
				$(".video-box").slice(1).fadeIn("normal");
				$(".video-hide").show();
				state = true;
			}
		});
		
		$(".video-hide").click(function(e) {
			if (state == true) {
				$(".preview-videos").animate({"height": "-=" + totalH + "px"}, 500);
				$(".video-box").slice(1).fadeOut("normal");
				$(".video-hide").hide();			
				state = false;				
			}
		});
		
	});	
