function linkMenu(id){
    if(id=='linhas'){
        $("#menuResponsabilidade").css('backgroundPosition' , '10px -250px');
        $("#linhasPremiadas").show();
        $("#acoesAmbientais").hide();
        $("#iso14001").hide();
        $("#premiacoes").hide();
        $("#prevencaoDengue").hide();
        $("#carbonoNeutro").hide();
    }
    else if(id=='acoes'){
        $("#menuResponsabilidade").css('backgroundPosition' , '10px -200px');
        $("#linhasPremiadas").hide();
        $("#acoesAmbientais").show();
        $("#iso14001").hide();
        $("#premiacoes").hide();
        $("#prevencaoDengue").hide();
        $("#carbonoNeutro").hide();
    }
    else if(id=='iso'){
        $("#menuResponsabilidade").css('backgroundPosition' , '10px -150px');
        $("#linhasPremiadas").hide();
        $("#acoesAmbientais").hide();
        $("#iso14001").show();
        $("#premiacoes").hide();
        $("#prevencaoDengue").hide();
        $("#carbonoNeutro").hide();
    }
    else if(id=='premiacoes'){
        $("#menuResponsabilidade").css('backgroundPosition' , '10px -100px');
        $("#linhasPremiadas").hide();
        $("#acoesAmbientais").hide();
        $("#iso14001").hide();
        $("#premiacoes").show();
        $("#prevencaoDengue").hide();
        $("#carbonoNeutro").hide();
    }
    else if(id=='dicas'){
        $("#menuResponsabilidade").css('backgroundPosition' , '10px -50px');
        $("#linhasPremiadas").hide();
        $("#acoesAmbientais").hide();
        $("#iso14001").hide();
        $("#premiacoes").hide();
        $("#prevencaoDengue").show();
        $("#carbonoNeutro").hide();
    }
    else if(id=='programa'){
        $("#menuResponsabilidade").css('backgroundPosition' , '10px 0');
        $("#linhasPremiadas").hide();
        $("#acoesAmbientais").hide();
        $("#iso14001").hide();
        $("#premiacoes").hide();
        $("#prevencaoDengue").hide();
        $("#carbonoNeutro").show();
    }
}

function linkAno(id){
    $("#1920 a img").attr('src',$("#1920 a img").attr('src').replace('1920_sel.jpg','1920.jpg'));
    $("#1950 a img").attr('src',$("#1950 a img").attr('src').replace('1950_sel.jpg','1950.jpg'));
    $("#1960 a img").attr('src',$("#1960 a img").attr('src').replace('1960_sel.jpg','1960.jpg'));
    $("#1980 a img").attr('src',$("#1980 a img").attr('src').replace('1980_sel.jpg','1980.jpg'));
    $("#1990 a img").attr('src',$("#1990 a img").attr('src').replace('1990_sel.jpg','1990.jpg'));
    $("#2000 a img").attr('src',$("#2000 a img").attr('src').replace('2000_sel.jpg','2000.jpg'));

    $("#"+id+" a img").attr('src',$("#"+id+" a img").attr('src').replace(''+id+'.jpg',''+id+'_sel.jpg'));
}

function mostraConteudo(id){
    $("#1920txt").hide();
    $("#1950txt").hide();
    $("#1960txt").hide();
    $("#1980txt").hide();
    $("#1990txt").hide();
    $("#2000txt").hide();
    
    $("#"+id).show();
}


/*************************************************************
** Função serve para personalizar o buttom de "procurar".	**
*************************************************************/
function initFileUploads() {
	var W3CDOM = (document.createElement && document.getElementsByTagName);
	if (!W3CDOM) return;
	var fakeFileUpload = document.createElement('div');
	fakeFileUpload.className = 'fakefile';
	var inputBg = document.createElement('input');
	inputBg.className = 'bg_input_file';
	fakeFileUpload.appendChild(inputBg);
	var image = document.createElement('img');
	image.src='../common/img/btn_procurar.gif';
	image.alt='Procurar';
	fakeFileUpload.appendChild(image);
	var x = document.getElementsByTagName('input');
	for (var i=0;i<x.length;i++) {
		if (x[i].type != 'file') continue;
		if (x[i].parentNode.className != 'fileinputs') continue;
		x[i].className = 'file';
		var clone = fakeFileUpload.cloneNode(true);
		x[i].parentNode.appendChild(clone);
		x[i].relatedElement = clone.getElementsByTagName('input')[0];
		x[i].onchange = x[i].onkeypress = function () {
			this.relatedElement.value = this.value;
		}
	}
}


/*************************************************************
** Autor: Marcus Vinicius Corrêa                            **
** Função de efeito sanfona	                            **
*************************************************************/
function fnDropDown(id){
    if($('#'+ id +'').css('display') == 'block'){
        $('#'+ id +'').slideUp('fast');
    }else{
        $('.conteudo').slideUp('fast');
        $('#'+ id +'').slideDown('fast');
    }
}

/*************************************************************
** Autor: Marcus Vinicius Corrêa                            **
** Função para visualização do submenu do header            **
*************************************************************/
function fnAbreMenu(id){
    if($('#' + id) != null){
        var boxId = 'box' + id.split('menu')[1];
		$('.menuDropDown').hide();
		$('#' + boxId).show();
		
		left = $('#' + boxId).offset().left;
		right = $('#' + boxId).offset().left + $('#' + boxId).width();
		top = $('#' + boxId).offset().top;
		bottom = $('#' + boxId).offset().top + $('#' + boxId).height();
    }
}


var requiredMajorVersion = 6;
var requiredMinorVersion = 0;
var requiredRevision = 79;
function showFlash(getSWF,getVars,getLink,getTarget,getLargura,getAltura){
	var nome = getSWF.split('/');
	
	nome = nome[(nome.length - 1)];
	
	if (AC_FL_RunContent == 0 || DetectFlashVer == 0) 
	{
		alert("This page requires AC_RunActiveContent.js.");
	} 
	else 
	{
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(hasRightVersion)
		{
			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
				'width', getLargura,
				'height', getAltura,
				'src', getSWF,
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', 'true',
				'loop', 'true',
				'scale', 'noscale',
				'wmode', 'transparent',
				'devicefont', 'false',
				'id', nome,
				'bgcolor', '#ffffff',
				'name', nome,
				'FlashVars', getVars,
				'menu', 'true',
				'allowScriptAccess','always',
				'allowFullScreen','false',
				'movie', getSWF,
				'salign', ''
			);
		}
	}
}

function showFlash2(getSWF,getVars,getLink,getTarget,getLargura,getAltura){
	var nome = getSWF.split('/');
	
	nome = nome[(nome.length - 1)];
	
	if (AC_FL_RunContent == 0 || DetectFlashVer == 0) 
	{
		alert("This page requires AC_RunActiveContent.js.");
	} 
	else 
	{
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(hasRightVersion)
		{
			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
				'width', getLargura,
				'height', getAltura,
				'src', getSWF,
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', 'true',
				'loop', 'true',
				'scale', 'noscale',
				'devicefont', 'false',
				'id', nome,
				'bgcolor', '#ffffff',
				'name', nome,
				'FlashVars', getVars,
				'menu', 'true',
				'allowScriptAccess','always',
				'allowFullScreen','false',
				'movie', getSWF,
				'salign', ''
			);
		}
	}
}


function abrir()
{
    window.open ("http://continental.neoassist.com", "Janela", "status=no, scrollbars=yes, width=332, height=420")
}


function fnComparaProd(id)
{
    if($('#inputComparar'+id).val() == 'false')
    {
        $('#inputComparar'+id).val('true');
        $('#imgComparar'+id).attr('src','../common/img/checkbox_laranja_on.png');
    }
    else
    {
        $('#inputComparar'+id).val('false');
        $('#imgComparar'+id).attr('src','../common/img/checkbox_laranja.png');
    }
        
    //alert($('#inputComparar'+id).val());
}
