// Get the url fragment #
function get_url_fragment()
{
	var url = document.location.href;

	var regexp = new RegExp('(.*)#(.*)', 'gi');
	regexp = regexp.exec(url);

	if (regexp != null && typeof(regexp[2]) != 'undefined')
	{
	    return regexp[2];
	}
	else
	{
		return false;
	}
}

$(document).ready(function()
{
	// PNG fixes
	$('#developers_header .dh_logo').ifixpng();
	$('#developers_header ul').ifixpng();
	$('#developers_header li').ifixpng();
	$('#developers_header li').each(function()
	{
		$(this).ifixpng();
	}); 
	
	// The current page is part of ... ?
	document.section = 'home';
	
	if (typeof(menu_highlight) != 'undefined')
	{
		for (var i in menu_highlight)
		{
			for (var j in menu_highlight[i])
			{
				// Select the current section tab
				
				$('#developers_header ul li').each(function()
				{
					// Extract class suffix
					var regexp = new RegExp('([0-9a-zA-Z\-_]+)' + menu_highlight[i][j], 'g');
        			regexp = regexp.exec($(this).attr('class'));
    
					if (!!regexp && typeof(regexp[1]) != 'undefined')
					{
						// Patch "quick" and dirty for IE 6 with the "Developer account" tab
						if (($.browser.msie && $.browser.version < 7) && $(this).attr('class') == 'dh_menu2_key')
						{			
							$(this).css({background: 'none', backgroundImage: 'none', filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src="/img/notext/menu2_on.png")'});
							$(this).addClass('dh_menu2_on_ie6');
						}
						else
						{
							$(this).attr('class', regexp[1] + 'on');
						}					
					}
				});
			
				// Set staticly the section
				document.section = menu_highlight[i][j];
			}
		}
	}
	
	switch (document.section)
	{	
	}

});
