/*
 * ContextMenu - jQuery plugin for right-click context menus
 *
 * Author: Chris Domigan
 * Contributors: Dan G. Switzer, II
 * Parts of this plugin are inspired by Joern Zaefferer's Tooltip plugin
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Version: r2
 * Date: 16 July 2007
 *
 * For documentation visit http://www.trendskitchens.co.nz/jquery/contextmenu/
 *
 */

(function($j) { 	

  $j.fn.ThaiSonPopup = function(id) {
       
              this.click(function () {
	        
	            var submenu = $j("#"+id);
	            submenu.css({
			                position:'absolute',
			                top: $(this).offset().top + $(this).height() + 'px',
			                left: $(this).offset().left + 'px',
			                zIndex:1000
		        });
	        
                if ($j("#"+id).is(":hidden")) {
                    
                    $j("#"+id).slideDown("slow");
                    
                    } 
                else {
                    $j("#"+id).hide();
                    
                }
                
                submenu.mouseleave(function(){
		        	$j("#"+id).slideUp(300);
		        	
		        });
                
            });
            
           
  };
 

})(jQuery);


