(function($){
 $.fn.influxisPlayer = function(options) {

  var defaults = {
   vconnection: 'rtmp://b3rzah4wk44.rtmphost.com/InfluxisPlayer/pritchett',
   vautoPlay: true,
   voutputlocation:'#slidedata', // 'self' for image thumbnail links
   vheight: '',
   vwidth: ''
  };
  var options = $.extend(defaults, options);
    
  return this.each(function() {
							
							
							 $(this).click(function (evt){
												
									evt.preventDefault();
									var cleanLocation = options.voutputlocation;
									if (options.voutputlocation == 'self'){
										options.voutputlocation = $(this);
									}
										 if (options.vheight == '' || options.vwidth == '') {
											 
														 options.vheight =  $(options.voutputlocation).height();
														 options.vwidth = $(options.voutputlocation).width();
														 
													 }
	var vOutput =	'<object type="application/x-shockwave-flash" data="http://66.135.33.137/apps/1xrcumem2mqucgufc2sc/InfluxisPlayer_20101005181715/InfluxisPlayer.swf" width="' +
		options.vwidth +
		'" height="'+ 
		options.vheight + 
		'">' +
		'<param name="movie" value="http://66.135.33.137/apps/1xrcumem2mqucgufc2sc/InfluxisPlayer_20101005181715/InfluxisPlayer.swf"></param>'+
		'<param name="allowFullScreen" value="true"></param>' +
		'<param name="allowScriptAccess" value="always"></param>' +
		'<param name="flashvars" value="RTMP='  +
		options.vconnection  +
		'&#038;file=' +
		$(this).attr('href') +
		'&#038;noServerDetect=true&#038;availableControls=play,stop,rewind,seek,time,duration,volume,fullscreen&#038;controls=auto&#038;controlsPosition=bottom&#038;volume=80&#038;mute=false&#038;autoPlay=' +
options.vautoPlay +'&#038;aspect=letterbox&#038;logo=&#038;logoPosition=bottomLeft&#038;logoScale=100&#038;buffer=5&#038;useDualBuffer=true"></param></object>';
$(options.voutputlocation).html(vOutput);
options.voutputlocation = cleanLocation;

 });

  });
 };
})(jQuery);





