// Cargar comparativa en flex
function compararFlex(formName,idUrl2,slValorName,slIndiceName){

	var formu = document.forms[formName];
	var url = formu.elements[idUrl2].value;
	
	if (formu.elements[slValorName].value == '') {

		var arr = formu.elements[slIndiceName].value.split(':');
		var indice = arr[1]+":"+ arr[2]+":"+ arr[3]+":"+ arr[4];
		
		url += indice;
	}
	else {
		url += formu.elements[slValorName].value;
	}
	
	graficas['objHist1'].compara(url);
}

// Cargar historica en flex
function resetFlex(formName,slVisualName,slValorName,slIndiceName,indiceReset,chkNoticias,chkRatings){

	var formu = document.forms[formName];

	formu.elements[chkNoticias].checked = 1;
	formu.elements[chkRatings].checked = 1;
	
	//selecciono la visualizacion por defecto
	formu.elements[slVisualName].selectedIndex = 1;

	//selecciono el valor por defecto
	formu.elements[slValorName].selectedIndex = 0;

	//selecciono el indice opr defecto: indiceReset
	var slIndices = formu.elements[slIndiceName];;
	for (var i = 0; i < slIndices.options.length; i++) {
		if (slIndices.options[i].value == indiceReset) {
			break;
		}
	}
	formu.elements[slIndiceName].selectedIndex = i;
	
	graficas['objHist1'].reset();
}

// añadir indicador a flex historica
function nuevoIndicador(formName, slIndicadorName){

	var formu = document.forms[formName];
	
	graficas['objInd1'].addindicator(formu.elements[slIndicadorName].value,'100');
	
	formu.elements[slIndicadorName].selectedIndex = 0;
}

