<?xml version="1.0" encoding = "utf-8"?>
<snippet xmlns:MMString="http://www.macromedia.com/schemes/dat/string/" MMString:name="Snippets/JavaScript/images/randomImage_csn/snippet/name/Random" MMString:description="Snippets/JavaScript/images/randomImage_csn/snippet/description/Displays" preview="code" type="block">

<insertText location="beforeSelection">
<![CDATA[// Example:
// randomImage(['0.gif',50,50,'1.gif',25,25,'2.gif',50,25]); 

// * Dependencies * 
// this function requires the following snippet:
// JavaScript/Randomizers/randomNumber

function randomImage(imgArr)
{
  var imgSrc, imgW, imgH, r;
  r = randomNumber(imgArr.length / 3)-1;
  
  imgSrc = imgArr[r * 3];
  imgW = imgArr[(r * 3)+1];
  imgH = imgArr[(r * 3)+2];

  document.write('<IMG SRC='+imgSrc+' WIDTH='+imgW+' HEIGHT='+imgH+'>');
}
]]>
</insertText>
<insertText location="afterSelection"><![CDATA[]]>
</insertText>
</snippet>
