// createVideoTag plugin:
(function($) {
	
	$.fn.extend({
		
		// Video Tag function
		createVideoTag: function(video_file_name) {
			
			var file_name = video_file_name;
			
			return this.each(function() {
				videotag = '<video \
        					class="oip_ea_duration_101 oip_ea_start_0" \
              			  	width="448" height="336" \
                			poster="videos/'+file_name+'.jpg"> \
                        <source type="video/mp4; codecs=h264" src="videos/'+file_name+'.mp4" /> \
						<source type="video/ogg; codecs=theora" src="videos/'+file_name+'.ogv"  /> \
						<source type="video/webm; codecs=vp8" src="videos/'+file_name+'.webm" /> \
                        You need a browser that understands the html5 video tag to play this item. \
                      </video> ';
				$(this).html(videotag);
			});
			
		}, // end of video tag
		
		
		// Video Tag function
		createAudioTag: function(audio_file_name) {
			var file_name = audio_file_name;
			
			return this.each(function() {
				audiotag = '<audio \
        					class="oip_ea_duration_101 oip_ea_start_0" width="500"> \
                        <source type="audio/mp3" src="audios/'+file_name+'.mp3" /> \
                        You need a browser that understands the html5 video tag to play this item. \
                      </video> ';
				$(this).html(audiotag);
			});
			
		} // end of video tag
		
		/*<audio controls="controls">
  <source src="horse.ogg" type="audio/ogg" />
  <source src="horse.mp3" type="audio/mp3" />
  Your browser does not support the audio element.
</audio>*/
		
		
	});
	
})(jQuery);


$(document).ready(function() {
    var pathname = window.location.pathname;
	
	// mark active menupoints:
	$.each(['biography', 'contact', 'links', 'work', 'work/video', 'work/performances', 'work/photo', 'work/objects', 'work/text'], function(index, value) {
		var regexp = new RegExp(value);
		if(pathname.match(regexp)) {
			$("a.m_"+value.replace(/\//g, '_')).addClass("active");
		}
	});
});
