﻿
$(document).ready(function () {

    $(".itemMenu").each(
        function () {
            $(this).hover(
                function () {
                    var cls = this.className.split(' ');
                    cls[0] = cls[0].replace("_hover","");
                    this.className = this.className.replace(cls[0],cls[0]+"_hover");
                    $("#sub_" + this.id).show();
                },
                function () { 
                    this.className = this.className.replace("_hover","");
                    $("#sub_" + this.id).hide(); 
                }
            );
        }
    );

    $(".itemSubMenu").each(
        function(){
            $(this).hover(
                function(){
                    var aux = $("#"+this.id.replace("sub_",""))[0];
                    aux.className = aux.className.replace(" ","_hover ");
                    $(this).show();
                },
                function(){
                    var aux = $("#"+this.id.replace("sub_",""))[0];
                    aux.className = aux.className.replace("_hover","");
                    $(this).hide();  
                }
            );
        }
    );

});


var atualSize = 0;

function sizeFont(opt){

    x = false;

    if(opt == 'maior'){

        $(".sizeText").each(function(){

            size = this.style.fontSize;
            aux = size.split('p');
			if (size != ''){

	            if(atualSize < 4){
	                this.style.fontSize = (parseInt(aux[0])+1)+"px";
	                x = true;
	            }
            }
        });

        if(x){
            atualSize++;
        }

    }else if(opt == 'menor'){

        $(".sizeText").each(function(){
            size = this.style.fontSize;
            aux = size.split('p');
			if (size != ''){

	            if(atualSize > 0){
	                this.style.fontSize = (parseInt(aux[0])-1)+"px";
	                x = true;
	            }
            }
        });

        if(x){
            atualSize--;
        }
    }
}










