
 $(document).ready(function(){
        //ever heard of a race condition?!  (check in init_load for this code now)

		

			  $('a[rel=no-zoom]').click(function(e){
					if(e){ e.preventDefault(); e.stopPropagation(); }
			  }).css({'cursor':'default'});
    });


$(document).ready(function() {
    $('span.thumbspan').hover(function() {
      $(this).addClass('hoverthumb');
    }, function() {
      $(this).removeClass('hoverthumb');
    });
});

$(document).ready(function(){
        $("#switch").bind( 'drag', function( event ){
            $( this ).parent().css({
                top:(event.offsetY-document.body.scrollTop),
                left:(event.offsetX-document.body.scrollLeft)
            });
        });
    });



$(window).bind('load', function() {
    var preload = new Array();
    $(".medthumb").each(function() {
        s = $(this).attr("src").replace(/\.(.+)$/i, "_on.$1");
        preload.push(s)
    });
    var img = document.createElement('img');
    $(img).bind('load', function() {
        if(preload[0]) {
            this.src = preload.shift();
        }
    }).trigger('load');
});