﻿function MM_changeProp(objId, x, theProp, theValue) { //v9.0
    var obj = null; with (document) {
        if (getElementById)
            obj = getElementById(objId);
    }
    if (obj) {
        if (theValue == true || theValue == false)
            eval("obj.style." + theProp + "=" + theValue);
        else eval("obj.style." + theProp + "='" + theValue + "'");
    }
}

function focusText(txt){
	if(txt == "Nome:"){
		return "";
	}
	if(txt == ""){
		return "Nome:";
	}
}

function focusMail(m){
	if(m == "Email:"){
		return "";
	}
	if(m == ""){
		return "Email:";
	}
}

function focusMsg(m)
{
	if(m == "Mensagem:"){
		return "";
	}
	if(m == ""){
		return "Mensagem:";
	}
}

$(function () {
    var boxes = $('.meio_home .quadnavegue');
    var activeIndex = 0;
    var interval = 15000;
    var intervalTimeout = null;

    boxes.find('.linksdestaques ul li').click(function (e) {
        var index = parseInt($(this).text()) - 1;
        if (index == activeIndex)
            return;
        troca(e, index);
        clearInterval(intervalTimeout);
        intervalTimeout = setInterval(troca, interval);
    });

    function troca(e, indice) {

        if (indice != undefined) {
            activeIndex = indice;
        }
        else {

            if (activeIndex == boxes.size() - 1) activeIndex = -1;
            activeIndex++
        }

        boxes.fadeOut();
        $(boxes[activeIndex]).fadeIn();
    }

    intervalTimeout = setInterval(troca, interval);
});
$(function () {

    var indice = window.location.href.indexOf('?');
    var _url = location.href.substring(0, (window.location.href.indexOf('?') != -1 ? window.location.href.indexOf('?') : location.href.length)).toLowerCase();
    $('.quadlinks a').each(function () {        
        var href = $(this).attr('href').toLowerCase();        
            if (href != '' && _url.toLowerCase().search(href) >= 0) {
                $(this).addClass("ativo");
            }        
    });
});
      
