function SmoothMenuManager(span) {
  var mySelf = this

  // Superclass Constructor
  top.glbDict.makeWidgetManager(this,span)

  mySelf.postMenuEvent = function(id) {
    top.glbDict.queueServerEvent(mySelf.span,'menu_select', false , id )
    mySelf.accinit()
  }
  
  mySelf.applyResize = function() {
    mySelf.cntDiv.style.width = mySelf.posDiv.style.width
    mySelf.cntDiv.style.height = mySelf.posDiv.style.height
    return
    
    
    
    
    var cname = '.accmenu_' + mySelf.getID()
    var w = mySelf.posDiv.style.width
    var h = mySelf.posDiv.style.height
    jQuery(cname).css({ 'width' : w })
    var xname = '.accmenu_' + mySelf.getID() + ' div.silverheader'
    var tot = 0
    jQuery(xname).each( 
    		function(i) {
    			tot += parseInt( $(this).get(0).offsetHeight )
    		}
    )
    /* Manual fudge to get bottom alignment on IE & firefox */
    var fudge = 10
    if (document.all && !window.opera) {
    	fudge = 0
    }
    
    var xname = '.accmenu_' + mySelf.getID() + ' div.submenu'
    jQuery(xname).css({'height':(parseInt(h)-tot-fudge)+'px'})
  }

  mySelf.initialize = function() {
	if (!mySelf.cntDiv) {
      mySelf.posDiv = mySelf.span.getElementsByTagName('div')[0]
      // Blow away positioning div contents
      top.glbDict.innerHTML(mySelf.posDiv,'')
      //mySelf.cntDiv = mySelf.posDiv.getElementsByTagName('div')[0]
      // Retrieve the initial data from the server side
      var menudata = decodeURIComponent( top.glbDict.uwWidgetFactory.getInitDataForWidget( mySelf.getID() )['menudata'] )
        
      // Solve IE Z-ORDER by binding the content right to document root
      var doc = mySelf.span.ownerDocument
      var cnt = doc.createElement('div')
      cnt.style.position = 'absolute'
      cnt.style.top = mySelf.span.style.top
      cnt.style.left = mySelf.span.style.left
      cnt.style.width = mySelf.posDiv.style.width
      cnt.style.height = mySelf.posDiv.style.height
      cnt.style.zIndex = 100
	  cnt.id = 'cntDiv_' + mySelf.getID()
      cnt.className = 'ddsmoothmenu'
      doc.body.appendChild(cnt)
      mySelf.cntDiv = cnt
      top.glbDict.innerHTML(cnt,menudata)
      mySelf.accinit()
	}
  }
  
  mySelf.replaceContents = function(stuff) {
    top.glbDict.innerHTML(mySelf.cntDiv,decodeURIComponent(stuff))
    mySelf.accinit()
    mySelf.applyResize()
  }
  
  mySelf.accinit = function() {
	  //if (document.all & !window.opera) {
      //  jQuery('html .ddsmoothmenu').css({'height':'1%'}) 
	  //}
	  mainmenuid = 'cntDiv_' + mySelf.getID()
	  smmid = '#' + mainmenuid
	  jQuery(smmid).css(
			  {'background' : 'url(/shared/smoothmenu/silvergradient.gif)' }
	  )
	  jQuery(smmid + ' ul li a').css(
			  {'background' : 'url(/shared/smoothmenu/silvergradient.gif)' }
	  )
	  jQuery(smmid + ' ul li a').hover( 
			  function() {
				  $(this).css(
					 {'background' : 'url(/shared/smoothmenu/bluegradient.gif)' }
				  )
			  },
			  function () {
				  $(this).css(
					 {'background' : 'url(/shared/smoothmenu/silvergradient.gif)' }
				  )
			  }
	  )
	  /*
	  jQuery(smmid + ' a.foo').css(
			  {'background' : 'orange' }
	  )
	  */
      ddsmoothmenu.init({
      	mainmenuid: mainmenuid, //menu DIV id
      	//customtheme: ["url(bluegradient.gif)", "url(silvergradient.gif)"], //override default menu CSS background values? Uncomment: ["normal_background", "hover_background"]
      	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
      })
  }

  mySelf.initialize()

  return mySelf
}

top.glbDict.uwWidgetFactory.registerWidgetClass('SmoothMenu',SmoothMenuManager)
