function situateObj(id,x,y)		{
	//	 Resitua un objecto en el lugar deseado de la pantalla  
	var obj = document.getElementById(id);
	obj.style.position='absolute';
	obj.style.left=x+'px';
	obj.style.top=y+'px';
}

function radio_button_checker(radio_button)	{
	//		Busca la selección de un radio button pasándole la dirección HTML para acceder a él 
	var value='';
	var varLength = eval(radio_button+'.length');
	var varChecked = false;
	for (i = 0; i < varLength; i++)		{
		varChecked = eval(radio_button+'['+i+'].checked')
		if (varChecked){	value = eval(radio_button+'['+i+'].value'); 		}
	}	
	return value;
}

function writeObj(text,id)		{
	//		Reescribe un objecto, preferiblemente DIV, con texto cualquiera (incluso HTML)
	if (document.getElementById)	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}	else if (document.all)			{
		x = document.all[id];
		x.innerHTML = text;
	}	else if (document.layers)		{
		x = document.layers[id];
		text2 = '<P CLASS="testclass">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}


function changeVisibility(who,action) {
	var oWho;
	if (!document.getElementById|document.all) {
		return;
	} else {
		if (document.getElementById){ 
			oWho = eval ("document.getElementById('" + who + "')");
		} else { 
			oWho = eval ("document.all." + who);
		}
	}
	window.focus();
	if (action == 'show'){
		oWho.style.display="";
	} else if (action == 'hide'){
		oWho.style.display="none";
	}
}

function getTextFromArray(idArray,idPos){
	if (typeof(idArray[idPos]) != "undefined"){
		return idArray[idPos];
	} else {
		return '&#160;';
	}
}

//funcion compatible para generar una opcion de un combo
function generaOpcionComboObj2(txt,value,pos,object) {
	oOption = document.createElement("OPTION");
	oOption.text = txt;
	oOption.value = value;
	//asi se puede acceder al browser que sea	
	object.options[pos] = oOption;
}

function generateCombo2(arrayContent,obj,selectedValue){
	alert('generamos combo2');
	/*Espera una estructura como la siguiente Array de  [ [texto,valor],...  */
	var posCombo = 0;
	var value = '';
	var txt ='';
	var posSelected = 0;
	obj.options.length = 0;	//borramos contenido
	for (z in arrayContent){
		txt = arrayContent[z][0];
		value = arrayContent[z][1];
		generaOpcionComboObj2(txt,value,posCombo,obj);
		//opcion preseleccionada 
		if (value == selectedValue) posSelected = posCombo;
		posCombo++;
	}
	obj.options[posSelected].selected=true;
}


function IsNumeric(sText) {
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) { 
	  Char = sText.charAt(i);
	  if (ValidChars.indexOf(Char) == -1) IsNumber = false;
	  }
	return IsNumber;
}

function writeFlash(DivID, CLSID,CODEID, ObjectID,WIDTH, HEIGHT, URL, AUTOSTART){
	var d		= document.getElementById(DivID);
	d.innerHTML = '<object classid=' + CLSID + ' codebase=' + CODEID + 'id=' + ObjectID +  ' width=' + WIDTH + ' height=' + HEIGHT 
				+'><param name="SRC" value=' + URL + '><param name="URL" value=' + URL 
				+ '><param name="autoStart" value=' + AUTOSTART + '/>';
	
}