///////////////////////// // Progress Bars // ///////////////////////// // Have been extracted to their own progressbar.js file, since most stuff won't need them. // NOTE: You can call this multiple times on the same bar. // results will be... interesting. Don't do it. // Butit does work fine applied to as many bars as you like. function Progress_IncrementTo( id, newPos, delay, callback ) { Debug ( "Progress_IncrementTo( id="+id+", newPos="+newPos+", delay="+delay+", callback="+callback+" )" ); if ( DISABLE_PROGRESS_BARS != false ) return; var curPos = Progress_Get( id ); var direction = CFG_Progress_TickSize; var breakout = false; if ( newPos < curPos ) { direction = 0 - CFG_Progress_TickSize; if ( curPos + direction < newPos ) { direction = newPos - curPos; breakout = true; } } else { if ( curPos + direction > newPos ) { direction = newPos - curPos; breakout = true; } } Progress_Set ( id, curPos + direction ); if ( breakout ) { if ( callback != null ) setTimeout ( callback, 1 ); } else { if ( callback != null ) callback = "\""+callback+"\""; Event_Add ( "Progress_Tick(\""+id+"\","+newPos+","+callback+" );" , delay, delay ); } } function Progress_Tick ( id, newPos, callback ) { if ( DISABLE_PROGRESS_BARS != false ) return; var curPos = Progress_Get( id ); var direction = CFG_Progress_TickSize; var breakout = false; if ( newPos < curPos ) { direction = 0 - CFG_Progress_TickSize; if ( curPos + direction < newPos ) { direction = newPos - curPos; breakout = true; } } else { if ( curPos + direction > newPos ) { direction = newPos - curPos; breakout = true; } } Progress_Set ( id, curPos + direction ); if ( breakout ) { if ( callback != null ) setTimeout ( callback, 1 ); Event_Delete( Event_ThisEvent ); } } function Progress_Get ( id ) { var obj = document.getElementById ( id+"_slider" ); if ( obj ) { Debug ( "ProgressGet(id="+id+" obj.style.width = " + obj.style.width ); return parseInt ( obj.style.width ); } } function Progress_Set (id, size ) { if ( DISABLE_PROGRESS_BARS != false ) return; Debug ( "ps " + id + "," + size ); var obj = document.getElementById ( id+"_slider" ); if ( obj ) { obj.style.width = size + "%"; var opa = parseInt(size) + 20; if ( opa > 100 ) opa = 100; obj.style.opacity = opa / 100; obj.innerHTML = "