/*
 *
 * Cufon and jQuery initialization code for freedomdolly.com
 *
 */
var J = jQuery.noConflict();

J(document).ready(function(){  
 


							   
         J(".sf-menu").supersubs({ 
            minWidth:    13,  
            maxWidth:    27,   
            extraWidth:  2   
                               
        }).superfish({
			autoArrows:    false, 
			dropShadows:   false
		}); 


	
	

// FancyBox

		J.fn.getTitle = function() {
			var arr = J("a.fancybox");
			J.each(arr, function() {
				var title = J(this).children("img").attr("title");
				if (title =="") {title = J(this).next().children("p").html()}; // create title from PWA + PHP captions
				if (title == "") {title = J(this).attr("title")}; // if nothing else, set title to that of the page
				J(this).attr('title',title);
			})
		}

		// Supported file extensions
		var thumbnails = 'a:has(img)[href$=".bmp"],a:has(img)[href$=".gif"],a:has(img)[href$=".jpg"],a:has(img)[href$=".jpeg"],a:has(img)[href$=".png"],a:has(img)[href$=".BMP"],a:has(img)[href$=".GIF"],a:has(img)[href$=".JPG"],a:has(img)[href$=".JPEG"],a:has(img)[href$=".PNG"]';

	
		J(thumbnails).addClass("fancybox").attr("rel","fancybox").getTitle();

		//J(thumbnails).addClass("fancybox").attr("rel","fancybox");

			J("a.fancybox").fancybox({
			'imageScale': false,
			'padding': 10,
			'zoomOpacity': true,
			'zoomSpeedIn': 500,
			'zoomSpeedOut': 500,
			'zoomSpeedChange': 300,
			'overlayShow': true,
			'overlayColor': "#333333",
			'overlayOpacity': 0.7,
			'enableEscapeButton': true,
			'showCloseButton': true,
			'hideOnOverlayClick': true,
			'hideOnContentClick': false,
			'frameWidth':  560,
			'frameHeight':  340,
			'callbackOnStart': null,
			'callbackOnShow': null,
			'callbackOnClose': null,
			'centerOnScroll': true,
			'title'			: this.title,
			'titlePosition'	:	'over',
			'titleShow'		: false
		

		});	

// show titles on blog page image expanders		
		
		
		J("body.blog a.fancybox").fancybox({
			'titleShow'		: true
			});	
	
// Shop Online

	J("a#shop_online").fancybox({
		'hideOnContentClick': false,
		'width'				: 400,
		'height'			: 260,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'overlayColor': "#333333",
		'overlayOpacity': 0.7,
		'padding'			: 0
	});


// Artist Profile Video

	J("a#open_profile_video").fancybox({
		'hideOnContentClick': false,
		'width'				: 580,
		'height'			: 360,
		'overlayColor': "#333333",
		'overlayOpacity': 0.7,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'		: false,
		'padding'			: 0
	});					


// XHTML TARGET FIX
J('a.newwin').attr('target', '_blank');


// dim the subscribe button

J("#mc-embedded-subscribe").hover(
  function () {
    J(this).addClass("dim");
  },
  function () {
    J(this).removeClass("dim");
  }
);


}); // end doc ready
	
