// JavaScript Document
function showPrinciple(theid)
{

    if (document.getElementById)
    {
       hideOtherNav(theid);
       hideOthers(theid);
       var switch_id = document.getElementById(theid);
       var switch_nav = document.getElementById(theid + 'nav');
       if(switch_id.className == 'hide')
        {
           switch_nav.className = 'shownav';
           switch_id.className = 'show';
        }
        else
        {
           switch_id.className = 'hide';
        }
    }
}

/*function showMenuItem(theid)
{

    if (document.getElementById)
    {
       hideOtherNav(theid);
       hideOthers(theid);
       var switch_id = document.getElementById(theid);
       var switch_nav = document.getElementById(theid + 'nav');
       if(switch_id.className == 'hide')
        {
           switch_nav.className = 'shownav';
           switch_id.className = 'show';
        }
        else
        {
           switch_id.className = 'hide';
        }
    }
} */

function showMenuItem(item)
{
	
$('.content1').hide();
$('.content').hide();
$('.subnav').hide();
$('#' + item).show();
$('#' + item + 'nav').show();

}

function showContent(item)
{
	
$('.content1').hide();
$('.content').hide();
$('#' + item).show();

}

function showContentMenu(item)
{
	
$('.subnav').hide();
$('.content1').hide();
$('.content').hide();
$('#' + item).show();

}

function showStart()
{
	
$('.content').hide();
$('.subnav').hide();
$('#materialintro').show();

}

/*function showContent(theid)
{

    if (document.getElementById)
    {
       hideOthers(theid);
       var switch_id = document.getElementById(theid);
//        if(switch_id.className == 'hide')
//        {
           switch_id.className = 'show';
        }
//        else
//        {
//           switch_id.className = 'hide';
//        }
//    }
}  */
function hideOthers(theid)
{
    if(document.getElementsByName)
    {
        var eleArray = document.getElementsByName('content');
//        var eleArray = document.getElementsByClassName('show');
        for(i=0;i<eleArray.length;i++)
        {
            if(eleArray[i].id != theid)
            {
                eleArray[i].className = 'hide';
            }
        }
    }
}
function hideOtherNav(theid)
{
    if(document.getElementsByName)
    {
        var eleArray = document.getElementsByName('subnav');
        for(i=0;i<eleArray.length;i++)
        {
            if(eleArray[i].id != theid)
            {
                eleArray[i].className = 'hide';
            }
        }
    }
}

