/**
* Methods relating to "My Collections" page
* @version 1
**/
var MyCollections = function() {

	var newTitleText = "";

	function createCollapsibleShareSection() {
		$('.email-share').hide();
		$('a.share-this-collection').click(
			function() {
				var emailShare = $(this).parent().parent().next();
				$(emailShare).slideToggle('fast');
				$(this).parent().parent().next().find('.email').focus();
			}
		);
	}
	function createAdjustableNewCollectionTitle() {
		newTitleText = $('.add-new-title').attr('value');
		$('.add-new-title').focus(function() {
	    	if ($(this).attr('value') == newTitleText) {
			   $(this).attr('value', '');
			}
		});
		$('.add-new-title').blur(function() {
		   if ($(this).attr('value') == '') {
			   $(this).attr('value', newTitleText);
		   }
		});
		
	}
	

	return {

		//initialiser
		init : function() {
			createCollapsibleShareSection();
			createAdjustableNewCollectionTitle();
		}
		
	};
	
}();

