jQuery.fn.WG_Img_Cycle = function(var_type,var_random,var_timeout,var_speed) {
  // 'this' is a jQuery object at this point - with all the jQuery functions

  return this.each(function() {
  	// return so we don't break the chain
    // now we are inside of a jQuery function, the DOM element is the context
    // so 'this' has changed to become a DOM element.

    html_elem = this;
	if(($(html_elem)).is('*'))
	{

			if($(html_elem).find("img").length>1)
			{

				$(html_elem).html($(html_elem).find("img").clone());
				$.fn.cycle.defaults.speed   = var_speed;
				$.fn.cycle.defaults.timeout = var_timeout;
				$.fn.cycle.defaults.random = var_random;
				$(html_elem).cycle(var_type);
			}
	}
  });
};


//	<script type="text/javascript">
//	    $(document).ready(function() {
//			$('div.moodbar').WG_Img_Cycle("fade",<$OPTION type=design id="Images Rotator; Random (0 = not random, 1 = random)" designtype="text" default="3000" langdep="no" $>,<$OPTION type=design id="Images Rotator; Transition speed. Higher is slower transition)" designtype="text" default="1500" langdep="no" $>, <$OPTION type=design id="Images Rotator; Timeout (in milliseconds, 2000 = 2 seconds)" designtype="text" default="3000" langdep="no" $>);
//	    });
//	</script>
