//
// www.therudkingroup.com trg_main.js v1.0 Thu Aug 09 12:50:32 PST 2007
// Copyright (c) 2007 Kristine Rudkin, The Rudkin Group (http://www.therudkingroup.com). All rights reserved.
// Feel free to use this software for any purpose. However, the copyright
// notice should not be removed from the source code. If you use the
// software in a product, an acknowledgement in the the product documentation
// would be a nice touch.
//
function fadeElement( el )
{
   new Effect.Fade( el, {duration:1.5, from:1.0, to:0.0} );
}

function appearElement( el )
{
   new Effect.Appear( el, {duration:1.5, from:0.0, to:1.0} );
}

function growElement( el )
{
   new Effect.Grow( el, {duration: 1.5, direction:'center'} );
}

function hideEffectElement( el )
{
	new Effect.BlindUp( el, {duration:1.0} );
}

function showEffectElement( el )
{
	new Effect.BlindDown( el, {duration:1.0} );
}

function toggleElement( id, menuId )
{
   if( currId != null ) {
      hideEffectElement( currId );
      if( currId == 'clients' || currId == 'projects' ) {
         if( id != currId ) {
            hideElement('cpsubmenu');
	 }
      }
      currMenuId.style.fontWeight = 'bold';
      if( currId == 'intro' )  {
         showElement('tagline');
      }
      setTimeout( function(){showEffectElement(id)}, 3000);
   }
   else {
      if( id == 'clients' || id == 'projects' ) {
         showElement('cpsubmenu');
      }
      showEffectElement( id );
   }

   menuId.style.fontWeight = 'bolder';
   currMenuId = menuId;
   currId = id;
}

function showElement( elementID )
{
   var elem, vis;  

   elem = getElement( elementID );
   vis = elem.style;
   vis.display = 'block';
}

function hideElement( elementID )
{
   var elem, vis;

   elem = getElement( elementID ); 
   vis = elem.style;
   vis.display = 'none';
}

function getElement( id )
{
   var elem;  

   if( document.getElementById ) // this is the way the standards work    
      elem = document.getElementById( id );  
   else if( document.all ) // this is the way old msie versions work
      elem = document.all[ id ];  
   else if( document.layers ) // this is the way nn4 works
      elem = document.layers[ id ];  

   return elem;
}
