var flg_3d_check = false;
function init3d()
{
	
	if(document.Applet1.isSceneLoaded()){
		if(document.Applet1.isTextureLoadInProgress()==false){
			//flg_3d_check=true;
			setTimeout("document.Applet1.setRedrawEnabled(-1)",2000);
			setTimeout("document.Applet1.loadBackground('')",2000);
			setTimeout("document.Applet1.selSetSelected(0,document.Applet1.getPdsgNumber('all'))",2000);
			setTimeout("document.Applet1.setShVisible(true)",2000);
			setTimeout("document.Applet1.setRedrawEnabled(2000)",2200);
			setTimeout("open_anime()",6000);
			setTimeout("flg_3d_check=true",6000);
		}else{
			setTimeout("init3d()",500);
		}
	}else{
		setTimeout("init3d()",500);
	}
}
function isWin()
{
	var uAgent = navigator.userAgent.toUpperCase();
	return (uAgent.indexOf('WIN')>=0)?(true):(false);
}
function isIE()
{
	var aName = navigator.appName.toUpperCase();
	var uAgent = navigator.userAgent.toUpperCase();
	if(uAgent.indexOf('SAFARI')>=0) return false;
	if(uAgent.indexOf('OPERA')>=0) return false;
	return (aName.indexOf('MICROSOFT')>=0)?(true):(false);
}
function isNS4()
{
	return (!!document.layers);
}
//----------------------------------------------------------------------------------------- 
function isSafari()
{
	var uAgent = navigator.userAgent.toUpperCase();
	return (uAgent.indexOf('SAFARI')>=0)?(true):(false);
}
function isSafari2()
{
	var uAgent = navigator.userAgent.toUpperCase();
	if(uAgent.indexOf('SAFARI')<0) return false; // not safari
	str = (uAgent).split("/")[3];
	n = parseInt(str.split(".")[0]);
	if(n>=125) return true; // Safari1.2 or upper
	else return false;
}
function SFR2() // safari1.2
{
	if(!isSafari2()) return;

	var str=""+location.search; // ?aaa=nnn:bbb=mmm
	if(((str).indexOf('?'))<0) location.href=location+"?sfr2=1"; // 
	else if(((str).indexOf('sfr2='))<0) location.href=location+":sfr2=1"; //
	else return; //
}
SFR2();
//----------------------------------------------------------------------------------------- 
var flg_event=false;
function init()
{
		var uOS = navigator.platform;
		var uAgent = navigator.userAgent;
		var uVersion = navigator.appVersion;
		if((isWin()&&isIE())||(isNS4())){
			//document.Applet1.setEventsFunction("My3daEventFunction");
			//flg_event=true;
		}
		if ((uOS.indexOf('Mac')>=0)&&(uAgent.indexOf('IE')>=0)) return;
		if (isSafari()) return;
		init3d();
}
function onResizeFunction()
{
	if(document.layers) location.href=location;
}
