﻿
function openPopup(w,h,top,left,nav,loc,sts,menu,scroll,resize,name,url) {
	var windowProperties='';
	if(nav==false)
		windowProperties+='toolbar=0,';
	else
  		windowProperties+='toolbar=1,';
  	if(loc==false) 
  		windowProperties+='location=0,';
  	else
 		windowProperties+='location=1,';
 	if(sts==false)
 		windowProperties+='status=0,';
 	else
 		windowProperties+='status=1,'; 
 	if(menu==false) 
 		windowProperties+='menubar=0,';
 	else
 		windowProperties+='menubar=1,'; 
 	if(scroll==false) 
 		windowProperties+='scrollbars=0,';
 	else 
 		windowProperties+='scrollbars=1,'; 
 	if(resize==false) 
 		windowProperties+='resizable=0,';
 	else 
 		windowProperties+='resizable=1,'; 
 	
 	if(w!="") 
 		windowProperties+='width='+w+',';
 	if(h!="") windowProperties+='height='+h+',';
 	
 	if(top!="") 
 		windowProperties+='top='+top+',';
 	if(left!="") windowProperties+='left='+left;
 	
 	if(windowProperties!="") { 
  		if( windowProperties.charAt(windowProperties.length-1)==',') 
   			windowProperties=windowProperties.substring(0,windowProperties.length-1); 
   	} 
 	window.open(url,name,windowProperties);
}
/*
function mostrarTooltip(el, div, text, alignX, alignY) {
	if (document.getElementById){
		var i = document.getElementById(el);
		var c = document.getElementById(div);
		if (c.style.display != "block"){
			var l=0; var t=0;
			aTag = i;
			do {
				aTag = aTag.offsetParent;
				l += aTag.offsetLeft;
				t += aTag.offsetTop;
			} while (aTag.offsetParent && aTag.tagName != 'BODY');
			var left =  i.offsetLeft + l;
			var top = i.offsetTop + t + i.offsetHeight + 2;
			if (alignX == 'left' && c.style.width){
				left = left - parseInt(c.style.width);
			}
			if (alignY == 'top' && c.style.height){
				top = top - parseInt(c.style.height) -25;
			}
			c.style.left = left+'px';
			c.style.top = top+'px';
			c.style.display = "block";
			c.innerHTML = "
			<table cellpadding="0" border="0">
			<tr>
			<td align="center">"+text+"</td>
			</tr>
			</table>
			";
			} else {
			c.style.display="none";
		}
	}
}
*/
function mostrarTooltip(el, div, text, alignX, alignY) {
		var i = document.getElementById(el);
		var c = document.getElementById(div);
		if (c.style.display != "block"){
			var l=0; 
			var t=0;
			aTag = i;
			
			/*do {
				aTag = aTag.offsetParent;
				l += aTag.offsetLeft;
				t += aTag.offsetTop;
			} while (aTag.offsetParent && aTag.tagName != 'BODY');
			*/
			//var left = 0; //i.offsetLeft + l;
			//var top = 0; //i.offsetTop + i.offsetHeight + 2;
			//var top = i.offsetTop + t + i.offsetHeight - 2;
			
			if (alignX == 'left' && c.style.width){
				left = left - parseInt(c.style.width);
			}
			if (alignY == 'top' && c.style.height){
				top = top - parseInt(c.style.height) -25;
			}
			c.style.left = i.style.left+i.offsetWidth+'px';
			//c.style.top = i.offsetHeight +'px'
			//c.style.left = left+'px';
			//c.style.top += top+'px';
			c.style.display = 'block';
			//c.innerHTML = "	<table cellpadding='0' border='0'><tr> <td align='center'>" +text+ "</td></tr></table>";
		} else {
			c.style.display='none';
		}
}


function ocultarTooltip(div) {
	if (document.getElementById){
	var c=document.getElementById(div);
	c.style.display='none';
	}
}




