var link_anterior = "";
var idAnterior = -1;
function mostrarCos(idNoticia,highlight) {
	if (typeof highlight != "undefined") {
		var varAjax = {"idNoticia": idNoticia, "highlight": highlight}
	} else {
		var varAjax = {"idNoticia": idNoticia}
	}
	getMyHTML("/noticies/cosNoticia.php",varAjax,"noticia"+idNoticia);
}

function mostrarFoto(idReferencia) {
	getMyHTML("/referencies/referencies_foto.php", {"idReferencia": idReferencia}, 'foto');
}

function getMyHTML(url,params,elementId) {
	$("#"+elementId).load(url,params,function () {$(".fancyboxImage").fancybox({ 'hideOnContentClick': true }); resizeMap();});
}


$(document).ready(function() {

    $(".fancyboxImage").fancybox({ 'hideOnContentClick': true, 'overlayShow': true  });
    resizeMap();
});


$(window).bind('resize', function() {
	resizeMap();
});

   
function e(id) {
	return document.getElementById(id);
}

function getWindowHeight() {
	return $(document).height();
}

function resizeMap() {
	var offset = $("#footer").height() + 50;
	var height = $('body').height() - offset;
	if ($('body').height()<$(document).height()) $("#desktop").height(height);
}