

function resize() {
	getRealSizeTO=setTimeout("getRealSize()",100)
}

function resizefull() {
	getRealSizeTOFull=setTimeout("getRealSizeFull()",100)
}

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 targetHeight = plugin.content.actualHeight
	var sourceWidthNatural = s.NaturalVideoWidth 
	var sourceHeightNatural = s.NaturalVideoHeight  
	
   
	video_ratio=sourceWidthNatural/sourceHeightNatural
	display_ratio=targetWidth/(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=targetWidth*(sourceWidthNatural/sourceHeightNatural)	
		me.height=(targetHeight)

		try {
		me["Canvas.Left"]=-280
		//(targetWidth/2-me.width/2)*3.35
		me["Canvas.Top"]=0
		} catch(err) {}
	
	}
	else {
		me.width=targetWidth
		me.height=targetWidth/(sourceWidthNatural/sourceHeightNatural)
		
		try {
		me["Canvas.Left"]=0
		me["Canvas.Top"]=(targetHeight-video_controls_height)/2-me.height/2
		} catch(err) {}
	}

	try {
		pc["Canvas.Top"]=targetHeight-video_controls_height-50
	} catch(err) {}
	
	vbg.width=targetWidth
	vbg.height=targetHeight-video_controls_height
	bmbg.width=targetWidth
	bmbg.height=targetHeight

	new_full_bar_width=targetWidth-270
	main.findName("PlayBG").width=targetWidth-57
	
	s.findName("ToBeLoadedPath").width=new_full_bar_width
	s.findName("LoadedPath").width= new_full_bar_width * me.downloadProgress
	s.findName("TimeText2")["Canvas.Left"] = new_full_bar_width-85
	
	vc["Canvas.Left"]=new_full_bar_width+90
	objsArr["volumeSlider"].world_offset=32+vc["Canvas.Left"]  //32-left offset,60-init volume level
	
	main.opacity=1
}

function getRealSizeFull() {

	video_controls_height=0
	
	var s=main.findName("videoElement")
	var sourceWidth = s.width
	var sourceHeight = s.height
	var targetWidth = plugin.content.actualWidth
	var targetHeight = plugin.content.actualHeight
	var sourceWidthNatural = s.NaturalVideoWidth 
	var sourceHeightNatural = s.NaturalVideoHeight  
	
   
	video_ratio=sourceWidthNatural/sourceHeightNatural
	display_ratio=targetWidth/(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=targetWidth*(sourceWidthNatural/sourceHeightNatural)	
		me.height=(targetHeight)

		try {
		me["Canvas.Left"]=0
		//(targetWidth/2-me.width/2)*3.35
		me["Canvas.Top"]=0
		} catch(err) {}
	
	}
	else {
		me.width=targetWidth
		me.height=targetWidth/(sourceWidthNatural/sourceHeightNatural)
		
		try {
		me["Canvas.Left"]=0
		me["Canvas.Top"]=(targetHeight-video_controls_height)/2-me.height/2
		} catch(err) {}
	}

	try {
		pc["Canvas.Top"]=targetHeight-video_controls_height-50
	} catch(err) {}
	
	vbg.width=targetWidth
	vbg.height=targetHeight-video_controls_height
	bmbg.width=targetWidth
	bmbg.height=targetHeight

	new_full_bar_width=targetWidth-270
	main.findName("PlayBG").width=targetWidth-57
	
	s.findName("ToBeLoadedPath").width=new_full_bar_width
	s.findName("LoadedPath").width= new_full_bar_width * me.downloadProgress
	s.findName("TimeText2")["Canvas.Left"] = new_full_bar_width-85
	
	vc["Canvas.Left"]=new_full_bar_width+90
	objsArr["volumeSlider"].world_offset=32+vc["Canvas.Left"]  //32-left offset,60-init volume level
	
	main.opacity=1
}
