
/* ++++++++++++++++++++++++++++++++
	++	blueprint.js					++
	++	extracted from					++
	++	jQuery Palette v0.1			++
	++										++
	++	Dependencies:					++
	++	- jQuery 1.2.6 or higher	++
	++++++++++++++++++++++++++++++++ */


/* ========================
	==  Extending jQuery  ==
	======================== */
	
(function( $ ) {
	$.fn.extend( {
	
		blueprint: "1.0",
		
		clickable: function( cpTtl ) { // v0.1.5
			//	Makes elements clickable, linking to location specified by href= attribute of first descending link (where href is not "#" and does not start with "javascript:").
			// Args.:	cpTtl:	[Boolean]	Specifies whether or not to copy the title= attribute from the link to clickable element (default: true)
			//	CSS:		.jsClickable (on this)
			//				.jsClickableHover (on this:hover)
			//				.jsGuide (on guiding link)
						
			// === ATTENTION: FORK VERSION === //
			
			return this
				.each( function() {
					var jClickElem = $(this);
					var jGuideLink = $("a[href]:not([href='#']):not([href^='javascript:'])", jClickElem).eq(0);
					if ( !jGuideLink ) return true;	// continu
					
					var href = jGuideLink.attr("href");
					if ( !href ) return true;	// continue
					
					$.data(this, "href", href);
					
					var target = jGuideLink.attr("target");
					if ( target && target != "_self" ) $.data(this, "target", target);
					
					if ( ( cpTtl || cpTtl == null ) && !this.title ) this.title = jGuideLink[0].title;
					jClickElem.click( function() {
						var href = $.data(this, "href");
						var target = $.data(this, "target");
						if ( target ) {
							window.open(href, target);
							return false;
						} else {
							window.location.href = $.data(this, "href");
						}
					} );
					jClickElem.hover(
						function() { $(this).addClass("jsClickableHover"); },
						function() { $(this).removeClass("jsClickableHover"); }
					);
					jGuideLink.addClass("jsGuide");
					jClickElem.addClass("jsClickable");
				} );
		}
		
	} );
} )(jQuery);

/* ========================
	==  Custom functions  ==
	======================== */

// --- //

/* ======================
	==  Function calls  ==
	====================== */

jQuery( function( $ ) {
	
	// mail a friend flyout (requires jquery.slidepanel.js):
	//$(".mailafriendprintsnippet_form").css("display", "none");	// only hide if JS is enabled
	//$(".mailafriend").slidePanel({ target: ".mailafriendprintsnippet_form" });

	// clickableItems:
	$(".clickableItem, .clickableItems li:not(.notClickable), .clickableRows tr:not(.notClickable), .clickableItems th:not(.notClickable), .clickableItems td:not(.notClickable)").clickable();

} );
