﻿// 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;
			}
			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;
}

function hideEmptyDIV() {
    
    alert('executou a função');
    //var div;
    var divs= document.getElementsByID('RightContentContainer');
    if(!divs.hasChildNodes())div.className = 'empty';
}
