// JavaScript Document
$(document).bind("ready",function(){
	establecerAlturas();
	cargarFaceBook();
	if($.browser.msie){
		$("iframe#pluginFacebook").css({"margin-top":"-46px","height":"74px"});
	}
	asignarOyentesPrincipales();
	
});

function cargarFaceBook(){
	
	$.ajax({
		url:"http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2Fprueba%2F217669781599122%3F&width=200&colorscheme=light&show_faces=false&border_color&stream=false&header=false&height=62",
		
	});
}

function establecerAlturas(){
	var alturaNoticia=160;
	
	$("#containerLeft").height($("#containerRight").height()-8);
	/*if ($.browser.mozilla && $('body').css("background-color")!="rgb(0, 0, 0)"){
			$("#containerLeft").height($("#containerLeft").height()+136);
	}*/
	
	var alturaNoticias = $("#containerLeft").height()-550 ;
	var nNoticias = parseInt(alturaNoticias/alturaNoticia);
	
	$.ajax({
		url:"_resumenNoticias_.php",
		type: "POST",
		data: "nNoticias="+nNoticias,
		success: function(html){
			$("#resumenNoticias").html(html);
		}
	});
	
}
function asignarOyentesPrincipales(){
	/**
	* cambia el tamaño del menú lateral si cambia el del contenido
	*/
	$.ajaxSetup({
		complete:function(){
			$("#containerLeft").height($("#containerRight").height());
		}
	});
	
	/**
	* Si esta en la página principal, cambia la imagen de cabecera por un swf.
	*/
	 if(window.location.pathname.indexOf("quienesSomos.php")>0){
		 $("#header h1").html("").flash({ 
			src: 'imagenes/cabecera.swf',
			width: 813,
			height: 161
		 });
	 }
	 
}

