﻿var flg_3d_check = false;
function init3d()
{
		if(document.Applet1.isTextureLoadInProgress()==false){
			TextureCache();
			flg_3d_check=true;
		}else{
			setTimeout("init3d()",500);
		}
}
//----------------------------------------------------------------------------------------- 
function init()
{
		var uOS = navigator.platform;
		var uAgent = navigator.userAgent;
		var uVersion = navigator.appVersion;
		if ((uOS.indexOf('Mac')>=0)&&(uAgent.indexOf('IE')>=0)) return;
		InitApplet('Applet1', 'event_function');
}
function onResizeFunction()
{
	if(document.layers) location.href=location;
}
//----------------------------------------------------------------------------------------- 
function event_function(iType, Param1, Param2, Param3)
{
	//parsing parameters, this is important for browser compatibility
	Param1 = parseInt(Param1);
	Param2 = parseInt(Param2);
	iType = parseInt(iType);
	switch(iType)//check the type of the event
	{
		
		case 1:
			break;
		
		case 4: //Scene has finished loading event
			//initialize the scene and applet
			if(!flg_3d_check) init3d();
			break;
	}
	return(false); // return default value
}