EVERYZING.snippetMod_initBaldr = function(){
	/* 
	 * Helper Functions
	 */
	var switchTextHighlights = function(highlight){
	    var marker = jQuery(highlight);
		
	   // var highlightText = jQuery(".wrapper div[@ts="+marker.attr("ts")+"]", marker.parent().parent());
	    var highlightText = jQuery(".ez-box-content div[@ts="+marker.attr("ts")+"]", marker.parent().parent());
		if (highlightText.length == 0) return; // snippet bubble not included
		
		marker.unbind("mouseover");
	    marker.siblings('.active-highlight').bind("mouseover", function(){switchTextHighlights(this);});
		
		marker.addClass('active-highlight');
	    marker.siblings('.active-highlight').removeClass('active-highlight');
	    
		highlightText.show();
		highlightText.siblings().hide();
	    highlightText.bind("click", function(){
		      location.href = marker.attr('href');
		  });
	}
	
	// Calculate length from timestamp;  time format: [hh:][mm]:ss
	var getTimeInSeconds = function(time){
		var timeArray = time.split(":");
		
	    var timeLen = 0;
	    for (var i=0; i<timeArray.length; i+=1){
			timeLen += timeArray[i]* Math.pow(60, timeArray.length-1-i);
		}
		
	    return timeLen;
	}
	
	// @returns relative position in percentage [0..1]
    var getRelativePosition = function(timestamp, duration){ 
        return (getTimeInSeconds(timestamp) / getTimeInSeconds(duration));
    }
    
	
	/* 
	 * Initialize The Timelines (Baldr doesn't have a timeline per se.)
	 */
	  jQuery(".ez-snippetMod-item .ez-timeline").each(function(){
		
		var currentTimeline = jQuery(this);
		var timeStamps = jQuery('.ez-timeline-marker', currentTimeline);

		
		timeStamps.each(function(){
			var stamp = jQuery(this);

			stamp.bind("mouseover", function(){
				switchTextHighlights(this);
			});
		});
		
		switchTextHighlights(timeStamps.slice(0,1));
	});
}
