	var d=document;
	$ = function(id) {
		if(!arguments[1]) return document.getElementById(id);
		else document.getElementById(id).style[arguments[1]]=arguments[2];
	}
	
	function goURL(){
		if (Item[atual][4] == '_blank'){
			window.open(Item[atual][3]);
		} else {
			location.href=Item[atual][3];
		}
	}
	
	function startSlide(){ 
		loadImages();
		timeoutId=setTimeout('changeImg(1)',6000);
	}
	
	function initialize(){
		timeoutId=0;
		textareaContent=d.form_cr.select_cr.value.split(/[\r\n]/i);
		Item = new Array();
		for(x=0,y=0;x<textareaContent.length;x++){ 
			if(textareaContent[x].length>30) Item[y++]=textareaContent[x].split('|');
		}
		for(i=Item.length-1;i>=0;i--){
			Item[i][0]=Item[i][0].replace(/([ \n\t\r])+/, " ");
				//Item[i][4]=(Item[i][4].length<3) ? '' : '<img src="'+Item[i][4]+'" width="418" border="0" class="central"/>';
			if(Item[i][1].length<3||Item[i][3].length<3||Item[i][2].length<3||Item[i][0].length<2) delItem(Item,i);
		}
		if(Item.length==1) d.write('<style>#anterior,#proximo</style>');
		atual = Math.random().toString().substring(2,6) % Item.length;
	}
	
	function startPanel(){
		usaCredito = '';
		initialize();
		if(arguments.length>0){
			if(!isNaN(arguments[0])) atual = arguments[0];
		}
		d.write('<table id=banner-rotativo width="100%" border="0" cellspacing="0" cellpadding="0">');
		d.write('<tr><td width="100%" align="center" id="to-blend">'+usaCredito+'<a href="javascript:goURL()"><img src="'+Item[atual][1]+'" id="imgslide" name="img1" border="0" title="'+Item[atual][0]+'" alt="'+Item[atual][0]+'" width="221" /></a></td></tr>');
		d.write('<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0" id="prox-ant">');
		d.write('<tr><td width="22"><a href="javascript:void(0)" id="anterior" onclick="if(okToGo)changeImg(-1)"><img src="_img/rotativoBotao_esq.png" width="22" height="22" border="0" /></a></td>');
		d.write('<td bgcolor="#ea9494" align="center"><a href="?pag=galeria" style="color:#FFF; text-decoration:none; font-weight:bold;">Galeria de Fotos</a></td>');
		d.write('<td width="22"><a href="javascript:void(0)" id="proximo" onclick="if(okToGo)changeImg(1)"><img src="_img/rotativoBotao_dir.png" width="22" height="22" border="0" /></a></td></tr>');
		d.write('</table></td></tr>');
		d.write('<tr><td width="100%" height="25"><div id="central_txt"><font color="#CC0000"><span id="titulo1">'+Item[atual][0]+'</span></font><br><a href="javascript:goURL()" id="p-link"><span id="txt1">'+Item[atual][2]+'</span></a></td></tr>');
		d.write('</table>');
				
	}
	
	var okToGo=false;
	
	onload=startSlide;