//es una bandera que me indica si estoy en la seccion de resumen o no
var banResumen=false;

function updateCarrerasHtml(calendarid, strGlobalURLWebservices, strGlobalURLProyectoLocal){
	var aleatorio = Math.round(Math.random()*10000);
	var strUrl = '/modules/ws/geturlajax.php?wsUrl=http://'+strGlobalURLWebservices+'/upload/htmls/'+strGlobalURLProyectoLocal+'/campeonato_'+calendarid+'_'+$("idCategoria").value+'.htm?ale='+aleatorio;
	AppObj.Ajax.updaterAjax(strUrl,"divCampeonato");		
}

function updatePlayOffHtml(calendarid, strGlobalURLWebservices, strGlobalURLProyectoLocal){
	var aleatorio = Math.round(Math.random()*10000);
	var strUrl = '/modules/ws/geturlajax.php?wsUrl=http://'+strGlobalURLWebservices+'/upload/htmls/'+strGlobalURLProyectoLocal+'/playoff_center_'+calendarid+'_'+$("idCategoria").value+'.htm?ale='+aleatorio;
	AppObj.Ajax.updaterAjax(strUrl,"divCampeonato");		
}

function changeCatego(catego_id, calendarid, strGlobalURLWebservices, strGlobalURLProyectoLocal){
	var aleatorio = Math.round(Math.random()*10000);
	var strUrl = '/modules/ws/geturlajax.php?wsUrl=http://'+strGlobalURLWebservices+'/upload/htmls/'+strGlobalURLProyectoLocal+'/campeonato_'+calendarid+'_'+catego_id+'.htm?ale='+aleatorio;
	AppObj.Ajax.updaterAjax( strUrl,"divCampeonato");			
}

function changeCategoPlayOff(catego_id, calendarid, strGlobalURLWebservices, strGlobalURLProyectoLocal){
	var aleatorio = Math.round(Math.random()*10000);
	var strUrl = '/modules/ws/geturlajax.php?wsUrl=http://'+strGlobalURLWebservices+'/upload/htmls/'+strGlobalURLProyectoLocal+'/playoff_center_'+calendarid+'_'+catego_id+'.htm?ale='+aleatorio;
	AppObj.Ajax.updaterAjax( strUrl,"divCampeonato");			
}

function selpiloto(idpiloto){
	var objHighlight = $V(idpiloto).toQueryParams();
	var intFirstDriver = '';
	if(idpiloto.value!=""){
		var elementos=$$('tr.bg-b');		
		elementos.each(function(ele){ 
 			var objCurrentDriver = ele.id.toQueryParams();
 			if (objCurrentDriver.team == objHighlight.team || objHighlight.driver == objCurrentDriver.driver) {
				if (intFirstDriver=='') intFirstDriver =  objHighlight.driver;
				ele.setStyle({ backgroundColor: '#CCCCCC'}) ;
			} else {
				ele.setStyle({ backgroundColor: '#FFFFFF'}) ;
			}
		});
		Effect.ScrollTo('ancla_' + intFirstDriver);				
	}
}

function chgListChampionship ( value , strGlobalURLWebservices, strGlobalURLProyectoLocal, intAno) {
	var aleatorio = Math.round(Math.random()*10000);
	if(value==1) {
		strUrl = '/upload/htmls/'+strGlobalURLProyectoLocal+'/campeonato_resumen_anual_'+intAno+'_'+$("idCategoria").value+'.htm?ale='+aleatorio;
		window.open(strUrl);
	} else {
		var strUrl = '/modules/ws/geturlajax.php?wsUrl=http://'+strGlobalURLWebservices+'/upload/htmls/'+strGlobalURLProyectoLocal+'/campeonato_resumen_anual_'+intAno+'_'+$("idCategoria").value+'.htm?ale='+aleatorio;
		AppObj.Ajax.updaterAjax( strUrl,"calendario");						
		banResumen=false;		
	}
}
