// Momentum Jquery
$(document).ready(function() {
        // Pagina principal  
        // Gradientes
	$('#content-miscelaneas').gradient({
            from:      'F2F2F2',
	    to:        'FAFAFA',
	    direction: 'horizontal'
	});
        $('#content-newsletter').gradient({
            from:      'F2F2F2',
	    to:        'FAFAFA',
	    direction: 'horizontal'
	});
        $('#content-projeto').gradient({
            from:      'F2F2F2',
	    to:        'FFFFFF',
	    direction: 'horizontal'
	});
        $('#content-restrito').gradient({
            from:      'F2F2F2',
	    to:        'FFFFFF',
	    direction: 'horizontal'
	});
        $('#content-produtos').gradient({
            from:      'F2F2F2',
	    to:        'FFFFFF',
	    direction: 'horizontal'
	});
        $("#rotator-bottom").gradient({
            from:      'F2F2F2',
	    to:        'FFFFFF',
	    direction: 'horizontal'
        });
        $("#div-news").gradient({
            from:      'F2F2F2',
	    to:        'FAFAFA',
	    direction: 'horizontal'
        });
        
        $("#content-produtos").corner({
			  tl: { radius: 4 },
			  tr: { radius: 4 },
			  bl: { radius: 4 },
			  br: { radius: 4 },
                          autoPad: false
        });
        $("#content-restrito").corner({
			  tl: { radius: 4 },
			  tr: { radius: 4 },
			  bl: { radius: 4 },
			  br: { radius: 4 },
                          autoPad: false
        });
        $("#content-projeto").corner({
			  tl: { radius: 4 },
			  tr: { radius: 4 },
			  bl: { radius: 4 },
			  br: { radius: 4 },
                          autoPad: false
        });
        $("#content-newsletter").corner({
			  tl: { radius: 4 },
			  tr: { radius: 4 },
			  bl: { radius: 4 },
			  br: { radius: 4 },
                          autoPad: false
        });
        $("#content-miscelaneas").corner({
			  tl: { radius: 4 },
			  tr: { radius: 4 },
			  bl: { radius: 4 },
			  br: { radius: 4 },
			  autoPad: false
        });
        $("#rotator-bottom").corner({
			  tl: { radius: 4 },
			  tr: { radius: 4 },
			  bl: { radius: 4 },
			  br: { radius: 4 },
			  autoPad: false
        });
        
        $("#div-news").corner({
         		  tl: { radius: 3 },
			  tr: { radius: 3 },
			  bl: { radius: 3 },
			  br: { radius: 3 },
			  autoPad: false
        });
        
        $(".div-produto").corner({
            		  tl: { radius: 4 },
			  tr: { radius: 4 },
			  bl: { radius: 4 },
			  br: { radius: 4 },
			  autoPad: false
        });
    
        
       // Glider  
       featuredcontentglider.init({
                gliderid: "banners-content", 
                contentclass: "glidecontent", 
                togglerid: "p-select", 
                remotecontent: "",
                selected: 0, 
                persiststate: false, 
                speed: 500, 
                direction: "downup", 
                autorotate: true, 
                autorotateconfig: [12000,]
       });
       
       //Slider
       
       $('#mycarousel').jcarousel({
                auto: 5,
                visible: 5,
		scroll: 5,
		wrap: 'first'
       });
        
       // Correção IE Last Child
       $(".menu-content .cat:last-child").ready(function() {
                $(this)
       });
       
       //Frescuras do Gulão
       
       // Arrumando tamanho das imagens
       $("#miscelaneas-imagens img").ready(function() {
         $(this).css({
            'width':'281',
            'height':'164'
         });
       });
       // Produtos Hosting
       $("#hosting-label").click(function() {
          $("#hosting-label").css({
            'background':'url("/goto/store/temas/imagenet/images/topo_pontas.png") no-repeat',
            'color':'#000'
          });
         $("#produtos-label").css({
            'background':'0',
            'color':'#7A7A7A'
          });
         $("#produtos-bottom").hide();
         $("#hosting-bottom").show();
       });
       
       $("#produtos-label").click(function() {
          $("#produtos-label").css({
            'background':'url("/goto/store/temas/imagenet/images/topo_simples.png") no-repeat',
            'color':'#000'
          });
          $("#hosting-label").css({
            'background':'0',
            'color':'#7A7A7A'
          });
          $("#produtos-bottom").show();
          $("#hosting-bottom").hide();
       });
       // Projetos Hosting
       $("#projetos-bottom").show();
       $("#case-bottom").hide();
       $("#videos-bottom").hide();
       $("#projetos-label").click(function() {
          $("#projetos-label").css({
            'background':'url("/goto/store/temas/imagenet/images/topo_simplesp.png") no-repeat',
            'color':'#000'
          });
          $("#case-label").css({
            'background':'0',
            'color':'#7A7A7A'
          });
          $("#videos-label").css({
            'background':'0',
            'color':'#7A7A7A'
          });
          $("#projetos-bottom").show();
          $("#case-bottom").hide();
          $("#videos-bottom").hide();
       });
       
       $("#case-label").click(function() {
          $("#case-label").css({
            'background':'url("/goto/store/temas/imagenet/images/topo_pontasp.png") no-repeat',
            'color':'#000'
          });
          $("#projetos-label").css({
            'background':'0',
            'color':'#7A7A7A'
          });
          $("#videos-label").css({
            'background':'0',
            'color':'#7A7A7A'
          });
          $("#case-bottom").show();
          $("#projetos-bottom").hide();
          $("#videos-bottom").hide();
       });
       
       $("#videos-label").click(function() {
          $("#videos-label").css({
            'background':'url("/goto/store/temas/imagenet/images/topo_pontasp.png") no-repeat',
            'color':'#000'
          });
          $("#projetos-label").css({
            'background':'0',
            'color':'#7A7A7A',
            'z-index': "1412"
          });
          $("#case-label").css({
            'background':'0',
            'color':'#7A7A7A',
             'z-index': "1412"
          });
          
          $("#videos-bottom").show();
          $("#case-bottom").hide();
          $("#projetos-bottom").hide();
       });
       
	var first = 0;
	var speed = 500;
	var pause = 5000;
	
	function removeFirst(){
		first = $('ul#listticker li:first').html();
		$('ul#listticker li:first')
		.animate({opacity: 0}, speed)
		.fadeOut('slow', function() {$(this).remove();});
		addLast(first);
	}
		
	function addLast(first){
			last = '<li style="display:none">'+first+'</li>';
			$('ul#listticker').append(last)
			$('ul#listticker li:last')
			.animate({opacity: 1}, speed)
			.fadeIn('slow')
	}
	
	interval = setInterval(removeFirst, pause);
       // Fim pagina principal
       
       // Pagina Interna
       $('#innter-texto-banner').load(function(){
         alert("CARREGADO");
       });
       $("#inner-content").corner({
            		  tl: { radius: 9 },
			  tr: { radius: 9 },
			  bl: { radius: 9 },
			  br: { radius: 9 },
			  autoPad: false
       });
       // Página contato
       $('#div-contato-caixa').corner({
			  tl: { radius: 9 },
			  tr: { radius: 9 },
			  bl: { radius: 9 },
			  br: { radius: 9 },
			  autoPad: false
       })
});
