	hs.graphicsDir = 'highslide/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.outlineType = 'rounded-white';
	hs.fadeInOut = true;
	hs.numberPosition = 'caption';
	hs.dimmingOpacity = 0.75;

	// Add the controlbar
	if (hs.addSlideshow) hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .75,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	});
	

var link = new Array()
var texto = new Array()
var hora = new Array()

			link[0]	 = "contato.asp"

			texto[0] = "0800 17 18 38"

			hora[0] = "&nbsp;"



			//link[1]	 = "http//www.google.com"

			//texto[1] = "Google1"

			//hora[1] = "11:49"
			
			
var step_time = 40 ; //tempo entre a escrita das letras
var step = true ; //flag do step time
var freeze_time = 3000 ; //tempo para troca do texto
var indice_qt_texto = 0 ; //indice da qt de textos disponiveis
var texto_qt = texto.length - 1 ; //qt de textos disponiveis para rolagem
var fim = texto[indice_qt_texto].length ; //fim do texto corrente
var indice_texto = 0 ; //indice do texto corrente
var limite = 55 // limite do tamanho do texto
f = false

//executamos duas vezes para adequar o tamanho da frase com os ...
for (i=0;i<=texto.length - 1;i++)
{	
	texto[i] = texto[i].replace(/\&quot;/gi,'"');
	fim = texto[i].length;
	if (fim > limite)
	{
	fim = limite	
	texto[i]=texto[i].substring(0,limite);		texto[i]=texto[i].substring(0,texto[i].lastIndexOf(' ')) + '...';
	texto[i]=texto[i].substring(0,limite);
	texto[i]=texto[i].substring(0,texto[i].lastIndexOf(' ')) + '...';
	}
}
fim = texto[indice_qt_texto].length;
//funcao responsavel por limpar os textos anteriores e continuar a escrita
function time()
{	
	step = true ;
	child = document.getElementById('plantao_txt').lastChild ;
	document.getElementById('plantao_txt').removeChild( child ) ;	
	plantao() ;
}

//funcao responsavel por escrever o texto do plantao
function plantao()
{
	// atribui valor ao link corrente
	document.getElementById('plantao_link').setAttribute( "href" , link[indice_qt_texto]);	
	document.getElementById('plantao_hora').innerHTML = hora[indice_qt_texto] ;
	// escreve o texto apresentado letra a letra no objeto TextNode
	if (indice_texto == fim)		
	{
		str = document.createTextNode( texto[indice_qt_texto].substring(0, indice_texto) );
		f = true
	}
	else
		str = document.createTextNode( texto[indice_qt_texto].substring(0, indice_texto) + '|' );
	//acrescenta TextNode ao div
	document.getElementById('plantao_txt').appendChild( str ) ;
	indice_texto ++ ;
	//controle do final de um texto
	if (f)
	{			
		f = false
		//reinica indice do texto corrente
		indice_texto = 0 ;
		//passa para o proximo texto
		indice_qt_texto ++ ;
		//caso textos tenham acabado, reinicie
		if (indice_qt_texto > texto_qt)
			indice_qt_texto = 0 ;
		//recalcula o final do texto corrente
		fim = texto[indice_qt_texto].length	;				
		window.setTimeout( 'time()' , freeze_time ) ;
		step = false ;
	}
	if (step)
		window.setTimeout( 'time()' , step_time ) ;		
}
