

function onStart( args ) {
	var type = args[0];
	var index = args[1];

	console.log( "start %s: %s", type, index );
}
function onFinish( args ) {
	var type = args[0];
	var index = args[1];

	console.log( "finish %s: %s", type, index );
	showDetails();
}
function onComplete() {
	console.log( "complete" );
}

var flashvars = {
//	src:'http://193.230.173.53/Handler/cat.aspx?s=xmlTrailer&amm=2',
	autostart: 'false',
	themeColor: 'bf3f26',
	scaleMode: 'fit',
	frameColor: '333333',														// framecolor of the player
	fontColor: 'cccccc',
	link: '',
	embed: '',
	allowScriptAccess: 'always',												// is allowed to call JS-functions
	mode: 'overlay',															// show and hide playlist/controller by mouseover
	hidePlaylist: 'true',														// hide playlist
	loopPlaylist: 'false',														// 	- default: true
	allowSmoothing: 'true',														//	- default: false
	overlay_delay: '2',										// starts overlay after this period (in seconds, default: 5)
	midroll_video_length: '10',								// minimum content video length threshold for displaying midrolls (in seconds, default: 100)
	close_flashvars: true									// final helper variable, ends the list (without comma at the end)
	};
var params = {
	allowFullScreen: 'true',								// fullscreen mode allowed
	allowScriptAccess: 'always',								// javascript-functions can be called
	wmode:"transparent"
	};
var attributes = {
	id: 'myPlayer',											// id of the player
	name: 'myPlayer'										// name of the player
};

function playMovie_URL(url) {
	flashvars['src']=url;

	var vars = [], hash;

	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	for(var i = 0; i < hashes.length; i++)
	{
		hash = hashes[i].split('=');
		vars.push(hash[0]);
		vars[hash[0]] = hash[1];
	}
	
	if (vars['play'] != undefined && vars['play'] != '')
	{
		flashvars['autostart']=vars['play'];
	}
	
	var version = getFlashVersion();
	if (version > 0 && version < 10) {
	  $("#videoPlayer").css("display","none");
    $("#videoPlayerWrongFlash").css("display","block");	   
  } else {
    $("#videoPlayerWrongFlash").css("display","none");
	  swfobject.embedSWF('swf/trailer_player.swf', 'videoPlayer','520', '316', '10.0.0', 'swf/expressInstall.swf', flashvars, params, attributes);
	}
}
function showDetails() { //when trailer ends meta information is displayed
	window.location = "film_details.aspx";
}

