(function ($){
	var $this = null;
	var $shown = null;
	var $options = {};

	observe = function(){
		$this.find(".item").each(function(i, obj){
			if(i > 0){ $(this).hide(); }
		});

		$this.find(".navigation a").each(function(i, obj){
			if($(obj).attr("href").length < 2){
				$(obj).css({ "cursor": "default" });
			}
			/*$(obj).click(function(){
				if($(this).attr("href").length < 2){
					return false;
				}
			});*/


			$(obj).delay(1000).hover(function(){
				// mousein
				$($this.find(".item-active"))
					.show()
					.css("zIndex", "")
					.removeClass("item-active")
					.fadeOut(500);
				$($this.find(".item")[i+1])
					.hide()
					.css("zIndex", 10)
					.addClass("item-active")
					.fadeIn(500);
			},function(){
				// mouseout
				$($this.find(".item-active"))
					.show()
					.css("zIndex", "")
					.removeClass("item-active")
					.fadeOut(500);
			});




			/*$(obj).mouseover(function(){
				//$this.find(".navigation a").each(function(i, obj){
					//$(this).removeClass("on");
				//});
				//$(this).addClass("on");

					//show($($this.find(".item")[i+1]));

				return false;
			});
			$(obj).mouseout(function(){
				//$this.find(".navigation a").each(function(i, obj){
					//$(this).removeClass("on");
				//});

				return false;
			});*/
		});
	};

	$.fn.teaser = function(options){
		$this = $(this);
		$options = $.extend({}, $.fn.teaser.defaults, options);
		observe();
	};

	$.fn.teaser.defaults = {};
}(jQuery));

$(document).ready(function(){  
	$(".tx-rmteaser-pi1").teaser();
});  
