
$(function() {

	$.localScroll.hash({
		duration:1500
	});
	
	$.localScroll({
		duration:250
	});
	
	$("div#func_quicklinks_hover").appendTo("span#quicklinks_holder");
	$("div#func_overview_hover").appendTo("span#overview_holder");
	$("div#func_lookup_hover").appendTo("span#lookup_holder");
        
	$('#toplinks #quicklinks').click(function() {
	
		if ($('#func_quicklinks_hover').css('display')=='none') {
		
			if ($('#func_overview_hover').css('display')=='block') {
				$('#toplinks #overview').click();
			}
			
			if ($('#func_lookup_hover').css('display')=='block') {
				$('#toplinks #searchlink').click();
			}
			
			$('#func_quicklinks_hover').css('display', 'block');
			//$(this).addClass('searchlink_act');
			return false;
               } else {
                    	$('#func_quicklinks_hover').css('display', 'none');
			//$(this).removeClass('searchlink_act');
			return false;
               }
	
	});
	
	$('#toplinks #overview').click(function() {
	
		if ($('#func_overview_hover').css('display')=='none') {
		
			if ($('#func_quicklinks_hover').css('display')=='block') {
				$('#toplinks #quicklinks').click();
			}
			
			if ($('#func_lookup_hover').css('display')=='block') {
				$('#toplinks #searchlink').click();
			}
			
			$('#func_overview_hover').css('display', 'block');
			//$(this).addClass('searchlink_act');
			return false;
               } else {
                    	$('#func_overview_hover').css('display', 'none');
			//$(this).removeClass('searchlink_act');
			return false;
               }

	});
	
	$('#toplinks #searchlink').click(function() {
	
	
		if ($('#func_lookup_hover').css('display')=='none') {
			
			if ($('#func_quicklinks_hover').css('display')=='block') {
				$('#toplinks #quicklinks').click();
			}
			
			if ($('#func_overview_hover').css('display')=='block') {
				$('#toplinks #overview').click();
			}
			
			$('#search #topsearch').focus();
			$('#func_lookup_hover').css('display', 'block');
			//$(this).addClass('searchlink_act');
			return false;
               } else {
                    	$('#func_lookup_hover').css('display', 'none');
			//$(this).removeClass('searchlink_act');
			return false;
               }
               
	});
	
	
	/* 
	* Patch IE's :hover & :focus problems with tags other than <a> */
	
        /*$('#topnav').children('li').hover(
        	function() { 
			
			$(this).addClass('sfhover');
			$(this).find('ul').css('visibility','visible');
			$(this).find('select').css('visibility','hidden');
		}, 
        	function() {
			//alert('mouseout');
			$(this).removeClass('sfhover');
			$(this).find('ul').css('visibility','hidden');
			$(this).find('select').css('visibility','visible');
		}
	);*/
	
	$('table.contenttable tr:has(td)').hover(
		function(){ 
			$(this).addClass('highlighthover');
			$(this).find('td.highlight_grey').addClass('highlighthover_grey');
			$(this).find('td.highlight_grey_flex').addClass('highlighthover_grey');
			$(this).find('td.highlight').addClass('highlighthover_red');
		}, 
		function() {
			$(this).removeClass('highlighthover');
			$(this).find('td.highlight_grey').removeClass('highlighthover_grey');
			$(this).find('td.highlight_grey_flex').removeClass('highlighthover_grey');
			$(this).find('td.highlight').removeClass('highlighthover_red');
		}
	);

	$('div.tx-fileindex-pi1 table tr:has(td)').hover(
		function(){ 
			$(this).addClass('highlighthover');
			/*$(this).find('td.highlight_grey').addClass('highlighthover_grey');
			$(this).find('td.highlight_grey_flex').addClass('highlighthover_grey');
			$(this).find('td.highlight').addClass('highlighthover_red');*/
		}, 
		function() {
			$(this).removeClass('highlighthover');
			/*$(this).find('td.highlight_grey').removeClass('highlighthover_grey');
			$(this).find('td.highlight_grey_flex').removeClass('highlighthover_grey');
			$(this).find('td.highlight').removeClass('highlighthover_red');*/
		}
	);
}); 
    
 

/*

var transparentImage = "/fileadmin/templates/js/blank.gif";

function fixTrans()
{
	if (typeof document.body.style.maxHeight == 'undefined') {

	var imgs = document.getElementsByTagName("img");
	
	for (i = 0; i < imgs.length; i++)
	{	
		if (imgs[i].src.indexOf(transparentImage) != -1)
		{
			return;
		}

		if (imgs[i].src.indexOf(".png") != -1)
			{
				var src = imgs[i].src;
				imgs[i].src = transparentImage;
				imgs[i].runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='none')";
			}
		}	
	}
}
if (document.all && !window.opera)
	attachEvent("onload", fixTrans);
*/
