﻿// JScript File
// CSS change

function hideAll(id)
{    
    var ids;
    ids = id.split(",");    
    var defaulDisplay = "none";
    var newDisplay = "block";
    for(i=0;i<ids.length - 1;i++)
    {   
        document.getElementById(ids[i]).style.display = defaulDisplay;        
    }
}


function showNewDisplay(id)
{   
    
	// setup vars
	var defaulDisplay = "none";
	var newDisplay = "block";

	
	// other supported styles
	// myElement.style.fontSize = "24px";
	// myElement.style.fontFamily = "Verdana, Arial, Courier New";
	// myElement.style.textDecoration = "underline";
	// myElement.style.fontWeight = "normal";
	// myElement.style.visibility = "hidden";
	
	if((document.getElementById)&& (document.getElementById(id)!=null))
	{
  		// Get a reference to the element
		var myElement = document.getElementById(id);
		// Check the element's style object and background property are available
	 	if ((myElement.style)&& (myElement.style.display!=null))
	 	{
			// Check the value of the property
		    if(myElement.style.display == 'none' || myElement.style.display == '')
		    {
		        // change style to new color
		        //document.getElementById.style.display = defaulDisplay;
		        document.getElementById(id).style.display = newDisplay;
		        //InserirSessionStorage(id);
			}
			else
			{
				// change style to default color
			    document.getElementById(id).style.display = defaulDisplay;
			    //RemoverSessionStorage(id);
			}
		}
		else
		{	
			// This CSS property is not assigned or is not supported
			return;
		}
	}
	else 
	{
	  return;
	}
}
/*
function InserirSessionStorage(idValor) {

    
    var opcao = "";

    for (var i = 0, len = sessionStorage.length; i < len; i++) {
        var key = window.sessionStorage.key(i);
        var value = window.sessionStorage.getItem(key);
        if (value == idValor) {
            opcao = "sim";
        }
    }

    if (opcao == "") {
        window.sessionStorage.setItem(idValor, idValor);
    }
}

function RemoverSessionStorage(idValor) {
    //var value = sessionStorage.getItem(key);
    window.sessionStorage.removeItem(idValor);

}
*/
function ConfigurarMenusSessionStorage() {

    /*for (var i = 0, len = window.sessionStorage.length; i < len; i++) {
        var key = window.sessionStorage.key(i);
        var value = window.sessionStorage.getItem(key);
        configurarSessionStorage(value);
    }*/
}

function configurarSessionStorage(id) {
/*
    // setup vars
    var defaulDisplay = "none";
    var newDisplay = "block";


    // other supported styles
    // myElement.style.fontSize = "24px";
    // myElement.style.fontFamily = "Verdana, Arial, Courier New";
    // myElement.style.textDecoration = "underline";
    // myElement.style.fontWeight = "normal";
    // myElement.style.visibility = "hidden";

    if ((document.getElementById) && (document.getElementById(id) != null)) {
        // Get a reference to the element
        var myElement = document.getElementById(id);
        // Check the element's style object and background property are available
        if ((myElement.style) && (myElement.style.display != null)) {
            // Check the value of the property
            if (myElement.style.display == 'none' || myElement.style.display == '') {
                // change style to new color
                //document.getElementById.style.display = defaulDisplay;
                document.getElementById(id).style.display = newDisplay;
            }
            else {
                // change style to default color
                document.getElementById(id).style.display = defaulDisplay;
            }
        }
        else {
            // This CSS property is not assigned or is not supported
            return;
        }
    }
    else {
        return;
    }*/
}



function showNewDisplay2(id, idsmenupai)
{   
    
    
	// setup vars
	var defaulDisplay = "none";
	var newDisplay = "block";
	
    //hideAll(idsmenupai);
    
	
	// other supported styles
	// myElement.style.fontSize = "24px";
	// myElement.style.fontFamily = "Verdana, Arial, Courier New";
	// myElement.style.textDecoration = "underline";
	// myElement.style.fontWeight = "normal";
	// myElement.style.visibility = "hidden";
	
	if((document.getElementById)&& (document.getElementById(id)!=null))
	{
  		// Get a reference to the element
		var myElement = document.getElementById(id);
		// Check the element's style object and background property are available
	 	if ((myElement.style)&& (myElement.style.display!=null))
	 	{
			// Check the value of the property
		    if(myElement.style.display == 'none' || myElement.style.display == '')
		    {
		        // change style to new color
		        //document.getElementById.style.display = defaulDisplay;
				document.getElementById(id).style.display = newDisplay;
			}
			else
			{
				// change style to default color
				document.getElementById(id).style.display = defaulDisplay;      
			}
		}
		else
		{	
			// This CSS property is not assigned or is not supported
			return;
		}
	}
	else 
	{
	  return;
	}
}

function hideSelf(id) {
    var defaulDisplay = "none";
    document.getElementById(id).style.display = defaulDisplay;
}




if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
{ 
	var ieversion=new Number(RegExp.$1)
	if (ieversion==6)
	{
		over = function()
		{
			var sfEls = document.getElementById("DIV").getElementsByTagName("LI");
			for (var i = 0; i < sfEls.length; i++)
			{
				sfEls[i].onmouseover=function() {this.className+=" over";}
				sfEls[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" over\\b"), "");}
			}
		}
		if (window.attachEvent) window.attachEvent("onload", over);
	}
}



