$(document).ready(function(){
	$('#main_nav li .nojs').each(function(){
		$(this).removeClass('nojs');
	});
	$('#main_nav li').hover(function(){
		$(this).find('ul').fadeIn();
	},function(){ 
		$(this).find('ul').fadeOut();
	});
	$('#languages_quick_btn').hover(function(){
		$(this).find('#langues_list').fadeIn();
	},function(){ 
		$(this).find('#langues_list').fadeOut();
	});
	if($('.gallery').attr('class'))
		{
			$('.gallery a').lightBox();
		}
	if($('.gallery2').attr('class'))
		{
			$('.gallery2 a').lightBox();
		}
	$('.faq_answer').each(function(){
		$(this).css({'display':'none'});
	});
	$('.question').click(function(){ 
		if($($(this).attr('href')).css('display') == 'none'){
			$($(this).attr('href')).fadeIn();
			$(this).swapClass('question','questionOpen');
		}else{
			$($(this).attr('href')).fadeOut();
			$(this).swapClass('questionOpen','question');
		}
		return false;
	});
	if($('#show1').attr('id')){
		dots(); 
		$('#show1').css({'display':'none'});
		//$('#show2').css({'display':'none'});
		$('#show3').css({'display':'inline'}); 
		
		$('#download_biz_bl_outer').hover(function(){
				//this.style.textDecoration = 'underline';
				$('#slider').slideDown();
				$('#slider').css({'display':'block'}); 
				//slidedown('slider');
			}, function(){
				//this.style.textDecoration = 'none'; 
				$('#slider').slideUp();
			}); 
			
		window.setTimeout("show_instructions()", 4500);
	}
});

$.fn.swapClass = function(c1, c2){
    return this.each(function(){
        var t = $(this);
        (!t.is('.'+c1)) ? 
            t.addClass(c1).removeClass(c2) : t.addClass(c2).removeClass(c1);
    });
}

function show_instructions(){
	$('#slider').slideUp();
	document.getElementById('show1').style.display = 'inline';
	//document.getElementById('show2').style.display = 'block';
	document.getElementById('show3').style.display = 'none';
}
function dots(){
	var dotspan = document.getElementById('dots'); 
	 window.setInterval(function(){  
		   dotspan.innerHTML += '.';  
	 }, 500);
}