function openErnani() {
var tp = null, lf = null;
var opts = 'width=750,height=515,location=no,menubar=no,resizable=no,scrollbars=no,status=yes,toolbar=no,directories=no,channelmode=no';
var h = 515;
var w = 750;

	if (screen != null) {
	   if (screen.height <= 600) {
	        tp = 0;	
           } else {                	
    	   	tp = screen.height;
	        if (tp != null) {
			tp = (tp - h) / 2 - 25; 
	        }
           } 
	   if (screen.height <= 600) {
	        lf = 20;	
           } else {                	
  	        lf = screen.width;
  	        if (lf != null) {
		   lf = (lf - w) / 2; 
  	        }
           } 
	}
			 
	if (lf != null) {
		opts = opts + ',left=' + new Number(lf).toString();
	}
		
	if (tp != null) {
		opts = opts +  ',top=' + new Number(tp).toString();
	}	

   window.open('ernMain.asp', '_teste', opts);
   return false;
}


function openOfflineImage(obj) {
  var sImg = obj.getElementsByTagName('IMG')[0].getAttribute('EXPAND');
  var sAlt = obj.getElementsByTagName('IMG')[0].getAttribute('ALT');
  var w;
  var o;   

  if (sImg != '') {
     w = window.open ('mcbImageOffline.asp?sImage=' + escape(sImg) + '&sLegend=' + escape(sAlt), 
'_blank', 'width=405,height=380,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
  }
  
  return false;
}

function openImage(obj) {
  var sImg = obj.getElementsByTagName('IMG')[0].getAttribute('EXPAND');
  var sDir = obj.getElementsByTagName('IMG')[0].getAttribute('TIPO');

  if (sImg != '') {
     window.open ('mcbImage.asp?sImage=' + sImg +'&sDir=' + sDir, '_blank', 'width=405,height=380,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
  }
  
  return false;
}

function showLegend(obj) {
	var oSrc = obj.getElementsByTagName('IMG')[0];
	var oTgt = document.getElementById('divLegenda');
	var sLeg; 
	
	// Posiciona
	oTgt.style.top = document.getElementById('tabCentral').offsetTop + 
	                 oSrc.parentNode.parentNode.parentNode.offsetTop -
	                 document.getElementById('divMain').scrollTop + 
	                 oSrc.height + 100;

   	oTgt.style.left = document.getElementById('tabCentral').offsetLeft -
	                  oSrc.width - parseFloat(oTgt.style.width) + 790;
	                 
	if (parseFloat(oTgt.style.top) < document.getElementById('tabCentral').offsetTop + parseFloat(document.getElementById('tabCentral').height)) {

	if (oSrc != null && oTgt != null && (sLeg = oSrc.getAttribute('ALT')) != '') {
		oTgt.getElementsByTagName('TD')[0].innerHTML = sLeg;
		oTgt.style.display = 'block';
	}

	}
	
	return false;
}

function hideLegend() {
	var oTgt = document.getElementById('divLegenda');
	
	if (oTgt != null) {
		oTgt.style.display = 'none';
	}	
	
	return false;
}

function openInscricao() {
var tp = null, lf = null;
var opts = 'width=752,height=515,location=no,menubar=no,resizable=no,scrollbars=yes,status=yes,toolbar=no,directories=no,channelmode=no';
var h = 515;
var w = 752;

	if (screen != null) {
	   if (screen.height <= 600) {
	        tp = 0;	
           } else {                	
    	   	tp = screen.height;
	        if (tp != null) {
			tp = (tp - h) / 2 - 25; 
	        }
           } 
	   if (screen.height <= 600) {
	        lf = 20;	
           } else {                	
  	        lf = screen.width;
  	        if (lf != null) {
		   lf = (lf - w) / 2; 
  	        }
           } 
	}
			 
	if (lf != null) {
		opts = opts + ',left=' + new Number(lf).toString();
	}
		
	if (tp != null) {
		opts = opts +  ',top=' + new Number(tp).toString();
	}	

   window.open('mcbInscricao.html', '_teste', opts);
   return false;
}

