﻿function checkAll() 
{
	
	for (var j=0; j < document.aspnetForm.length; j++) 
	{
		if ( document.aspnetForm.elements[j].type == 'checkbox' )
		{
			if (!document.aspnetForm.elements[j].checked)
				document.aspnetForm.elements[j].checked = true;
			else 
			    document.aspnetForm.elements[j].checked = false;
		}
	}
}

function PopUpJogo(texto)
{	    
          var largura = screen.width - 200;
          var altura = screen.height - 200;
          
	      var atributos = "status=no,scrollbars=no,width="+largura+",height="+altura+",left=" + ((screen.width / 2) - (largura / 2)) + ",top=" + ((screen.Height / 2) - (altura / 2)) + ",location=no;";
		  window.open("jogar.aspx?Id="+texto+"&Alt="+altura+"&Lar="+largura,"Jogos",atributos);
}


function abrePopUp(texto, largura, tamanho){	    
	      var atributos = "status=no,scrollbars=no,width=" + largura + ",height=" + tamanho + ",left=" + ((screen.width / 2) - (largura / 2)) + ",top=" + ((screen.Height / 2) - (tamanho / 2)) + ",location=no;";
		  window.open(texto,"win",atributos);
	}

	function abrePopUpScroll(texto, largura, tamanho){	    
	      var atributos = "status=no,scrollbars=yes,width=" + largura + ",height=" + tamanho + ",left=" + ((screen.width / 2) - (largura / 2)) + ",top=" + ((screen.Height / 2) - (tamanho / 2)) + ",location=no;";
		  window.open(texto,"win",atributos);
	}


function formatNumber(num,dec,thou,pnt,curr1,curr2,n1,n2) {var x = Math.round(num * Math.pow(10,dec));if (x >= 0) n1=n2='';var y = (''+Math.abs(x)).split('');var z = y.length - dec;y.splice(z, 0, pnt);while (z > 3) {z-=3; y.splice(z,0,thou);}var r = curr1+n1+y.join('')+n2+curr2;return r;}

  // Change the style for a RI given the state of the "is checked" checkbox
  function CheckMBRow(Obj) {
     if (Obj.parentNode && Obj.parentNode.parentNode) {
			HighlightRow(Obj.parentNode.parentNode,Obj.checked);			
     }
  }
  
  // Set the "highlight" state of a row
  function HighlightRow(Row,Chk) {
     //if (Row.className) {
        if (Row.className.indexOf('Al') >= 0) {
		   Row.className = (Chk ? 'selTD-Alter' : 'item-grid-Alter');
        } else {
		   Row.className = (Chk ? 'selTD' : 'item-grid');
        } 
     //}
  }

