function carga_seccion(id, enlace){
	if (enlace.length>0){
		window.open(enlace);	
	}
	self.location="./index.php?seccion="+id;
}
function carga_contenido(seccion, contenido){
	self.location="./index.php?seccion="+seccion+"&contenido="+contenido;
}
function marca(id){
	obj=document.getElementById("td_"+id);
	obj.background="images/textura_boton_fondo3.gif";
}
function desmarca(id){
	obj=document.getElementById("td_"+id);
	obj.background="images/textura_boton_fondo2.gif";
}
function creditos(){
	window.open("creditos.php", "creditos", "width=243, height=203, scrollbars=0");
}

function draw_flash(name, swf, width, height, bgcolor, wmode){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+width+"\" height=\""+height+"\" id=\""+name+"\" name=\""+name+"\" align=\"middle\">");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\""+swf+"\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	if (wmode != undefined){
		document.write("<param name=\"wmode\" value=\""+wmode+"\" />");
	}
	document.write("<param name=\"bgcolor\" value=\""+bgcolor+"\" />");
	document.write("<embed src=\""+swf+"\" quality=\"high\" bgcolor=\""+bgcolor+"\" width=\""+width+"\" height=\""+height+"\" name=\""+name+"\" id=\""+name+"\" wmode=\"opaque\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}

function number_format (number, decimals, dec_point, thousands_sep){
	var exponent = "";
	var numberstr = number.toString ();
	var eindex = numberstr.indexOf ("e");
	if (eindex > -1){
		exponent = numberstr.substring (eindex);
		number = parseFloat (numberstr.substring (0, eindex));
	}
	
	if (decimals != null){
		var temp = Math.pow (10, decimals);
		number = Math.round (number * temp) / temp;
	}
	var sign = number < 0 ? "-" : "";
	var integer = (number > 0 ?  Math.floor (number) : Math.abs (Math.ceil (number))).toString ();
	
	var fractional = number.toString ().substring (integer.length + sign.length);
	dec_point = dec_point != null ? dec_point : ".";
	fractional = decimals != null && decimals > 0 || fractional.length > 1 ? 
			   (dec_point + fractional.substring (1)) : "";
	if (decimals != null && decimals > 0){
	for (i = fractional.length - 1, z = decimals; i < z; ++i)
		fractional += "0";
	}
	
	thousands_sep = (thousands_sep != dec_point || fractional.length == 0) ? 
				  thousands_sep : null;
	if (thousands_sep != null && thousands_sep != ""){
		for (i = integer.length - 3; i > 0; i -= 3)
			integer = integer.substring (0 , i) + thousands_sep + integer.substring (i);
	}
	
	return sign + integer + fractional + exponent;
}