	var mod_div="#featurette-player";
	var mod_divID="featurette-player";
	var mod_scroller=false;
	var mod_rtmp_server="rtmp://media2.olympusamerica.com/vod";
	var mod_player=null;
	//var mod_default_page_name=null;
	var mc_height=0;
	var pc_height=0;
	var pc_height_diff=0;
	var height_change=false;
	function create_non_rtmp_player(video_full)
	{
		pc_height_diff=0;
		video_parts=video_full.split("?height=");
		if(video_parts[1]) {
			vid_height=Number(video_parts[1]);
		} else {
			vid_height=450;
		}
		canvas_height=vid_height+16;
		nrtmp_video=video_parts[0];
		$(mod_div).html('');
		$(mod_div).css('height',canvas_height+'px');
		if (mc_height<canvas_height) {
			pc_height_diff=canvas_height-mc_height;
			$('#page-content').height(pc_height+pc_height_diff);
			$('#maincontent-container').height(canvas_height);
			height_change=true;		
		}
		$(mod_div).css('display','block');
		$(mod_div).css('top','0px');
		$(mod_div).scrollFollow({
			container:'maincontent-container',
			offset:10
		});
		mod_player=flowplayer
		(
		mod_divID, 
		{
			src: "/swf_bin/flowplayer.commercial-3.1.5.swf",
			wmode: 'opaque'
		},
		{
			'key':oly_fp_key,
			canvas:
			{
				width:809,
				height:canvas_height,
				backgroundColor:'#000000',
				backgroundGradient:'none'
			},
			screen:
			{
				width:793,
				height:vid_height,
				top:8,
				left:8
			},
			clip:
			{
				url:nrtmp_video,
				scaling:'fit'
			},
			plugins: 
			{
				content:
				{
					url:'/swf_bin/flowplayer.content-3.1.0.swf',
					html:'<a href="javascript:close_mod_player();"><img src="/productos/images/product/template/close-corner-fp.gif" alt="Close" vspace="0" hspace="0" border="0" align="right"/></a>',
					top:1,
					right:3,
					width:70,
					height:70,
					border:'none',
					borderRadius:'none',
					backgroundColor:'transparent',
					backgroundGradient:'none',
					opacity:1
				},
			   controls: 
			   {
					url:'/swf_bin/flowplayer.controls-3.1.5.swf',
					all:false,
					play:true,
					scrubber:true,
					time:true,
					volume:true,
					autoHide:'always',
					hideDelay:800,
					backgroundColor:'#000000',
					backgroundGradient:'none',
					borderRadius:'0px',		  
					volumeSliderGradient:'none',
					volumeSliderColor:'#007fd8',
					sliderGradient:'none',
					sliderColor:'#bbbbbb',
					bufferGradient:'none',
					bufferColor:'#d5d5d5',
					progressGradient: 'none',
					progressColor: '#ffffff',
					buttonColor:'#000000',
					buttonOverColor:'#007fd8',
					timeBgColor:'#000000',
					timeColor:'#007fd8',
					durationColor:'#ffffff',
					tooltipColor:'#5F747C',
					tooltipTextColor: '#ffffff',
					height: 20,
					bottom:15,
					width:'90%'
				}
				
			}
		});
	}
	function create_mod_player(rtmp_video_full)
	{
		pc_height_diff=0;
		rtmp_video_parts=rtmp_video_full.split("?height=");
		if(rtmp_video_parts[1]) {
			vid_height=Number(rtmp_video_parts[1]);
		} else {
			vid_height=450;
		}
		canvas_height=vid_height+16;
		rtmp_video=rtmp_video_parts[0];
		rtmp_video=rtmp_video.replace(mod_rtmp_server+"/","");
		if (rtmp_video.lastIndexOf(".mp4")!=-1 || rtmp_video.lastIndexOf(".m4v")!=-1) {
			rtmp_video="mp4:"+rtmp_video;
		} 
		else if (rtmp_video.lastIndexOf(".flv")!=-1) {
			rtmp_video=rtmp_video.replace(".flv","");
		}
		else {
			rtmp_video=rtmp_video;
		}
		$(mod_div).html('');
		$(mod_div).css('height',canvas_height+'px');
		if (mc_height<canvas_height) {
			pc_height_diff=canvas_height-mc_height;
			$('#page-content').height(pc_height+pc_height_diff);
			$('#maincontent-container').height(canvas_height);
			height_change=true;			
		}
		$(mod_div).css('display','block');
		$(mod_div).css('top','0px');
		$(mod_div).scrollFollow({
			container:'maincontent-container',
			offset:10
		});
		mod_player=flowplayer
		(
		mod_divID, 
		{
			src: "/swf_bin/flowplayer.commercial-3.1.5.swf",
			wmode: 'opaque'
		},
		{
			'key':oly_fp_key,
			canvas:
			{
				width:809,
				height:canvas_height,
				backgroundColor:'#000000',
				backgroundGradient:'none'
			},
			screen:
			{
				width:793,
				height:vid_height,
				top:8,
				left:8
			},
			clip:
			{
				url:rtmp_video,
				provider:'olympus_rtmp',
				scaling:'fit',
				onStart: function () {
					this.setVolume(75);
				}
			},
			plugins: 
			{
				olympus_rtmp:
				{
					url:'/swf_bin/flowplayer.rtmp-3.1.4.swf',
					netConnectionUrl:mod_rtmp_server
				},
				content:
				{
					url:'/swf_bin/flowplayer.content-3.1.0.swf',
					html:'<a href="javascript:close_mod_player();"><img src="/productos/images/product/template/close-corner-fp.gif" alt="Close" vspace="0" hspace="0" border="0" align="right"/></a>',
					top:1,
					right:3,
					width:70,
					height:70,
					border:'none',
					borderRadius:'none',
					backgroundColor:'transparent',
					backgroundGradient:'none',
					opacity:1
				},
			   controls: 
			   {
					url:'/swf_bin/flowplayer.controls-3.1.5.swf',
					all:false,
					play:true,
					scrubber:true,
					time:true,
					volume:true,
					autoHide:'always',
					hideDelay:800,
					backgroundColor:'#000000',
					backgroundGradient:'none',
					borderRadius:'0px',		  
					volumeSliderGradient:'none',
					volumeSliderColor:'#007fd8',
					sliderGradient:'none',
					sliderColor:'#bbbbbb',
					bufferGradient:'none',
					bufferColor:'#d5d5d5',
					progressGradient: 'none',
					progressColor: '#ffffff',
					buttonColor:'#000000',
					buttonOverColor:'#007fd8',
					timeBgColor:'#000000',
					timeColor:'#007fd8',
					durationColor:'#ffffff',
					tooltipColor:'#5F747C',
					tooltipTextColor: '#ffffff',
					height: 20,
					bottom:15,
					width:'90%'
				}
				
			}
		});
	}
	
	
	function close_mod_player(){
		mod_player=null;
		$(mod_div).html('');		
		$(mod_div).css('display','none');
		if (height_change) {
			$('#maincontent-container').height(mc_height);
			$('#page-content').height(pc_height);
			height_change=false;
		}
	}
	
	/*function mod_player_omniture(video)
	{
		video=video.split("?height=");
		videoType=":video";
		videoName=video[0].replace("seg/",":");
		videoName=videoName.replace("/",":");
		videoTracking=videoType+videoName;
		
		var new_page_name=mod_default_page_name+videoTracking;
		
		var s=s_gi(s_account);
		s.linkTrackVars="pageName";
		s.pageName=new_page_name;
		void(s.t());
	}*/
	
	$(document).ready(function()
	{
		mc_height=$('#maincontent-container').height();
		pc_height=$('#page-content').height();
		//mod_default_page_name=s.pageName;
		
		$('.featurette-link').click(function()
		{
			mod_player=null;
			$(mod_div).html('');
			$(mod_div).css('display','none');
			create_non_rtmp_player($(this).attr('href'));
			/*if ($(this).hasClass('no-ms')){create_non_rtmp_player($(this).attr('href'));}
			else {create_mod_player($(this).attr('href'));}*/
			//mod_player_omniture($(this).attr('href'));
			return false;
		});
	});
