$(document).ready(function(){
	
	if( $("a[rel^='prettyPhoto']").size() > 0 ){
		$("a[rel^='prettyPhoto']").prettyPhoto({
			animationSpeed: 'normal', /* fast/slow/normal */
			padding: 40, /* padding for each side of the picture */
			opacity: 0.40, /* Value betwee 0 and 1 */
			showTitle: false, /* true/false */
			allowresize: true, /* true/false */
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
			hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			modal: false, /* If set to true, only the close button will close the window */
			changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
			callback: function(){} /* Called when prettyPhoto is closed */
		});
	}
	
	
	// xhtml 1.0 strict way of using target _blank 
	jQuery('.sexy-bookmarks a.external').attr("target", "_blank"); 
	// this block sets the auto vertical expand when there are more than 
	// one row of bookmarks. 
	var sexyBaseHeight=jQuery('.sexy-bookmarks').height(); 
	var sexyFullHeight=jQuery('.sexy-bookmarks ul.socials').height(); 
	if (sexyFullHeight>sexyBaseHeight) { 
	jQuery('.sexy-bookmarks-expand').hover( 
	function() { 
	jQuery(this).animate({ 
	height: sexyFullHeight+'px' 
	}, {duration: 400, queue: false}); 
	}, 
	function() { 
	jQuery(this).animate({ 
	height: sexyBaseHeight+'px' 
	}, {duration: 400, queue: false}); 
	} 
	); 
	} 
	// autocentering 
	if (jQuery('.sexy-bookmarks-center')) { 
	var sexyFullWidth=jQuery('.sexy-bookmarks').width(); 
	var sexyBookmarkWidth=jQuery('.sexy-bookmarks:first ul.socials li').width(); 
	var sexyBookmarkCount=jQuery('.sexy-bookmarks:first ul.socials li').length; 
	var numPerRow=Math.floor(sexyFullWidth/sexyBookmarkWidth); 
	var sexyRowWidth=Math.min(numPerRow, sexyBookmarkCount)*sexyBookmarkWidth; 
	var sexyLeftMargin=(sexyFullWidth-sexyRowWidth)/2; 
	jQuery('.sexy-bookmarks-center').css('margin-left', sexyLeftMargin+'px'); 
	
	} 
	
	
});
