function HideVideo()
{
	jQuery('#smart-video').fadeOut();
	LoadBanners();
	jQuery('#smart-close').hide();
	jQuery('#video').empty();
}

function LoadBanners()
{
	// If you change the canvas size of your flash piece in the FLA file,
	// you'll need to change the dimension of the flash piece here too.
	var so = new SWFObject("assets/swf/smart-banner-v2.swf", "myMovie", "601", "269", "8", "#000000");
	so.addVariable("XMLpath", "smart-banner.xml?time=012345"); 
	so.addParam("wMode", "transparent");
	so.write("smart-banner");
}

function ShowVideo()
{
	var s1 = new SWFObject('/assets/swf/player.swf','ply','601','269','9');
										s1.addParam('allowfullscreen','true');
										s1.addParam('allowscriptaccess','always');
										s1.addParam('wMode','transparent');
										s1.addVariable('link','javascript:HideVideo()');
										s1.addVariable('linktarget', '_self');
										s1.addVariable('linkfromdisplay','true');
										s1.addVariable('skin', '/assets/swf/bekle.swf');
										s1.addVariable('fullscreen', 'true');
										s1.addVariable('backcolor', '222222');
										s1.addVariable('lightcolor', 'ffde00');
										s1.addVariable('stretching', 'exactfit');
										s1.addVariable('type','video');
										s1.addVariable('file', '/assets/flv/FPCO_WS1_Intro4.flv');
										s1.addVariable('controlbar', 'over');
										s1.addVariable('autostart', 'true');
										s1.write('video');
	jQuery('#smart-video').show();
	jQuery('#smart-close').show();
	jQuery('#smart-banner').empty();
}


// Hide video player, after video is complete
var player = null;

function playerReady(obj)
{
	player = gid(obj.id);
	player.addModelListener('STATE', 'stateMonitor');
};

function stateMonitor(obj)
{
	//...load a new playlist on completion of current item
	if(obj.newstate == 'COMPLETED')
	{
	  HideVideo()
	}
};

function gid(name)
{
	return document.getElementById(name);
};

