	
if (!document.FIN)
{ 	
	var aShowHideItems;
	
	window.addEvent('domready', function()
	{		
			showHideCommonItems();
			if (this.aShowHideItems[0].btn) 				this.aShowHideItems[0].btn.fireEvent('click');
			initOverLabels();
	});
		
	function showHideCommonItems()
	{	
		
		// find the btns and the content we want
		aShowHideItems										= [{btn: $('dyn_ln'),			container:	$('news-updates')},
															   {btn: $('dyn_pc'), 			container:	$('popular-content')}];		
		// cycle through our items
		for (var i = 0; i < aShowHideItems.length; i++)
		{
			// if both the btn and container exist 
			if (aShowHideItems[i].btn && aShowHideItems[i].container)
			{
				aShowHideItems[i].btn.set('inx', i);				
				aShowHideItems[i].btn.addEvent('click', function(event)
				{
					// hide everything else in the menu except the current btn
					hideAll(this.get('inx'));
					// define our content
					var objLanContainer							= aShowHideItems[this.get('inx')].container;	
					var objLanBtn								= aShowHideItems[this.get('inx')].btn;					
					
					// set the relevent classes 
					if (objLanBtn.hasClass('inactive'))			objLanBtn.removeClass('inactive').addClass('active');			
					//else 										objLanBtn.removeClass('active').addClass('inactive');
					if (objLanContainer.hasClass('inactive'))	objLanContainer.removeClass('inactive').addClass('active');			
					//else 										objLanContainer.removeClass('active').addClass('inactive');					
					
					return false;
				});		
			}
		}
	}
	
	function hideAll(param_execption)
	{
		// cycle through our common items
		for (var x = 0; x < aShowHideItems.length; x++)
		{
			// as long as it isn't the caller/execption & both the btn and container exist 
			if (x != param_execption && aShowHideItems[x].container && aShowHideItems[x].btn)
			{
				// hide it
				aShowHideItems[x].container.removeClass('active').addClass('inactive');
				aShowHideItems[x].btn.removeClass('active').addClass('inactive');		
			}
		}
	}
	
	window.addEvent('domready', function()
	{  
		 var sitemaplink = $('sitemaplink');
		 if(sitemaplink)
		 	sitemaplink.addEvent('click',function() { 
												  		return toggleSitemap();
												  	});
		var closesitemaplink = $('closesitemaplink');
		 if(closesitemaplink)
		 	closesitemaplink.addEvent('click',function() { 
												  		return toggleSitemap();
												  	});
	});
	
	function toggleSitemap()
	{
		var sitemap = $('sitemap');
		if(sitemap)
		{
			var display = 'none';
			if(sitemap.getStyle('display') == 'none')
				display = 'block';
			sitemap.setStyle('display',display);
			if(document.body.hasClass('noscroll'))
				document.body.removeClass('noscroll');
			else
				document.body.addClass('noscroll');
		}
		return false;
	}
	
	function startUpload(category)
	{
		var waitImg = $('category_'+category+'_wait');
		if(waitImg)
		{
			waitImg.setStyle('display','inline');
		}
		
		var arrFileBoxes = $$('input[type=file]');
		for(var i =0; i < arrFileBoxes.length; i++)
		{
			arrFileBoxes[i].setStyle('width','0px');
		}
	}
}
		