// JavaScript Document

//Google Analitycs
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-6574507-1");
pageTracker._trackPageview();
} catch(err) {}

//Reconocer Navegador

//Menu Home
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}
function mantener_on(id){
	document.getElementById(id).style.background='#da8500';
	document.getElementById(id).style.marginBottom='3px'
	document.getElementById(id).style.color='#ffffff';
	}
function mantener_off(id){
	document.getElementById(id).style.backgroundImage='url(../img/bg_menu.gif)';
	document.getElementById(id).style.color='#333333';
	document.getElementById(id).style.backgroundRepeat='repeat-x';
	}
	
	
//
function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow[wp].document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}

//---------- Funcion para determinar la altura del container ---------//
$(document).ready(function() {
	var altura_container=$('#container').height();
	var altura_contenido=$('#contenido').height();
	/*alert(altura_container);
	var altura_contenido=$('#contenido').height();	
	var altura_col_derecha=$('#col_derecha').height();
	var altura_cajas_centrales=($('#caja_es_noticia').height())+($('#caja_entrevistas').height())+($('#caja_reportajes').height());
	var diferencia_alturas=altura_col_derecha-altura_cajas_centrales;
	if($.browser.msie){
		diferencia_alturas=diferencia_alturas-50;
	}else{
		diferencia_alturas=diferencia_alturas-10;
	}
	$('#banner_pie_home').css('position', 'absolute');
	$('#banner_pie_home').css('top', diferencia_alturas);
	if($.browser.msie){
		altura_container=altura_container+150;
	}else{
		altura_container=altura_container+230;
	}*/	
	$('#footer_copy').css('position', 'absolute');
	if($.browser.msie){
		if(altura_contenido<1920){
	$('#footer_copy').css('top', 1920);	
		}else{
			$('#footer_copy').css('top', altura_contenido+150);
		}
	}else{
		if(altura_contenido<1860){
	$('#footer_copy').css('top', 1860);	
		}else{
			$('#footer_copy').css('top', altura_contenido+150);
		}
	}
	$('#alerts').html(altura_container);
});
