var mainServer="localhost";var roomName="room.mgs";var serverName="";var serverTex="";var csDataURL="";var serverTex="";function LoadDefaults(name){	document.location.reload();}var isIE=false;var isIE=false;function CrossBrowserInit(){	isIE=false;		if (navigator.appName.indexOf("Microsoft")!=-1)	{ 		isIE=true;							}	else	{ 	}		var loc=getHTMLLoc();	var i=loc.indexOf("///");	if (i!=-1)	{		i=loc.indexOf("///"); 		var root=loc.substring(i+3);		i=root.indexOf("/");		rootLocation="file:///"+root.substring(0,i);	}	else	{		i=loc.indexOf("//"); 		var root=loc.substring(i+2);		i=root.indexOf("/");   		rootLocation="file://"+root.substring(0,i);	}}/////////////////////////////////////////////////////////////////////// ******************************************************************////	WINDOWS STARTUP////	Uses multithreading//	No memory allocation and loading speed problems//	Browser supports scripatble plugins				//// ******************************************************************/////////////////////////////////////////////////////////////////////var n=0;var action=false;var actionNum=0;function Timer(){ n++; if (n>=1) { miaObject=mia; if (!mia.isReady) return; if (!IsActionDone()) return; if (actionNum==0)  {   actionNum=1;   SetActions(0);   SetVisMode();      SetSelection(0);   UseThreadingMode();   InstallDB(gFileName+".cab","@Root","Installing "+gFileName+" Mia Database - ");   return;  } NoThreadingMode(); if (mia.isReady) {		dbstatus=GetDBStatus();		if (dbstatus=="db-failed")		{		  window.clearInterval(iID);	          ShowMsg('Models database error: ','check your connection, disk free space and memory (20MB HDD free space+128MB RAM required)');          	  alert("Architecture database installation failed, check your connection and system, make sure you are not logged as limited user");		  return;		}		 if (actionNum==1) {  actionNum=2;  NoThreadingMode();
  ShowMsg(StyleName,'Reading database information...');    LoadAutoScale(gFileName+".mgs");  return; } if (actionNum==2) {    } if (actionNum==3) {  actionNum=4; }  window.clearInterval(iID);  SetActions(1);  PredOn();  ReflOn()     LoadStartup();   if (GetComputerLevel()>=4)  {	alert("Computer is running slowly.  Make sure there is no background applications that makes computer running slowly. It is recommended to view Architecture on PIII 1000Mhz or higher machine");  }  mia.focus(); } }}function WindowsStartLoad(style,file,cmdList){	gFileName=file;	StyleName=style;	miaObject=mia;	level=GetVideoCardLevel();
	ram=GetFreePhysicalRam();
  	if (level<=2)	{	   alert("Your computer graphics card configuration is not enough for normal run, NVidia 128MB graphics card is recommended");	}	if (ram<=200000)	{	  alert("Not enough free memory for normal run, computer with at least 256MB free ram is recommended");	}	iID=window.setInterval("Timer()",200); }///////////////////////// COMMON START FUNCTIONfunction StartLoad(style,file,cmdList){	CrossBrowserInit();		if (!isIE) document.location.href="error.html";	if (navigator.platform.indexOf("Win32")!=-1)	{		isMacOS=false;		WindowsStartLoad(style,file,cmdList);	}}
