﻿function SelecionaTodosChecks(spanChk){
    var oItem = spanChk.children;
    var theBox= (spanChk.type=="checkbox") ?
        spanChk : spanChk.children.item[0];
    xState=theBox.checked;
    elm = theBox.form.elements;

    for(i=0;i<elm.length;i++)
        if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
        {
            if(elm[i].checked!=xState)
                elm[i].click();
        }
}

function abrePopUp(url, id, altura, largura, top, left)
{
  top=((top/2)-(altura/2));
  left=((left/2)-(largura/2));
  window.open(url, id, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, menubar=no, top='+top+', left='+left+', width='+largura+', height='+altura);  
}

function abrePopUp2(url, id, altura, largura, top, left)
{
  top=((top/2)-(altura/2));
  left=((left/2)-(largura/2));
  window.open(url, id, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, menubar=no, top='+top+', left='+left+', width='+largura+', height='+altura);  
}

function abrePopUp3(url, id, altura, largura, top, left)
{
  top=((top/2)-(altura/2));
  left=((left/2)-(largura/2));
  window.open(url, id, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, menubar=no, top='+top+', left='+left+', width='+largura+', height='+altura);  
}

function abrePopUpa(url, altura, largura, top, left)
{
  top=((top/2)-(altura/2));
  left=((left/2)-(largura/2));
  window.open(url, altura, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, menubar=no, top='+top+', left='+left+', width='+largura+', height='+altura);  
  return false;
}

function abrePopUpa2(url, id, altura, largura, top, left)
{
  top=((top/2)-(altura/2));
  left=((left/2)-(largura/2));
  window.open(url, id, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, menubar=no, top='+top+', left='+left+', width='+largura+', height='+altura);  
  return false;
}