
	var timeout    = 500;
	var closetimer = 0;
	var ddmenuitem = 0;
	
	function jsddm_open()
	{  jsddm_canceltimer();
	   jsddm_close();
	   ddmenuitem = $(this).find('ul').css({'visibility' : 'visible', 'display' : 'block'});
	}

	function jsddm_close()
	{  
		if(ddmenuitem)
		{
			ddmenuitem.css({'visibility' : 'hidden', 'display' : 'block'});
		}
	}

	function jsddm_timer()
	{  closetimer = window.setTimeout(jsddm_close, timeout);}

	function jsddm_canceltimer()
	{  if(closetimer)
	   {  window.clearTimeout(closetimer);
		  closetimer = null;
		}
	}

	
$(document).ready(function(){
   	
	$('tr:first td').css({'border-top' : '1px solid #e8e8e8'});

	
	//get compat links for sweet roll over effects
	var $startHot = $( '#compatBarBody a.hotCompat');
	var $moreLink = $('#moreLink');
	var $moreText = $('#moreText');
	
	$moreLink.click(function(){
		return false;
	});
	
	var $otherList = $('#otherCompats');
	addWhite($startHot);
	$('#compatBarBody a').each(function(){
		
		if($(this).attr('class') != 'hotCompat')
		{
			$(this).mouseenter(function(){
				addWhite($(this));
			});
			

			$(this).mouseleave(function(e){
				removeWhite($(this));
			});

		/*
			$('#x02 ul').click(function (e) {
			if ($(e.target).parent().parent().is('li'))
				$(e.target).parent().parent().toggleClass('highlight');
			return false;
		});

			
			$(this).find('span').mouseout(function(){
				removeWhite($(this).parent());
			});
		*/

			
			$(this).find('span').click(function(){
				removeWhite($startHot);
				if($(this).parent().parent().parent().attr('id') == 'otherCompats')
				{
					$moreText.text($(this).text());
					//removeWhite($moreLink);
					addWhite($moreLink);
					$moreLink.unbind('mouseleave');
				}
				else
				{
					$(this).unbind('mouseleave');
				}
			});
		}
	});
	
	
	function addWhite($hotElement)
	{	
		if($hotElement != $startHot)
		{
			$hotElement.toggleClass('hotCompat');
		}
		$hotElement.prepend('<span class="hotCompatLeft"></span>');
		$hotElement.append('<span class="hotCompatRight"></span>');
		
		return $hotElement;
	}
	
	function removeWhite($hotElement)
	{	
		$hotElement.find('.hotCompatLeft').remove();
		$hotElement.find('.hotCompatRight').remove();
		$hotElement.toggleClass('hotCompat');
	}	
	


	$('#compatMenu > li').bind('mouseover', jsddm_open);
	$('#compatMenu > li').bind('mouseout',  jsddm_timer);
	
	$('#comp_header_list > li').bind('mouseover', jsddm_open);
	$('#comp_header_list > li').bind('mouseout',  jsddm_timer);
	
	


});

	document.onclick = jsddm_close;
