of 248 /248
DIEGO RAFAEL FLORES BARBAT SISTEMA DE ENSINO PRESENCIAL CONECTADO TECNOLOGIA EM ANÁLISE E DESENVOLVIMENTO DE SISTEMAS SISTEMA DE INFORMAÇÃO WEB PARA CONTROLE DE CHAMADOS E VISITAS

Help Desk nas Nuvens

Embed Size (px)

DESCRIPTION

Trabalho de Conclusão de Curso desenvolvido com tecnologias web pelo formando Diego Rafael Flores Barbat, estudande na Universisade Norte do Paraná.

Text of Help Desk nas Nuvens

SISTEMA DE ENSINO PRESENCIAL CONECTADO TECNOLOGIA EM ANLISE E DESENVOLVIMENTO DE SISTEMAS DIEGO RAFAEL FLORES BARBAT

SISTEMA DE INFORMAO WEB PARA CONTROLE DE CHAMADOS E VISITAS

Uruguaiana - RS 2010

DIEGO RAFAEL FLORES BARBAT

SISTEMA DE INFORMAO WEB PARA CONTROLE DE CHAMADOS E VISITAS

Trabalho de Concluso de Curso apresentado Universidade Norte do Paran - UNOPAR, como requisito parcial para a obteno do ttulo de Tecnlogo em Anlise e Desenvolvimento de Sistemas. Orientador: Prof. Everson Matias de Morais

Uruguaiana - RS 2010

Dedico este trabalho a minha famlia, que sempre me apoiou e ajudou-me para que eu conseguisse concluir o curso de Anlise e Desenvolvimento de Sistemas.

Londrina, _____de ___________de 20___.

AGRADECIMENTOS A Deus por ter me proporcionado a oportunidade de realizar o curso. minha famlia, que sempre esteve presente me apoiando. minha namorada, por ter me compreendido nos momentos que eu estava estressado, ou sem tempo pra ela. Aos amigos que sempre com palavras de motivao e sucesso me fizeram obter sucesso no trabalho. Ao meu tutor de sala, Ricardo Aires Simas, pelos conselhos, dicas e por ter acreditado na minha capacidade.

RESUMO

A proposta deste sistema foi baseado no desenvolvimento de um sistema de Help Desk aplicado a empresa Comaco Copiadoras, utilizando como linguagem o PHP (Personal Home Page). A sua implementao utilizou o framework Cake PHP, descrevendo sua utilizao e seus principais conceitos. O trabalho demonstra tambm o uso de outras linguagens de conceito Opensource apresentando algumas de suas definies e a sua utilizao em sistemas web.

Palavras-chave: PHP, Opensource, Sistemas Web, Help Desk.

SUMRIO 1 INTRODUO...........................................................................................................6 2 JUSTIFICATIVA ........................................................................................................7 3 OBJETIVOS...............................................................................................................8 4 REFERENCIAL TERICO.........................................................................................9 5 METODOLOGIA.......................................................................................................11 6 CARACTERIZAO DA ORGANIZAO EM ESTUDO........................................12 7 TECNOLOGIA..........................................................................................................13 8 LEVANTAMENTO DE REQUISITOS.......................................................................14 9 DIAGRAMAS............................................................................................................15 10 CRONOGRAMA.....................................................................................................22 11 CONCLUSO.........................................................................................................23 REFERNCIAS..........................................................................................................24 ANEXOS.....................................................................................................................26 ANEXO 1 Telas do Programa.................................................................................27 ANEXO 2 Cdigo Fonte..........................................................................................34 ANEXO 3 Banco de Dados e Tabelas do Sistema...............................................190

6

1 INTRODUO

A cada dia, as organizaes buscam melhorar seus procedimentos de negcio, visando maior qualidade dos seus produtos e satisfao de seu pblico-alvo (ZSCHORNACK, 2003, p. 1).

No ambiente atual das organizaes uma das principais ferramentas de produo o computador e, portanto primordial que ele esteja sempre em perfeito funcionamento. Diante disso, as empresas possuem equipes de suporte tcnico para auxiliar seus usurios na resoluo de problemas e manter o funcionamento de seus computadores. Este ambiente pode demandar muitos controles no gerenciamento das solicitaes existentes, nas etapas da resoluo de problemas, no gerenciamento de equipamentos e na satisfao do usurio com acompanhamento dos resultados. Estes controles acabam gerando vrios processos dentro da equipe de suporte. Sendo assim, as empresas utilizam sistemas denominados Help Desk. Este tipo de software tem a funo de auxiliar a equipe de suporte para coordenar e solucionar os incidentes que ocorrem com os usurios, assegurando que os chamados gerados por estes incidentes no sejam perdidos, esquecidos ou negligenciados. Este tipo de sistema constitui em um mecanismo computacional facilitador da informao. A empresa Comaco Copiadoras esta inserida nesse contexto. Ela contm vrios processos e estes no esto mapeados de uma maneira formal, e na maioria dos casos no so conduzidos dentro de alguma metodologia de gerenciamento de processos. O sistema utilizado neste ambiente de trabalho no proporciona o acompanhamento dos processos do setor. Por isto este trabalho de concluso de curso visa desenvolver um sistema de Help Desk com o intuito de gerenciar e melhor organizar os processos de trabalho.

7

2 JUSTIFICATIVA Atualmente este controle de chamados realizado no momento em que o cliente entra em contato com a empresa atravs de ligaes telefnicas, o atendente encarregado de protocolar o chamado em formulrios, assim podendo extraviar essas anotaes informais, apresentando tambm alguma inconsistncia nos dados solicitados ao abrir um chamado, tornando o processo pouco confivel e to pouco gil, prejudicando o bom funcionamento da empresa. O controle de visitas aos clientes realizado por meio dos vendedores da empresa, onde os mesmos preenchem formulrios por escrito, descrevendo os acontecimentos ocorridos durante a visita. Todos os formulrios de chamados e visitas aps analisados pelo administrador so armazenados em gavetas. Analisando o atual sistema de trabalho descrito acima, observou-se que de tal forma o servio no realizado com confiana e agilidade tornando todo o processo inseguro, tendo em vista a ampliao da rea de trabalho e tomando novos ramos em que um controle de chamado e visitas sem dvida muito importante para um desenvolvimento saudvel da empresa. Com o desenvolvimento do sistema que estamos propondo desenvolver, os usurios tero maior confiabilidade, agilidade e facilidade para tratar com essas informaes. A motivao maior por se tratar de um software de controle baseado em tecnologias web que vai disponibilizar ao usurio e o administrador um acesso remoto a estas informaes descritas, permitindo que os mesmos possam utilizar o sistema apartir de qualquer lugar que possua um acesso a internet. Por ser um sistema web ele ira proporcionar inmeras vantagens para ambas as partes como, por exemplo, a portabilidade que ns permite um sistema on-line 24 horas, 7 dias por semana, de fcil manuseio, reduzindo gastos com a infra-estrutura da empresa e de fcil manuteno.

8

3 OBJETIVOS

3.1 OBJETIVO GERAL Desenvolver um software web para o controle dos processos que envolvam os chamados e visitas dos clientes da empresa Comaco Copiadoras. 3.2 OBJETIVOS ESPECFICOS a) Controlar todos os chamados envolvidas; b) Gerar relatrios por perodo dos chamados e visitas aos clientes c) Cadastrar clientes, mquinas e funcionrios. d) Realizar qualquer tipo de consulta relacionada aos clientes, mquinas, funcionrios, chamados e visitas realizadas. e) Permitir que o cliente tenha um acompanhamento do seu chamado, podendo ele analisar os servios realizados pelo tcnico. f) Disponibilizar o acesso remoto desses chamados; opinio sobre o atendimento recebido. g) Possibilitar que ao encerrar um chamado o cliente possa colocar sua

9

4 REFERENCIAL TERICO Segundo Gonalves et all, (1993, p. 109).Atravs dos tempos, o homem tem buscado mtodos e processos de trabalho que minimizem o esforo e aperfeioem o resultado na produo dos bens que necessita. Assim, se no incio da atividade laboral o trabalho era executado com as mos, a evoluo ocorreu no sentido da utilizao de ferramentas, mquinas de acionamento mecnico e, atualmente, equipamentos automatizados. A tecnologia pode ser considerada, ento, como uma potente fora no sentido de poder estender as capacidades humanas. Capacidades fsicas, com a revoluo industrial, e capacidades mentais, com a revoluo da informtica.

A constante evoluo, na qual vivenciamos nos dias atuais permitira futuramente que a mo de obra brutal seja substituda muitas vezes por mquinas inteligentes. De acordo com (OBrien, 2004, p. 6).Sistemas de informao um conjunto organizado de pessoas, hardware, software, rede de comunicao e recursos de dados que coleta, transforma e dissemina informaes em uma organizao. O sistema recebe recursos de dados como entrada e os processa em produtos, como sada.

Um sistema de informao nada mais que a coleta e entrada de dados na forma crua, que so trabalhados e retornam como sada dados em forma de informao que possa ser utilizada. De acordo com o site escoladeprotese.Ter uma pgina na internet se tornou indispensvel para empresas de todos os tamanhos: grande, mdio ou pequeno porte. Esta ferramenta possibilita comunicao junto ao seu cliente sobre os seus produtos e servios, apresentando seus diferenciais. Mas no basta ter um site "bonitinho" e esperar que chova clientes! Pelo contrrio, ter um site na internet apenas o primeiro passo para a empresa que est "engatinhando" no mundo virtual, o comeo de muito trabalho para que essa ferramenta seja utilizada de forma inteligente, que possa corresponder positivamente ao tempo e dinheiro investidos.Cerca de 95% das empresas que atualmente esto na internet no obtm o sucesso esperado. Porqu? Simples: quem o produziu no pensou no pblico alvo do site, pensou apenas no "design" da pgina.Antes de comear a desenvolver um projeto web, necessrio saber o que seus clientes querem quando entram em seu site, necessrio satisfaz-los, cativ-los para que se sintam seguros em relao a sua empresa, e percebam os valores que a destacam no mercado!

Para xito nos objetivos esperados na construo de um site com sistema integrado, precisamos acima de tudo de um bom planejamento antes do

10

desenvolvimento propriamente dito. Segundo Campos (br-linux.org).Software Livre, ou Free Software, conforme a definio de software livre criada pela Free Software Foundation, o software que pode ser usado, copiado, estudado, modificado e redistribudo sem restrio. A forma usual de um software ser distribudo livremente sendo acompanhado por uma licena de software livre (como a GPL ou a BSD), e com a disponibilizao do seu cdigo-fonte.

Para um software ser considerado livre precisa possuir as 4 liberdades exigidas pela organizao GNU. Unipress afirma (Unipress, 2001, p. 4).Os clientes hoje, particularmente com o surgimento da internet, esperam e exigem um servio de qualidade e dentro do prazo. As empresas que esto olhando para o futuro, esto investindo em operaes de servios ao cliente, para atingirem uma vantagem competitiva.

A internet nos abriu um leque de opes, possibilitando uma maior visualizao de servios, muitas empresas esto investindo forte nesse aspecto para que possam ser mais conhecidas.

11

5 METODOLOGIA A pesquisa feita para executar este trabalho foi uma pesquisa exploratria. Conforme Oliveira, pesquisa exploratria: a nfase dada descoberta de praticas ou diretrizes que precisam modificar-se na elaborao de alternativas que possam ser substitudas. A pesquisa teve como objetivo, proporcionar maior familiaridade com o problema, para com isso torn-lo mais evidente, aprofundou-se em uma realidade especifica, e procurou captar as explicaes e interpretaes do que ocorre na realidade da empresa. Antes de iniciar o trabalho, para colocar em prtica o procedimento de um sistema de informao para controle de chamados e visitas, foi feito uma pesquisa para saber os problemas: A empresa no tinha uma segurana e agilidade na hora de realizar suas rotinas de chamados e visitas aos clientes. Os primeiros contatos com a empresa foram realizados atravs de encontros, onde neles foram estipulados as necessidades que a empresa possua no momento. Ao longo da jornada realizamos diversas reunies onde nelas, desenvolvemos o levantamento de dados, extrao de requisitos, leitura de artigos, matrias e desenvolvimento dos diagramas de caso de uso e de classe. Atualmente na forma de trabalho exercida na empresa encontramos algumas deficincias, tais como: a) Anotaes realizadas em papeis; b) Deslocamento desnecessrio do encarregado do setor at a empresa; c) Muitas ligaes para celular, aumentando os custos; d) Perda de tempo na execuo das tarefas; e) Dificuldades em especificar consultas; O sistema dever corrigir essas e outras deficincias que no decorrer do projeto possam ser constatadas no modo de trabalho que atualmente a empresa utiliza, aprimorando esses controles.

12

6 CARACTERIZAO DA ORGANIZAO EM ESTUDO Comaco Copiadoras: Empresa de natureza no ramo de Mquinas Copiadoras, situada na Rua Flores da Cunha, nmero 1120, telefone (55)34122962, Uruguaiana, RS. Fundada em 05 de junho de 1986. Constituda pelos scios Pedro Tjader e Celma Tjader. O quadro de funcionrios constitudo por uma secretria e 4 tcnicos. Atualmente seus servios so voltados a assistncia de mquinas copiadoras, vendas de suprimentos e mquinas copiadoras de pequeno, mdio e grande porte. Faz parte de sua estrutura uma recepo constituda de um computador desktop e 3 mquinas copiadoras, cozinha, 2 banheiros, 1 sala de reunio, 2 salas da diretoria cada uma com um notebook, 1 depsito de mquinas copiadoras, 1 garagem e um departamento tcnico que possui um computador desktop que serve para realizar instalaes e testes nas mquinas copiadoras e 1 Servidor com sistema operacional linux que tem por finalidade gerenciar a rede.

13

7 TECNOLOGIA Tendo em vista as inmeras vantagens que o software livre nos proporciona decidimos utilizar em nosso trabalho apenas tecnologias livres, citadas a seguir. Personal Home Page (PHP) como linguagem de programao sobre um servidor web Apache e um banco de dados Mysql como sistema gerenciador de banco de dados (SGBD). As pginas do sistema so estruturadas em Extensible Hyper Text Markup Language (XHTML) e Cascading Style Sheet (CSS), utilizamos a bilioteca Jquery do JavaScript para validar informaes provindas dos formulrios. Usamos, tambm, a tecnologia AJAX que ns permite uma aplicao assncrona. Para a modelagem UML usamos o software JUDE, para editorao dos textos o pacote OpenOffice. Para a edio grfica o Gimp e para a criao de cronogramas o Gannt Project.

14

8 LEVANTAMENTO DE REQUISITOS Atualmente o processo que a empresa usa para gerenciar os seus chamados e visitas ao cliente geram uma srie de preocupaes quanto a segurana, confiabilidade e agilidade nas operaes, pois todo o sistema de trabalho armazenado em formulrios, posteriormente guardados em fichrios. Existe um gasto muito alto em ligaes telefnicas, perda de tempo na execuo das tarefas e dificuldades em especificar consultas e gerar relatrios. Com base nessas informaes pretendemos amenizar essas deficincias com um sistema web totalmente dinmico que ir nos permitir realizar cadastro dos chamados, das visitas, dos funcionrios, dos clientes e das mquinas. Possibilitar que atravs do sistema o cliente possa realizar a abertura de um chamado e at mesmo acompanhar a situao do chamado. O administrador ter uma viso geral do sistema e ainda poder gerar relatrios e consultas sobre qualquer informao desejada.

15

9 DIAGRAMAS

9.1 DIAGRAMA DE CASO DE USO

Figura 1 Diagrama de Caso de Uso do Controle de Chamados e Visitas

A seguir so descritos brevemente os principais casos de uso destes nveis: a) a) Encerra Visita: este processo permitido somente ao administrador, que aps conferir os dados da visita encerra a mesma. b) b) Encerra Chamado: este processo permitido somente ao administrador, que aps conferir os dados do chamado encerra o mesmo. c) c) Registra Funcionrio: este processo permitido somente ao administrador, que registra novos funcionrios conforme a necessidade. d) d) Consulta Visita: este processo permitido ao administrador e ao

16

vendedor, que permite realizar consulta sobre visitas j realizadas. e) f) Realiza Visita: este processo destina-se ao administrador, que tem por finalidade armazenar os acontecimentos das visitas realizadas. f) g) Atende Chamado: este processo de responsabilidade do tcnico, onde so armazenados os acontecimentos do chamado. g) h) Exclui Chamado: este processo permitido a secretria e ao administrador, com finalidade de excluir algum chamado aberto acidentalmente. h) i) Consulta Chamado: este processo permitido ao administrador, o cliente e a secretria, que permite realizar consulta sobre chamados j realizados. i) j) Abre Chamado: este processo permitido ao administrador, o cliente e a secretria, onde nele aberto um chamado tcnico conforme necessidade. j) k) Consulta Cliente: este processo permitido ao administrador, e a secretria, que permite realizar consultas sobre clientes. k) l) Consulta Cliente: este processo permitido ao administrador, e a secretria, que permite realizar consultas sobre mquinas. l) m) Registra Cliente: este processo permitido ao administrador, e a secretria, que permite registrar novos clientes conforme necessidade. m) n) Registra Mquina: este processo permitido ao administrador, e a secretria, que permite registrar novas mquinas conforme necessidade. n) o) Imprime Chamado: este processo permitido ao administrador, o cliente e a secretria, onde logo aps a abertura de um chamado ele permite imprimir o mesmo.

17

9.2 DIAGRAMA DE CLASSE

Figura 2 Diagrama de Classe do Controle de Chamados e Visitas

18

9.3 DIAGRAMA DE ATIVIDADE

Figura 3 Diagrama de Atividade de Consulta de Copiadoras

19

9.4 DIAGRAMA DE SEQUNCIA

Figura 4 Diagrama de Seqncia de Login ao Sistema

20

9.5 DIAGRAMA DE ENTIDADE RELACIONAMENTO MODELO CONCEITUAL

Figura 5 Diagrama de Entidade Relacionamento (DER) Modelo Conceitual

21

9.6 DIAGRAMA DE ENTIDADE RELACIONAMENTO MODELO LGICO

Figura 6 Diagrama de Entidade Relacionamento (DER) Modelo Lgico

22

10 CRONOGRAMA Atividades 1 Visita empresa Extrao dos Requisitos Anlise dos Requisitos Modelagem dos Dados Fundamentao da Proposta Elaborao do Projeto Reviso do Projeto Entrega do Projeto Ago. Set. Out. Nov.

23

11 CONCLUSO A idia de se criar um sistema de chamados e visitas para web, surgiu como desafio e contribuio para toda esta histria do mundo computacional. O sistema fornece ao administrador informaes especficas sobre a empresa, essas informaes podem ser usadas para o acompanhamento, controle e destina-se a apresent-las ao administrador, de forma grfica e de fcil visualizao, melhorar o processo da tomada de decises, dimensionamento de agilidade na prestao de qualquer informao solicitada pelo cliente. Considera-se que o objetivo principal do trabalho foi atingido: Desenvolver um Sistema Web utilizando apenas software livre. O sistema possibilita o gerenciamento do andamento dos chamados atravs dos vrios relatrios, para que o gestor tenha um melhor controle sobre eles. Possibilita o acompanhamento do desempenho dos tcnicos com a diviso dos chamados em tarefas. Com isto existe a possibilidade de saber o que cada tcnico fez no chamado sendo possvel ter um controle maior de nvel gerencial sobre os chamados. Os objetivos de aprendizagem do trabalho foram alcanados, pois o desenvolvimento do trabalho permitiu a aplicao dos conceitos estudados durante o curso, o aprofundamento sobre o estudo de sistemas de informaes, o estudo de novas ferramentas e tecnologias de desenvolvimento.

24

REFERNCIAS CAMPOS, A. O que software livre, Florianpolis, maro de 2006. Disponvel em http://br-linux.org/linux/faq-softwarelivre. Acesso em 10 de setembro de 2010. CARNEIRO, t.; LEAL s. Sig e sua importncia para tomada de decises, Rondnia, Dezembro de 2007. Disponvel em http://www.administradores.com.br/informe-se/artigos/sig-e-sua-importancia-paratomada-de-decisoes/26869/. Acesso em 21 de outubro de 2010. CENTRO DE EDUCAO PROFISSIONALIZANTE, A importncia de a sua empresa ter um Site, 2005. Disponvel em http://escoladeprotese.com.br/noti. Acesso em 15 de Outubro de 2010. COLHO, A. V. S. ; FERNEDA, E. ; MARTINS, A. de S. ; BARROS, M. A. ; GORGNIO, F. L. E. Help Desk inteligente em gesto do conhecimento: Um tratamento integrador de paradigmas. Inesc Em Revista, Una, v. 1, p. 46-51, 2003. Disponvel em: http://www.exercito.gov.br/06OMs/gabcmtex/PEGEB/artigopdf/help.PDF. Acesso em 15 Setembro de 2010. GONALVES. Revoluo da Informtica, Florianpolis, Junho de 1993. Disponvel em (Gonalves et all, 1993, p. 109). Acesso em 12 de Outubro de 2010. MAGALHES, Luizio; PINHEIRO Walfrido B. Gerenciamento de servios de TI na prtica: Uma abordagem com base na ITIL. So Paulo: Novatec, 2007. Acesso em 01 de Outubro de 2010. SILVA, Jaime J. Help Desk com sistema RBC para as gerncias de aplicativos do Banco do Brasil. 2004. 45 f. Trabalho de Concluso de Curso (Curso de Especializao e Desenvolvimento, segurana e Qualidade a Internet) Instituto de Informtica, Universidade Federal do Rio Grande do Sul, Porto Alegre. Acesso em 01 de Outubro de 2010. TAPIAS, D. Internet. 2006. Disponvel em http://www.infonova.com.br. Acesso em 26 de outubro de 2010. UNIPRESS, Software Inc. O Help Desk baseado na web: O que ele pode fazer por sua empresa e porque voc precisa dele. NM Brasil, [So Paulo], n.15, fev., 2001.Disponvel em: http://www.mmbrasil.com.br/images/stories/solucoes/doc/footprints.pdf. Acesso em: 25 setembro de 2010. UNIVERSIDADE FEDERAL DE SANTA CATARINA, Tecnologia, 2008. Disponvel em http://www.eps.ufsc.br/teses96/proenca/cap2/capitulo2.html . Acesso em 10 de Abril de 2010.

25

WIKIPEDIA A ENCICLOPEDIA LIVRE, Internet, 2002. Disponvel http://pt.wikipedia.org/wiki/Internet. Acesso em 25 de maro de 2010.

em

26

ANEXOS

27

ANEXO 1 Telas do Programa

Figura 7 Login ao Sistema

Figura 8 Abertura de Chamados

28

Figura 9 Cadastro de Cliente Pessoa Fsica

29

Figura 10 Cadastro de Pessoa Jurdica

Figura 11 Cadastro de Copiadoras

30

Figura 12 Cadastro de Funcionrios

Figura 13 Consulta de Copiadoras

31

Figura 14 Encaminhar Chamado ao tcnico

Figura 15 Consulta Chamado individual

Figura 16 Consulta todos os chamados

32

Figura 17 Consulta Visitas

Figura 18 Relatrio de Chamados

33

Figura 19 rea Administrativa

34

ANEXO 2 Cdigo Fonte BUSCACONCOP.PHP Cadastro de Copiadoras $(function($) { // Quando o formulrio for enviado, essa funo chamada $("#formulario").submit(function() { // Colocamos os valores de cada campo em uma vriavel para facilitar a manipulao var nomecliente = $("#nomecliente").val(); var datavisita = $("#datavisita").val(); var descvisita = $("#descvisita").val(); // Exibe mensagem de carregamento $("#status").html(""); // Fazemos a requiso ajax com o arquivo tratacadcop.php e enviamos os valores de cada campo atravs do mtodo POST $.post('tratacadvisita.php', {nomecliente: nomecliente, datavisita: datavisita, descvisita: descvisita }, function(resposta) { // Quando terminada a requisio // Exibe a div status $("#status").slideDown(); // Se a resposta um erro if (resposta != false) {

40

// Exibe o erro na div $("#status").html(resposta); } // Se resposta for false, ou seja, no ocorreu nenhum erro else { // Exibe mensagem de sucesso $("#status").html("Cadastro Efetuado com Sucesso!"); // Limpando todos os campos $("#nomecliente").val(""); $("#datavisita").val(""); $("#descvisita").val(""); } }); }); }); Cadastro de Visitas
Nome: Cliente:

41

Consulta Geral de Copiadoras Consulta de Copiadoras Digite o Modelo:

52



CONN.PHP DELCOP.PHP DESLOGA.PHP Notas

53

$(function($) { // Quando o formulrio for enviado, essa funo chamada $("#formulario").submit(function() { // Colocamos os valores de cada campo em uma vriavel para facilitar a manipulao var nota = $("#nota").val(); var id = $("#id").val(); // Exibe mensagem de carregamento $("#statusn").html(""); // Fazemos a requiso ajax com o arquivo tratacadcop.php e enviamos os valores de cada campo atravs do mtodo POST $.post('tratanota.php', {nota: nota}, function(resposta) { // Quando terminada a requisio // Exibe a div status $("#statusn").slideDown(); // Se a resposta um erro if (resposta != false) { // Exibe o erro na div $("#statusn").html(resposta); } // Se resposta for false, ou seja, no ocorreu nenhum erro else { // Exibe mensagem de sucesso $("#statusn").html("Cadastro Efetuado com Sucesso!"); // Limpando todos os campos $("#nota").val(""); } }); }); });
Classifique seu Atendimento!

54

N NOME DEFEITO SITUAO NOTA


55

EXIBECONCOP.PHP function teste(id,modelo){ //funcao testa pega o id e o nome if ( confirm('Deseja Excluir o '+modelo) ) { // abre janela de confirmao location.href="delcop.php?id="+id; }else{ location.href="exibeconcop.php"; } } Consulta Geral de Copiadoras Consulta de Copiadoras! CDIGO N DE SERIE MODELO NUMERADOR EXCLUIR Cadastro de Copiadoras Notas $(function($) { // Quando o formulrio for enviado, essa funo chamada $("#formulario").submit(function() { // Colocamos os valores de cada campo em uma vriavel para facilitar

60

a manipulao var nota = $("#nota").val(); var id = $("#id").val(); // Exibe mensagem de carregamento $("#statusn").html(""); // Fazemos a requiso ajax com o arquivo tratacadcop.php e enviamos os valores de cada campo atravs do mtodo POST $.post('tratanota.php', {nota: nota}, function(resposta) { // Quando terminada a requisio // Exibe a div status $("#statusn").slideDown(); // Se a resposta um erro if (resposta != false) { // Exibe o erro na div $("#statusn").html(resposta); } // Se resposta for false, ou seja, no ocorreu nenhum erro else { // Exibe mensagem de sucesso $("#statusn").html("Cadastro Efetuado com Sucesso!"); // Limpando todos os campos $("#nota").val(""); } }); }); });
Classifique seu Atendimento! N NOME DEFEITO SITUAO NOTA


TOPO.PHP $(array) if ( match[1] ) selector = jQuery.clean( [ match[1] ], context ); // HANDLE: $("#id") else { var elem = document.getElementById( match[3] ); // Handle the case where IE and Opera return items // by name instead of ID if ( elem && elem.id != match[3] ) return jQuery().find( selector ); // Otherwise, we inject the element directly into the jQuery object var ret = jQuery( elem || [] ); ret.context = document; ret.selector = selector; return ret; } // HANDLE: $(expr, [context]) // (which is just equivalent to: $(content).find(expr) } else return jQuery( context ).find( selector ); // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) return jQuery( document ).ready( selector ); // Make sure that old selector state is passed along if ( selector.selector && selector.context ) { this.selector = selector.selector; this.context = selector.context; } return this.setArray(jQuery.isArray( selector ) ? selector : jQuery.makeArray(selector)); },

69

// Start with an empty selector selector: "", // The current version of jQuery being used jquery: "1.3.2", // The number of elements contained in the matched element set size: function() { return this.length; }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num === undefined ? // Return a 'clean' array Array.prototype.slice.call( this ) : // Return just the object this[ num ]; }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = jQuery( elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; if ( name === "find" ) ret.selector = this.selector + (this.selector ? " " : "") + selector; else if ( name ) ret.selector = this.selector + "." + name + "(" + selector + ")"; // Return the newly-formed element set return ret; }, // Force the current matched set of elements to become // the specified array of elements (destroying the stack in the process) // You should use pushStack() in order to do this, but maintain the stack setArray: function( elems ) { // Resetting the length to 0, then using the native Array push // is a super-fast way to populate an object with array-like properties this.length = 0;

70

Array.prototype.push.apply( this, elems ); return this; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem && elem.jquery ? elem[0] : elem , this ); }, attr: function( name, value, type ) { var options = name; // Look for the case where we're accessing a style value if ( typeof name === "string" ) if ( value === undefined ) return this[0] && jQuery[ type || "attr" ]( this[0], name ); else { options = {}; options[ name ] = value; } // Check to see if we're setting style values return this.each(function(i){ // Set all the styles for ( name in options ) jQuery.attr( type ? this.style : this, name, jQuery.prop( this, options[ name ], type, i, name ) ); }); }, css: function( key, value ) {

71

// ignore negative width and height values if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) value = undefined; return this.attr( key, value, "curCSS" ); }, text: function( text ) { if ( typeof text !== "object" && text != null ) return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); var ret = ""; jQuery.each( text || this, function(){ jQuery.each( this.childNodes, function(){ if ( this.nodeType != 8 ) ret += this.nodeType != 1 ? this.nodeValue : jQuery.fn.text( [ this ] ); }); }); return ret; }, wrapAll: function( html ) { if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).clone(); if ( this[0].parentNode ) wrap.insertBefore( this[0] ); wrap.map(function(){ var elem = this; while ( elem.firstChild ) elem = elem.firstChild; return elem; }).append(this); } return this; }, wrapInner: function( html ) { return this.each(function(){ jQuery( this ).contents().wrapAll( html ); });

72

}, wrap: function( html ) { return this.each(function(){ jQuery( this ).wrapAll( html ); }); }, append: function() { return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.appendChild( elem ); }); }, prepend: function() { return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.insertBefore( elem, this.firstChild ); }); }, before: function() { return this.domManip(arguments, false, function(elem){ this.parentNode.insertBefore( elem, this ); }); }, after: function() { return this.domManip(arguments, false, function(elem){ this.parentNode.insertBefore( elem, this.nextSibling ); }); }, end: function() { return this.prevObject || jQuery( [] ); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: [].push, sort: [].sort, splice: [].splice, find: function( selector ) { if ( this.length === 1 ) { var ret = this.pushStack( [], "find", selector ); ret.length = 0; jQuery.find( selector, this[0], ret ); return ret;

73

} else { return function(elem){ } },

this.pushStack(

jQuery.unique(jQuery.map(this,

return jQuery.find( selector, elem ); })), "find", selector );

clone: function( events ) { // Do the clone var ret = this.map(function(){ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { // IE copies events bound via attachEvent when // using cloneNode. Calling detachEvent on the // clone will also remove the events from the orignal // In order to get around this, we use innerHTML. // Unfortunately, this means some modifications to // attributes in IE that are actually only stored // as properties will not be copied (such as the // the name attribute on an input). var html = this.outerHTML; if ( !html ) { var div = this.ownerDocument.createElement("div"); div.appendChild( this.cloneNode(true) ); html = div.innerHTML; } return jQuery.clean([html.replace(/ null)"/g, "").replace(/^\s*/, "")])[0]; } else return this.cloneNode(true); }); // Copy the events from the original to the clone if ( events === true ) { var orig = this.find("*").andSelf(), i = 0; ret.find("*").andSelf().each(function(){ if ( this.nodeName !== orig[i].nodeName ) return; var events = jQuery.data( orig[i], "events" ); for ( var type in events ) { for ( var handler in events[ type ] ) { jQuery.event.add( this, type, events[ type ] [ handler ], events[ type ][ handler ].data ); } } jQuery\d+="(?:\d+|

74

i++; }); } // Return the cloned set return ret; }, filter: function( selector ) { return this.pushStack( jQuery.isFunction( selector ) && jQuery.grep(this, function(elem, i){ return selector.call( elem, i ); }) || jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ return elem.nodeType === 1; }) ), "filter", selector ); }, closest: function( selector ) { var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null, closer = 0; return this.map(function(){ var cur = this; while ( cur && cur.ownerDocument ) { if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) { jQuery.data(cur, "closest", closer); return cur; } cur = cur.parentNode; closer++; } }); }, not: function( selector ) { if ( typeof selector === "string" ) // test special case where just one selector is passed in if ( isSimple.test( selector ) ) return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); else selector = jQuery.multiFilter( selector, this ); var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;

75

return this.filter(function() { return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; }); }, add: function( selector ) { return this.pushStack( jQuery.unique( jQuery.merge( this.get(), typeof selector === "string" ? jQuery( selector ) : jQuery.makeArray( selector ) ))); }, is: function( selector ) { return !!selector && jQuery.multiFilter( selector, this ).length > 0; }, hasClass: function( selector ) { return !!selector && this.is( "." + selector ); }, val: function( value ) { if ( value === undefined ) { var elem = this[0]; if ( elem ) { if( jQuery.nodeName( elem, 'option' ) ) return (elem.attributes.value || elem.value : elem.text;

{}).specified

?

// We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, values = [], options = elem.options, one = elem.type == "select-one"; // Nothing was selected if ( index < 0 ) return null; // Loop through all the selected options for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; if ( option.selected ) { // Get the specifc value for the option

76

value = jQuery(option).val(); // We don't need an array for one selects if ( one ) return value; // Multi-Selects return an array values.push( value ); } } return values; } // Everything else, we just grab the value return (elem.value || "").replace(/\r/g, ""); } return undefined; } if ( typeof value === "number" ) value += ''; return this.each(function(){ if ( this.nodeType != 1 ) return; if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) this.checked = (jQuery.inArray(this.value, value) >= 0 || jQuery.inArray(this.name, value) >= 0); else if ( jQuery.nodeName( this, "select" ) ) { var values = jQuery.makeArray(value); jQuery( "option", this ).each(function(){ this.selected = (jQuery.inArray( this.value, values ) >= 0 || jQuery.inArray( this.text, values ) >= 0); }); if ( !values.length ) this.selectedIndex = -1; } else this.value = value; }); },

77

html: function( value ) { return value === undefined ? (this[0] ? this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : null) : this.empty().append( value ); }, replaceWith: function( value ) { return this.after( value ).remove(); }, eq: function( i ) { return this.slice( i, +i + 1 ); }, slice: function() { return this.pushStack( Array.prototype.slice.apply( this, arguments ), "slice", Array.prototype.slice.call(arguments).join(",") ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function(elem, i){ return callback.call( elem, i, elem ); })); }, andSelf: function() { return this.add( this.prevObject ); }, domManip: function( args, table, callback ) { if ( this[0] ) { var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), first = fragment.firstChild; if ( first ) for ( var i = 0, l = this.length; i < l; i++ ) callback.call( root(this[i], first), this.length > 1 || i > 0 ? fragment.cloneNode(true) fragment ); if ( scripts ) jQuery.each( scripts, evalScript ); } :

78

return this; function root( elem, cur ) { return table && jQuery.nodeName(elem, "table") jQuery.nodeName(cur, "tr") ? (elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody"))) : elem; } } }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; function evalScript( i, elem ) { if ( elem.src ) jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); else jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); if ( elem.parentNode ) elem.parentNode.removeChild( elem ); } function now(){ return +new Date; } jQuery.extend = jQuery.fn.extend = function() { // copy reference to target object var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } &&

79

// Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) target = {}; // extend jQuery itself if only one argument is passed if ( length == i ) { target = this; --i; } for ( ; i < length; i++ ) // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) // Extend the base object for ( var name in options ) { var src = target[ name ], copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) continue; // Recurse if we're merging object values if ( deep && copy && typeof copy === "object" && ! copy.nodeType ) target[ name ] = jQuery.extend( deep, // Never move original objects, clone them src || ( copy.length != null ? [ ] : { } ) , copy ); // Don't bring in undefined values else if ( copy !== undefined ) target[ name ] = copy; } // Return the modified object return target; }; // exclude the following css properties to add px var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, // cache defaultView defaultView = document.defaultView || {}, toString = Object.prototype.toString; jQuery.extend({ noConflict: function( deep ) { window.$ = _$; if ( deep )

80

window.jQuery = _jQuery; return jQuery; }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return toString.call(obj) === "[object Function]"; }, isArray: function( obj ) { return toString.call(obj) === "[object Array]"; }, // check if an element is in a (or is an) XML document isXMLDoc: function( elem ) { return elem.nodeType === 9 && elem.documentElement.nodeName ! == "HTML" || !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument ); }, // Evalulates a script in a global context globalEval: function( data ) { if ( data && /\S/.test(data) ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scopeevaluation-and-dom.html var head = document.getElementsByTagName("head")[0] || document.documentElement, script = document.createElement("script"); script.type = "text/javascript"; if ( jQuery.support.scriptEval ) script.appendChild( document.createTextNode( data ) ); else script.text = data; // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709). head.insertBefore( script, head.firstChild ); head.removeChild( script ); } }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toUpperCase() ==

81

name.toUpperCase(); }, // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length; if ( args ) { if ( length === undefined ) { for ( name in object ) if ( callback.apply( object[ name ], args ) === false ) break; } else for ( ; i < length; ) if ( callback.apply( object[ i++ ], args ) === false ) break; // A special, fast, case for the most common use of each } else { if ( length === undefined ) { for ( name in object ) if ( callback.call( object[ name ], name, object[ name ] ) === false ) break; } else for ( var value = object[0]; i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} } return object; }, prop: function( elem, value, type, i, name ) { // Handle executable functions if ( jQuery.isFunction( value ) ) value = value.call( elem, i ); // Handle passing in a number to a CSS property return typeof value === "number" && type == "curCSS" && ! exclude.test( name ) ? value + "px" : value; }, className: { // internal only, use addClass("class") add: function( elem, classNames ) { jQuery.each((classNames || "").split(/\s+/), function(i, className) {

82

if ( elem.nodeType == 1 && ! jQuery.className.has( elem.className, className ) ) elem.className += (elem.className ? " " : "") + className; }); }, // internal only, use removeClass("class") remove: function( elem, classNames ) { if (elem.nodeType == 1) elem.className = classNames !== undefined ? jQuery.grep(elem.className.split(/\s+/), function(className){ return !jQuery.className.has( classNames, className ); }).join(" ") : ""; }, // internal only, use hasClass("class") has: function( elem, className ) { return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; } }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { var old = {}; // Remember the old values, and insert the new ones for ( var name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } callback.call( elem ); // Revert the old values for ( var name in options ) elem.style[ name ] = old[ name ]; }, css: function( elem, name, force, extra ) { if ( name == "width" || name == "height" ) { var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; function getWH() { val = name == "width" ? elem.offsetWidth :

83

elem.offsetHeight; if ( extra === "border" ) return; jQuery.each( which, function() { if ( !extra ) val -= parseFloat(jQuery.curCSS( "padding" + this, true)) || 0; if ( extra === "margin" ) val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0; else val "border" + this + "Width", true)) || 0; }); } if ( elem.offsetWidth !== 0 ) getWH(); else jQuery.swap( elem, props, getWH ); return Math.max(0, Math.round(val)); } return jQuery.curCSS( elem, name, force ); }, curCSS: function( elem, name, force ) { var ret, style = elem.style; // We need to handle opacity special in IE if ( name == "opacity" && !jQuery.support.opacity ) { ret = jQuery.attr( style, "opacity" ); return ret == "" ? "1" : ret; } // Make sure we're using the right name for getting the float value if ( name.match( /float/i ) ) name = styleFloat; if ( !force && style && style[ name ] ) ret = style[ name ]; else if ( defaultView.getComputedStyle ) { -= parseFloat(jQuery.curCSS( elem,

elem,

84

// Only "float" is needed here if ( name.match( /float/i ) ) name = "float"; name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); var computedStyle = defaultView.getComputedStyle( elem, null ); if ( computedStyle ) ret = computedStyle.getPropertyValue( name ); // We should always get a number back from opacity if ( name == "opacity" && ret == "" ) ret = "1"; } else if ( elem.currentStyle ) { var camelCase = name.replace(/\-(\w)/g, function(all, letter){ return letter.toUpperCase(); }); ret = elem.currentStyle[ camelCase ]; elem.currentStyle[ name ] ||

// From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { // Remember the original values var left = style.left, rsLeft = elem.runtimeStyle.left; // Put in the new values to get a computed value out elem.runtimeStyle.left = elem.currentStyle.left; style.left = ret || 0; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; elem.runtimeStyle.left = rsLeft; } } return ret; }, clean: function( elems, context, fragment ) {

85

context = context || document; // !context.createElement fails in IE with an error but returns typeof 'object' if ( typeof context.createElement === "undefined" ) context = context.ownerDocument || context[0].ownerDocument || document; context[0] &&

// If a single string is passed in and it's a single tag // just do a createElement and skip the rest if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { var match = /^$/.exec(elems[0]); if ( match ) return [ context.createElement( match[1] ) ]; } var ret = [], scripts = [], div = context.createElement("div"); jQuery.each(elems, function(i, elem){ if ( typeof elem === "number" ) elem += ''; if ( !elem ) return; // Convert html string into DOM nodes if ( typeof elem === "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(]*?)\/>/g, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta| param|hr|area|embed)$/i) ? all : front + ">"; }); // Trim whitespace, otherwise indexOf won't work as expected var 10).toLowerCase(); var wrap = // option or optgroup !tags.indexOf(" 0 ? this.clone(true) : this).get(); jQuery.fn[ original ].apply( jQuery(insert[i]), elems ); ret = ret.concat( elems ); } return this.pushStack( ret, name, selector ); }; }); jQuery.each({ removeAttr: function( name ) { jQuery.attr( this, name, "" ); if (this.nodeType == 1) this.removeAttribute( name ); }, addClass: function( classNames ) { jQuery.className.add( this, classNames ); }, removeClass: function( classNames ) { jQuery.className.remove( this, classNames ); }, toggleClass: function( classNames, state ) { if( typeof state !== "boolean" ) state = !jQuery.className.has( this, classNames ); jQuery.className[ state ? "add" : "remove" ]( this, classNames ); }, remove: function( selector ) { if ( !selector || jQuery.filter( selector, [ this ] ).length ) { // Prevent memory leaks jQuery( "*", this ).add([this]).each(function(){ jQuery.event.remove(this); jQuery.removeData(this); }); if (this.parentNode) this.parentNode.removeChild( this ); } }, empty: function() { // Remove element nodes and prevent memory leaks jQuery(this).children().remove(); // Remove any remaining nodes while ( this.firstChild ) this.removeChild( this.firstChild ); }

94

}, function(name, fn){ jQuery.fn[ name ] = function(){ return this.each( fn, arguments ); }; }); // Helper function used by the dimensions and offset modules function num(elem, prop) { return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; } var expando = "jQuery" + now(), uuid = 0, windowData = {}; jQuery.extend({ cache: {}, data: function( elem, name, data ) { elem = elem == window ? windowData : elem; var id = elem[ expando ]; // Compute a unique ID for the element if ( !id ) id = elem[ expando ] = ++uuid; // Only generate the data cache if we're // trying to access or manipulate it if ( name && !jQuery.cache[ id ] ) jQuery.cache[ id ] = {}; // Prevent overriding the named cache with undefined values if ( data !== undefined ) jQuery.cache[ id ][ name ] = data; // Return the named cache data, or the ID for the element return name ? jQuery.cache[ id ][ name ] : id; }, removeData: function( elem, name ) { elem = elem == window ? windowData : elem; var id = elem[ expando ]; // If we want to remove a specific section of the element's data if ( name ) {

95

if ( jQuery.cache[ id ] ) { // Remove the section of cache data delete jQuery.cache[ id ][ name ]; // If we've removed all the data, remove the element's cache name = ""; for ( name in jQuery.cache[ id ] ) break; if ( !name ) jQuery.removeData( elem ); } // Otherwise, we want to remove all of the element's data } else { // Clean up the element expando try { delete elem[ expando ]; } catch(e){ // IE has trouble directly removing the expando // but it's ok with using removeAttribute if ( elem.removeAttribute ) elem.removeAttribute( expando ); } // Completely remove the data cache delete jQuery.cache[ id ]; } }, queue: function( elem, type, data ) { if ( elem ){ type = (type || "fx") + "queue"; var q = jQuery.data( elem, type ); if ( !q || jQuery.isArray(data) ) q = jQuery.data( elem, type, jQuery.makeArray(data) ); else if( data ) q.push( data ); } return q; }, dequeue: function( elem, type ){ var queue = jQuery.queue( elem, type ), fn = queue.shift();

96

if( !type || type === "fx" ) fn = queue[0]; if( fn !== undefined ) fn.call(elem); } }); jQuery.fn.extend({ data: function( key, value ){ var parts = key.split("."); parts[1] = parts[1] ? "." + parts[1] : ""; if ( value === undefined ) { var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); if ( data === undefined && this.length ) data = jQuery.data( this[0], key ); return data === undefined && parts[1] ? this.data( parts[0] ) : data; } else return value]).each(function(){ }); }, removeData: function( key ){ return this.each(function(){ jQuery.removeData( this, key ); }); }, queue: function(type, data){ if ( typeof type !== "string" ) { data = type; type = "fx"; } if ( data === undefined ) return jQuery.queue( this[0], type ); return this.each(function(){ var queue = jQuery.queue( this, type, data ); if( type == "fx" && queue.length == 1 ) queue[0].call(this); this.trigger("setData" + parts[1] + "!", [parts[0], jQuery.data( this, key, value );

97

}); }, dequeue: function(type){ return this.each(function(){ jQuery.dequeue( this, type ); }); } });/*! * Sizzle CSS Selector Engine - v0.9.3 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\ [\\]+)+|[>+~])(\s*,\s*)?/g, done = 0, toString = Object.prototype.toString; var Sizzle = function(selector, context, results, seed) { results = results || []; context = context || document; if ( context.nodeType !== 1 && context.nodeType !== 9 ) return []; if ( !selector || typeof selector !== "string" ) { return results; } var parts = [], m, set, checkSet, check, mode, extra, prune = true; // Reset the position of the chunker regexp (start from head) chunker.lastIndex = 0; while ( (m = chunker.exec(selector)) !== null ) { parts.push( m[1] ); if ( m[2] ) { extra = RegExp.rightContext; break; } } if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context ); } else { set = Expr.relative[ parts[0] ] ?

98

[ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) selector += parts.shift(); set = posProcess( selector, set ); } } } else { var ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === context.parentNode ? context.parentNode : context, isXML(context) ); set = Sizzle.filter( ret.expr, ret.set ); if ( parts.length > 0 ) { checkSet = makeArray(set); } else { prune = false; } while ( parts.length ) { var cur = parts.pop(), pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, isXML(context) ); } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { throw "Syntax error, unrecognized expression: " + (cur || selector); }

1

&&

99

if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context.nodeType === 1 ) { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, context, results, seed ); if ( sortOrder ) { hasDuplicate = false; results.sort(sortOrder); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[i-1] ) { results.splice(i--, 1); } } } } } return results; }; Sizzle.matches = function(expr, set){ return Sizzle(expr, null, null, set); }; Sizzle.find = function(expr, context, isXML){ var set, match; if ( !expr ) { return [];

||

100

} for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var type = Expr.order[i], match; if ( (match = Expr.match[ type ].exec( expr )) ) { var left = RegExp.leftContext; if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace(/\\/g, ""); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = context.getElementsByTagName("*"); } return {set: set, expr: expr}; }; Sizzle.filter = function(expr, set, inplace, not){ var old = expr, result = [], curLoop = set, match, anyFound, isXMLFilter = set && set[0] && isXML(set[0]); while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.match[ type ].exec( expr )) != null ) { var filter = Expr.filter[ type ], found, item; anyFound = false; if ( curLoop == result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } }

101

if ( match ) { for ( var i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, curLoop ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } // Improper expression if ( expr == old ) { if ( anyFound == null ) { throw "Syntax error, unrecognized expression: " + expr; } else { break; } } old = expr; }

i,

102

return curLoop; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*) (.*?)\3|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*) +)\2\))?/ }, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function(elem){ return elem.getAttribute("href"); } }, relative: { "+": function(checkSet, part, isXML){ var isPartStr = typeof part === "string", isTag = isPartStr && !/\W/.test(part), isPartStrNotTag = isPartStr && !isTag; if ( isTag && !isXML ) { part = part.toUpperCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) elem.nodeType !== 1 ) {} checkSet[i] elem.nodeName === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); = isPartStrNotTag || elem

&& &&

103

} }, ">": function(checkSet, part, isXML){ var isPartStr = typeof part === "string"; if ( isPartStr && !/\W/.test(part) ) { part = isXML ? part : part.toUpperCase(); for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName === part ? parent : false; } } } else { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( !part.match(/\W/) ) { var nodeCheck part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); }, "~": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !part.match(/\W/) ) { var nodeCheck = part = isXML part.toUpperCase(); checkFn = dirNodeCheck; ? part : = part = isXML ? part :

104

} checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); } }, find: { ID: function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? [m] : []; } }, NAME: function(match, context, isXML){ if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName(match[1]); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function(match, context){ return context.getElementsByTagName(match[1]); } }, preFilter: { CLASS: function(match, curLoop, inplace, result, not, isXML){ match = " " + match[1].replace(/\\/g, "") + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && elem.className + " ").indexOf(match) >= 0) ) { if ( !inplace ) result.push( elem ); } else if ( inplace ) { curLoop[i] = false; } } }

("

"

+

105

return false; }, ID: function(match){ return match[1].replace(/\\/g, ""); }, TAG: function(match, curLoop){ for ( var i = 0; curLoop[i] === false; i++ ){} return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); }, CHILD: function(match){ if ( match[1] == "nth" ) { // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); // calculate the numbers (first)n+(last) including if they are negative match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } // TODO: Move to normal caching system match[0] = done++; return match; }, ATTR: function(match, curLoop, inplace, result, not, isXML){ var name = match[1].replace(/\\/g, ""); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function(match, curLoop, inplace, result, not){ if ( match[1] === "not" ) { // If we're dealing with a complex expression, or a simple one if ( match[3].match(chunker).length > 1 ||

106

/^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function(match){ match.unshift( true ); return match; } }, filters: { enabled: function(elem){ return elem.disabled === false && elem.type !== "hidden"; }, disabled: function(elem){ return elem.disabled === true; }, checked: function(elem){ return elem.checked === true; }, selected: function(elem){ // Accessing this property makes selected-by-default // options in Safari work properly elem.parentNode.selectedIndex; return elem.selected === true; }, parent: function(elem){ return !!elem.firstChild; }, empty: function(elem){ return !elem.firstChild; }, has: function(elem, i, match){ return !!Sizzle( match[3], elem ).length; }, header: function(elem){ return /h\d/i.test( elem.nodeName ); }, Expr.match.POS.test( match[0] ) ||

107

text: function(elem){ return "text" === elem.type; }, radio: function(elem){ return "radio" === elem.type; }, checkbox: function(elem){ return "checkbox" === elem.type; }, file: function(elem){ return "file" === elem.type; }, password: function(elem){ return "password" === elem.type; }, submit: function(elem){ return "submit" === elem.type; }, image: function(elem){ return "image" === elem.type; }, reset: function(elem){ return "reset" === elem.type; }, button: function(elem){ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; }, input: function(elem){ return /input|select|textarea|button/i.test(elem.nodeName); } }, setFilters: { first: function(elem, i){ return i === 0; }, last: function(elem, i, match, array){ return i === array.length - 1; }, even: function(elem, i){ return i % 2 === 0; }, odd: function(elem, i){ return i % 2 === 1; }, lt: function(elem, i, match){ return i < match[3] - 0; }, gt: function(elem, i, match){ return i > match[3] - 0;

108

}, nth: function(elem, i, match){ return match[3] - 0 == i; }, eq: function(elem, i, match){ return match[3] - 0 == i; } }, filter: { PSEUDO: function(elem, match, i, array){ var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3];

elem.innerText

||

for ( var i = 0, l = not.length; i < l; i++ ) { if ( not[i] === elem ) { return false; } } return true; } }, CHILD: function(elem, match){ var type = match[1], node = elem; switch (type) { case 'only': case 'first': while (node = node.previousSibling) { if ( node.nodeType === 1 ) return false; } if ( type == 'first') return true; node = elem; case 'last': while (node = node.nextSibling) { if ( node.nodeType === 1 ) return false; } return true; case 'nth': var first = match[2], last = match[3]; if ( first == 1 && last == 0 ) { return true; }

109

var doneName = match[0], parent = elem.parentNode; if ( parent && (parent.sizcache !== doneName || ! elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent.sizcache = doneName; } var diff = elem.nodeIndex - last; if ( first == 0 ) { return diff == 0; } else { return ( diff % first == 0 && diff / first >= 0 ); } } }, ID: function(elem, match){ return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function(elem, match){ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; }, CLASS: function(elem, match){ return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function(elem, match){ var name = match[1], result = Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : type === "=" ?

110

value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value != check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function(elem, match, i, array){ var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS; for ( var type in Expr.match ) { Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\ (]*\))/.source ); } var makeArray = function(array, results) { array = Array.prototype.slice.call( array ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; // Perform a simple check to determine if the browser is capable of // converting a NodeList to an array using builtin methods. try { Array.prototype.slice.call( document.documentElement.childNodes );

111

// Provide a fallback method if it does not work } catch(e){ makeArray = function(array, results) { var ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var i = 0, l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( var i = 0; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( "sourceIndex" in document.documentElement ) { sortOrder = function( a, b ) { var ret = a.sourceIndex - b.sourceIndex; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( document.createRange ) { sortOrder = function( a, b ) { var aRange = a.ownerDocument.createRange(), bRange b.ownerDocument.createRange(); aRange.selectNode(a); aRange.collapse(true); bRange.selectNode(b); bRange.collapse(true);

=

112

var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } // Check to see if the browser returns elements by name when // querying by getElementById (and provide a workaround) (function(){ // We're going to inject a fake input element with a specified name var form = document.createElement("form"), id = "script" + (new Date).getTime(); form.innerHTML = ""; // Inject it into the root element, check its status, and remove it quickly var root = document.documentElement; root.insertBefore( form, root.firstChild ); // The workaround has to do additional checks after a getElementById // Which slows things down for other browsers (hence the branching) if ( !!document.getElementById( id ) ) { Expr.find.ID = function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function(elem, match){ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); })(); (function(){ // Check to see if the browser returns only elements // when doing getElementsByTagName("*") // Create a fake element var div = document.createElement("div");

113

div.appendChild( document.createComment("") ); // Make sure no comments are found if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function(match, context){ var results = context.getElementsByTagName(match[1]); // Filter out possible comments if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } // Check to see if an attribute returns normalized href attributes div.innerHTML = ""; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function(elem){ return elem.getAttribute("href", 2); }; } })(); if ( document.querySelectorAll ) (function(){ var oldSizzle = Sizzle, div = document.createElement("div"); div.innerHTML = ""; // Safari can't handle uppercase or unicode characters when // in quirks mode. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function(query, context, extra, seed){ context = context || document; // Only use querySelectorAll on non-XML documents // (ID selectors don't work in non-HTML documents) if ( !seed && context.nodeType === 9 && !isXML(context) ) {

114

try { return extra ); } catch(e){} } return oldSizzle(query, context, extra, seed); }; Sizzle.find = oldSizzle.find; Sizzle.filter = oldSizzle.filter; Sizzle.selectors = oldSizzle.selectors; Sizzle.matches = oldSizzle.matches; })(); if ( document.getElementsByClassName document.documentElement.getElementsByClassName ) (function(){ var div = document.createElement("div"); div.innerHTML = ""; // Opera can't find a second classname (in 9.6) if ( div.getElementsByClassName("e").length === 0 ) return; // Safari caches class attributes, doesn't catch changes (in 3.2) div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) return; Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function(match, context, isXML) { if ( typeof context.getElementsByClassName !== "undefined" && ! isXML ) { return context.getElementsByClassName(match[1]); } }; })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { var sibDir = dir == "previousSibling" && !isXML; for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { if ( sibDir && elem.nodeType === 1 ){ elem.sizcache = doneName; elem.sizset = i; } elem = elem[dir]; var match = false; && makeArray( context.querySelectorAll(query),

115

while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem.sizcache = doneName; elem.sizset = i; } if ( elem.nodeName === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { var sibDir = dir == "previousSibling" && !isXML; for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { if ( sibDir && elem.nodeType === 1 ) { elem.sizcache = doneName; elem.sizset = i; } elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem.sizcache = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) {

116

match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } var contains = document.compareDocumentPosition ? function(a, b){ return a.compareDocumentPosition(b) & 16; } : function(a, b){ return a !== b && (a.contains ? a.contains(b) : true); }; var isXML = function(elem){ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || !!elem.ownerDocument && isXML( elem.ownerDocument ); }; var posProcess = function(selector, context){ var tmpSet = [], later = "", match, root = context.nodeType ? [context] : context; // Position selectors must be done after the filter // And so must :not(positional) so we move all PSEUDOs to the end while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet ); } return Sizzle.filter( later, tmpSet ); };

117

// EXPOSE jQuery.find = Sizzle; jQuery.filter = Sizzle.filter; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; Sizzle.selectors.filters.hidden = function(elem){ return elem.offsetWidth === 0 || elem.offsetHeight === 0; }; Sizzle.selectors.filters.visible = function(elem){ return elem.offsetWidth > 0 || elem.offsetHeight > 0; }; Sizzle.selectors.filters.animated = function(elem){ return jQuery.grep(jQuery.timers, function(fn){ return elem === fn.elem; }).length; }; jQuery.multiFilter = function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return Sizzle.matches(expr, elems); }; jQuery.dir = function( elem, dir ){ var matched = [], cur = elem[dir]; while ( cur && cur != document ) { if ( cur.nodeType == 1 ) matched.push( cur ); cur = cur[dir]; } return matched; }; jQuery.nth = function(cur, result, dir, elem){ result = result || 1; var num = 0; for ( ; cur; cur = cur[dir] ) if ( cur.nodeType == 1 && ++num == result ) break; return cur; }; jQuery.sibling = function(n, elem){

118

var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType == 1 && n != elem ) r.push( n ); } return r; }; return; window.Sizzle = Sizzle; })(); /* * A number of helper functions used for managing events. * Many of the ideas behind this code originated from * Dean Edwards' addEvent library. */ jQuery.event = { // Bind an event to an element // Original by Dean Edwards add: function(elem, types, handler, data) { if ( elem.nodeType == 3 || elem.nodeType == 8 ) return; // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process if ( elem.setInterval && elem != window ) elem = window; // Make sure that the function being executed has a unique ID if ( !handler.guid ) handler.guid = this.guid++; // if data is passed, bind to handler if ( data !== undefined ) { // Create temporary function pointer to original handler var fn = handler; // Create unique handler function, wrapped around original handler handler = this.proxy( fn ); // Store data in unique handler handler.data = data; }

119

// Init the element's event structure var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ // Handle the second event of a trigger and when // an event is called after a page has unloaded return typeof jQuery !== "undefined" jQuery.event.triggered ? jQuery.event.handle.apply(arguments.callee.elem, arguments) : undefined; }); // Add elem as a property of the handle function // This is to prevent a memory leak with non-native // event in IE. handle.elem = elem; // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); jQuery.each(types.split(/\s+/), function(index, type) { // Namespaced event handlers var namespaces = type.split("."); type = namespaces.shift(); handler.type = namespaces.slice().sort().join("."); // Get the current list of functions bound to this event var handlers = events[type]; if ( jQuery.event.specialAll[type] ) jQuery.event.specialAll[type].setup.call(elem, namespaces); // Init the event handler queue if (!handlers) { handlers = events[type] = {}; // Check for a special event handler // Only use addEventListener/attachEvent if the special // events handler returns false if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) { // Bind the global event handler to the element if (elem.addEventListener) elem.addEventListener(type, handle, false); else if (elem.attachEvent) elem.attachEvent("on" + type, handle); } } data, && !

120

// Add the function to the element's handler list handlers[handler.guid] = handler; // Keep track of which events have been used, for global triggering jQuery.event.global[type] = true; }); // Nullify elem to prevent memory leaks in IE elem = null; }, guid: 1, global: {}, // Detach an event or set of events from an element remove: function(elem, types, handler) { // don't do events on text and comment nodes if ( elem.nodeType == 3 || elem.nodeType == 8 ) return; var events = jQuery.data(elem, "events"), ret, index; if ( events ) { // Unbind all events for the element if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") ) for ( var type in events ) this.remove( elem, type + (types || "") ); else { // types is actually an event object here if ( types.type ) { handler = types.handler; types = types.type; } // Handle multiple events seperated by a space // jQuery(...).unbind("mouseover mouseout", fn); jQuery.each(types.split(/\s+/), function(index, type){ // Namespaced event handlers var namespaces = type.split("."); type = namespaces.shift(); var namespace = RegExp("(^|\\.)" namespaces.slice().sort().join(".*\\.") + "(\\.|$)");

+

if ( events[type] ) { // remove the given handler for the given type if ( handler ) delete events[type][handler.guid];

121

// remove all handlers for the given type else for ( var handle in events[type] ) // Handle the removal namespaced events if ( namespace.test(events[type][handle].type) ) delete [handle]; if ( jQuery.event.specialAll[type] ) jQuery.event.specialAll[type].teardown.call(elem, namespaces);

of

events[type]

// remove generic event handler if no more handlers exist for ( ret in events[type] ) break; if ( !ret ) { if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) { if (elem.removeEventListener) elem.removeEventListener(type, jQuery.data(elem, "handle"), false); else if (elem.detachEvent) elem.detachEvent("on" + type, jQuery.data(elem, "handle")); } ret = null; delete events[type]; } } }); } // Remove the expando if it's no longer used for ( ret in events ) break; if ( !ret ) { var handle = jQuery.data( elem, "handle" ); if ( handle ) handle.elem = null; jQuery.removeData( elem, "events" ); jQuery.removeData( elem, "handle" ); } } }, // bubbling is internal trigger: function( event, data, elem, bubbling ) { // Event object or event type var type = event.type || event;

122

if( !bubbling ){ event = typeof event === "object" ? // jQuery.Event object event[expando] ? event : // Object literal jQuery.extend( jQuery.Event(type), event ) : // Just the event type (string) jQuery.Event(type); if ( type.indexOf("!") >= 0 ) { event.type = type = type.slice(0, -1); event.exclusive = true; } // Handle a global trigger if ( !elem ) { // Don't bubble custom events when global (to avoid too much overhead) event.stopPropagation(); // Only trigger if we've ever bound an event for it if ( this.global[type] ) jQuery.each( jQuery.cache, function(){ if ( this.events && this.events[type] ) jQuery.event.trigger( event, this.handle.elem ); }); } // Handle triggering a single element // don't do events on text and comment nodes if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 ) return undefined; // Clean up in case it is reused event.result = undefined; event.target = elem; // Clone the incoming data, if any data = jQuery.makeArray(data); data.unshift( event ); } event.currentTarget = elem; // Trigger the event, it is assumed that "handle" is a function var handle = jQuery.data(elem, "handle"); if ( handle ) handle.apply( elem, data );

data,

123

// Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) event.result = false; // Trigger the native events (except for clicks on links) if ( !bubbling && elem[type] && !event.isDefaultPrevented() && ! (jQuery.nodeName(elem, 'a') && type == "click") ) { this.triggered = true; try { elem[ type ](); // prevent IE from throwing an error for some hidden elements } catch (e) {} } this.triggered = false; if ( !event.isPropagationStopped() ) { var parent = elem.parentNode || elem.ownerDocument; if ( parent ) jQuery.event.trigger(event, data, parent, true); } }, handle: function(event) { // returned undefined or false var all, handlers; event = arguments[0] = jQuery.event.fix( event || window.event ); event.currentTarget = this; // Namespaced event handlers var namespaces = event.type.split("."); event.type = namespaces.shift(); // Cache this now, all = true means, any handler all = !namespaces.length && !event.exclusive; var namespace = namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); RegExp("(^|\\.)" +

handlers = ( jQuery.data(this, "events") || {} )[event.type]; for ( var j in handlers ) { var handler = handlers[j]; // Filter the functions by class if ( all || namespace.test(handler.type) ) {

124

// Pass in a reference to the handler function itself // So that we can later remove it event.handler = handler; event.data = handler.data; var ret = handler.apply(this, arguments); if( ret !== undefined ){ event.result = ret; if ( ret === false ) { event.preventDefault(); event.stopPropagation(); } } if( event.isImmediatePropagationStopped() ) break; } } }, props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix: function(event) { if ( event[expando] ) return event; // store a copy of the original event object // and "clone" to set read-only properties var originalEvent = event; event = jQuery.Event( originalEvent ); for ( var i = this.props.length, prop; i; ){ prop = this.props[ --i ]; event[ prop ] = originalEvent[ prop ]; } // Fix target property, if necessary if ( !event.target ) event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either // check if target is a textnode (safari) if ( event.target.nodeType == 3 ) event.target = event.target.parentNode;

125

// Add relatedTarget, if necessary if ( !event.relatedTarget && event.fromElement ) event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && event.clientX != null ) { var doc = document.documentElement, body = document.body; event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); } // Add which for key events if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) event.which = event.charCode || event.keyCode; // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) if ( !event.metaKey && event.ctrlKey ) event.metaKey = event.ctrlKey; // Add which for click: 1 == left; 2 == middle; 3 == right // Note: button is not normalized, so don't use it if ( !event.which && event.button ) event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); return event; }, proxy: function( fn, proxy ){ proxy = proxy || function(){ return fn.apply(this, arguments); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; // So proxy can be declared as an argument return proxy; }, special: { ready: { // Make sure the ready event is setup setup: bindReady, teardown: function() {} } },

126

specialAll: { live: { setup: function( selector, namespaces ){ jQuery.event.add( this, namespaces[0], liveHandler ); }, teardown: function( namespaces ){ if ( namespaces.length ) { var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); jQuery.each( (jQuery.data(this, "events").live || {}), function(){ if ( name.test(this.type) ) remove++; }); if ( remove < 1 ) jQuery.event.remove( this, namespaces[0], liveHandler ); } } } } }; jQuery.Event = function( src ){ // Allow instantiation without the 'new' keyword if( !this.preventDefault ) return new jQuery.Event(src); // Event object if( src && src.type ){ this.originalEvent = src; this.type = src.type; // Event type }else this.type = src; // timeStamp is buggy for some events on Firefox(#3843) // So we won't rely on the native value this.timeStamp = now(); // Mark it as fixed this[expando] = true; }; function returnFalse(){ return false; }

127

function returnTrue(){ return true; } // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-scriptbinding.html jQuery.Event.prototype = { preventDefault: function() { this.isDefaultPrevented = returnTrue; var e = this.originalEvent; if( !e ) return; // if preventDefault exists run it on the original event if (e.preventDefault) e.preventDefault(); // otherwise set the returnValue property of the original event to false (IE) e.returnValue = false; }, stopPropagation: function() { this.isPropagationStopped = returnTrue; var e = this.originalEvent; if( !e ) return; // if stopPropagation exists run it on the original event if (e.stopPropagation) e.stopPropagation(); // otherwise set the cancelBubble property of the original event to true (IE) e.cancelBubble = true; }, stopImmediatePropagation:function(){ this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse }; // Checks if an event happened on an element within another element // Used in jQuery.event.special.mouseenter and mouseleave handlers var withinElement = function(event) { // Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; // Traverse up the tree while ( parent && parent != this )

128

try { parent = parent.parentNode; } catch(e) { parent = this; } if( parent != this ){ // set the correct event type event.type = event.data; // handle event if we actually just moused on to a non sub-element jQuery.event.handle.apply( this, arguments ); } }; jQuery.each({ mouseover: 'mouseenter', mouseout: 'mouseleave' }, function( orig, fix ){ jQuery.event.special[ fix ] = { setup: function(){ jQuery.event.add( this, orig, withinElement, fix ); }, teardown: function(){ jQuery.event.remove( this, orig, withinElement ); } }; }); jQuery.fn.extend({ bind: function( type, data, fn ) { return type == "unload" ? this.one(type, data, fn) : this.each(function(){ jQuery.event.add( this, type, fn || data, fn && data ); }); }, one: function( type, data, fn ) { var one = jQuery.event.proxy( fn || data, function(event) { jQuery(this).unbind(event, one); return (fn || data).apply( this, arguments ); }); return this.each(function(){ jQuery.event.add( this, type, one, fn && data); }); }, unbind: function( type, fn ) { return this.each(function(){ jQuery.event.remove( this, type, fn ); }); }, trigger: function( type, data ) { return this.each(function(){

129

jQuery.