JavaScript 'SuperMenu'?


Please forgive me - I’m really new to PHP, and even newer still to JavaScript. I’ve done some looking around this forum, but have been unable to find something to address my needs - perhaps not using the correct search criteria.

Anyways, I’m looking for a way to create a Javascript ‘super menu’…not for use as a standard top or side menu item, but as a way to display general product information, specifications, and other notes in an OSCommerce shopping cart. Currently, each of these are presented on separate tabs within the product page.

I’ve been playing around with an XP style menu (sample found at I can change the button appearance, label, etc.

Primary Question:
Having seen other posts advising against including SQL statements in the JavaScript for security purposes, can I perform the necessary SQL statement(s) in PHP, assign to a variable, and then pass the variable into a JavaScript function?

Nice-to-Have Secondary Question:
If so, and to minimize SQL overhead, I’d like to execute the SQL statement to obtain general product info when the page is loaded. Subsequent SQL statements for Specification and Notes would only be executed when the corresponding menu item is selected. To further minimize overhead, as long as the user stays on the same product page, once a General, Specification or Note variable is populated, it won’t resubmit the query (my product descriptions are not changing nearly enough to where this could possibly be a problem).

A couple of quality examples would be greatly appreciated. If I can see an example, I’m fairly confident I could modify it accordingly to meet my needs.

Thanks in advance, and a Happy New Year to all.