

$(function(){

				$(".idiomas ul li:eq(0), .idiomas ul li:eq(1)").click(function(){
					//alert($(this).text());
					var direccion = location.href;
					if(location.href.indexOf('/en/') != -1)
					{

						var direccion = location.href.split('/en/');
						location.href = '../es/'+direccion[1];
					}
					else if(location.href.indexOf('/es/') != -1)
					{

						var direccion = location.href.split('/es/');
						location.href = '../en/'+direccion[1];
					}

				});

                                        $(".idiomas ul li").removeClass('activo');

                                        if(location.href.indexOf('/en/') != -1)
					{
                                           $(".idiomas ul li:eq(0)").addClass('activo');						
					}
					else if(location.href.indexOf('/es/') != -1)
					{
                                           $(".idiomas ul li:eq(1)").addClass('activo');						
					}


	});

function abreNoticia(cual)
{

}

function abre(param)
{
$('.ui-dialog').remove();

			//var params = "name=John&location=Boston";
			var archivo = param;

			$.ajax({
		      type: "POST",
		      url: archivo,
		      async: false,
		      //data: params,
		      dataType: "html",
		      success: function(msg){
		         $(msg).dialog({
							modal: true,
							width: 681,
							open: function(event, ui) { $("#contieneFlash").hide();$("#mapaFlash").hide(); },
							close: function(event, ui) { $("#contieneFlash").show();$("#mapaFlash").show(); }
						});

		      }
   		});

}


function abreEnlaces(param)
		{
			var params = "name=John&location=Boston";
			var archivo = param;

			$.ajax({
		      type: "POST",
		      url: "enlaces_pop.html",
		      async: false,
		      data: params,
		      dataType: "html",
		      success: function(msg){
		         $(msg).dialog({
							modal: true,
							width: 681,
							open: function(event, ui) { $("#contieneFlash").hide(); },
							close: function(event, ui) { $("#contieneFlash").show(); }
						});

		      }
   		});

}


/*********************
Controlador de errores
**********************/
//onerror=handleErr;
var txt="";
function handleErr(msg,url,l){
	txt="There was an error on this page.\n\n";
	txt+="Error: " + msg + "\n";
	txt+="URL: " + url + "\n";
	txt+="Line: " + l + "\n\n";
	txt+="Click OK to continue.\n\n";
//alert(txt);
return true;
}
