function labelBytes(bytes){
	if (bytes > 1024 * 1024 * 1024){
		return (bytes/1024/1024/1024).toFixed(1) + " GB";
	}
	if (bytes > 1024 * 1024){
		return (bytes/1024/1024).toFixed(1) + " MB";
	}
	if (bytes > 1024){
		return (bytes/1024).toFixed(1) + " KB";
	}
	return bytes + " B";
}
function fileQueueError(file, errorCode, message) {

		$("#uploadDLG").css({"margin-left":"-5000px"});
        	$("#uploadModal").hide();
		$("#uploadDLG").css({"margin":"0px"});
		$("#uploadDLG").hide();

try {
		if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
			alert("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;
		}
		

		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setError();
		progress.toggleCancel(false);
		
		switch (errorCode) {
		case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
			if (this.settings.account_type == 0){
				progress.setError("ERROR: Log in to upload files larger than " + this.settings.file_size_limit);
			} else if (this.settings.account_type == 1){
				progress.setError("Get PREMIUM to upload files larger than " + this.settings.file_size_limit);
			} else {
				progress.setError("ERROR: File exceeds size limit of " + this.settings.file_size_limit);
			}
			this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
			progress.setError("ERROR: Cannot upload Zero Byte files.");
			this.debug("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
			progress.setError("ERROR: Invalid File Type.");
			this.debug("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:
			alert("You have selected too many files.  " +  (message > 1 ? "You may only add " +  message + " more files" : "You cannot add any more files."));
			break;
		default:
			if (file !== null) {
				progress.setError("ERROR: Unhandled Error");
			}
			this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		}
	} catch (ex) {
        this.debug(ex);
    }

		document.getElementById('filesfolders_container1').style.display='block';
}
function flashReady()
{
//			$(".swfupload").css({"left":"100px", "padding-left":"611px", "position":"absolute", "width": "784px"});
//		setTimeout( '$(".swfupload").hide();', 6000);

}
function fileDialogComplete(numFilesSelected, numFilesQueued) {
	if (numFilesSelected > 0){
		if(document.upload_form.tos.checked != true){
			alert('Please agree to Terms of Service');
		}
		
	}
	try {
		if (this.getStats().files_queued > 0) {
		$('#popupbox').hide();
		$('#popuptri').hide();
			//document.getElementById(this.customSettings.cancelButtonId).disabled = false;
		}
		
		/* I want auto start and I can do that here */
		this.startUpload();
	} catch (ex)  {
        this.debug(ex);
	}
}

function uploadStart(file) {

		$("#uploadDLG").css({"margin-left":"-5000px"});
        	$("#uploadModal").hide();

	filesExists = document.getElementById('filesfolders_container1');
	this.addFileParam(file.id,"APC_UPLOAD_PROGRESS",file.size);
	this.addFileParam(file.id,"tos",1);
	//	document.getElementById('bytesleft').innerHTML = rfesponseXML.getElementsByTagName('bytesleft')[0].firstChild.nodeValue;

		
	if(filesExists){
		filesExists.style.display = 'block';
		var filesEmpty = document.getElementById('files_empty');
		if(filesEmpty)
			filesEmpty.style.display = 'none';

	}
	
	try {
		
		/* I don't want to do any file validation or anything,  I'll just update the UI and return true to indicate that the upload should start */
		var progress = new FileProgress(file, this.customSettings.progressTarget);
	}
	catch (ex) {
	}
	
	return true;
}

function uploadProgress(file, bytesLoaded, bytesTotal) {
	try {
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setProgress(bytesLoaded,bytesTotal);
	} catch (ex) {
		this.debug(ex);
	}
}

function uploadSuccess(file, serverData) {
	if (serverData.match("ERROR: ")){
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setError(serverData);
		progress.toggleCancel(false);
	} else {
		try {
			var progress = new FileProgress(file, this.customSettings.progressTarget);
			progress.setComplete();
			//progress.setStatus("Complete.");
			progress.toggleCancel(false);

		} catch (ex) {
			this.debug(ex);
		}
	}
}

function uploadComplete(file) {
	try {
		/*  I want the next upload to continue automatically so I'll call startUpload here */
		if (this.getStats().files_queued === 0) {
			//document.getElementById(this.customSettings.cancelButtonId).disabled = true;

		} else {	
			this.startUpload();
		}
	} catch (ex) {
		this.debug(ex);
	}

}


function uploadError(file, errorCode, message)
{
	//alert(message);
	//alert(errorCode);
	$("#uploadModal").hide();
	$("#uploadDLG").css({"margin":"0px"});
	$("#uploadDLG").hide();
	try
	{
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		//progress.setError();
		progress.toggleCancel(false);
		switch (errorCode)
		{
		case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
			progress.setError("ERROR: Upload Error: " + message);
			this.debug("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:
			progress.setError("ERROR: Configuration Error");
			this.debug("Error Code: No backend file, File name: " + file.name + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
			progress.setError("ERROR: Upload Failed.");
			this.debug("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.IO_ERROR:			
			{
				$.ajax
				({
					url:			'/ajax_requests.php',
					processData:	false,
					cache:			false,
					data:			'uploadError=' + encodeURIComponent('UPLOAD_ERROR.IO_ERROR') + '&upload_url=' + encodeURIComponent(this.settings.upload_url) + '&fileName=' + encodeURIComponent(file.name) + '&fileSize=' + encodeURIComponent(file.size),
					success: function(resp_xml)
					{
						return;
					},
					error: function(resp_xml)
					{
						return;
					}
				});

			}
			progress.setError("ERROR: Storage server unaccessible - Please try later.");
			this.debug("Error Code: IO Error, File name: " + file.name + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
			progress.setError("ERROR: Security Error");
			this.debug("Error Code: Security Error, File name: " + file.name + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
			progress.setError("ERROR: Upload limit exceeded.");
			this.debug("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND:
			progress.setError("ERROR: File not found.");
			this.debug("Error Code: The file was not found, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
			progress.setError("ERROR: Failed Validation.  Upload skipped.");
			this.debug("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
			
			if (this.getStats().files_queued === 0) {
				// global cancel button
				// document.getElementById(this.customSettings.cancelButtonId).disabled = true;
			}
			
			progress.setStatus("Cancelled");
			progress.setCancelled();
			break;
		case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
			progress.setError("ERROR: Stopped");
			break;
		default:
			progress.setError("ERROR: Unhandled Error: " + error_code);
			this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		}
	} catch (ex) {
        this.debug(ex);
    }
}



/* This is an example of how to cancel all the files queued up.  It's made somewhat generic.  Just pass your SWFUpload
object in to this method and it loops through cancelling the uploads. */
function cancelQueue(instance) {
	instance.stopUpload();
	var stats;
	
	do {
		stats = instance.getStats();
		instance.cancelUpload();
	} while (stats.files_queued !== 0);
	
}


function fileDialogStart() {
	/* I don't need to do anything here */
}
function fileQueued(file) {

	if(document.upload_form.tos.checked != true)
	{
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		this.cancelUpload(file.id);
		progress.setStatusText("Cancelled - Please agree to terms of service!");
		return;
	}
	try {
		// You might include code here that prevents the form from being submitted while the upload is in
		// progress.  Then you'll want to put code in the Queue Complete handler to "unblock" the form
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setStatus("Pending...");
		progress.toggleCancel(true, this);

	} catch (ex) {
		this.debug(ex);
	}

}
/*
	Queue Plug-in
	
	Features:
		*Adds a cancelQueue() method for cancelling the entire queue.
		*All queued files are uploaded when startUpload() is called.
		*If false is returned from uploadComplete then the queue upload is stopped.
		 If false is not returned (strict comparison) then the queue upload is continued.
		*Adds a QueueComplete event that is fired when all the queued files have finished uploading.
		 Set the event handler with the queue_complete_handler setting.
		
	*/

var SWFUpload;
if (typeof(SWFUpload) === "function") {
	SWFUpload.queue = {};
	
	SWFUpload.prototype.initSettings = (function (oldInitSettings) {
		return function () {
			if (typeof(oldInitSettings) === "function") {
				oldInitSettings.call(this);
			}
			
			this.queueSettings = {};
			
			this.queueSettings.queue_cancelled_flag = false;
			this.queueSettings.queue_upload_count = 0;
			
			this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
			this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler;
			this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
			this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler;
			
			this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
		};
	})(SWFUpload.prototype.initSettings);

	SWFUpload.prototype.startUpload = function (fileID) {
		this.queueSettings.queue_cancelled_flag = false;
		this.callFlash("StartUpload", [fileID]);
	};

	SWFUpload.prototype.cancelQueue = function () {
		this.queueSettings.queue_cancelled_flag = true;
		this.stopUpload();
		
		var stats = this.getStats();
		while (stats.files_queued > 0) {
			this.cancelUpload();
			stats = this.getStats();
		}
	};
	
	SWFUpload.queue.uploadStartHandler = function (file) {
		var returnValue;
		if (typeof(this.queueSettings.user_upload_start_handler) === "function") {
			returnValue = this.queueSettings.user_upload_start_handler.call(this, file);
		}
		
		// To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value.
		returnValue = (returnValue === false) ? false : true;
		
		this.queueSettings.queue_cancelled_flag = !returnValue;

		return returnValue;
	};
	
	SWFUpload.queue.uploadCompleteHandler = function (file) {
		var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
		var continueUpload;
		
		if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
			this.queueSettings.queue_upload_count++;
		}

		if (typeof(user_upload_complete_handler) === "function") {
			continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
		} else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) {
			// If the file was stopped and re-queued don't restart the upload
			continueUpload = false;
		} else {
			continueUpload = true;
		}
		
		if (continueUpload) {
			var stats = this.getStats();
			if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) {
				this.startUpload();
			} else if (this.queueSettings.queue_cancelled_flag === false) {
				this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]);
				this.queueSettings.queue_upload_count = 0;
			} else {
				this.queueSettings.queue_cancelled_flag = false;
				this.queueSettings.queue_upload_count = 0;
			}
		}
	};
}

/*
	A simple class for displaying file information and progress
	Note: This is a demonstration only and not part of SWFUpload.
	Note: Some have had problems adapting this class in IE7. It may not be suitable for your application.
*/

// Constructor
// file is a SWFUpload file object
// targetID is the HTML element id attribute that the FileProgress HTML structure will be added to.
// Instantiating a new FileProgress object with an existing file will reuse/update the existing DOM elements
function FileProgress(file, targetID) {
	this.fileUniqueID = file.size; 
	this.fileProgressID = file.id;
	this.opacity = 100;
	this.height = 0;


	this.fileProgressWrapper = document.getElementById(this.fileProgressID);
	if (!this.fileProgressWrapper) {
		
		this.fileProgressWrapper = document.createElement("div");
		this.fileProgressWrapper.className = "progressWrapper";
		this.fileProgressWrapper.id = this.fileProgressID;		

		var spacer = document.createElement("div");
		spacer.className = "fst_filesfolders_c01b";
		spacer.innerHTML = "&nbsp;";
		this.fileProgressWrapper.appendChild(spacer);

		var spacer = document.createElement("div");
		spacer.className = "fst_filesfolders_c02b";
		spacer.innerHTML = file.name ;
		this.fileProgressWrapper.appendChild(spacer);


		var elementWrapper = document.createElement("div");
		elementWrapper.className = "fst_filesfolders_c03b";
		
		


		this.fileProgressElement = document.createElement("div");
		this.fileProgressElement.className = "upload_progress";

		//<div class="upload_progress"><div class="upload_progress_bar" style="width:0px; background-color:#FF9933"></div>'
		//	+ '<div class="upload_progress_text">Uploading</div></div>



		var progressText = document.createElement("div");
		progressText.className = "upload_progress_text";
		progressText.appendChild(document.createTextNode("Queued for upload"));

		var progressBar = document.createElement("div");
		progressBar.className = "upload_progress_bar";

		
		var progressBarBack = document.createElement("div");
		progressBarBack.className = "upload_progress_bar_back";
		progressBarBack.style.width = "0px";

		var progressStatus = document.createElement("div");
		progressStatus.className = "upload_progress_text";
		progressStatus.innerHTML = "&nbsp;";

		var progressCancel = document.createElement("a");
		progressCancel.className = "upload_progress_cancel";
		progressCancel.href = "#";
		progressCancel.title = "cancel upload";	
		progressCancel.style.visibility = "hidden";
		progressCancel.appendChild(document.createTextNode(""));
		
		



		this.fileProgressElement.appendChild(progressCancel);
		this.fileProgressElement.appendChild(progressBarBack);
		this.fileProgressElement.appendChild(progressText);
		this.fileProgressElement.appendChild(progressStatus);
		this.fileProgressElement.appendChild(progressBar);


		elementWrapper.appendChild(this.fileProgressElement);
		this.fileProgressWrapper.appendChild(elementWrapper);
		var spacer = document.createElement("div");
		spacer.className = "fst_filesfolders_c04b";
		this.fileProgressWrapper.appendChild(spacer);

		var spacer = document.createElement("div");
		spacer.className = "item_float_clear";
		this.fileProgressWrapper.appendChild(spacer);

		var spacer = document.createElement("div");
		spacer.className = "fst_spacer";
		this.fileProgressWrapper.appendChild(spacer);
				
		//document.getElementById(targetID).insertBefore(this.fileProgressWrapper, document.getElementById(targetID).childNodes[0]);
		$("#"+targetID).prepend(this.fileProgressWrapper);
		
		
	} else {
		this.fileProgressElement = this.fileProgressWrapper.childNodes[2].firstChild;
		this.reset();
	}
	this.height = this.fileProgressWrapper.offsetHeight;
	this.setTimer(null);
	ie6resize();


}

FileProgress.prototype.setTimer = function (timer) {
	this.fileProgressElement["FP_TIMER"] = timer;
};
FileProgress.prototype.getTimer = function (timer) {
	return this.fileProgressElement["FP_TIMER"] || null;
};

FileProgress.prototype.reset = function () {
	return;
	this.appear();	
};

FileProgress.prototype.setProgress = function (bytesLoaded, bytesTotal) {
	var percentage = Math.ceil((bytesLoaded / bytesTotal) * 100);
	var pixelWidth = (percentage * 3.1)
	this.fileProgressElement.childNodes[1].style.width = pixelWidth + "px";
	this.fileProgressElement.childNodes[1].style.backgroundColor = "#FF9933";
	this.fileProgressElement.childNodes[2].innerHTML = labelBytes(bytesLoaded) + " of " + labelBytes(bytesTotal) + " (" + percentage + "%)";
	this.appear();	
};
FileProgress.prototype.setComplete = function () {
;
	fp = this.fileProgressElement;
	fpw = this.fileProgressWrapper
	fp.childNodes[2].innerHTML = "Processing...";
	fp.childNodes[2].style.backgroundColor = "#cee8f6";;
	uploadCompletedAPI(fpw,0,this.fileUniqueID);
};
FileProgress.prototype.setError = function (errorMsg) {
	fp = this.fileProgressElement;
	fpw = this.fileProgressWrapper
	fp.childNodes[2].style.background = "#FF0000";
	fp.childNodes[2].innerHTML = errorMsg;
	//uploadCompletedAPI(fpw,0,this.fileUniqueID);
};
//FileProgress.prototype.setError = function () {
	//this.fileProgressElement.childNodes[1].style.width = "";
//
	//var oSelf = this;
	//this.setTimer(setTimeout(function () {
	//	oSelf.disappear();
	//}, 5000));
///};


function uploadCompletedAPI(fpw,counter,uniqueID){

	var processing_found = false;
	if (counter > 6){ // attempt 3 times on processing state
	//var progress = new FileProgress(file, this.customSettings.progressTarget);
	//progress.setError('baba');
		return;
	}
	
	var xml = '\
		<request>\
			<function>UploadProgress</function>';
			makerequest = true;
			xml += '\
			<upload>\
				<id>' + uniqueID + '</id>\
				<status>processing</status>\
				<retries></retries>\
			</upload>';
	xml += '\
		</request>';
	$.ajax(
	{	
		
		type:			"POST",
		url:			"/api/index.php",
		cache:			false,
		data:			"host=" + storageServer + "&xml=" + xml,
		dataType:		"xml" ,
		success: function(responseXML)
		{
			if (responseXML.normalize)
				responseXML.normalize();	
			var uploads = responseXML.getElementsByTagName('upload');
			for(i = 0; i < uploads.length; ++i) 
			{
				if (uploads[i].getElementsByTagName("status")[0].firstChild.nodeValue != 'processing'){
					fpw.id = uploads[i].getElementsByTagName("row_id")[0].firstChild.nodeValue;
					fpw.innerHTML = Base64.decode(uploads[i].getElementsByTagName("html")[0].firstChild.nodeValue);



$(".fst_filesfolders_c02 a").unbind("click");
$(".fst_filesfolders_c02, .fst_filesfolders_c03, .fst_filesfolders_c04, .fst_filesfolders_c05").unbind("click");
$(".fst_filesfolders_c02 a").click(function(event){
event.stopPropagation();


});

 $(".fst_filesfolders_c02, .fst_filesfolders_c03, .fst_filesfolders_c04, .fst_filesfolders_c05").click(function(event){
//$(document).unbind('click');
	var element=$(this).parent().find('.editbutton'); 

	if($(element).attr('alt')=='+')
        {
                $(element).attr("alt",'-');
                $(element).parent().parent().find(".fst_ffml").slideDown();
                $(element).attr("src",'/_images/buttons/btn_edit.png');

        }
        else
        {
                $(element).attr("alt",'+');
                $(element).parent().parent().find(".fst_ffml").slideUp();
                $(element).attr("src",'/_images/buttons/btn_edit_closed.png');

        }
        ie6resize();


 });



					//update space left
					if (document.getElementById('count_bytesused') != null) 
					{
						//document.getElementById('count_files').innerHTML = Math.abs(document.getElementById('count_files').innerHTML) + 1;
						updateStorageUsed();
					} 
				} else {
					setTimeout("uploadCompletedAPI(fp," + (counter + 1) + "," + uniqueID + ")",(counter * 500));
				}
			}
			
			if (($("div[id^='file_']").length) == 0) 
			{
				$("#files_empty").show();
				$("#files_exist").hide();
			}
			else
			{
				$("#files_empty").hide();
				$("#files_exist").show();
			}
				stButtons.locateElements(); 
			
			
			
			

		},
		error: function(responseXML)
		{			
			setTimeout("uploadCompletedAPI(fp," + (counter + 1) + "," + uniqueID + ")",(counter * 500));
			return;			
		}			
	});
}
FileProgress.prototype.setCancelled = function () {
	var oSelf = this;
	this.setTimer(setTimeout(function () {
		oSelf.disappear();
	}, 2000));
};
FileProgress.prototype.setStatus = function (status) {
	if (status != "Pending..."){
		this.fileProgressElement.childNodes[1].style.width = (3.1 * 100) + "px";
		this.fileProgressElement.childNodes[1].style.backgroundColor = "#F0F0F0";
	}
	this.fileProgressElement.childNodes[2].innerHTML = status;
	this.appear();	
};

FileProgress.prototype.setStatusText = function (statusText) {
	this.fileProgressElement.childNodes[1].style.width = (3.1 * 100) + "px";
	this.fileProgressElement.childNodes[1].style.backgroundColor = "#F0F0F0";
	this.fileProgressElement.childNodes[2].innerHTML = statusText;
	this.appear();	
};
// Show/Hide the cancel button
FileProgress.prototype.toggleCancel = function (show, swfUploadInstance) {
	this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
	if (swfUploadInstance) {
		var fileID = this.fileProgressID;
		this.fileProgressElement.childNodes[0].onclick = function () {
			swfUploadInstance.cancelUpload(fileID);
			return false;
		};
	}
};

FileProgress.prototype.appear = function () {
	return;
	if (this.getTimer() !== null) {
		clearTimeout(this.getTimer());
		this.setTimer(null);
	}
	
	if (this.fileProgressWrapper.filters) {
		try {
			this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = 100;
		} catch (e) {
			// If it is not set initially, the browser will throw an error.  This will set it if it is not set yet.
			this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
		}
	} else {
		this.fileProgressWrapper.style.opacity = 1;
	}
		
	this.fileProgressWrapper.style.height = "";
	
	this.height = this.fileProgressWrapper.offsetHeight;
	this.opacity = 100;
	this.fileProgressWrapper.style.display = "";
	
};

// Fades out and clips away the FileProgress box.
FileProgress.prototype.disappear = function () {


	var reduceOpacityBy = 15;
	var reduceHeightBy = 4;
	var rate = 30;	// 15 fps

	if (this.opacity > 0) {
		this.opacity -= reduceOpacityBy;
		if (this.opacity < 0) {
			this.opacity = 0;
		}

		if (this.fileProgressWrapper.filters) {
			try {
				this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = this.opacity;
			} catch (e) {
				// If it is not set initially, the browser will throw an error.  This will set it if it is not set yet.
				this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity + ")";
			}
		} else {
			this.fileProgressWrapper.style.opacity = this.opacity / 100;
		}
	}

	if (this.height > 0) {
		this.height -= reduceHeightBy;
		if (this.height < 0) {
			this.height = 0;
		}

		this.fileProgressWrapper.style.height = this.height + "px";
	}

	if (this.height > 0 || this.opacity > 0) {
		var oSelf = this;
		this.setTimer(setTimeout(function () {
			oSelf.disappear();
		}, rate));
	} else {
		this.fileProgressWrapper.style.display = "none";
		this.setTimer(null);
	}
};

