function debugFunction(message){}
function fileQueueError(file,error_code,message){try{if(error_code!==""){alert("Erro: "+message);return;}}catch(ex){this.debug(ex);}}
function fileDialogComplete(num_files_queued){try{if(num_files_queued>0){this.startUpload();}}catch(ex){this.debug(ex);}}
function uploadStartFunction(file){new Effect.Appear($('divFileProgressContainer').update("Enviando arquivo para o servidor [ "+file.name+" ]"));}
function uploadProgress(file,bytesLoaded){try{var percent=Math.ceil((bytesLoaded/file.size)*100);$('divFileProgressContainer').update("Enviando arquivo para o servidor [ "+percent+"% "+file.name+" ]")}catch(ex){this.debug(ex);}}
var thumbDiv=new Template(''
+'<li id="fotos_#{id}" class="thumbDiv">'
+'<img class="thumbDivHandler imgThumb" src="http://www.knabben.com.br/img/#{id}/100/100/1"/>'
+'</li>');function mostraFoto(_id,_legenda){var show={id:_id,legenda:_legenda};$('thumbnailsFotos').insert(thumbDiv.evaluate(show));}
function uploadSuccessFotos(file,server_data){try{_input=document.createElement("input");_input.type="hidden";_input.name=_input.id="fotos[]";_input.value=server_data;$('thumbnailsFotos').insert(_input);mostraFoto(server_data);}catch(ex){this.debug(ex);}}
function uploadCompleteFotos(file){try{if(this.getStats().files_queued>0){this.startUpload();}else{new Effect.Fade($('divFileProgressContainer').update(''));}}catch(ex){this.debug(ex);}}
function uploadError(file,error_code,message){var image_name="error.gif";var progress;try{switch(error_code){case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:try{$(file.id).update('Cancelado');}
catch(ex1){this.debug(ex1);}
break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:try{$(file.id).update('Parado');}
catch(ex2){this.debug(ex2);}
case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:image_name="uploadlimit.gif";break;default:$(file.id).update(message);break;}}catch(ex3){this.debug(ex3);}}