$(document).ready(function() {

	$("#holoslide .bvk-slide:nth-child(1)").css({display : 'block'});
	var t = 0;
	var sCount = 0;
	$('.bvk-slide').each(function() {
		if (t < $(this).height()) {
			t = $(this).height();
		} 
		sCount++;
    }); 
	var current = 1;	
	$(".slidetabs a").click(function(e) {
		e.preventDefault();
		current = $(this).attr("rel");
		slideDisplay();
	});
	function slideDisplay() {	
		$('.bvk-slide').css({display : "none"});
		$('.bvk-slide:nth-child('+current+')').css({display : "block"});
	}
	$(".holoArrowRight").click(function() {
		current++;
		if (current > sCount) {
			current = 1;
		}
		slideDisplay();
	});
	$(".holoArrowLeft").click(function() {
		current--;
		if (current <= 0) {
			current = sCount;
		}
		slideDisplay();
	});
	
	$('#holoslide').height(t);
	
	$("SELECT").selectBox();
	$('.holobot a, .slidetabs').each(function() {
		$(this).data("title", $(this).attr("title")).removeAttr("title");
		var valA = $(this).height();
		var valB = $(this).width() / 2;
		var valT = $(this).data("title");
		$(this).append('<div class="tooltip">'+valT+'</div>');
		$(this).children('.tooltip').css({marginTop : -(valA - 4), marginLeft: -80 + valB}).hide();
	});
	$(".holobot a, .slidetabs").mouseenter( function() {		
		$(this).children('.tooltip').stop().fadeIn(200);
	});
	$(".holobot a, .slidetabs").mouseleave( function() {
		$(this).children('.tooltip').hide();
	});
	$('#ftrcls').click( function(){
		$('.footer-content').slideToggle();
	});
	
	$('a.thumb').click( function(e) {	
		var lbu = $(this).attr("href");
		e.preventDefault();
		$('.lBox').hide();		
		$('.lBox').append('<img src="'+lbu+'">');
		$('.lBox').slideDown();
	});
	$('.lBoxClose, .lBox').click( function() {
		$('.lBox img').fadeOut(300, function() {
			$(this).remove();
		});
		$('.lBox').slideUp();
	});
	
});	
