/*ESTE ARQUIVO JAVASCRIPT FOI DESENVOLVIDO POR PUBLIONLINE BRASIL
http://www.publionline.com.br*/

$(document).ready(function(){
		
		(function($){ // Wrapper to make sure that the $ is used by jQuery and wasn't taken over by another library
			
			//////////////////////////// MENU /////////////////////////////
			
			$('li.submenu').menuRollover();	
			
			///////////////////////////////////////////////////////////////
			
		  ///////////////////////////// PNG FIX /////////////////////////////////
		  
		  $(document).pngFix();
		  
		  ///////////////////////////////////////////////////////////////////////
		  
		  
		  var larg = $(window).width();
	  
		  if(larg <= 1024){
		  $('#rodape').addClass('rodape-bg-1024');
		  }
			  
		  else if(larg <= 1280){
		  $('#rodape').addClass('rodape-bg-1280');
		  }	
		  
		  else if(larg <= 1360){
		  $('#rodape').addClass('rodape-bg-1360');
		  }
		  
		   else if(larg <= 1440){
		  $('#rodape').addClass('rodape-bg-1440');
		  }
		  
		  else if(larg <= 1600){
		  $('#rodape').addClass('rodape-bg-1600');
		  }	
		  
		  
		  
		  var fonte = 13;		  
		  
		  $('.a-pequeno').click(function(){
				fonte = 10;
				$('.size, .noticia-content p').animate({
					fontSize: fonte				   
				}, 'fast', 'linear');						 
		  });
		  
		  
		  $('.a-medio').click(function(){
				fonte = 13;
				$('.size, .noticia-content p').animate({
					fontSize: fonte				   
				}, 100, 'linear');							 
		  });
		  
	  
		  $('.a-grande').click(function(){
				fonte = 16;
				$('.size, .noticia-content p').animate({
					fontSize: fonte				   
				}, 100, 'linear');						 
		  });
		  
		    $('#banner-interno').cycle({
			random: 1,
			speed: 1000,
			timeout: 10000,
			fx: 'fade',
			fit: 1,
			nowrap: 1,
			sync: 1
			});
		  
			/*$('#menu li, #menu li.submenu ul li').each(function(){			
				$(this).hover(function(){
					$(this).css({'color' : '#FFFFFF', 'background-color' : '#A272A2'});
					$(this).children('a, .link-maior').css({'color' : '#FFFFFF', 'background-color' : '#A272A2'});							 
					}, function(){
					$(this).css({'color' : '#A272A2', 'background-color' : ''});
					$(this).children('a, .link-maior').css({'color' : '#A272A2', 'background-color' : ''});	
				});		
			});
			
			$('#menu li').click(function(){
				$(location).attr('href', $(this).children('a').attr('href'));
			});
			
			$('#submenu li').click(function(){
				//$(location).attr('href', $(this).children('a').attr('href'));
				alert('yohohoh');
			});*/
			
						
			
		/////////////////////////////// hover para o botão 'procurar'
		$('.procurar-bt').addClass('submit');	
		$('.procurar-bt').hover(function(){
		$(this).addClass('submit-hover');							   
		}, function(){
		$(this).removeClass('submit-hover');	
		});

		/////////////////////////////// hover para o botão 'ok'
		$('.ok-bt, .ok-bt-tratamento, .ok-bt-tipo-tratamento').addClass('submit-ok-bt');	
		$('.ok-bt, .ok-bt-tratamento, .ok-bt-tipo-tratamento').hover(function(){
		$(this).addClass('submit-ok-bt-hover');							   
		}, function(){
		$(this).removeClass('submit-ok-bt-hover');	
		});

		/////////////////////////////// hover para a seta
		$('.seta-interna-bt').addClass('submit-seta-interna-bt');	
		$('.seta-interna-bt').hover(function(){
		$(this).addClass('submit-seta-interna-bt-hover');							   
		}, function(){
		$(this).removeClass('submit-seta-interna-bt-hover');	
		});

		/////////////////////////////// select em notícias
		$('.lista-meses li a').mouseover(function(){
			$('#form-filtro .input-default').val($(this).attr('rel'));										  
		}).click(function(){
			$('.lista-meses').hide();
			return false;
		});
		
		$('.seta-interna-bt, #form-filtro .input-default').click(function(){
			$('#form-filtro .input-default').css('background', '#FDFCFE');					 
			if($('.lista-meses ').is(':hidden')){					 
			$('.lista-meses ').show('fast');	
			} else {
			$('.lista-meses ').fadeOut();
			}
		});

	
		/////////////////////////////// funções para o focus e blur do select de datas de notícias
		$('#form-filtro .input-default').focus(function(){
			$(this).val('');								 
		});
		
		
		/////////////////////////////// funções para o focus e blur do select de gênero
		$('.input-select').focus(function(){
			$(this).val('');								 
		});

		$('.select-genero li').mouseover(function(){ //mouseover na lista de de gêneros
			$('.input-select').val($(this).attr('title'));										  
		}).click(function(){
			$('.select-genero').hide();	
		});
		
		$('.select-genero li, .select-tratamento li, .select-tipo-tratamento li').hover(function(){
			$(this).addClass('zebra-lilas');									  
		}, function(){
			$(this).removeClass('zebra-lilas');	
		});

		$('.seta-down, .input-select').click(function(){ //clique na seta ou no input de gêneros, mostra o menu
			$('.input-select').css('background', '#FDFCFE');					 
			if($('.select-genero').is(':hidden')){					 
			$('.select-genero').show('fast');	
			} else {
			$('.select-genero').fadeOut();
			}
		});


		$('.ok-bt').click(function(){ // clique no ok para enviar o usuário à página para homens ou mulheres
				if($('.input-select').val()== 'Tratamentos para Homens' || $('.input-select').val()== 'Tratamentos para Mulheres'){
					$(location).attr('href', 'http://www.clinicavisia.com.br/tratamentos.htm');
				}					   
		});
		
		/////////////////////////////// funções para o focus e blur do select de tratamento
		$('.input-tratamento').focus(function(){
			$(this).val('');								 
		});	
		
		$('.select-tratamento li').mouseover(function(){ //mouseover na lista de de tratamento
			$('.input-tratamento').val($(this).attr('title'));										  
		}).click(function(){
			$('.select-tratamento').hide();	
		});
		
		$('.seta-down-tratamento, .input-tratamento').click(function(){ //clique na seta ou no input de tratamento, mostra o menu
			if($('.select-tratamento').is(':hidden')){					 
			$('.select-tratamento').show('fast');	
			} else {
			$('.select-tratamento').fadeOut();
			}
		});
				
		$('.ok-bt-tratamento').click(function(){ // clique no ok para enviar o usuário à página para homens ou mulheres
				var tratamento = $('.input-tratamento').val();						  
				$(location).attr('href', '#' + tratamento);
		});
		
		/////////////////////////////// funções para o focus e blur do select de tipo de tratamento
		$('.input-tipo-tratamento').focus(function(){
			$(this).val('');								 
		});
		
	
		$('.select-tipo-tratamento li').mouseover(function(){ //mouseover na lista de de tratamento
			$('.input-tipo-tratamento').val($(this).attr('title')).css('background', '#FDFCFE');										  
		}).click(function(){
			$('.select-tipo-tratamento').hide();	
		});
		
		$('.seta-down-tipo-tratamento, .input-tipo-tratamento').click(function(){ //clique na seta ou no input de tratamento, mostra o menu
			$('.input-tipo-tratamento').css('background', '#FDFCFE');					 
			if($('.select-tipo-tratamento').is(':hidden')){					 
			$('.select-tipo-tratamento').show('fast');	
			} else {
			$('.select-tipo-tratamento').fadeOut();
			}
		});
				
		$('.ok-bt-tipo-tratamento').click(function(){ // clique no ok para enviar o usuário à página para homens ou mulheres
				var tratamento = $('.input-tipo-tratamento').val(); //fazer looping switch							  
				
				switch(tratamento){
				
				case 'Tratamentos Cirúrgicos':
				$(location).attr('href', 'http://www.clinicavisia.com.br/tratamentos-cirurgicos.htm');
				break;
				
				case 'Tratamentos Faciais':
				$(location).attr('href', 'http://www.clinicavisia.com.br/tratamentos-faciais.htm');
				break;
				
				case 'Tratamentos Corporais':
				$(location).attr('href', 'http://www.clinicavisia.com.br/tratamentos-corporais.htm');
				break;
				
				default: 
				alert('Tratamento Inexistente');
				$(location).attr('href', 'http://www.clinicavisia.com.br/index.asp');				
				}					   
		});
		


		$('.link-credito').hover(function(){// hover nos créditos no rodapé
			$('.tooltip').fadeIn('fast');							 
		}, function(){
			$('.tooltip').fadeOut('fast');	
		});

							   
		$('.agenda-bt').click(function(){ // clique no botão de agendar na home e em profissionais, mostra o formulário
		$('#caixa-form').show(300);							   
		});
		
		$('.minimizar, .enviar-bt').click(function(){ // minimiza/esconde o formulário
		$('#caixa-form').hide(300);							   
		});	
		
		$('#carrega-form').load('form.htm'); // carregando o formulário dentro da div #carrega-form			
		
		$('#form-contato .form-bt').addClass('form-bt-default');
		$('#form-contato .form-bt').hover(function(){
			$(this).addClass('form-bt-hover');										   
		}, function(){
			$(this).removeClass('form-bt-hover');	
		});


		$('.agenda-bt').hover(function(){
			$(this).attr('src', '../img/bt-agende-hover.jpg')							  
		}, function(){
			$(this).attr('src', '../img/bt-agende.jpg')	
		});
			
		})(jQuery);
 });


