/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


if (Drupal.jsEnabled) {
  $(document).ready(function() {



    $("a").each(function(el) {
      try {
          var  poo = this.href;
          var larray=poo.split("/");

          // $(this).addClass('bold');
          var rel = "/"+larray[3]+"/";

          ////////////

     if(larray[3] !== "cart"){       // do not flip on cart links

              

                      if( larray[4] != undefined){
                          rel = "/"+larray[3]+"/"+larray[4];
                           if( larray[5] != undefined){
                                rel = "/"+larray[3]+"/"+larray[4]+"/"+larray[5]+"/";
                           }
                      }


                        if($(this).parent().get(0).tagName != 'M'  ){     /// gets around sound links in optable  pager

                             $(this).attr(
                                'rel', rel
                             );

                            $(this).click(function() { return selectPage(this) } );


                        }
           


      }

      
    /////////
    //var parentTag = $(this).parent().get(0).tagName;
    //  $(this).prepend(document.createTextNode(parentTag + " > "));


      }
      catch(error) {
        return false;
      }

    })


  })

}








