$(document).ready(function(){

	/* TEXTBOXES */
	init_swap_text_boxes();
	
	
	/* INFOBOX */
	$('#info-box .nav a').click(function(){
	
		if($(this).hasClass('active'))
		{
			$(this).removeClass('active');
			$('#info-box .views div').hide();
			$('#info-box .views div.gratisverkoop').show();
		}
		else
		{
			var clickedId = $(this).attr('id');
			

				$('#info-box .nav a').removeClass('active');
				$(this).addClass('active');
					
				$('#info-box .views div').hide();
				$('#info-box .views').find('.'+clickedId).show();
				$('#info-box .views').find('.'+clickedId).find('div').show();
					
		}		
		
	});
	
	$('#info-box .views a.close').click(function(){
		$('#info-box .nav a').removeClass('active');
		$('#info-box .views div').hide();
		$('#info-box .views div.gratisverkoop').show();
	});
	
	/* LABEL */
	$('#label').everyTime(2500,function(i) {
		$(this).toggleClass('openonsaturday');
	});

	 
});  

/* TEXTBOXES */
var swap_text_boxes = [];
			
function init_swap_text_boxes(){
  //Store the default value for each box
  $('input[type=text][value].swaptextbox').each(function() {
    swap_text_boxes[$(this).attr('id')] = $(this).attr('value');
  });
  //Add focus and blur events to set or clear the value
  $('input[type=text][value].swaptextbox').bind('focus', function() {
    if($(this).val() == swap_text_boxes[$(this).attr('id')]) {
      $(this).val('');
    }
  });
  $('input[type=text][value].swaptextbox').bind('blur', function() {
    if($(this).val() == '') {
      $(this).val(swap_text_boxes[$(this).attr('id')]);
    }
  });
}
