var gacode='UA-6682987-1';
var kfPlayerTracker=false;
jQuery(document).ready(function(){try{kfPlayerTracker=_gat._getTracker(gacode);}catch(err){}});

var kf_options={
	onStart: function(clip) { 
    	//	this.getScreen().animate({width:640, height:360});
		$('#player').height(360);		
	}, 
	key: '#$9a4fe49cbfdd3775d30',
	clip:{
		// track start event for this clip
		onStart: function(clip) {
			kfPlayerTracker=kfPlayerTracker || _gat._getTracker(gacode);
			kfPlayerTracker._trackEvent("Video", "Play", location.href+':'+clip.url);
		},

		// track pause event for this clip. time (in seconds) is also tracked
		onPause: function(clip) {
			kfPlayerTracker=kfPlayerTracker || _gat._getTracker(gacode);
			kfPlayerTracker._trackEvent("Video", "Pause", location.href+':'+clip.url, parseInt(this.getTime()));
		},

		// track stop event for this clip. time is also tracked
		onStop: function(clip) {
			kfPlayerTracker=kfPlayerTracker || _gat._getTracker(gacode);
			kfPlayerTracker._trackEvent("Video", "Stop", location.href+':'+clip.url, parseInt(this.getTime()));
		},

		// track finish event for this clip
		onFinish: function(clip) {
			kfPlayerTracker=kfPlayerTracker || _gat._getTracker(gacode);
			kfPlayerTracker._trackEvent("Video", "Finish", location.href+':'+clip.url);
		},		
		
		baseUrl: 'http://www.kanalfrederikshavn.dk/uploads/kanal/video/',
		autoPlay: true,
		scaling: 'orig',
		autoBuffering: true
	},
	plugins: {
	    controls: {
	    	autoHide: '2s',
			backgroundGradient: 'none', 
			backgroundColor: 'transparent',
			stop:true
	    }
	},
	canvas: {
		backgroundColor: '#000000' //,
//		backgroundImage: 'url(/fileadmin/template/main/images/film-back.jpg)'
	},
	screen: { 
	    bottom:0
	},
	play: {
		opacity: 1,
		label:	'Afspil',
		replayLabel: 'Afspil igen'
	},
	logo: { 
	    url:'/kf.png',  
	    top: 15, 
	    right: 15, 
	    opacity:1.0, 
	    fullscreenOnly: true, 
	    displayTime: 0, 
	    fadeSpeed: 0, 
	    linkUrl: 'http://www.kanalfrederikshavn.dk/' 
	},
	contextMenu: [ 
	    {'Om Kanal frederikshavn...' : function(){location.href = 'http://www.kanalfrederikshavn.dk/';}}, 
	    '-', 
	    {'IdeFA Gruppen' : function(){window.open( 'http://www.idefa.dk/' );}}
	]			
};

var kplayer=null;
			
function kPlay(clip){
	if ( kplayer==null ){
		kplayer=$f("player","/flowplayer/flowplayer.commercial-3.0.1.swf",kf_options);
	}
	if ( !kplayer.isLoaded() ){
		kplayer.load();
	}
	$(document).scrollTop(228); 
	kplayer.play(clip);
	//kplayer.getScreen().animate({width:640, height:360}); 
	//kplayer.play();
}


