function formUpdateProgress(id){var id=$('#progress_key').attr('value');$.get('/mod/form/upload-progress.php?id='+id,function(data){var response;eval('response = '+data);if(response){var maxBytes=parseInt($('input[name=MAX_FILE_SIZE]').attr('value'));if(maxBytes>0&&parseInt(response['bytes_total'])>maxBytes){alert("Your upload is too large. It must be less than "
+Math.round(maxBytes/1000/1000)+'MB. Please try again.');location.reload();}
var percentage=Math.floor(100*parseInt(response['bytes_uploaded'])/parseInt(response['bytes_total']));$('#progressInner').css('width',percentage+'%');if(response['est_sec']>0){$('#progressStatus').html('About <b>'+formatTime(response['est_sec'])+'</b> remain...');$('input[type=submit]').attr('disabled','true');}}
setTimeout('formUpdateProgress()',1000);});}
function formatTime(secs){if(secs<60){return secs+' seconds';}else if(secs<60*60){return Math.round(secs/60)+' minutes and '+(secs%60)+' seconds';}else{return Math.round(secs/60/60)+' hours and '+Math.round((secs/60)%60)+' minutes';}}
$(document).ready(function(){$('.yuiCal').each(function(){var $cal=$(this);$cal.hide();var name=$cal.attr('id').replace(/^cal/,'').replace(/Container$/,'');var $input=$('#id_'+name);$input.change(function(){$cal.slideUp();}).click(function(){$cal.slideToggle();});});$('#progressOuter').each(function(){$(this).closest('form').submit(function(){$('#progressOuter').fadeIn();setTimeout('formUpdateProgress()',100);});});});;function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
func();}}}
function recacheOddEven(){$('table.etable').each(function(){$(this).find('tr').removeClass('odd');$(this).find('tr:even').addClass('odd');});}
$(document).ready(function(){$('ul.menu').children().filter('LI').each(function(){$(this).mouseover(function(){$(this).addClass('over');}).mouseout(function(){$(this).removeClass('over');});});$('table.etable TR').hover(function(){$(this).find('td').addClass('etableHover');},function(){$(this).find('td').removeClass('etableHover');}).addClass('etableLineBetweenRows').filter(':first').removeClass('eTableLineBetweenRows');recacheOddEven();$('#breadcrumb A[href=/]').css('font-weight','bold');});