function $(id) {
	this.obj = document.getElementById(id);
	return this.obj;
}

$.prototype.ih = function() {
	
}

// Default upload start function.
uploadStart = function(fileObj) {
	
	$("filesDisplay").style.display = "block";
		
	var li = document.createElement("li");
	var txt = document.createTextNode(fileObj.name);

	li.className = "uploading";
	li.id = fileObj.name;
	
	var prg = document.createElement("span");
	prg.id = fileObj.name + "progress";
	prg.className = "progressBar"
	
	li.appendChild(txt);
	li.appendChild(prg);

	$("mmUploadFileListing").appendChild(li);
		
}

uploadProgress = function(fileObj, bytesLoaded) {
	var progress = $(fileObj.name + "progress");
	var percent = Math.ceil((bytesLoaded / fileObj.size) * 100)
	
	
//	progress.style.background = "url(jscripts/SWFUpload/images/progressbar2.png) no-repeat -" + ( 300 - percent*3 ) + "px 0";
	progress.style.background = "url(jscripts/SWFUpload/images/progressbar2.png) no-repeat -" + ( 300 - percent*3 ) + "px 0";
	//progress.style.background = "url(jscripts/SWFUpload/images/progressbar.png) no-repeat -" + (100 - percent) + "px 0";
	document.getElementById('DivExample').innerHTML = percent + "%";
	document.getElementById('DivaExample').innerHTML =  Math.ceil((bytesLoaded / 1024)) + "Kb (" + Math.ceil((fileObj.size / 1024)) + "Kb)";
	
}

uploadComplete = function(fileObj) {
	$(fileObj.name).className = "uploadDone";
	$(fileObj.name).innerHTML += " " + (Math.ceil(fileObj.size / 1024)) + " kb";
//	document.write(" " + (Math.ceil(fileObj.size / 1000)) + " kb");
//	document.write("name: " + fileObj.name);
	clipname = fileObj.name;
	clipname = clipname.replace(/\s/g,"");
	window.location = "ok.php?name=" + clipname + "&size=" + (Math.ceil(fileObj.size / 1024));

}

uploadQueueComplete = function(fileObj) {
	//alert("Queue done!");
//	var fs = Math.ceil(fileObj.size / 1000);
//	var ho = " " + (Math.ceil(fileObj.size / 1000));

//	loc = "ok.php?size=";
//	alert(loc);
//	window.location = loc;
}

uploadCancel = function() {
	alert("You pressed cancel!");
	$("SWFUpload").ih();
}