/***************************************************************************
*	Criado em:		07/08/2007			Por: ANDRÉ LUIZ
****************************************************************************/

// dispara função após carregar a página
window.onload 		= function() {
	i				= 0;	// contador das imgs (índice)
	slideShow();
}

/***************************************************************************
**************	ESSA FUNÇÃO FOI REPLICADA DO PROJETO [ ICONE ]	************
****************************************************************************/
function slideShow(){
	if (!document.images.slide || !document.getElementById("imagemVC")) return;	// verifica se os dados necessários existem
	
	var im_slide				= document.images.slide.src;
	ar_img						= document.getElementById("imagemVC").value.split(",");	// Recupera nome das imagens e monta uma array
	if(ar_img[i].length>0){
		document.getElementById('slide').style.display='block';
		document.images.slide.src	= 'imagens/produtos/slideshow/'+ar_img[i]; 	// atualiza o indice do link da 1ª imagem
	}
	// insere próxima imagem [aqui fica o endereço das imagens]
	it_lk						= i;													
	 
	// verifica se chegou no fim das imagens p/ zerar o contador
	if (i < ar_img.length - 1) 
		i++;
	else
		i						= 0;
		
	setTimeout("slideShow()",3000);														// muda a foto a cada 3 segundos
}


function popUp(W, H, it_zIndex, vc_titulo, vc_url) {
	var it_zIndex	= (it_zIndex) ? parseInt(it_zIndex) : 0;
	var W			= (W) ? parseInt(W) : 0;
	var H			= (H) ? parseInt(H) : 0;
	var vc_titulo	= (vc_titulo) ? new String(vc_titulo) : new String('PopUp');

	var win			= new Window({className:"alphacube", width:W, height:H, zIndex:it_zIndex, resizable:false, title:vc_titulo,  draggable:true, maximizable:false, wiredDrag:true, url:vc_url, destroyOnClose:true, showEffect:Effect.SlideDown, hideEffect: Effect.SlideUp, fps:40, duration:12});
	win.showCenter(true);
	win.refresh(this);
}


