$(function() {
	if($('#video_player').length > 0 )
	 var vid = flowplayer("video_player", {
	// 	 				    // our Flash component 
	 	 				    src: WP.root_path + "/flash/flowplayer-3.1.1.swf", 
	// 	 
	// 	 				    // we need at least this Flash version 
	 	 				    version: [8, 115], 
	// 	 
	// 	 				    // older versions will see a custom message 
	 	 				    onFail: function()  { 
	 	 				        throw("video failed to load");
	 	 				    } 
	 	 				    // here is our third argument which is the Flowplayer configuration 
	 	 				}, { 
	 	 				    clip: {url: WP.root_path + "/media/jupiteroxygend2.flv",
	 	 									autoBuffering: true }
	 	 				});
		$("#video_player, #play_video_link").click(function(e){
			$("#video_player").unbind("click", this);
	 		e.preventDefault();
	 		//swfobject.embedSWF('/flash/flowplayer-3.1.1.swf', 'video_player', '372','248', '8.0.0', false, {"config": 'test'});
	 		 var flashvars = {
				"clip_id": 4967284,
				"server": "vimeo.com",
				"show_title": 1,
				"show_byline": 1,
				"show_portrait": 0,
				"color": "",
				"fullscreen": 1,
				"autoplay": 1
			}
			vid.play();
			//swfobject.embedSWF(WP.root_path + "/flash/flowplayer-3.1.1.swf", "video_player", '372', '279', '8.0.0', false, flashvars);
		});
	
	
	// var s1 = new SWFObject(WP.root_path + '/flash/player-viral.swf','player','400','300','9');
	// 	s1.addParam('allowfullscreen','true');
	// 	s1.addParam('allowscriptaccess','always');
	// 	s1.addParam('flashvars','file=' + WP.root_path + '/media/jupiteroxygend2.flv');
	// 	s1.write('video_player');
	
	$("a[href$=.pdf]:not(:has(\'img\'))").addClass("pdf");
	$("a[href$=.doc]:not(:has(\'img\'))").addClass("doc");
	//fix p margin before ul
	$("p+ul:not('.sub, .clearfix')").prev().css({"margin-bottom": "4px"});
});