﻿function openPopup(url, ancho, alto)
{
	var x = (screen.width - ancho) / 2;
	var y = (screen.height - alto) / 2;
	var ventana = window.open(url, "Popup", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=" + ancho + ",height=" + alto + ",left=" + x + ",top=" + y, "");
}
function openPopupScroll(url, ancho, alto)
{
	var x = (screen.width - ancho) / 2;
	var y = (screen.height - alto) / 2;
	var ventana = window.open(url, "Popup", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + ancho + ",height=" + alto + ",left=" + x + ",top=" + y, "");
}
function openPopupResizable(url, ancho, alto)
{
	var x = (screen.width - ancho) / 2;
	var y = (screen.height - alto) / 2;
	var ventana = window.open(url, "Popup", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + ancho + ",height=" + alto + ",left=" + x + ",top=" + y, "");
}
function GetListOfSelectedCheckboxes(Prefix)
{
    var objs=document.getElementsByTagName("input");
    var sresult="";        
    for(i=0;i<objs.length;i++)
    {
        if(objs[i].checked==true && objs[i].name.substring(0,Prefix.length)==Prefix)
        {
            if(sresult=="")
            {
                sresult=objs[i].name.replace(Prefix,"");
            }
            else
            {
                sresult+="," + objs[i].name.replace(Prefix,"");
            }
        }
    }
    return sresult;
}
//////////////
function ToggleChecked(chkprefix)
{
    var objs=document.getElementsByTagName("input");				
	for(i=0;i<objs.length;i++)
	{					
		if(objs[i].id.substring(0,chkprefix.length)==chkprefix && !objs[i].disabled)
		{
			objs[i].checked=!objs[i].checked;
		}
	}
}
