     // load a content section
     function loadSection(section)
     {
          file = null === section.match(/\w+\.php/) ? section + ".php" : section.match(/\w+\.php/);
          $('.nav li a').removeClass("selected");
          $('.nav li a.' + section).addClass("selected");
          $('#framex').css({width:"764px",height:"486px"});
          $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');
          $('#framex').load(file);
          $('#framex').css({width:"1%",height:"1%"});
          location.href = "#" + section;
          return false;
     }
     
     $(function(){
          //$('.nav li a, .externallinks .contact').attr({'target':'cframe'});
          $('#links a, .externallinks a').attr({'target':'_blank'});
          $('.nav li a.product').addClass("selected");
          $('.designateria').click(function(){self.location.href='index.php';}).css({cursor:"pointer"});
          $('#flmenu').flash({src:'da_music_player.swf',width:147,height:460,expressInstall:true})
          
          var hash = location.hash;
          var section;
          var file;
          if(hash != "")
          {
               section = hash.replace("#","");
               loadSection(section);
          }    
          else{loadSection("product");}
          

          /*       
          TODO: even tho loc might be something like product.php, the length of loc shows as 1
          $('#menu li a').click(function(){
               loc = this.href.match(/\w+\.php/);
               //loc = loc.substring(0,loc.length-3);
               //location.href = loc;
               //loadSection(this.href);
               return false;
          });
          
          */
          
          // yes, this is obnoxious -- I'll fix it later
          $('.musicianlink,.artistlink,.boutiquelink').livequery('click', function(event) { 
               $('.nav li a').removeClass("selected");
               $('.nav li a.spotlight').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');
               $("#framex").load(this.href);
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;
               return false;
          });
          
          $('.pastlink').livequery('click', function(event) { 
               $('.nav li a').removeClass("selected");
               $('.nav li a.history').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');
               $("#framex").load(this.href);
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;
               return false;
          });
          
          $('.colorbox').livequery('click', function(event) { 
               $('.colorbox').css("border","1px solid #000")
               $(this).css("border","1px solid red");
               
               $('#productcolor').val(this.id);
               
               // ie returns hex, mozilla rgb -- do we care about opera and safari?
               /*
               if ($.browser.msie) 
               {
                    $('#productcolor').val($(this).css("background-color"));
               }
               else if($.browser.mozilla)
               {
                    $('#productcolor').val(rgbToHex($(this).css("background-color")));
               }
               $('#colorandsize').livequery(function(){
                    $(this).val($('#productsize').val() + " " + $('#productcolor').val());
                    
                    if($('#productsize').val() != "" && $('#productcolor').val() != "")
                    {
                    $("#buynow").show();
                    }
               });
               */
               
               updateColorAndSize();
               return false;
          }); 
          
          $("#emailimg").click(function(){
               $.post("email.php", { email: $('#email').val() }, function(data){
                    alert(data);
               });          
          });

          
          // thumbs in the spotlight sections
          $('.bthumbs > a').livequery('click', function(event) { 
               $('#largeimg').html('<img src="assets/resizePhoto.php?path=assets/images/boutique/' + this.id + '&width=360&height=375" />');
               return false;
          });          
          $('.athumbs > a').livequery('click', function(event) { 
               $('#largeimg').html('<img src="assets/resizePhoto.php?path=assets/images/artist/' + this.id + '&width=360&height=375" />');
               return false;
          });          
          $('.mthumbs > a').livequery('click', function(event) { 
               $('#largeimg').html('<img src="assets/resizePhoto.php?path=assets/images/musician/' + this.id + '&width=360&height=375" />');
               return false;
          });
          
          $('#shopbox > a,.productthumbs > a').livequery('click', function(event) { 
               $('.nav li a').removeClass("selected");
               $('.nav li a.product').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');
               $("#framex").load(this.href);
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;
               return false;
          });    
          
          $('.nav li a.product,#products a').click(function(){
               $('.nav li a').removeClass("selected");
               $('.nav li a.product').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');
               $("#framex").load(this.href);
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;
               return false;
          });
          $('.nav li a.signature,#vendors a').click(function(){
               $('.nav li a').removeClass("selected");
               $('.nav li a.signature').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');
               $('#framex').load(this.href, function(){

               });
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;
               return false;
          });
          $('.nav li a.history').click(function(){
               $('.nav li a').removeClass("selected");
               $('.nav li a.history').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');               
               $('#framex').load(this.href);
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;
               return false;
          });
          $('.nav li a.blogs').click(function(){
               $('.nav li a').removeClass("selected");
               $('.nav li a.blogs').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');               
               $('#framex').load(this.href);
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;               
               return false;
          });
          $('.nav li a.spotlight,#spotlights a').click(function(){
               $('.nav li a').removeClass("selected");
               $('.nav li a.spotlight').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');
               $('#framex').load(this.href);
               /*               
               $('#framex').load(this.href, function(){
                    $('.musicianlink,.artistlink,.boutiquelink').click(function(){
                         //alert($('#framex'));
                         $('#framex').load(this.href);
                         $('#framex').css({width:"1%",height:"1%"});
                         loc = '#' + this.href.match(/\w+\.php/);
                         loc = loc.substring(0,loc.length-4);
                         location.href = loc;                          
                         return false;
                    });
               });
               */
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;               
               return false;
          });
          $('.nav li a.boutiques').click(function(){
               $('.nav li a').removeClass("selected");
               $('.nav li a.boutiques').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');               
               $('#framex').load(this.href, function(){

               });
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;               
               return false;
          });
          $('.nav li a.links').click(function(){
               $('.nav li a').removeClass("selected");
               $('.nav li a.links').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');               
               $('#framex').load(this.href);
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;               
               return false;
          });
          $('.nav li a.contact, .externallinks .contact').click(function(){
               $('.nav li a').removeClass("selected");
               $('.nav li a.contact').addClass("selected");
               $('#framex').css({width:"764px",height:"486px"});
               $('#framex').html('<img src="assets/images/30-0.gif" style="margin-left:375px;margin-top:200px;" />');               
               $('#framex').load(this.href);
               $('#framex').css({width:"1%",height:"1%"});
               loc = '#' + this.href.match(/\w+\.php/);
               loc = loc.substring(0,loc.length-4);
               location.href = loc;               
               return false;
          });


          $('#email').focus(function(){
               $('#email').removeClass("email");
               $('#email').addClass("bmail");
          }).blur(function(){
               if($('#email').val() == "")
               {
                    $('#email').removeClass("bmail");
                    $('#email').addClass("email");
               }
          });
                    
          var options = {target:   '#response'}
          
          //$('input[type="image"]').css({vertical-align:"top"});
          
          
          //---//$('#emailform').ajaxForm(options);

          $("ul.sf-menu").superfish();
          
          $("ul.nav").superfish({
          	animation : { opacity:"show", height:"show" }
          });
          
          /*
          $('#BB_BuyButtonForm').validate({
               rules:
          })
          */

     });
     
     function setoptions(val)
     {
          $('#productsize').livequery(function(){
               $(this).val(val);
          });
          updateColorAndSize();
     }
     
     function updateColorAndSize()
     {
          $('#colorandsize').livequery(function(){
               //$(this).val(val + " " + $('#productcolor').val());
               $(this).val(
                    //$('#productdescription').val()  + " " + 
                    $('#productsize').val()  + " " + 
                    $('#productcolor').val()
                    );
               
               //$("#buynow").show();
          });     
     }
     
     function rgbToHex(rgb) 
     {
          if(rgb != null && rgb != "" && typeof rgb != 'undefined' && rgb != 'transparent')
          {
               /// this isn't cool
               var rgbvals = /rgb\((.+),(.+),(.+)\)/i.exec(rgb);
               var rval = parseInt(rgbvals[1]);
               var gval = parseInt(rgbvals[2]);
               var bval = parseInt(rgbvals[3]);
               return '#' + (
               rval.toString(16) +
               gval.toString(16) +
               bval.toString(16)
               ).toUpperCase();          
          }
     }