function resize() 
{
	getRealSizeTO=setTimeout("getRealSize()",200)
}

function getRealSize() 
{
	video_controls_height=0
	var s=main.findName("videoElement")
	var sourceWidth = s.width
	var sourceHeight = s.height
	var targetWidth = plugin.content.actualWidth
	var videoWidth = plugin.content.actualWidth
	var targetHeight = plugin.content.actualHeight
	var sourceWidthNatural = s.NaturalVideoWidth 
	var sourceHeightNatural = s.NaturalVideoHeight  
	video_ratio=sourceWidthNatural/sourceHeightNatural
	display_ratio=videoWidth/(targetHeight-video_controls_height)

	vbg=s.findName("videoBG")	
	pc=s.findName("PlayControls")
	vc=s.findName("volumeControl")
	me=s.findName("videoElement")
	bmbg=s.findName("bufferMsgBG")
	
	if(display_ratio>video_ratio) 
	{
		me.width=videoWidth*(sourceWidthNatural/sourceHeightNatural)	
		me.height=(targetHeight)
		me["Canvas.Left"]=videoWidth/2-me.width/2
		me["Canvas.Top"]=0
	}
	else if(isNaN(video_ratio))
	{
		// Er is helemaal geen video ofzo..
		me.width=0
		me.height=0
		me["Canvas.Left"]=0
		me["Canvas.Top"]=0
	}
	else 
	{
		me.width=videoWidth
		me.height=videoWidth/(sourceWidthNatural/sourceHeightNatural)
		me["Canvas.Left"]=0
		me["Canvas.Top"]=(targetHeight-video_controls_height)/2-me.height/2
	}
	pc["Canvas.Top"]=targetHeight-video_controls_height-50
	vbg.width=videoWidth
	vbg.height=targetHeight-video_controls_height
	bmbg.width=videoWidth
	bmbg.height=targetHeight

	new_full_bar_width=targetWidth-240
	main.findName("PlayBG").width=targetWidth-57
	
	s.findName("ToBeLoadedPath").width=new_full_bar_width
	s.findName("LoadedPath").width= new_full_bar_width * me.downloadProgress
	
	vc["Canvas.Left"]=new_full_bar_width+60
	objsArr["volumeSlider"].world_offset=35+vc["Canvas.Left"]  //182-left offset,60-init volume level
	
	main.opacity=1
}
