

// config viewers
YAHOO.photoViewer.config = {
	viewers: {
		"showcase" : {
			properties: {
				id: "showcase",
				grow: 0.1,
				fade: 0.2,
				modal: false,
				dragable: false,
				fixedcenter: false,
				loadFrom: "html",
				position: "relative",
				container:"showcase",
				xy: [0,0],
				easing: YAHOO.util.Easing.easeBothStrong
			}
		}
	}
};
YAHOO.photoViewer.example = function(){
	var controls = null;
	var slideshowtimeout = null;
	var cnt = 0;
	var public = {
		init: function(){
			controls = lib.d.get("controls").getElementsByTagName("a");
			lib.d.addClass(controls[0], "active");
			this.startTimeout();
		},
		page: function(p, el){
			if (p >= controls.length) { p = 0; }
			YAHOO.photoViewer.controller.getViewer('showcase').open(p);
			inactive(el);
			lib.d.addClass(el, "active");
			cnt = p;
			clearInterval(slideshowtimeout);
		},
		startTimeout: function(){
			if (slideshowtimeout){ clearInterval(slideshowtimeout); }
			this.page(cnt, controls[cnt]);
			cnt++;
			if (cnt >= controls.length) { cnt = 0; }
			slideshowtimeout = setInterval("$.startTimeout()", 8000);
		}
	};
	function inactive(el){
		for (var a = 0; a < el.parentNode.childNodes.length; a++){
			lib.d.removeClass(el.parentNode.childNodes[a], "active");
		}
	};
	return public;
}();
lib.e.onDOMReady(YAHOO.photoViewer.example.init, YAHOO.photoViewer.example, YAHOO.photoViewer.example);
// shortcut
var $ = YAHOO.photoViewer.example;

