
YAHOO.example.init = function() {
	var thumbs = [
				  "thumb-mdl",
				  "thumb-fun",
				  "thumb-pone",
				  "thumb-plos",
				  "thumb-taxi",
				  "thumb-luxe",
				  "thumb-inaction",
				  "thumb-fostered",
				  "thumb-medicine",
				  "thumb-frowny",	
				  "thumb-pw",
				  "thumb-add",
				  "thumb-album"
				  ];
	for (thumbId in thumbs)
		 {
			var myTabs = new YAHOO.widget.TabView(thumbs[thumbId]);
			myTabs.contentTransition = function(newTab, oldTab) {
				if ( newTab.anim && newTab.anim.isAnimated() ) {
					newTab.anim.stop(true);
				}
				
				newTab.set('contentVisible', true);
				YAHOO.util.Dom.setStyle(newTab.get('contentEl'), 'opacity', 0);
				
				newTab.anim = newTab.anim || new YAHOO.util.Anim( newTab.get('contentEl') );
				newTab.anim.attributes.opacity = { to: 1 };
				
				var hideContent = function() {
					oldTab.set('contentVisible', false);
					oldTab.anim.onComplete.unsubscribe(hideContent);
				};
				
				oldTab.anim = oldTab.anim || new YAHOO.util.Anim( oldTab.get('contentEl') );
				oldTab.anim.onComplete.subscribe(hideContent, this, true);
				oldTab.anim.attributes.opacity = { to: 0 };
				
				newTab.anim.animate();
				oldTab.anim.animate();
			}
		 }

};
YAHOO.example.init();