	/***********************************************
	* MultiFrame Image/Flash Slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
	***********************************************/
	
	//Função que ordena o array randômicamente
	seqslides.sort(randOrd);
	
	//Set pause between each image display (2000=2 second):
	var slidedelay = 10000;
	var inteval = 1;
	
	//Set how many images to show at once (must be less than total # of images above):
	var slidestoreveal = 1;
	
	//Specify code to insert between each slide (ie: "<br>" to insert a line break and create a vertical layout)
	//"" for none (or horizontal):
	var slideseparater = "<br/>";
	
	//Set image border width:
	var imgborderwidth = 0;
	
	//Set opacity value of each image when it's "dimmed", and when it's not, respectively (1=100% opaque/normal).
	//Change 0.2 to 0 to completely hide image when it's dimmed:
	var opacityvalues = [0.2,1];
	

function processcode(objslide){
	var html = '';
	
	document.getElementById('fecharDHTML').style.display = 'none';
	if(objslide[2] == 'flash'){
		html = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+objslide[3]+'" height="'+objslide[4]+'">';
		html += '<param name="movie" value="'+objslide[0]+'?'+objslide[1]+'">';
		html += '<param name="quality" value="high">';
		html += '<param name="wmode" value="transparent">';
		html += '<embed src="'+objslide[0]+'?'+objslide[1]+'" width="'+objslide[3]+'" height="'+objslide[4]+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>';
		html += '</object>';
	} else {//default: imagem
		posicionaFechar(objslide[3], objslide[4]);
		if (objslide[1] != '')
			html = '<a href="'+objslide[1]+'" target="'+objslide[6]+'">';
		html += '<img src="'+objslide[0]+'" border="'+imgborderwidth+'" style="filter:alpha(opacity='+(opacityvalues[0]*100)+');-moz-opacity:'+opacityvalues[0]+'">';
		if (objslide[1] != '')
			html += '</a>';
	}
	centralizaDHTML(objslide[3], objslide[4]);
	if(seqslides.length > 1){
		window.clearInterval(inteval);
		if(!isNaN(objslide[5]) && parseInt(objslide[5]) > 0){
			//alert('='+objslide[5]);
			inteval = self.setInterval("displayit()", parseInt(objslide[5])*1000);
		}else{
			inteval = self.setInterval("displayit()", slidedelay);
		}
	}
	
	return html;
}
	
	var curslide = 1; //var to track current slide (total: slidestoreveal)
	var curindex = 0; //var to track current image (total: seqslides.length)
	var isfirstcycle = 1; //boolean to indicate whether this is the first cycle
	if (document.getElementById){
		for (i = 0; i < slidestoreveal; i++)
			document.write('<span id="seqslide'+i+'" class="seqslidestyle">'+processcode(seqslides[i])+'</span>'+slideseparater);
		curindex = slidestoreveal;
		illuminateslide(0, opacityvalues[1]);
	}
	
function illuminateslide(slideindex, amt){
	var slideobj = document.getElementById("seqslide"+slideindex).getElementsByTagName("IMG")[0];
	if(slideobj != undefined || slideobj != null)
	{
		if (slideobj.filters)
			slideobj.filters.alpha.opacity = amt*100;
		else if (slideobj.style.MozOpacity)
			slideobj.style.MozOpacity = amt;
	}
}
	
function displayit(){
	if (curslide < slidestoreveal){
		if (!isfirstcycle)
			changeslide(curslide);
		illuminateslide(curslide, opacityvalues[1]);
		curslide++;
	}
	else{
		isfirstcycle = 0;
		for (i = 0; i < slidestoreveal; i++)
			illuminateslide(i, opacityvalues[0]);
		changeslide(0);
		illuminateslide(0, opacityvalues[1]);
		curslide = 1;
	}
}
	
function changeslide(slideindex){
	document.getElementById("seqslide"+slideindex).innerHTML = processcode(seqslides[curindex]);
	curindex++;//alert(seqslides.sort(randOrd));
	if (curindex >= seqslides.length)
		curindex = 0;
}
	
function randOrd() {
	return (Math.round(Math.random())-0.5);
}
	/*if (document.getElementById){alert('ini');
		var inteval = self.setInterval("displayit()", slidedelay);}*/
