function pl() { fl(); rl(); oc_init('header');  }


document.pick = function(name)
{
  var i, objects, chosen;

  if ( document.getElementsByTagName && document.getElementById )
  {
	objects = document.getElementsByTagName('div');
	for ( i = 0; i < objects.length; i++ )
		if ( objects[i].id.indexOf( 'pick_' ) != -1 )
			objects[i].style.display = 'none';

   chosen = document.getElementById( 'pick_' + name );
   if ( chosen )
		chosen.style.display = 'block';
   }
};

function fl()
{
  var i, frm, objects;

	if ( document.getElementsByTagName )
	  for ( frm = 0; frm < document.forms.length; frm++ )
	  {
		objects = document.forms[frm].getElementsByTagName('input');
		for ( i = 0; i < objects.length; i++ )
		  if ( typeof( objects[i].src ) != 'undefined' )
			il( objects[i] );
	  }
}

function rl()
{
  var i, objects;

  if ( document.getElementsByTagName )
	objects = document.getElementsByTagName('img');
	for ( i = 0; i < objects.length; i++ )
	  if ( typeof( objects[i].src ) != 'undefined' )
		il( objects[i] );
}

function il( object ) { if ( object.src.indexOf( '-normal' ) != -1 ) { object.nsrc = object.src; object.osrc = object.src.replace( '-normal', '-over' ); object.oimg = new Image; object.oimg.src = object.osrc; } }
function i0( name ) { var object; if ( document.getElementById ) if ( ( object = document.getElementById( name ) ) != null ) if ( object.nsrc != null ) object.src = object.nsrc; }
function i1( name ) { var object; if ( document.getElementById ) if ( ( object = document.getElementById( name ) ) != null ) if ( object.osrc != null ) object.src = object.osrc; }


var FlashActiveX;
var FlashActiveXVersion;

function FlashOK( version )
{
  if (navigator.plugins && navigator.plugins.length > 0)
  {
 	  if (navigator.plugins["Shockwave Flash"])
	{
	  var words = navigator.plugins["Shockwave Flash"].description.split(" ");

		for (var i = 0; i < words.length; ++i)
  	  {
		if (isNaN(parseInt(words[i])))
	   		continue;

	 		if ( parseInt(words[i]) >= version )
	 		{
	 		  return true;
	 		}
	  }
	}
  }
  else if ( FlashActiveX != null)
  {
	if ( FlashActiveX )
	{
	  return FlashActiveXVersion >= version;
	}
  }

  return false;
}


if ( navigator.userAgent.indexOf("MSIE") != -1 )
{
  if ( ! ( ( navigator.appVersion.indexOf("Mac") != -1 ) && ( parseInt(navigator.appVersion) == 3) ) )
  {
	document.writeln('<script language="VBScript">');
	document.writeln('Private i, x');

	document.writeln('On Error Resume Next');

	document.writeln('FlashActiveX = False');
	document.writeln('FlashActiveXVersion = 0');

	document.writeln('For i = 12 To 2 Step -1');

	document.writeln('  Set x = CreateObject("ShockwaveFlash.ShockwaveFlash." & i)');

	document.writeln('  If IsObject(x) Then');
	document.writeln('	FlashActiveX = True');
	document.writeln('	FlashActiveXVersion = i');
	document.writeln('	Exit For');
	document.writeln('  End If');

	document.writeln('Next');

	document.write('</scr');
	document.writeln('ipt>');

  }
}

function pu( url, w, h ) { window.open( url, "popup", "width=" + w + ",height=" + h + ",scrollbars=yes,directories=no,toolbar=no,status=no,menubar=no,location=no,resizable=no"); return false; }

function fm (v,f,w,h,i,a)
{
	if ( FlashOK(v) )
	{
		document.write( '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + w + '" height="' + h + '" id="' + i + '" align="middle">' );
		document.write( '  <param name="allowScriptAccess" value="sameDomain" />' );
		document.write( '  <param name="movie" value="' + f + '" /><param name="quality" value="high" />' );
		document.write( '  <embed src="' + f + '" quality="high" wmode="transparent" width="' + w + '" height="' + h + '" name="' + i + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' );
		document.write( '</object>' );
	}
	else
	{
		document.write( a );
	}
}

function oc_init( treename )
{
	var tree;
	var uls;
	var i;


	if ( ! document.getElementById )
		return;

	if ( ( tree = document.getElementById( treename ) ) == null )
		return;


	if ( ! tree.getElementsByTagName )
		return;

	uls = tree.getElementsByTagName( 'UL' );

	for ( i = 0; i < uls.length; i++ )
	{
		uls[i].firstChild.className += ' first-child';
		uls[i].lastChild.className += ' last-child';
	}
}


if( navigator.userAgent.indexOf('MSIE') != -1 && window.attachEvent ) window.attachEvent('onload', function() 
{
	if ( document.getElementById && document.getElementsByTagName ) 
	{
		var menu = document.getElementById('menu');
		
		// Add events to fake  a hover selector for IE6
		
		if( navigator.userAgent.indexOf('MSIE 6') != -1 )
		{
			var navigation = menu.getElementsByTagName('LI');
			
			for ( var index = 0; index < navigation.length; index++ )
			{
				var node = navigation[index];
			
				node.attachEvent( 'onmouseenter', function() 
				{
					event.srcElement.className += ' ie6hover';
				} );

				node.attachEvent( 'onmouseleave', function() 
				{              
					event.srcElement.className = event.srcElement.className.replace( new RegExp(" ie6hover\\b"), '' ); 
				} );                                          
			}
		}
		
		
		// For IE6+ add an iframe to each menu element so it will render over flash/combos
		// structure *must* be <div id="menu"><ul><li> 
		
		for ( var i = 0; i < menu.childNodes.length; i ++ )
		{
			var ul = menu.childNodes[i];
			
			if ( ul.tagName == 'UL' )
			{
				for ( var j = 0; j < ul.childNodes.length; j ++ )
				{
					var li = ul.childNodes[j];
					
					if ( li.tagName == 'LI' )
					{
						// Got the top of a submenu, now do addition across it's sub tree
						
						var navigation = li.getElementsByTagName('LI');
						
						for ( var index = 0; index < navigation.length; index++ )
						{
							var node = navigation[index];
							var frame = document.createElement('IFRAME');
							
							frame.style.height = node.offsetHeight + 'px';
							//frame.style.left = node.screenLeft + 'px';
							node.appendChild( frame );							
						}
					}
				}
			}
		}
	}
} );

	

