var formChecker=null;function swfUploadLoaded(){}function doSubmit(e){if(formChecker!==null){clearInterval(formChecker);formChecker=null;}e=e||window.event;if(e.stopPropagation){e.stopPropagation();}e.cancelBubble=true;try{swfu.startUpload();}catch(ex){}return false;}function uploadStart(file){try{document.getElementById('btnSubmit').disabled=true;return true;}catch(ex){alert("Error submitting form");return false;}}function uploadDoneTrial(){try{$('#SubmitInformation').ajaxForm({dataType:'json',beforeSubmit:function(a,f,o){$('.throbber').jqmShow();},success:function(data){if(typeof(data.error)!='undefined'){if(data.error!==''){displayError(data.error);}else{document.location.href='thankyoutrial';}}},error:function(data,status,e){displayError(e);}});$('#SubmitInformation').submit();}catch(ex){displayError('Error submitting form');}}function uploadDonePurchase(){try{$('#SubmitInformation').ajaxForm({dataType:'json',beforeSubmit:function(a,f,o){$('.throbber').jqmShow();},success:function(data){if(typeof(data.error)!='undefined'){if(data.error!==''){displayError(data.error);}else{document.location.href='cart';}}},error:function(data,status,e){displayError(e);}});$('#SubmitInformation').submit();}catch(ex){displayError('Error submitting form');}}function fileDialogStart(){var txtFileName=document.getElementById("txtFileName");txtFileName.value="";this.cancelUpload();}function fileQueueError(file,errorCode,message){try{switch(errorCode){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:displayError("You have attempted to queue too many files.\n"+(message===0?"You have reached the upload limit.":"You may select "+(message>1?"up to "+message+" files.":"one file.")));return;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:displayError("The maximum file size is 100 MB.");this.debug("Error Code: File too big, File name: "+file.name+", File size: "+file.size+", Message: "+message);return;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:displayError("The file you selected is empty.  Please select another file.");this.debug("Error Code: Zero byte file, File name: "+file.name+", File size: "+file.size+", Message: "+message);return;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:displayError("The file you selected is not an allowed file type.");this.debug("Error Code: Invalid File Type, File name: "+file.name+", File size: "+file.size+", Message: "+message);return;default:displayError("An error occurred in the upload. Try again later.");this.debug("Error Code: "+errorCode+", File name: "+file.name+", File size: "+file.size+", Message: "+message);return;}}catch(e){}}function fileQueued(file){try{var txtFileName=document.getElementById("txtFileName");txtFileName.value=file.name;}catch(e){}}function fileDialogComplete(numFilesSelected,numFilesQueued){}function uploadProgress(file,bytesLoaded,bytesTotal){try{var percent=Math.ceil((bytesLoaded/bytesTotal)*100);file.id="singlefile";var progress=new FileProgress(file,this.customSettings.progress_target);progress.setProgress(file,percent);progress.setStatus("Uploading...");}catch(e){}}function uploadSuccess(file,serverData,responseReceived){var json=eval('('+serverData+')');try{file.id="singlefile";var progress=new FileProgress(file,this.customSettings.progress_target);progress.setComplete();progress.setStatus("Complete.");progress.toggleCancel(false);if(json.error==='1'){this.customSettings.upload_successful=false;document.getElementById("hidFileID").value=json.message;}else{this.customSettings.upload_successful=true;document.getElementById("hidFileID").value=json.message;}}catch(e){}}function uploadCompleteTrial(file){try{if(this.customSettings.upload_successful){document.getElementById('btnSubmit').disabled=true;uploadDoneTrial();}else{file.id="singlefile";var progress=new FileProgress(file,this.customSettings.progress_target);progress.setError();progress.setStatus(document.getElementById("hidFileID").value);progress.toggleCancel(false);var txtFileName=document.getElementById("txtFileName");txtFileName.value="";document.getElementById('captcha').src='showcaptcha/'+Math.random();document.getElementById('securitycode').value="";document.getElementById('btnSubmit').disabled=false;displayError(document.getElementById("hidFileID").value);}}catch(e){}}function uploadCompletePurchase(file){try{if(this.customSettings.upload_successful){document.getElementById('btnSubmit').disabled=true;uploadDonePurchase();}else{file.id="singlefile";var progress=new FileProgress(file,this.customSettings.progress_target);progress.setError();progress.setStatus(document.getElementById("hidFileID").value);progress.toggleCancel(false);var txtFileName=document.getElementById("txtFileName");txtFileName.value="";document.getElementById('captcha').src='showcaptcha/'+Math.random();document.getElementById('securitycode').value="";document.getElementById('btnSubmit').disabled=false;displayError(document.getElementById("hidFileID").value);}}catch(e){}}function uploadError(file,errorCode,message){try{if(errorCode===SWFUpload.UPLOAD_ERROR.FILE_CANCELLED){return;}var txtFileName=document.getElementById("txtFileName");txtFileName.value="";switch(errorCode){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:displayError("There was a configuration error.  You will not be able to upload a resume at this time.");this.debug("Error Code: No backend file, File name: "+file.name+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();return;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:displayError("You may only upload 1 file.");this.debug("Error Code: Upload Limit Exceeded, File name: "+file.name+", File size: "+file.size+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();return;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:break;default:displayError("An error occurred in the upload. Try again later.");this.debug("Error Code: "+errorCode+", File name: "+file.name+", File size: "+file.size+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();return;}file.id="singlefile";var progress=new FileProgress(file,this.customSettings.progress_target);progress.setError();progress.toggleCancel(false);switch(errorCode){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:progress.setStatus("Upload Error");this.debug("Error Code: HTTP Error, File name: "+file.name+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:progress.setStatus("Upload Failed.");this.debug("Error Code: Upload Failed, File name: "+file.name+", File size: "+file.size+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:progress.setStatus("Server (IO) Error");this.debug("Error Code: IO Error, File name: "+file.name+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:progress.setStatus("Security Error");this.debug("Error Code: Security Error, File name: "+file.name+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:progress.setStatus("Upload Cancelled");this.debug("Error Code: Upload Cancelled, File name: "+file.name+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:progress.setStatus("Upload Stopped");this.debug("Error Code: Upload Stopped, File name: "+file.name+", Message: "+message);document.getElementById('captcha').src='showcaptcha/'+Math.random();break;}document.getElementById('btnSubmit').disabled=false;}catch(ex){}}