/**
*	Config 1
*	Site-specific configuration settings for Highslide JS
*/
hs.graphicsDir = '/js/highslide/graphics/';
hs.showCredits = false;
hs.creditsPosition = 'bottom right';
hs.outlineType = 'custom';
hs.dimmingOpacity = 0.5;
hs.fadeInOut = true;
hs.align = 'center';
hs.captionEval = 'this.a.title';
hs.headingEval = 'this.thumb.title';
hs.headingOverlay.width = '100%';
hs.registerOverlay({
	html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
	position: 'top left',
	useOnHtml: true,
	fade: 2 // fading the semi-transparent overlay looks bad in IE
});

// Add the slideshow controller
    hs.addSlideshow({
    	//slideshowGroup: 'group1',
    	interval: 5000,
    	repeat: false,
    	useControls: true,
    	fixedControls: 'fit',
    	overlayOptions: {
    		opacity: '0.75',
    		position: 'bottom center',
    		offsetX: '1',
    		offsetY: '50',
    		hideOnMouseOut: false
    	}
    });
   
    hs.transitions = ['expand', 'crossfade'];
    hs.headingEval = 'this.a.title';
    hs.captionEval = '"&nbsp;"';
    hs.headingOverlay.position = "bottom";
    
    //NOT FINISHED YET
    hs.wrapperClassName = "blog-slideshow";


$(document).ready(function() {
    $('.blog_post').each(function(e){
        $(this).unbind().find('.imagelink').addClass('highslide').attr('onClick',function(){
            return 'return hs.expand(this,{  slideshowGroup: ' + (e+1) + ' })';
        });
        hs.addSlideshow({
        	slideshowGroup: (e+1),
        	interval: 5000,
        	repeat: false,
        	useControls: true,
        	fixedControls: 'fit',
        	overlayOptions: {
        		opacity: '0.75',
        		position: 'bottom center',
        		offsetX: '1',
        		offsetY: '50',
        		hideOnMouseOut: false
        	}
        });
    });

    
    //NOT FINISHED YET
    $("a.you-tube").each(function(){
    $(this).attr('href',$(this).attr('href') + '?rel=0&amp;wmode=transparent');
	var string = "return hs.htmlExpand(this,{ objectType: 'iframe', width: 640, objectWidth: 640,  objectHeight: 390, preserveContent: false, wrapperClassName: 'no-footer titlebar no-header', allowSizeReduction: false,  headingText: 'Video', preserveContent: false, objectLoadTime: 'after'})";
$(this).attr('onclick',string);
	});
});

