function troca(foto)
{
	foto = foto * 3;
	document.getElementById('destaque').src = colecao[foto];
	document.getElementById('destaque').width = colecao[foto+1];
	document.getElementById('destaque').height = colecao[foto+2];
}
//<|fnc:rotate_images;data:2005.10.27;autor:Leandro N. Camargo|>
function rotate_images(imgs, img_obj, delay, imgs_alt) // #criada: 2005-10-27
{
	if( !delay ) var delay = 3; // segundos
	if( imgs instanceof String ) imgs = [imgs];
	if( imgs_alt && imgs_alt instanceof String ) imgs_alt = [imgs_alt];
	if( !imgs instanceof Array || !img_obj ) return false;
	var apos = 0, t = imgs.length, fnc, timer = setTimeout( fnc = function() {
		if( imgs_alt ) img_obj.alt = imgs_alt[apos % t];
		img_obj.src = imgs[apos++ % t];
		timer = setTimeout( fnc, delay * 1000 );
	}, parseInt( delay * 1000 ) );
}
//<|@fnc:rotate_images|>
//<|fnc:addEvent;data:2005.11.30;autor:Peter Paul|>
function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}
//<|@fnc:addEvent|>
//<|fnc:removeEvent;data:2005.11.30;autor:Peter Paul|>
function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener)
		obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		if(obj[type+fn]) {
			obj.detachEvent( "on"+type, obj[type+fn] );
			obj[type+fn] = null;
			obj["e"+type+fn] = null;
		}
	}
}
//<|@fnc:removeEvent|>
//<|fnc:crossObj;data:2005.08.10;autor:Leandro N. Camargo|>
function crossObj(/*string ID [,stringId]+*/)
{
	var args = crossObj.arguments;
	var n_args = args.length;
	if(!n_args) return 0;
	
	if(n_args == 1)
	{
		if(document.getElementById) return document.getElementById(args[0]);
		else if(document.all) return document.all[args[0]];
		else return 0;
	}
	else
	{
		var objCollec = new Array(n_args);

		for(var i = 0; i < n_args; i++)
		{
			if(document.getElementById) objCollec[i] = document.getElementById(args[i]);
			else if(document.all) objCollec[i] = document.all[args[i]];
			else objCollec[i] = 0;
		}
	}
}
//<|fnc:array.concatRecursive;data:2005.09.24;autor:Leandro N. Camargo|>
Array.prototype.concatRecursive = function() {
	var a = [].slice.call( arguments , 0 );
	for( var i = 0; i < a.length; i++ )
		a[i] instanceof Array && ( a = a.slice( 0, i ).merge( a[i], a.slice( i-- + 1 ) ) );
	return this.merge(a);
}
//<|@fnc:array.concatRecursive|>
Array.prototype.merge = [].concat; // hack para um bug bizarro
//<|@fnc:crossObj|>
//<|obj:DataSlider;data:2005.08.08;autor:Jonas Raoni Soares Silva;site:jsfromhell.com|>
( DataSlider = function( onchange, interval, args ){ //v1.0
	var i = DataSlider.instances = DataSlider.instances || [], o = this;
	( o.c = 0, o.timer = null, o.interval = ( o.onchange = ( o.data = [].slice.call( arguments, 0 ) ).shift(), o.data.shift() ), i[o.index = i.length] = o );
} ).prototype = {
	stop: function(){ clearTimeout( this.timer ); },
	play: function(){ this.timer = setInterval( "DataSlider.instances[" + this.index + "].next()", this.interval ); },
	show: function( x ){ this.c = x; this.onchange( this.data[ x ] ); },
	previous: function(){ this.show( this.c > 0 ? --this.c : this.data.length-1 ); },
	next: function(){ this.show( ( this.c + 1 ) % this.data.length ); }
};
//<|@obj:DataSlider|>
( AutoRotate = function( fnc , interval, data_recursive, data )
{
	var s = this, a = [].slice.call( arguments, 0 ), fncs = AutoRotate.fncs = AutoRotate.fncs || [];
	fncs[s.ind = fncs.length] = s;
	var t = (s.data = data_recursive ? a.slice(3).subArray(1) : a.slice(3)).length;
	s.pos = 0; s.fnc = fnc; s.timer = null; s.interval = interval;
	s.data = s.data[0];
}).prototype = {
	rotate: function() {
		this.timer = setInterval( 'AutoRotate.fncs[' + this.ind + '].next()', this.interval );
	},
	next: function() {
		this.show((this.pos + 1) % this.data.length);
	},
	show: function( x ){
		this.pos = x; this.fnc( this.data[ x ] );
	}
};
//<|fnc:array.subArray;data:2005.12.06;autor:Leandro N. Camargo|>
Array.prototype.subArray = function( n ) {
	if( n < 0 || this.getDeepness() <= n ) return undefined;
	if( n === 0 ) return this;
	var r = [], t = this.length;
	
	for( var i1 = 0; i1 < t ; i1++ )
	{
		if( this[i1] instanceof Array ) r.push( this[i1].subArray( n - 1 ) );
	}
	return r;
}
Array.prototype.getDeepness = function() {
	var t = this.length, s, max = 1;

	for( ; t--; ) {
		s = 1;
		if( this[t] instanceof Array ) s += this[t].getDeepness();
		if( s > max ) max = s;
	}
	return max;
}
//<|@fnc:array.itens|>

