// thumbs up function... // accepts and processes positive votes for a file... function imageboxThumbsUp(file_id) { switchToLoaderStatus(); new Ajax.Request('http://www.enterprisesa.com/za/admin/modules/media/ajax/thumbs_up.php?id=' + file_id, {method:'get', onSuccess: function() { ImageBox.showCloseButton(); new Ajax.Updater('imagebox_status_bar_info', 'http://www.enterprisesa.com/za/admin/modules/media/ajax/get_status_info.php?id=' + file_id + '&voted', {method:'get', onComplete: function() { ImageBox.showCloseButton(); }}); }}); } // thumbs down function... // opposite effect to the thumbs up function... function imageboxThumbsDown(file_id) { switchToLoaderStatus(); new Ajax.Request('http://www.enterprisesa.com/za/admin/modules/media/ajax/thumbs_down.php?id=' + file_id, {method:'get', onSuccess: function() { ImageBox.showCloseButton(); new Ajax.Updater('imagebox_status_bar_info', 'http://www.enterprisesa.com/za/admin/modules/media/ajax/get_status_info.php?id=' + file_id + '&voted', {method:'get', onComplete: function() { ImageBox.showCloseButton(); }}); }}); } // switch to loader status function... // this function will put a little loading sign in the status info box // when the user clicks on either a thumbs up or thumbs down vote... // it's purely there for visual awesomeness while the vote is being made in the background... function switchToLoaderStatus() { var HTML = ""; HTML += ""; HTML += ""; HTML += "
"; HTML += "loading"; HTML += "
"; $('imagebox_status_bar_info').innerHTML = HTML; }