        lastimg=1;        
        function imgInfo(i,td,id) {
          $(".imgblock").hide();
          $("#block"+i).show();
          thumbSize(td,i,id);

          if ($('#crsl').length) {
            $("#crslimg"+lastimg).css("border","4px solid #444444");
            $("#crslimg"+i).css("border","4px solid #5FC15F");
            lastimg=i;
          } else {
            $("#imgselect > a").css("background-color","#222222");
            $("#imglink"+i).css("background-color","#444444");
          }
        }

        function thumbSize(t,i,id) {
          $(".thumblink").css("background-color","#111111");
          $("#thumblink"+t+i).css("background-color","#444444");
          $("#wsthumb"+i).val('<a href="http://xomf.com/'+id+'"><img src="http://i.xomf.com/'+t+'/'+id+'.jpg"></a>');
          $("#frthumb"+i).val('[url=http://xomf.com/'+id+'][img]http://i.xomf.com/'+t+'/'+id+'.jpg[/img][/url]');
        }

        $(document).ready(function() {
          $('.social').css({ opacity: 0.8 });
          $('.social').hover(
            function () { $(this).css({ opacity: 1.0 }); }, 
            function () { $(this).css({ opacity: 0.7 }); }
          );
        });

        function toggle(i) {
          $('#extinfo'+i).toggle();
          if ($('#expicon'+i).attr('src') == '/img/icon_expand.gif') $('#expicon'+i).attr('src', '/img/icon_contract.gif');
          else $('#expicon'+i).attr('src', '/img/icon_expand.gif');
        }

        function share(type,id) {
          switch (type) {
            case 'twitter':
              width = 550; height = 400;
              url = 'http://twitter.com/share?url=http://xomf.com/'+id+'&text=Check+this+out%3a&via=xomf';
              break;

            case 'facebook':
              width = 600; height = 350;
              url = 'http://www.facebook.com/sharer.php?u=http://xomf.com/'+id;
              break;

            case 'reddit':
              width = 1000; height = 600;
              url = 'http://reddit.com/submit?url=http://xomf.com/'+id;
              break;

            case 'digg':
              width = 1050; height = 600;
              url = 'http://digg.com/submit?phase=2&url=http://xomf.com/'+id;
              break;

            case 'stumbleupon':
              width = 1050; height = 600;
              url = 'http://www.stumbleupon.com/submit?url=http://xomf.com/'+id;
              break;

            case 'delicious':
              width = 1050; height = 600;
              url = 'http://del.icio.us/post?url=http://xomf.com/'+id;
              break;

            case 'linkedin':
              width = 520; height = 570;
              url = 'http://www.linkedin.com/shareArticle?mini=true&url=http://xomf.com/'+id+'&source=XOMF.com';
              break;

            case 'myspace':
              width = 550; height = 450;
              url = 'http://www.myspace.com/Modules/PostTo/Pages/?u=http://xomf.com/'+id;
              break;
          }
          if (!window.open(url,'share','resizable=1,toolbar=0,status=0,scrollbars=yes,width='+width+',height='+height)) document.location.href=url;
        }

        function report(id) {
          $('#report').modal({
            onOpen: function (dialog) {
              dialog.overlay.fadeIn('fast', function () {
                dialog.container.fadeIn('fast', function () {
                  dialog.data.fadeIn('fast', function() {
                    $('.roco').corner();
                    if (!$.browser.msie) $('.smroco').corner('4px');
                    $('#reason').selectbox({effect: 'slide'});
                  });
                });
              });
            },

            onClose: function (dialog) {
              dialog.data.fadeOut('fast', function () {
                dialog.container.fadeOut('fast', function () {
                  dialog.overlay.fadeOut('fast', function () {
                    $.modal.close(); 
                  });
                });
              });
            }
          });

          $('#reportbutton').click(function() {
            reason = $('#reason').val();
            $.post('ajax', 'a=r&id='+id+'&r='+reason);
            $('#report'+id).html('Reported');
          });
        }

