var programaRuta	='http://www.inictel-uni.edu.pe/modulos/EVENTSYS/iu/programa/';
var registroRuta	='http://www.inictel-uni.edu.pe/modulos/EVENTSYS/iu/registro/';
var bannerRuta		='http://www.inictel-uni.edu.pe/modulos/banner/';

var bannerList		=['banner01.php'];
var programaList	=['programa_tv3d.html'];
var registroList	=['iu_registro.php','iu_registro2.php'];

var bannerIndex	= 0;
var bannerSize	= bannerList.length;

function animacionBanner(elemento){
	window.setTimeout(function(){  									   
			Ext.get('idBodyBanner').fadeOut();  
			bannerIndex++;
			if(bannerIndex==bannerSize) bannerIndex=0;
			Ext.get('idBodyBanner').fadeIn();
			elemento.load(bannerRuta+bannerList[bannerIndex]);
			
			
				
			
			animacionBanner(elemento);
	},10000);
}
function verRegistroEnlace(ruta,query){
	window.open(ruta+'?'+query,"_blank");
}
function verProgramaEnlace(ruta,query){
	window.open(ruta+'?'+query,"_blank");
}
function verRegistroEvento(){
	 var winEvent = new Ext.Window({  
          id	 : 'idRegistroEvento',
          title: 'INICTEL-UNI', //the title of the window  
          width: 565,  
		  height:545,
		  border:false,
		  modal: true,
		  resizable : false,
		  bodyStyle: 'background-color: white; z-index:10',
		  html:'<iframe id="container" src="'+registroRuta+registroList[bannerIndex]+'" style="width:100%;height:100%;border:none;z-index:10;"> </iframe>'
	}); 
	winEvent.show();
}
function verProgramaEvento(){
		var winProg = new Ext.Window({  
			id	 : 'idProgramaEvento',
			title: 'INICTEL-UNI', //the title of the window  
			width: 565,  
			height:545,
			border:false,
			modal: true,
			resizable : false,
	  	    bodyStyle: 'background-color: #4C4C4C; z-index:10',
			html:'<iframe id="container" src="'+programaRuta+programaList[bannerIndex]+'" style="width:100%;height:100%;border:none;z-index:10;"> </iframe>'
		});  
		winProg.show();		
}
Ext.namespace('inictel_uni.portal.panel');
Ext.BLANK_IMAGE_URL = '/extjs/resources/images/default/s.gif';
inictel_uni.portal.panel.banner={
	init : function(){
		/************************************************/
		var panBodyBanner= new Ext.Panel({
				id : "idBodyBanner",
				height:135,
				autoWidth: true,								
				collapsible : true,
				title:'INICTEL-UNI',
				renderTo: 'idBanner',
				hideBorders : false,
				border:false,
				bodyBorder:false,
				bodyStyle: 'background-color:#4C4C4C'
		});
		panBodyBanner.load(bannerRuta+bannerList[bannerIndex]); 
		animacionBanner(panBodyBanner);		
	}
}
Ext.onReady(inictel_uni.portal.panel.banner.init, inictel_uni.portal.panel.banner);
