/*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
			
			//////////////////////////// SCRIPTS DO MENU /////////////////////////////
			$('ul#MENU li.submenu, ul#MENU li.franquias').hover(function(){
				$(this).find('ul.firstSub')
				.stop(true, true)
				.fadeIn('fast');
			}, function(){
				$(this).find('ul.firstSub')
				.stop(true, true)				
				.fadeOut('fast');
				});
			
			$('ul#MENU li.submenu ul li.submenu2').hover(function(){
				$(this).find('ul.secondSub')
				.stop(true, true)
				.fadeIn('fast');
			}, function(){
				$(this).find('ul.secondSub')
				.stop(true, true)
				.fadeOut('fast');
				});	
			
			
			$('#menu li.submenu').hover(function(){
				$(this).children('div').stop(true, true).fadeIn(200);									 
			}, function(){
				$(this).children('div').stop(true, true).fadeOut(200);
			});
			
			////////////////////////////////////////////////////////////////////////
			
			///////////////////////// SCRIPTS DO MAPA //////////////////////////////
			//$('.corpoDadosFranquias').text();
			$('.hover-map').hover(function(){		
										   
			var url = $(this).attr('name') + '.htm' + ' #' + $(this).attr('title');
			
			$(this).each(function(){
				$('.corpoDadosFranquias').load(url);
			});	
			
			}, function(){									  
				//  
			});
			
			$('.hover-map').click(function(e){
				e.preventDefault();	
			});
		    ////////////////////////////////////////////////////////////////////////
		
			////////////////////////// TWITTER /////////////////////////////////////
			$(".tweet").tweet({
			  username: "casacor",
			  count: 4,
			  loading_text: "Procurando Tweets..."
			});
			////////////////////////////////////////////////////////////////////////
			
			////ALTERANDO A LARGURA DA FAIXA VERMELHA QUE FICA EM CIMA DO BANNER E DA DIV 'PARTICIPE' DE ACORDO COM A RESOLUÇÃO////
			//if($(window).width() >= 1200 && $(window).width() <= 1280){
//				$('#FAIXA-DATAS').css('width', '190px');	
//			}
//			else if($(window).width() <= 1024){
//				$('#FAIXA-DATAS').css('width', '60px');	
//			}
//			
//			if($(window).width() <= 1024){
//				$('#PARTICIPE').css({width: '316px', bottom: '0'});
//				//$('#PARTICIPE span').css({width: '313px'});
//			}
			//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

			var larg = $(window).width();	
			var participe = $('#PARTICIPE');
			
			if(larg <= 1024 && larg > 800){
			participe.addClass('participe1024');
			}
			
			if(larg <= 1280 && larg > 1024){
			participe.addClass('participe1280');
			}
			
			if(larg <= 1360 && larg > 1280){
			participe.addClass('participe1360');
			}
			
			if(larg <= 1440 && larg > 1360){
			participe.addClass('participe1440');
			}
			
			if(larg <= 1600 && larg > 1440){
			participe.addClass('participe1600');
			}
			
			if(larg <= 1680 && larg > 1600){
			participe.addClass('participe1680');
			}	
			
			if(larg <= 1920 && larg > 1680){
			participe.addClass('participe1920');
			}

	
		})(jQuery);
 });


