var WhatsNew = new Class({
						 
						 	// declare any variables needed
							arrIDs:		null,
							
							initialize: function()
							{
								// set up the array of link ids and
								// the sections they control
								this.arrIDs							= new Array();
								this.arrIDs['lnk_whatsnew']			= 'section_whatsnew';
								this.arrIDs['lnk_industrynews']		= 'section_industrynews';
								this.arrIDs['lnk_pressreleases']	= 'section_pressreleases';
								this.arrIDs['lnk_clubcirculars']	= 'section_clubcirculars';
								this.arrIDs['lnk_clubnews']			= 'section_clubnews';
								
								
								// go through each
								for(var i in this.arrIDs)
								{
									// if this isn't a link ID
									// ie. something else in the array
									// skip it
									if(!i.match('^lnk_'))
										continue;
										
									// attempt to locate the link
									var lnkSwitch = $(i);
									
									// if we found it, add the handler
									if(lnkSwitch)
									{
										lnkSwitch.addEvent('click', this.clickHandler);
										this.disableAnchor(lnkSwitch);
									}
										
								}
								
							},
							
							clickHandler: function()
							{
								// if the class has been instantiated
								if(whatsNew)
								{
									// go through each id
									for(var j in whatsNew.arrIDs)
									{
										// find the news articles section
										// and make sure it is set to hidden
										var secTarget = $(whatsNew.arrIDs[j]);
										if(secTarget && !secTarget.hasClass('force-hidden'))
											secTarget.addClass('force-hidden');
										
										// also make sure that the
										// parent node is set to inactive
										var elTarget = $(j);
										if(elTarget && elTarget.getParent())
										{
											elTarget.getParent().removeClass('active');
											elTarget.getParent().addClass('inactive');
											
											// if the element is a span, i.e. the
											// previous selected node, change it to an anchor
											if(elTarget.tagName.toLowerCase() == "span")
											{
												var aReplacement = new Element('a');
												aReplacement.set('html', elTarget.get('html'));
												aReplacement.setAttribute('id', elTarget.getAttribute('id'));
												aReplacement.setAttribute('href', 'javascript:void(0)');
												aReplacement.addEvent('click', whatsNew.clickHandler);
												aReplacement.replaces(elTarget);
												whatsNew.disableAnchor(elTarget);
											}
										}
									}
									
									// now find the clicked anchor's section
									var mySecTarget = $(whatsNew.arrIDs[this.getAttribute('id')]);
									
									// unhide it
									if(mySecTarget)																		  
										mySecTarget.removeClass('force-hidden');
									
									// switch active / inactive classes
									this.getParent().addClass('active');
									this.getParent().removeClass('inactive');
									
									// now create a new element
									// to replace this one
									var spanReplacement = new Element('span');
									spanReplacement.set('html', this.get('html'));
									spanReplacement.setAttribute('id', this.getAttribute('id'));
									spanReplacement.replaces(this);
								}
							},
							
							disableAnchor: function(mxLabel)
							{
								// assume failure
								var bDisabled 	= false;
								
								// try and locate the item
								var elTarget	= $(mxLabel);
								
								// if we located it
								if(elTarget)
								{
									// disable the link
									if(Browser.Engine.trident) // IE
										elTarget.onclick = function(){ return false; };
									else // FF, Safari, Opera
										elTarget.setProperty('onclick', 'return false');
									
									// declare success
									bDisabled = true;
								}
								
								// return the result
								return bDisabled;
							}
						 
						});

// create a null holder
var whatsNew = null;

window.addEvent('domready', function()
							{
								if(!document.FIN)
								{
									// instantiate the class
									whatsNew = new WhatsNew();
									
									// fire off the first link
									if($('lnk_whatsnew'))
										$('lnk_whatsnew').fireEvent('click');
								}
							});