def toggle_menuclass(cssclass='pressed', menuid='headermenu'):
 positions = dict(index='', what='-108px -115px', download='-211px -115px', who='-315px -115px', support='-418px -115px', documentation='-520px -115px')
 if (request.function in positions.keys()):
  jscript = ("\n            <script>\n             $(document).ready(function(){\n                         $('.%(menuid)s a').removeClass('%(cssclass)s');\n                         $('.%(function)s').toggleClass('%(cssclass)s').css('background-position','%(cssposition)s')\n\n             });\n            </script>\n            " % dict(cssclass=cssclass, menuid=menuid, function=request.function, cssposition=positions[request.function]))
  return XML(jscript)
 else:
  return ''

def toggle_menuclass ( cssclass = 'pressed' , menuid = 'headermenu' ) : positions = dict ( index = '' , what = '-108px -115px' , download = '-211px -115px' , who = '-315px -115px' , support = '-418px -115px' , documentation = '-520px -115px' ) if ( request . function in positions . keys ( ) ) : jscript = ( "\n            <script>\n             $(document).ready(function(){\n                         $('.%(menuid)s a').removeClass('%(cssclass)s');\n                         $('.%(function)s').toggleClass('%(cssclass)s').css('background-position','%(cssposition)s')\n\n             });\n            </script>\n            " % dict ( cssclass = cssclass , menuid = menuid , function = request . function , cssposition = positions [ request . function ] ) ) return XML ( jscript ) else : return ''
this function changes the menu class to put pressed appearance .