function BSHighlightBusca()
{
    try
    {
        if(BuscaStr!=null && BuscaStr.length>0)
        {
            
            var GridView = $('ctl00_C1_G');
            var QStr = BuscaStr.split(" ");
            
            for(y=0;y<QStr.length;y++)
            {
            if(QStr.length==1 || QStr[y].length>2)
            {
            for(i=0;i<GridView.rows.length;i++)
            {
                for(x=0;x<GridView.rows[i].cells.length;x++)
                {
                     if(GridView.rows[i].cells[x].innerHTML.indexOf("BSTipoResultado")>-1)
                     {
                         var StrTemp = RemoverAcentos(GridView.rows[i].cells[x].innerHTML.toString().toLowerCase());
                         var StrTemp2 = RemoverAcentos(QStr[y].toLowerCase());
                         if(StrTemp.indexOf(StrTemp2)>-1)
                         {
                            var PosStr = StrTemp.indexOf(StrTemp2);
                            var StrEncontrada = GridView.rows[i].cells[x].innerHTML.substring(PosStr,QStr[y].length + PosStr);
                            GridView.rows[i].cells[x].innerHTML = GridView.rows[i].cells[x].innerHTML.replace(StrEncontrada, "<span id='SpnHighlightBusca' class='HighlightBusca'>" + StrEncontrada + "</span>");
                         }
                     }
                }
            }
            }
            }
        }
    }
    catch(e){}
}
function BSSubmitOnEnter(e, BtnBusca, BtnBuscaGlobal)
{ 
      var evt = e ? e : window.event;
      var bt = document.getElementById(BtnBusca);
      var bt2 = document.getElementById(BtnBuscaGlobal);
      if (bt)
      { 
          if (evt.keyCode == 13)
          {
                if(evt.shiftKey)
                {
                    bt2.click(); 
                    return false;
                }
                else
                {
                    bt.click(); 
                    return false; 
                }
          } 
      } 
}
function PEDVerDetalhes(Id)
{
    window.open("YourSales/PedidoDetalhe.aspx?Id=" + Id);
}
function PEDAlterar(Id)
{
    window.location.href = "YourSales/PedidoForm.aspx?Op=UldScGRHRnk=&Id=" + Id;
}
function PEDEnviarEmail(Id)
{
    window.location.href = "YourSales/PedidoEnviar.aspx?Ids=" + Id;
}
function PEDEnviarFax(Id)
{
    window.location.href = "YourSales/PedidoEnviarFax.aspx?Id=" + Id;
}
//FUN??ES PARA FORNECEDORES
function FORNovoPedido(Id)
{
    window.location.href = "YourSales/Produto.aspx?FornId=" + Id;
}
function FORVisualizarPedidos(Id)
{
    window.location.href = "YourSales/Pedido.aspx?FornId=" + Id;
}
function FOREnviarTabPrecos(Id)
{
    window.location.href = "YourSales/TabelaPrecoEnviar.aspx?Ids=" + Id;
}
function FORVerTabPrecos(Id)
{
    window.open("YourSales/TabelaPreco.aspx?Id=" + Id);
}
function FORAlterar(Id)
{
    window.location.href = "Form.aspx?IdMod=TWprPQ==&Op=UldScGRHRnk=&Id=" + Id;
}
//FUN??ES PARA CLIENTES
function CLINovoPedido(Id)
{
    window.location.href = "YourSales/Produto.aspx?ClieId=" + Id;
}
function CLIRelatorioGrade(Id)
{
    window.open("YourSales/Relatorios/GradeVendaClienteFornecedor.aspx?Id=" + Id);
}
function CLIVisualizarPedidos(Id)
{
    window.location.href = "YourSales/Pedido.aspx?ClieId=" + Id;
}
function CLIAlterar(Id)
{
    window.location.href = "Form.aspx?IdMod=TWpZPQ==&Op=UldScGRHRnk=&Id=" + Id;
}
// 5/9/2010 3:34:17