
var showcase_timer = false;
var showcase_index = 1;
var showcase_total = 3;

function showcase_init(){
	var t = document.getElementById('showcaseindex');
	if(t){
		var l = t.getElementsByTagName('div');
		showcase_index = l.length;
		showcase_total = l.length;
		for(var i = 0; i < l.length; i++){
			l.item(i).style.cursor = 'pointer';
			l.item(i).onmouseover = function() { showcase_over(this); };
			l.item(i).onmouseout = function() { showcase_out(this); };
			l.item(i).onclick = function() { showcase_click(this); };
			}
		var s = document.getElementById('showcase');
		s.onmouseover = function() { clearInterval(showcase_timer); showcase_timer = false; };
		s.onmouseout = function() { showcase_run(); };
		showcase_run();
		}
	}

set_onload(showcase_init);

function showcase_over(obj_tabref){
	var t = obj_tabref;
	var l = document.getElementById('showcaseindex').getElementsByTagName('div');
	for(var i = 0; i < l.length; i++){
		l.item(i).className = null;
		}
	t.className = 'active';
	clearInterval(showcase_timer);
	showcase_timer = false;
	var m = document.getElementById('showcase').getElementsByTagName('div');
	for(var i = 0; i < m.length; i++){
		document.getElementById("showitem" + (i + 1)).style.display = 'none';
		}
	document.getElementById("showitem" + obj_tabref.firstChild.nodeValue).style.display = 'block';
	}

function showcase_out(obj_tabref){
 	showcase_click(obj_tabref);
	var l = document.getElementById('showcaseindex').getElementsByTagName('div');
	for(var i = 0; i < l.length; i++){
		l.item(i).className = null;
		}
	l.item(showcase_index - 1).className = 'active';
	showcase_run();
	}

function showcase_click(obj_tabref){
	var l = document.getElementById('showcase').getElementsByTagName('div');
	for(var i = 0; i < l.length; i++){
		document.getElementById("showitem" + (i + 1)).style.display = 'none';
		}
	document.getElementById("showitem" + obj_tabref.firstChild.nodeValue).style.display = 'block';
	showcase_index = obj_tabref.id.match(/[1-9][0-9]*/);
	}

function showcase_auto(){
	var c = document.getElementById('showcaseindex').getElementsByTagName('div').item(showcase_index - 1);
	var cid = c.firstChild.nodeValue;
	var nid = showcase_index - 1;
	if(nid <= 0){
		nid = showcase_total;
		}
	showcase_out(document.getElementById('showcaseindex').getElementsByTagName('div').item((nid - 1)));
	}

function showcase_run(){
	if(showcase_timer === false){
		showcase_timer = setInterval('showcase_auto()', 5000);
		}
	}

