// JavaScript Document


function closeMenuBottom(func)
{
    if ($('div.dropdown').css('display') == 'block')
    {
        $('div.dropdown').slideUp('slow', func);
        $('div.dropgradient').fadeOut('slow');
    }
    else
    {
        if (func != null) func();
    }
};

function openMenuBottom(func)
{
    if ($('div.dropdown').css('display') == 'none')
    {
        $('div.dropgradient').fadeIn('slow');
        $('div.dropdown').slideDown('slow', func);
    }
    else
    {
        if (func != null) func();
    }
};

function toggleMenuBottom()
{
    if ($('div.dropdown').css('display') == 'none')
    {
         openMenuBottom();
	 
    }
    else
    {
          closeMenuBottom();
    }
};

var globalLink = null;

function showPopup(link)

{
	if (link == globalLink) 
	{
		toggleMenuBottom();
		return false;
	}
	
	globalLink = link;
	
	closeMenuBottom(function()
	{
		$('div#productdropdowncontent').load('/popuploader.asp', {option: link}, function(response, status, xhr)
	
		{
	
			if (status == 'error')
	
			{
	
				$('div#productdropdowncontent').html('<strong>Sorry, but we were unable to complete that request. The webmaster has been notified.</strong> (Message: ' + xhr.status + ' ' + xhr.statusText + ')');
	
			}
	
			$('div#productdropdowncontent').append('<div id="popupClose"><a href="#" id="dropdownclose"><img src="/images/close_button.jpg"></a><script type="text/javascript">$(document).ready(function(){$(\'#dropdownclose\').click(function(){closeMenuBottom()});});</script></div>');
	
			   openMenuBottom();
	
	
		});
	});

}




/*
		$('#rightpanel a').hover(function()
		{
			$(this).children('.blackblock').css(
			{
				'opacity': '0.7'
			}).fadeIn('fast');
	
		}, function()
		{
			$(this).children('.blackblock').fadeOut('fast');
		});


*/
