/******************************************************************************************* 
* eiConcrles = são scripts gerados pelo jQuery p/ faculitar algumas funções p/ o eiSistama *
* Data: 28/03/2009
********************************************************************************************/
//**** Validação eiFormulario *****
	$.noConflict( );   
	jQuery(function($){     
	$.mask.addPlaceholder("~","[+-]");
	$("#txt_telefone").mask("(99) 9999-9999");   
	$("#date").mask("99/99/9999"); 
	$("#txt_cep").mask("99999-999");     
	$("#ssn").mask("999-99-9999");     
	$("#product").mask("a*-999-a999",{placeholder:" ",completed:function(){alert("You typed the following: "+this.val());}});    
	$("#eyescript").mask("~9.99 ~9.99 999"); 
	$("#cpf").mask("999.999.999-99");
	$("#rg").mask("99.999.999-9");
	$("#cnpj").mask("99.999.999/9999-99");	
 });  

// ***** eiMenuTopo ***** 	
	var tabAtual = 1
 
		mudarTab = function(numeroTab) {
			$("#tab_"+tabAtual).toggle()
			$("#tab_"+numeroTab).toggle()
			tabAtual = numeroTab
		}
// ***** Campo eiBusca ***** 
	$(document).ready(function() {
	var textoDefault = $('#formulario label').remove().text();
	$('#busca')
	.val(textoDefault)
	.css('color', '#999')
		.focus(function(){
			if ($(this).val() == textoDefault){
			$(this).css('color', '').val('');
			}
		}).blur(function(){
			if ($(this).val() == '' ){
			$(this).val(textoDefault).css('color', '#999');
			}
		});
	});
	
//***** eiMENU *****
	$(document).ready(function(){
	    //adicionando o evento click a todos os links que estão na primeira ul dentro da div menu
		$('#eiMenu').find('ul:eq(0)> li > a').click(function(){
			//adicionando o efeito ao elemento ul que está dentro da mesma li do link que foi clicado
		$(this).parent().find('ul:eq(0)').slideToggle("slow");
		});
	});
	
//***** MENU DIREITO eiPublicidade *****
	$(document).ready(function(){
	    //adicionando o evento click a todos os links que estão na primeira ul dentro da div menu
		$('#eiPublicidade').find('ul:eq(0)> li > a').click(function(){
			//adicionando o efeito ao elemento ul que está dentro da mesma li do link que foi clicado
		$(this).parent().find('ul:eq(0)').slideToggle("slow");
		});
	})


//*** Mouse over da DIV "não usar ainda"**** 
	/*$(document).ready(function(){
		$('div').mouseover(function(){
		$(this).css('background', '0000ff');
		}).mouseout(function(){
		$(this).css('background', 'ff0000');;
		});
	});*/
// ]]>	


//***** Abre e fecha DIV 2 *****
	//$(document).ready(function() {		
		/*var htmlBotaoUm = '<div><label>Todos os parágrafos<br /></label><button type="button"></button></div>';		
		$('div').after(htmlBotaoUm);*/		
		/*$('button:eq(0)').text('-').click(function(){
			if ($(this).text() == '+') { 
			$(this).text('-');
			$('#menu_esquerdo').slideDown('slow');
			} else {
			$(this).text('+');
			$('#menu_esquerdo').slideUp(1500);
			}
		});
		
		$('button:eq(1)').text('-').click(function(){
			if ($(this).text() == '+') { 
			$(this).text('-');
			$('#listar_resultado').slideDown(1500);
			} else {
			$(this).text('+');
			$('#listar_resultado').slideUp('slow');
			}
		});
		
		$('button:eq(2)').text('-').click(function(){
			if ($(this).text() == '+') { 
			$(this).text('-');
			$('#bloco-voce').slideDown('slow');
			} else {
			$(this).text('+');
			$('#bloco-voce').slideUp(1500);
			}
		});
		
		$('button:eq(3)').text('-').click(function(){
			if ($(this).text() == '+') { 
			$(this).text('-');
			$('#bloco-video').slideDown('slow');
			} else {
			$(this).text('+');
			$('#bloco-video').slideUp(1500);
			}
		});
		
			$('button:eq(4)').text('-').click(function(){
			if ($(this).text() == '+') { 
			$(this).text('-');
			$('#bloco-noticia').slideDown('slow');
			} else {
			$(this).text('+');
			$('#bloco-noticia').slideUp(1500);
			}
		});		
		
		$('button:eq(5)').text('-').click(function(){
			if ($(this).text() == '+') { 
			$(this).text('-');
			$('#listar_aplicativo').slideDown('slow');
			} else {
			$(this).text('+');
			$('#listar_aplicativo').slideUp(1500);
			}
		});
		
		$('button:eq(6)').text('-').click(function(){
			if ($(this).text() == '+') { 
			$(this).text('-');
			$('#publicidade-direito').slideDown('slow');
			} else {
			$(this).text('+');
			$('#publicidade-direito').slideUp(1500);
			}
		});		
		
	});*/


//***** cor do texto *****			
	/* com button
		$(document).ready(function() {
		(function($) {
			$.corTexto = function(e, cor) {
			var el = document.getElementsByTagName(e);
				for( var i = 0; i < el.length; i++) {
				el[i].style.color = cor;
				}
			}	
		})(jQuery);
	
		$('button:eq(0)').click(function() {		
		$.corTexto('p', '#ff0000');
		});
		$('button:eq(1)').click(function() {		
		jQuery.corTexto('p', '#0000ff');
		});
		$('button:eq(2)').click(function() {		
		$.corTexto('p', '#00cc00');
		});
		$('button:eq(3)').click(function() {		
		jQuery.corTexto('p', '');
		});
	});*/
		
//**** Muda cor da o "p" *****	
/*	$(document).ready(function() {
		(function($) {
			$.corTexto = function(e) {
			var selecao = document.getElementById('selecionaCor');
			var indiceSelecao = selecao.selectedIndex;
			sel = selecao.options[indiceSelecao].value; 				
			
			var el = document.getElementsByTagName(e);
				for( var i = 0; i < el.length; i++) {
				el[i].style.color = sel;
				}
			}
		})(jQuery);
		$('#selecionaCor').change(function() {		
		$.corTexto('p');
		});
	});
*/
//***** abre e fecha 'P' em show ***** 
	/*$(document).ready(function() {
	
			var htmlBotaoUm = "<div id='com-classe'> <label>Parágrafos com classe 'esconde'<br /></label><button type='button'></button></div>";
			var htmlBotaoDois = '<div id="todos"><label>Todos os parágrafos<br /></label><button type="button"></button></div>';

			
			$('h1').before(htmlBotaoUm);
			$('#com-classe').after(htmlBotaoDois);	
					
			$('button:eq(0)').text('Esconder').click(function() {
					if($(this).text() == 'Mostrar') {
					$(this).text('Esconder');
					$('p.esconde').show('fast');
					}else {
					$(this).text('Mostrar');
					$('p.esconde').hide('slow');
					}					
				});
				
			$('button:eq(1)').text('Esconder').click(function() {
				if ($(this).text() == 'Mostrar') {
				$(this).text('Esconder');
				$('p').show(3000);
				}else {
				$(this).text('Mostrar');
				$('p').hide(1000);
				}				
			});			
		});*/
// ]]>	