<HTML> 
<HEAD>
<TITLE>DirectAnimation SDK, JScript sample</TITLE>
<SCRIPT LANGUAGE="JScript">
<!--
if (window.top.frames.length!=0 && window.top.frames[0].ShowNoButtons!=null)
    window.top.frames[0].ShowNoButtons();
//-->
</SCRIPT>
</HEAD>	 

<BODY BGCOLOR=WHITE TOPMARGIN=15 LEFTMARGIN=20 ONRESIZE="setSize()">

<FONT FACE="Verdana, Arial, Helvetica" SIZE=2> 
<CENTER>
<H1>Running Animations in different browser types and versions</H1>


The following animation will use DirectAnimation to create a spinning 
eightball in IE4, and IE3.  For all other browser types it will default to
a static eightball image.<BR>

<OBJECT ID="DAControl"
  STYLE="position:relative ;width:200;height:200" 
  CLASSID="CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D">
</OBJECT>
          
<SCRIPT LANGUAGE="JScript">
<!--
  imageBase = "../../../../media/image/";

	if ( msieversion() >= 4 ) {
   	m = DAControl.MeterLibrary;
    ball = m.ImportImage(imageBase+"eightbll.gif");
    ball = ball.Transform(m.Rotate2Rate(3));
    DAControl.Image = ball;
	  DAControl.Start(); 
  }
	else if ( msieversion() >= 3 ) {
   	m = DAControl.MeterLibrary;
    ball = m.ImportImage(imageBase+"eightbll.gif");
    ball = ball.Transform(m.Rotate2Rate(3));
    DAControl.Image = ball;
    DAControl.BackgroundImage = m.SolidColorImage(m.White);
	  DAControl.Start();  
  }
	else
	  document.write("<IMG SRC=\""+imageBase+"eightbll.gif\">");
	
	
	function msieversion()
	// return Microsoft Internet Explorer (major) version number, or 0 for others
	// This function works by finding the "MSIE " string and extracting the version number
	// following the space, up to the decimal point for the minor version which is ignored.
	{
		var ua = window.navigator.userAgent;
		var msie = ua.indexOf ( "MSIE " );
		if ( msie > 0 )		// is Microsoft Internet Explorer; return version number
			return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) );	
		else
			return 0;	// is other browser
	}	
//-->
</SCRIPT>
</CENTER>
</FONT>
</BODY>
</HTML>
