//jQuery(window).load(function(){
var don = false;
function gosteam() {
/*
 *    Animate stoom / rook
 */

    var createSteam = function createSteam() {
        "use strict";
			var IE = '\v'=='v';
			if (IE) {
				return(0);
			}
    
        var i = 0;
        for (; i < 3; i += 1) {
        setTimeout((function (idx) {
            return function addSmoke () {
            var time = 8500,
                smoke = jQuery('<div />', {
                "class": 'smoke smoke' + (idx + 1),
                css: {
                    opacity: 0
                }
            });
            
            // add to steam container
            jQuery(smoke).appendTo('.steam');
    
            // animate
            jQuery.when(
              // animate to 100% opacity in half the time (fade in)
              jQuery(smoke).animate({
                opacity: 0.3
              }, {
                duration: time * 0.2,
                easing: 'linear',
                queue: false,
                
                // animate to 0% opacity in the remaining time (fade out)
                complete: function () {
                  jQuery(smoke).animate({
                    opacity: 0
                  }, {
                    duration: time * 0.8,
                    easing: 'linear',
                    queue: false
                  });
                }
              }),
    
              // animate movement
              jQuery(smoke).animate({
                bottom: jQuery('.steam').height()
              }, {
                duration: time,
                easing: 'linear',
                queue: false
              })
    
            // when all down, remove and add new random smoke
            ).then(function () {
              jQuery(smoke).remove();
              //addSmoke();
            });
          };
          
        }(i % 3)), i * 2500);
      }
    }
    jQuery( createSteam );
//});
}

