<?xml version="1.0"?>
<!DOCTYPE testsuite SYSTEM "http://www.w3.org/WAI/UA/TS/dtd/uaag-testsuite-2.dtd">


<testsuite id="ts0102-onmouse-multiple-events">
	
	<metaInfo>
		<testTitle>Multiple Event Handlers for ONMOUSEOVER and ONMOUSEOUT</testTitle>
		<shortTitle>ONMOUSEOVER and ONMOUSEOUT for multiple event handlers</shortTitle>				
		<testElement>
			<elementName>ONMOUSEOVER</elementName>
			<hlink href="http://www.w3.org/TR/html401/interact/scripts.html#h-18.2.3">&hspec; ONMOUSEOVER</hlink>
		</testElement>
		<testElement>
			<elementName>ONMOUSEOUT</elementName>
			<hlink href="http://www.w3.org/TR/html401/interact/scripts.html#h-18.2.3">&hspec; ONMOUSEOUT</hlink>
		</testElement>		
		<creator>Dominique Kilman</creator>
		<creator>Colin Koteles</creator>		
		
				
		<metaElement></metaElement>
		<testStyle></testStyle>
	</metaInfo>
	
	<requirementInfo>
   	<checkpoints>
      	<checkpoint xref="tech-device-independent-handlers">
         	<provisions>
            	<provision xref="tech-device-independent-handlers-2"/>
            </provisions>
         </checkpoint>
      </checkpoints>
 	</requirementInfo>
	
	<content>
		
		
		
		<test section="1">
			<procedure>
				<list>
					<item>Using the keyboard or an assistive technology that emulates the keyboard, navigate to the image link and activate both ONMOUSEOVER events.</item>
					<item>Using the keyboard or an assistive technology that emulates the keyboard, navigate off the image link and activate both ONMOUSEOUT events.</item>					
				</list>
			</procedure>
			<testCode>
				<table border="1" cellpadding="10" summary="">
					<tr><td>
						<a href="../action/return.html">
							<img id="lamp1" onmouseover="imgChange1('../images/tn_desklamp1.gif'); imgChange2('../images/tn_desklamp1.gif')" onmouseout="imgChange1('../images/desklamp2.gif'); imgChange2('../images/desklamp2.gif')" src="../images/desklamp2.gif" height="32" width="25" alt="Lamp turned off" border="0" name="lamp1"/>
						</a>
					</td><td>
						<a href="../action/return.html">
							<img id="lamp2" onmouseover="imgChange1('../images/tn_desklamp1.gif'); imgChange2('../images/tn_desklamp1.gif')" onmouseout="imgChange1('../images/desklamp2.gif'); imgChange2('../images/desklamp2.gif')" src="../images/desklamp2.gif" height="32" width="25" alt="Lamp turned off" border="0" name="lamp2"/>
						</a>
					</td></tr>
				</table>	
			</testCode>
      	<exResults>
				<list>
					<item>Both images swap with keyboard command</item>
				</list>
			</exResults>
			<sourcescript>
				function imgChange1( img ) 
				{
   				document.lamp1.src = img;
				}	
				function imgChange2( img ) 
				{
   				document.lamp2.src = img;
				}		
			</sourcescript>
		</test>
		
		<test section="2">
			<procedure>
				<list>
					<item>Using the keyboard or an assistive technology that emulates the keyboard, navigate to the image and activate both ONMOUSEOVER events.</item>
					<item>Using the keyboard or an assistive technology that emulates the keyboard, navigate off the image and activate both ONMOUSEOUT events.</item>					
				</list>
			</procedure>
			<testCode>
				<table border="1" cellpadding="10" summary="">
					<tr><td>	
						<img id="lamp3" onmouseover="imgChange3('../images/tn_desklamp1.gif'); imgChange4('../images/tn_desklamp1.gif')" onmouseout="imgChange3('../images/desklamp2.gif'); imgChange4('../images/desklamp2.gif')" src="../images/desklamp2.gif" height="32" width="25" alt="Lamp turned off" border="0" name="lamp3"/>
					</td><td>
						<img id="lamp4" onmouseover="imgChange3('../images/tn_desklamp1.gif'); imgChange4('../images/tn_desklamp1.gif')" onmouseout="imgChange3('../images/desklamp2.gif'); imgChange4('../images/desklamp2.gif')" src="../images/desklamp2.gif" height="32" width="25" alt="Lamp turned off" border="0" name="lamp4"/>
					</td></tr>
				</table>												
			</testCode>
      	<exResults>
				<list>
					<item>Both images swap with keyboard command</item>
				</list>
			</exResults>
			<sourcescript>
				function imgChange3( img ) 
				{
   				document.lamp3.src = img;
				}	
				function imgChange4( img ) 
				{
   				document.lamp4.src = img;
				}	
			</sourcescript>
		</test>		
		
		<test section="3">
			<procedure>
				<list>
					<item>Using the keyboard or an assistive technology that emulates the keyboard, navigate to the form element and activate both ONMOUSEOVER events.</item>
					<item>Using the keyboard or an assistive technology that emulates the keyboard, navigate off the form element and activate both ONMOUSEOUT events.</item>					
				</list>
			</procedure>
			<testCode>
				<form action="../action/return.html" method="get" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
					<input style="background-color: red; color: white; font-weight: bold;" type="button" value="Test Button" onmouseover="changeBackColor(this); changeTextColor(this)" onmouseout="changeBackColor(this); changeTextColor(this)" name="button1" id="button1"/> 
				</form>		
			</testCode>
      	<exResults>
				<list>
					<item>Button color changes from red to white with keyboard command</item>
					<item>Text value color changes from white to red with keyboard command</item>					
				</list>
			</exResults>
			<sourcescript>
				function changeBackColor() 
				{
					if (document.form1.button1.style.backgroundColor == "red")
					 	document.form1.button1.style.backgroundColor = "white"
					else
					 	document.form1.button1.style.backgroundColor = "red"
				}
				function changeTextColor() 
				{
					if (document.form1.button1.style.color == "white")
					 	document.form1.button1.style.color = "red"
					else
					 	document.form1.button1.style.color = "white"
				}							 	
			</sourcescript>
		</test>				
						
	</content>

</testsuite>