function NuevaVentana(documento, ancho, alto, scroll)
        {       
        var TapaWindow=null;
        TapaWindow=window.open(documento,'','resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars=' + scroll + ',directories=no,width=' + ancho + ',height=' + alto+ ',top=200,left=200');
        if (TapaWindow){TapaWindow.focus;}
        }
        
        function NuVe(documento, ancho, alto, scroll)
        {         
        var TapaWindow=null;
        TapaWindow=window.open(documento,'','resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars=' + scroll + ',directories=no,width=' + ancho + ',height=' + alto+ ',top=200,left=200');
        if (TapaWindow){TapaWindow.focus;return true}
        else
        return false;
        }
        
        function printpage() {
        window.print();  
        }

        function gg( trgt,inc, max, min, intmax, intmin ) 
		{
		if (!document.getElementById(trgt))
		{ alert(trgt+'!!');
		return;
		}
		var d = document,cEl = null;
		var tama, inter;
		if ( cEl = d.getElementById( trgt ) )
		{
		
		tama=parseInt(cEl.style.fontSize.substring(0,2),10) + inc;
		inter=parseInt(cEl.style.lineHeight.substring(0,2),10) + inc;
		
		if (tama>max) tama=max;
		if (tama<min) tama=min;
		if (inter>intmax) inter=intmax;
		if (inter<intmin) inter=intmin;
		
			cEl = d.getElementById(trgt);
			cEl.style.fontSize = tama + 'px';
			cEl.style.lineHeight = inter + 'px';
		}
		}

function CrearIFrame(pagina, ancho, donde, marco) {
var iframe;
var contenedor=document.getElementById(donde);
if (document.all){
iframe = document.createElement('<iframe onload="iFrameHeight(\'' + marco + '\')"></iframe>');
}
else if (document.getElementById) {
iframe = document.createElement('iframe');
iframe.onload=function(){iFrameHeight(marco)};
}
if (!iframe) return;
iframe.frameBorder = 0;
iframe.width = ancho;
iframe.src = pagina;
iframe.setAttribute ("id", marco);
contenedor.appendChild(iframe);
}

function CrearIFrameh(pagina, ancho, alto, donde, marco) {
var iframe;
var contenedor=document.getElementById(donde);

iframe = document.createElement('iframe');

if (!iframe) return;
iframe.frameBorder = 0;
iframe.width = ancho;
iframe.height = alto;
iframe.src = pagina;
iframe.setAttribute ("id", marco);
contenedor.appendChild(iframe);
}

function iFrameHeight(nombre) {
var h = 0;
if ( !document.all ) {
h = document.getElementById(nombre).contentDocument.height;
if (h<230){
h=230;}
document.getElementById(nombre).style.height = h + 2 + 'px';
} else if( document.all ) {
h = document.frames(nombre).document.body.scrollHeight;
if (h<230){
h=230;}
eval("document.all." + nombre + ".style.height = h + 2 + 'px'");
}
}

function CrearIFrame1(pagina, ancho, donde, marco) {
var iframe;
var contenedor=document.getElementById(donde);
if (document.all){
iframe = document.createElement('<iframe onload="iFrameHeight1(\'' + marco + '\')"></iframe>');
}
else if (document.getElementById) {
iframe = document.createElement('iframe');
iframe.onload=function(){iFrameHeight1(marco)};
}
if (!iframe) return;
iframe.scrolling="no";
iframe.frameBorder = 0;
iframe.width = ancho;
iframe.src = pagina;
iframe.setAttribute ("id", marco);
contenedor.appendChild(iframe);
}

function iFrameHeight1(nombre) {
var h = 0;
if ( !document.all ) {
h = document.getElementById(nombre).contentDocument.height;
if (h<260){
h=260;}
document.getElementById(nombre).style.height = h + 2 + 'px';
} else if( document.all ) {
h = document.frames(nombre).document.body.scrollHeight;
if (h<260){
h=260;}
eval("document.all." + nombre + ".style.height = h + 2 + 'px'");
}
}

function disableSelection(target){
}
function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit)
      {field.value = field.value.substring(0, maxlimit);}
      else
      {countfield.value = maxlimit - field.value.length;}
}
function TextHeight(nombre)
{
test=document.getElementById(nombre);
if (test == null){
return 0;
}
else{
return test.clientHeight;
}
}
// Ampliar comentarios de los lectores
function sendDataToServer(idn,ori,dato) {
$.get("/opiniones.ashx", {idn: +idn, ori: + ori, mas: + dato}, function(data) {$("#mas_noti").html(data);});
$("#ampliar").hide("slow");}
// Reemplazo en <div>
     function sendDataToServer1(origen, destino) {
     $.get(origen, {}, function(data) {$(destino).html(data);});
     }
// Remplazo de Iframe
  
function loadContent( sourceURL, elementSelector) {
$(""+elementSelector+"").load(""+sourceURL+"");
}

function loadContent1(sourceURL, elementSelector) {
    $("" + elementSelector + "").load("" + sourceURL + "", {}, function(data) { alert(data); });
}
     
// Tool Tip
ShowTooltip = function(e)
{var text = $(this).next('.show-tooltip-text');
	if (text.attr('class') != 'show-tooltip-text')
		return false;
	text.fadeIn()
//		.css('top', e.pageY);
//		.css('left', e.pageX+10);
		.css('top', -75)
		.css('left', -100);
	return false;}
HideTooltip = function(e)
{var text = $(this).next('.show-tooltip-text');
	if (text.attr('class') != 'show-tooltip-text')
		return false;
	text.fadeOut();}

SetupTooltips = function()
{$('.show-tooltip')
		.each(function(){
		$(this)
		.after($('<span/>')
		.attr('class', 'show-tooltip-text')
		.html($(this).attr('title')))
		.attr('title', '');
		})
		.hover(ShowTooltip, HideTooltip);}