jQuery(document).ready(function(){
	//pos = jQuery('#menu_float').offset();
		//alert(pos.left);
		
		//alert (pos2.left);
		//jQuery('#menu_float').find('.menu1').css('left', pos.left * -1);
		jQuery('body').mouseenter(function(){
			jQuery('.menu1').css('display', 'none');
			});
		var over = true;
		orig = jQuery('#menu_float').find('.menu1:first').offset();
		jQuery('#menu_float').find('.menu1').css('left', orig.left);
		jQuery('.catList').mouseover(function(){
			over=false;
			me = jQuery(this);
			entered=false;
			poss = jQuery(this).offset();
			jQuery('.menu1').css('display','none');
			jQuery(this).parent().find('.menu1').css('display', 'block');
			
			jQuery(this).parent().find('.menu1').css('top',poss.top+25-jQuery(document).scrollTop());
			jQuery('.catList').css('color', '');
			jQuery('.catList').css('background-color', '');
			cnt = jQuery(this).parent().find('.menu1').find('.subcatdiv').size();
			sz = parseInt(jQuery('.subcatdiv').css('width')) + 15;
			bgcolor= jQuery('#backcolor').css('background-color');
			fgcolor= jQuery('#backcolor').css('color');
			//alert (bgcolor);
			jQuery(this).css('background-color', bgcolor);
			jQuery(this).css('color', fgcolor);
			jQuery(this).parent().find('.menu1').css('width', cnt*sz);
			jQuery(this).parent().find('.menu1').css('background-color', bgcolor);
			
			jQuery(this).parent().find('.menu1').mouseleave(function(){
				jQuery('.catList').css('color', '');
				jQuery('.catList').css('background-color', '');	
				jQuery(this).css('display', 'none');
				
				
			});
			jQuery(this).parent().find('.menu1').mouseover(function(){
				me.css('background-color', bgcolor);
				me.css('color', fgcolor);
				jQuery(this).css('display', 'block');
				
				
			});
			jQuery(document).scroll(function(){
				
				jQuery('.menu1').css('display', 'none');
			});
			jQuery(this).mouseleave(function(){
					jQuery('.catList').css('color', '');
					jQuery('.catList').css('background-color', '');	
					jQuery(this).parent().find('.menu1').css('display', 'none');
					
			});
		});
		
		
		
});

