﻿$(document).ready(function() {
      
     $('a.moreButton').click(function(){
     
            // Setup the ajax indicator
            $(this).append('<div id="ajaxBusy"><p><img src="'+siteRoot+'_gowaihi/images/global/updating.gif" /></p></div>');
        
            $('#ajaxBusy').css({
                display:"none",
                position:"absolute",
                right:"3px",
                top:"3px",
                width:"auto",
                zIndex:"10000"
            });
     
            // Ajax activity indicator bound
            // to ajax start/stop document events
            $(document).ajaxStart(function(){
                $('#ajaxBusy').show();
            }).ajaxStop(function(){
                $('#ajaxBusy').hide();
                
                // Remove the added div to prevent 'cloning'
                $('#ajaxBusy').remove();
            });
         
            var id=$(this).attr('id');
                    
            // parse out the id number
            var idpart = id.slice(11);
                   
            $.post(siteRoot+"AJAXGallery.aspx",{imageid: idpart}, function(response) {
                         
                $("div#moreDetail_" + idpart).html(response);
                $("div#galleryThumb_" + idpart).toggle("fast");
                $("div#moreDetail_" + idpart).toggle("fast");
                         
            });
     
            // Prevent the link from actually being followed
            return false;
        
       });   
            
});
    



