var browser = navigator.userAgent.toLowerCase();
var flashinstalled = 0;
var flashVersion = 0;
// NS3+, Opera3+, IE5+ Mac
if ( navigator.plugins != null && navigator.plugins.length > 0 ) {
	var flashPlugin = navigator.plugins['Shockwave Flash'];
	if ( typeof flashPlugin == 'object' ) { 
		var verArr = flashPlugin.description.split(' ');
		var ver = verArr[2].split('.');
		if(ver[0] > 6) flashVersion = 7; //Actual version may be higher, 7 just satisfies requirements
	}
} // IE4+ Win32 (VBscript)
else if ( browser.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && browser.indexOf("win")!= -1 && browser.indexOf("16bit")== -1 ) {
  document.write('<scr' + 'ipt language="VBScript"> \n');
	document.write('on error resume next \n');
	document.write('For i = 2 to 20 \n');
	document.write('If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then \n');
	document.write('Else \n');
	document.write('	flashinstalled = 2 \n');
	document.write('	flashVersion = i \n');
	document.write('	End If \n');
	document.write('Next \n');				
	document.write('If flashinstalled = 0 Then \n');
	document.write('	flashinstalled = 1 \n');
	document.write('End If \n');
  document.write('</scr' + 'ipt> \n');
  
} // no Flash
else {
flashVersion = -1;
}

function pageInit()
{
	if( window.sim_init )
	{
	  sim_init();
	}
	if( window.mos_init )
	{
		mos_init();
	}
	if( window.finit )
	{
		finit();
	}
	if( window.direction )
	{
		popup_init();
	}
	if( window.RUZEE )
	{
		RUZEE.Borders.render();
	}
}

window.onload = pageInit;