/* lib_s_p */
$(document).ready(function() {

	// PORTFOLIO UI
		// set values for image show & hide (defaults)
	var lib_more_style = 'lib_img_more';
	var lib_more_con_type = 'div';
	var lib_more_show_text = 'View more images';
	var lib_more_hide_text = 'Hide images';
	var lib_more_hide_speed_initial = 1000;
	var lib_more_show_speed = lib_more_hide_speed_initial;
	var lib_more_hide_speed = lib_more_hide_speed_initial;

	libShowHide(lib_more_style, lib_more_con_type, lib_more_show_text, lib_more_hide_text, lib_more_hide_speed_initial, lib_more_show_speed, lib_more_hide_speed);

		// set values for description show & hide
	var lib_more_style = 'lib_dtls_more';
	var lib_more_con_type = 'span';
	var lib_more_show_text = 'Read More';
	var lib_more_hide_text = 'Hide Description';

	libShowHide(lib_more_style, lib_more_con_type, lib_more_show_text, lib_more_hide_text, lib_more_hide_speed_initial, lib_more_show_speed, lib_more_hide_speed);

	function libShowHide(lib_more_style, lib_more_con_type, lib_more_show_text, lib_more_hide_text, lib_more_hide_speed_initial, lib_more_show_speed, lib_more_hide_speed){

		// hide the content
		$(lib_more_con_type + '.' + lib_more_style).slideUp(lib_more_hide_speed_initial, function () {
	
			// add the show/hide link
			var lib_link = '<a href="#" class="' + lib_more_style + ' lib_show">' + lib_more_show_text + '</a>';
	    $(this).after(lib_link);    
	
			// add the show/hide behaviour to the link
			$('a.' + lib_more_style, $(this).parent()).toggle(function () {
				// show the content
		    $(lib_more_con_type + '.' + lib_more_style, $(this).parent()).slideDown(lib_more_show_speed, function (){
					// chenge the link text to hide
		    	$('a.' + lib_more_style, $(this).parent()).removeClass("lib_show").addClass("lib_hide").text(lib_more_hide_text);
		    });
		  } , 
		  function () { 
				// hide the content
		    $(lib_more_con_type + '.' + lib_more_style, $(this).parent()).slideUp(lib_more_hide_speed, function (){
					// chenge the link text to show
		    	$('a.' + lib_more_style, $(this).parent()).removeClass("lib_hide").addClass("lib_show").text(lib_more_show_text);
		    });
		  });    
	
	  });

	}

	// INITIALISE COLORBOX
	$("a.lib_fb").colorbox({slideshow:true});

});