// These are things we want to do on every page of the app
$(document).ready(function(){
  
  utilities.setAjaxRequestHeader();
  utilities.attachCommonHandlers();

	// launch shadowboxes
	$('.chart').click(function(){
		Shadowbox.open({player: 'img',content: '/images/aa-sizechart.jpg',height: 518,width: 530});
		return false;
	})
	$('.customer').click(function(){
		Shadowbox.open({player: 'iframe',content: 'login.html',height: 300,width: 400});
		return false;
	})
	
	// Watch the video link next to the shirt title
	$('#watch').click(function(){
		$('#shirt img').hide();
		$('#shirt div').hide();
	   	$('#shirt #show_five').fadeIn(500);
	});
	
	// shirt home image gallery
	$('#shirt_thumbs img').click(function(){
		$('#shirt img.shirt').hide();
		//$('#shirt div').hide();
	   	$('#shirt #gallery_' + this.id).fadeIn(500);
	});
	
  // $('#remember').click(function(){
  //  $('#remember_form').toggle();
  // });
	
  // $('#phone').click(function(){
  //  $('#phone_field').toggle();
  // });

	$('#line_item_style').click(function(){
		$('#errorExplanation').hide();
	});
	
	// shows the slickbox DIV on clicking the link with an ID of "slick-show"
  $('a.ccv, #ccv_help a.close').click(function() {
    $('#ccv_help').toggle(400);
    return false;
  });
  
  $('#subscriber_email').click(function(){
    this.value = "";
  });
	
});
