First Real jQuery Script - Need some help

First Real jQuery Script - Need some help

Here is my pseudo code for the operation I need to perform:

[code]
Document Ready
Set Variable href=0

      Find first child element under first div with class “commerce

      Save href attribute from image to Variable href

      Step up element structure to first <Table> encountered

       Wrap Table element in <a> tag

      Add href from variable to the <a> tag

      Continue down document to next element with a class of “ commerce “ and repeat until no other elements with "commerce" class exist.[/code]


I'm new to jQuery and scripting so this is over my head.  But I thought it was very doable and should be a good place to get my feet wet :D


Here's what I'm thinking so far:

[code]

$(function(){
    var link = 0;

    .find(div.commerce);

});

[/code]


Well that's about it so far.  I'm not sure the find function is what I want or not.  I thought about using .first but that doesn't help me move the script along to process all of the classes found with the "commerce" class.

Again, new to this so thank you for any tips and your patience!