// JavaScript Document

	s = 6;
	k = 0;
	
	$(document).ready(function() {
		$("#menu li:first a").addClass('first');
		$("#menu li:last a").addClass('pp');
		$('#content>div').css({'padding':'10px 10px 10px 20px'});
		
		x=new String($('#menuopc_analise_sensorial a').html());
		y=x.split(" ");
		y1=y[0]+'<br>'+'<span style="position:relative;left:-2px">'+y[1]+'</span>';
		$('#menuopc_analise_sensorial a').html(y1);
		
		$('#menuopc_provadores_celiacos a').css({'width':'60px !important'});
		
		setTimeout(cores,50);

        $('#header').append('<div style="width:73px;height:74px;background:url(/splash/pin.png) 50% 50%;position:absolute;left:690px;top:55%"></div>')
        /* splash 10anos
        if (readCookie('splash')==null && $('body').attr('id')=='main') {

            var h=$('body').height();
            $('body').append('<div id="splash_back" style="display:none;position:absolute;left:0;top:0;text-align:center;z-index:998;width:100%;height:'+h+'px;background:#fff"></div>')
            $('body').append('<div id="splash" style="display:none;position:absolute;left:0;top:0;text-align:center;z-index:999;width:100%;height:'+h+'px;"><img src="/splash/animacao10anos.gif" style="margin-top:50px" /><br /><a href="#" onclick="$(\'#splash_back\').fadeOut();$(this).parent().fadeOut();">fechar</a></div>')
            $('#splash_back').css({opacity:0.7});
            $('#splash_back').show();
            $('#splash').fadeIn();

            createCookie('splash', '1', 7);
        }
        */
	});

	function cores() {
		$('#navigation ul#submenu a').each(function(i,n){
			j = (i%s)+1;
			$(this).addClass('c1'+j);
			//alert($(this).css('border-right'));
			//$(this).css('border-right','5px solid '+c1[j]);
			//$(this).css({'border-right':'5px solid '+c1[j]});
			if ($(this).is('.current')) k=j;
		});
		$('#submenu li a.current').addClass('c2'+k);
	}

	function fixGallery(els,p) {
		t=$('dl'+els).size();
		r=Math.ceil(t/p)-1;
		$(els).each(function(i,n) {
			j = i+1;
			if (j%p==0) $(this).css({'border-right':'0'});
			if (j>r*p) $(this).css({'border-bottom':'0'});
		});
	}

    function createCookie(name,value,days) {
        var expires = "";
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            expires = "; expires="+date.toGMTString();
        }
        document.cookie = name+"="+value+expires+"; path=/";
    }

    function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    }

    function eraseCookie(name) {
        createCookie(name,"",-1);
    }

