/* Checks if elements overflow too much and hides or moves them */
function widthWatch()
{
	$('#lightContainer').css('width',($(window).width()+300));
}

function switchPage(page)
{
	$('#services-p1, #services-p2, #services-p3, #services-p4, #services-p5').hide();
	$('#sp1, #sp2, #sp3, #sp4, #sp5').removeClass('active');

	$('#services-'+page).fadeIn('slow');
	$('#s'+page).addClass('active');
	Cufon.refresh();
}

function switchPageConcurs(page)
{
	$('#concurs-p1, #concurs-p2, #concurs-p3, #concurs-p4, #concurs-p5').hide();
	$('#cp1, #cp2, #cp3, #cp4, #cp5').removeClass('active');
	$('#concurs-'+page).show();
	$('#c'+page).addClass('active');
	Cufon.refresh();	
}

$(function(){
  $('.overlay').click(function(e){
    var what = $(e.target);
    if (!what.parents('.overlay-box').length && $('.overlay-box:visible').length) {
      $(this).fadeOut('slow');
    }
  });

  $('ul.menu li').hover(function(){
      $(this).css('margin-bottom', '5px');
    }, function(){
      $(this).css('margin-bottom', '');
  });
});
