/*******************************
 * Info:
 *   Written by: Brandon Nimon
 *   Created: 5/24/2011
 *   Version 1.0 (5/24/2011)
 *   Compatible with IE5+, Firefox 0.9+, Safari, Opera 9+, and Chrome
 *******************************
 * License:
 *   Free to use and modify for non-commercial use. For commercial use: $10. Email me (brandonnimon AT comcast DOT net) for payment information.  
 *   No matter what, you must keep the Info and License comment areas to cite that I wrote it.
 *   Minified and non-minified versions available apon request. 
 *******************************/
function mt_rand(a,b){return Math.floor(Math.random()*(b-a+1))+a}function increase_trans(a,b,c){if(trans==0){document.getElementById(a).style.opacity=0;document.getElementById(a).style.filter="alpha(opacity=0)";document.getElementById(a).src=c}trans+=trans_amount;if(trans>100){trans=100}document.getElementById(a).style.opacity=trans/100;document.getElementById(a).style.filter="alpha(opacity="+trans+")";if(trans>=100){trans=0;document.getElementById(b).src=c}else{tmout=setTimeout(function(){increase_trans(a,b,c)},trans_pause)}}function prevImage(a,b,c){if(c){stopSlide(a,b)}if(--imgidx<0){imgidx=pre_load_ar.length-1}prev_img=pre_load_ar[imgidx].src;tmout=setTimeout(function(){increase_trans(a,b,pre_load_ar[imgidx].src)},1)}function nextImage(a,b,c){if(c){stopSlide(a,b)}if(++imgidx>=pre_load_ar.length){imgidx=0}prev_img=pre_load_ar[imgidx].src;tmout=setTimeout(function(){increase_trans(a,b,pre_load_ar[imgidx].src)},1)}function randomImage(a,b,c){if(c){stopSlide(a,b)}if(pre_load_ar.length-1!=0){var d;var e=mt_rand(0,pre_load_ar.length-1);while(prev_img==(d=pre_load_ar[e].src)&&prev_img!=undefined){e=mt_rand(0,pre_load_ar.length-1)}imgidx=e;prev_img=d;tmout=setTimeout(function(){increase_trans(a,b,d)},1)}}function setImage(a,b,c){stopSlide(a,b);prev_img=c;tmout=setTimeout(function(){increase_trans(a,b,c)},1)}function stopSlide(a,b){clearInterval(run);clearTimeout(tmout);if(trans>50){document.getElementById(b).src=prev_img}trans=0;document.getElementById(a).style.opacity=0;document.getElementById(a).style.filter="alpha(opacity=0)"}function startRandomSlideShow(a,b,c){clearInterval(run);clearTimeout(tmout);trans=0;run=setInterval(function(){randomImage(a,b,false)},c)}function startSlideShow(a,b,c){clearInterval(run);clearTimeout(tmout);trans=0;run=setInterval(function(){nextImage(a,b,false)},c)}function trans_init(a,b,c,d){trans_amount=d;prev_img=c;for(i=0;i<a.length;i++){pre_load_ar[i]=new Image;pre_load_ar[i].src=a[i]}if(b>=0&&b<pre_load_ar.length-1){imgidx=b}else{imgidx=0}}var trans_pause=30;var trans=0;var run;var tmout;var trans_amount;var prev_img;var imgidx;var pre_load_ar=new Array
