function gShowWin(name, iWidth, iHeight, bFlg) 
{
	attrib = "width=" + iWidth + ",height=" + iHeight + ",resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,top=0,left=0"
	self.name = "_MainWin"
	nw=window.open(name, "_NewWin", attrib);

	if (bFlg==1)
	{
		window.setTimeout("nw.focus()", 500)
	}
	else 
	{
		self.focus()
	}
}         

function gShowWinStatus(name, iWidth, iHeight, bFlg) 
{
	attrib = "width=" + iWidth + ",height=" + iHeight + ",resizable=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,top=0,left=0"
	self.name = "_MainWin"
	nw=window.open(name, "_NewWin", attrib);

	if (bFlg==1)
	{
		window.setTimeout("nw.focus()", 500)
	}
	else 
	{
		self.focus()
	}
}     
                                               
function gOpenWindow(URL)
{
	aWindow=window.open(URL,"_NewWin","toolbar=no,menubar=no,resize=no,scrollbars=yes,status=no,location=no,directories=no");
}

function getFlashMovieObject(movieName)
{
var mc = _root.createEmptyMovieClip("mc", this.getNextHighestDepth());

mc.loadMovie("YouTube.swf");

var thePlayer = mc.thePlayer;
thePlayer.StopPlay();


//  if (window.document[movieName]) 
//  {
//    return window.document[movieName];
//  }
//  if (navigator.appName.indexOf("Microsoft Internet")==-1)
//  {
//    if (document.embeds && document.embeds[movieName])
//      return document.embeds[movieName]; 
//  }
//  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
//  {
//    return document.getElementById(movieName);
//  }
}

function StopFlashMovie()
{
	var flashMovie=getFlashMovieObject("gdoFlashMovie");
	flashMovie.StopPlay();
}

function PlayFlashMovie()
{
	var flashMovie=getFlashMovieObject("gdoFlashMovie");
	flashMovie.Play();
	//embed.nativeProperty.anotherNativeMethod();
}

function RewindFlashMovie()
{
	var flashMovie=getFlashMovieObject("gdoFlashMovie");
	flashMovie.Rewind();
}

function NextFrameFlashMovie()
{
	var flashMovie=getFlashMovieObject("gdoFlashMovie");
	// 4 is the index of the property for _currentFrame
	var currentFrame=flashMovie.TGetProperty("/", 4);
	var nextFrame=parseInt(currentFrame);
	if (nextFrame>=10)
		nextFrame=0;
	flashMovie.GotoFrame(nextFrame);		
}


function ZoominFlashMovie()
{
	var flashMovie=getFlashMovieObject("gdoFlashMovie");
	flashMovie.Zoom(90);
}

function ZoomoutFlashMovie()
{
	var flashMovie=getFlashMovieObject("gdoFlashMovie");
	flashMovie.Zoom(110);
}


function SendDataToFlashMovie()
{
	var flashMovie=getFlashMovieObject("gdoFlashMovie");
	flashMovie.SetVariable("/:message", document.controller.Data.value);
}

function ReceiveDataFromFlashMovie()
{
	var flashMovie=getFlashMovieObject("gdoFlashMovie");
	var message=flashMovie.GetVariable("/:message");
	document.controller.Data.value=message;
}

