/* Configuração do Cycle para a lista de logomarcas dos parceiros no Rodapé */

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-708775-21']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


$(document).ready(function() {

	$('ul#bottom_clientes').cycle({  

		fx:'fade',

		speed: 1000

	});



	$('.last').css("border","none");

	$('.last').css("margin-right","0");

	$('.last').css("padding-right","0");

	$('.last').css("background","none");

	$('.nomargin').css("margin","0");

	

	$('.menu li').hover(

		function()
		{
			$(this).css('position','relative');
			$(this).find("ul:first").show();
			$(this).find("a").css('background-position','center top');
		}, 
		function()
		{
			$(this).css('position','static');
			$(this).find("ul:first").hide();
			$(this).find("a").css('background-position','center bottom');
		}
	);

	// SelectBox para área restrita

	function mostra_select(id)

	{
		$('#input_'+id).attr('value','');
		$('#link_'+id).html('Selecione');
		$('#select_'+id).slideToggle('normal');	
	}

	function valor(input,id)

	{

		$('#input_'+input).attr('value',id);

		$('#select_'+input).slideUp('normal');	

		var text = (id==1)?'Interno':'Externo';

		$('#link_'+input).html(text);

		$('#area_restrita').attr('action', $('#url_'+id).val() );				

	}

	

	$('#arearestrita_1').click( function() {

		valor('restrita',1);

	});

	$('#arearestrita_2').click( function() {

		valor('restrita',2);

	});



	$('#link_restrita').click( function() {

		mostra_select('restrita');

	});

		$("div#anim div a.img1").click(function(event) {
			if (!$(this).hasClass('active')) {
				$('.simg1').stop().animate({ 'opacity':'0' },1);
				$('div#anim div a').removeClass('active');
				$(this).animate({ 'width':'495px' });				
				$("div#anim div a.img2").stop().animate({ 'width':'495px'},500);
				$("div#anim div a.img3").stop().animate({ 'width':'495px'},500);
				$("div#anim div a.img4").stop().animate({ 'width':'495px'},500);
				$(this).addClass('active');
				$(this).find('.simg1').animate({ 'opacity':'0.7' });
			}
			if ($(this).attr('href') == '#') {
				$('div#anim div a').attr('href','#');
				$(this).attr('href','http://www.grupocrw.com.br/pt-br/expertise/moldes/');
				event.preventDefault();
			}
		});
		
		$("div#anim div a.img2").click(function(event) {
			if (!$(this).hasClass('active')) {
				$('.simg1').stop().animate({ 'opacity':'0' },1);
				$(this).animate({ 'width':'495px' });	
				$("div#anim div a.img1").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img3").stop().animate({ 'width':'495px'},500);
				$("div#anim div a.img4").stop().animate({ 'width':'495px'},500);
				$('div#anim div a').removeClass('active');
				$(this).addClass('active');
				$(this).find('.simg1').animate({ 'opacity':'0.7' });
			}
			if ($(this).attr('href') == '#') {
				$('div#anim div a').attr('href','#');
				$(this).attr('href','http://www.grupocrw.com.br/pt-br/expertise/moldes/');
				event.preventDefault();
			}

		});
		
		$("div#anim div a.img3").click(function(event) {
			if (!$(this).hasClass('active')) {
				$('.simg1').stop().animate({ 'opacity':'0' },1);
				$(this).animate({ 'width':'495px' });	
				$("div#anim div a.img1").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img2").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img4").stop().animate({ 'width':'495px'},500);
				$('div#anim div a').removeClass('active');
				$(this).addClass('active');
				$(this).find('.simg1').animate({ 'opacity':'0.7' });
			}
			
			if ($(this).attr('href') == '#') {
				$('div#anim div a').attr('href','#');
				$(this).attr('href','http://www.grupocrw.com.br/pt-br/expertise/moldes/');
				event.preventDefault();
			}
		});
		
		$("div#anim div a.img4").click(function(event) {
			if (!$(this).hasClass('active')) {
				$(this).stop().animate({ 'width':'495px' });
				$('.simg1').animate({ 'opacity':'0' },1);
				$("div#anim div a.img1").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img2").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img3").stop().animate({ 'width':'200px'},500);
				$('div#anim div a').removeClass('active');
				$(this).addClass('active');
				$(this).find('.simg1').animate({ 'opacity':'0.7' });
			}
			if ($(this).attr('href') == '#') {
				$('div#anim div a').attr('href','#');
				$(this).parent().attr('href','http://www.grupocrw.com.br/pt-br/expertise/moldes/');
				event.preventDefault();
			}
		});
	
		$("div#anim div a.img1").hover(
		function() {
			if (!$(this).hasClass('active')) {
				$('.simg1').stop().animate({ 'opacity':'0' },1);
				$('div#anim div a').removeClass('active');
				$(this).animate({ 'width':'495px' });				
				$("div#anim div a.img2").stop().animate({ 'width':'495px'},500);
				$("div#anim div a.img3").stop().animate({ 'width':'495px'},500);
				$("div#anim div a.img4").stop().animate({ 'width':'495px'},500);
				$(this).addClass('active');
				$(this).find('.simg1').animate({ 'opacity':'0.7' },100,'linear',function() {
					$('div#anim div a').attr('href','#');
					$(this).parent().attr('href','http://www.grupocrw.com.br/pt-br/expertise/moldes/');
				});
			}
		});
		
		$("div#anim div a.img2").hover(
		function() {
			if (!$(this).hasClass('active')) {
				$('.simg1').stop().animate({ 'opacity':'0' },1);
				$(this).animate({ 'width':'495px' });	
				$("div#anim div a.img1").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img3").stop().animate({ 'width':'495px'},500);
				$("div#anim div a.img4").stop().animate({ 'width':'495px'},500);
				$('div#anim div a').removeClass('active');
				$(this).addClass('active');
				$(this).find('.simg1').animate({ 'opacity':'0.7' });
			}
			$(this).find('.simg1').animate({ 'opacity':'0.7' },100,'linear',function() {
				$('div#anim div a').attr('href','#');
				$(this).parent().attr('href','http://www.grupocrw.com.br/pt-br/expertise/injecao/');
			});
		});
		
		$("div#anim div a.img3").hover(
		function() {
			if (!$(this).hasClass('active')) {
				$('.simg1').stop().animate({ 'opacity':'0' },1);
				$(this).animate({ 'width':'495px' });	
				$("div#anim div a.img1").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img2").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img4").stop().animate({ 'width':'495px'},500);
				$('div#anim div a').removeClass('active');
				$(this).addClass('active');
				$(this).find('.simg1').animate({ 'opacity':'0.7' });
			}
			$(this).find('.simg1').animate({ 'opacity':'0.7' },100,'linear',function() {
				$('div#anim div a').attr('href','#');
				$(this).parent().attr('href','http://www.grupocrw.com.br/pt-br/expertise/acabamentos/');
			});
		});
		
		$("div#anim div a.img4").hover(
		function() {
			if (!$(this).hasClass('active')) {
				$(this).stop().animate({ 'width':'495px' });
				$('.simg1').animate({ 'opacity':'0' },1);
				$("div#anim div a.img1").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img2").stop().animate({ 'width':'200px'},500);
				$("div#anim div a.img3").stop().animate({ 'width':'200px'},500);
				$('div#anim div a').removeClass('active');
				$(this).addClass('active');
				$(this).find('.simg1').animate({ 'opacity':'0.7' });
			}
			$(this).find('.simg1').animate({ 'opacity':'0.7' },100,'linear',function() {
				$('div#anim div a').attr('href','#');
				$(this).parent().attr('href','http://www.grupocrw.com.br/pt-br/expertise/montagem/');
			});
		});
		
		$('div#anim').hover(function() {},
		function() {
			$('.simg1').animate({ 'opacity':'0' },1);
			$("div#anim div a.img1").stop().animate({ 'width':'495px'},200);
			$("div#anim div a.img2").stop().animate({ 'width':'495px'},200);
			$("div#anim div a.img3").stop().animate({ 'width':'495px'},200);
			$("div#anim div a.img4").stop().animate({ 'width':'495px'},200);
			$('div#anim div a').removeClass('active');
			$("div#anim div a.img1").addClass('active');
			$("div#anim div a.img1").find('.simg1').animate({ 'opacity':'0.7' });
			$('div#anim div a').attr('href','#');
			$('div#anim div a.img1').attr('href','http://www.grupocrw.com.br/pt-br/expertise/moldes/');
		});
});



function swfConfig()

{

	this.path = '/swf/';

	this.type = ''; // '_' prod | '' dev

}

swfConfig = new swfConfig;


