
	
var zips = "";
var processid = '2010090913181640813';
var arc = "";
var udel;
var passmail;
var dmail;
var ssl;
var pdf;
var swfu;
var top_comments;
var zipbk = "1";

window.onload = function () {
	swfu = new SWFUpload({
		// Backend Settings
		upload_url: "http://server21.firestorage.jp/upload.cgi",	// Relative to the SWF file

		// File Upload Settings
		file_size_limit : "2 GB",	// 2g
		file_types : "*.*",
		file_upload_limit : "20",

		// Event Handler Settings - these functions as defined in Handlers.js
		//  The handlers are not part of SWFUpload but are part of my website and control how
		//  my website reacts to the SWFUpload events.

		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,

		// Button Settings
		button_image_url : "/flash10b/uploads.gif",	// Relative to the SWF file
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 165,
		button_height: 48,


//		button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
		
		// Flash Settings
		flash_url : "/flash10b/swfupload.swf",	// Relative to this file

		custom_settings : {
			upload_target : "divFileProgressContainer",
			cancelButtonId : "btnCancel"
		},

		upload_start_handler : myCustomUploadStartEventHandler, 

		// Debug Settings
		debug: false
	});

	if (!!document.getElementById('alg')) {
		document.getElementById('alg').checked = false;
	}

};

var myCustomUploadStartEventHandler = function () { 

	
//	if ( zipbk == zips ) {
//		zips = '';
//	}

	comments = document.getElementById("comment").value;


	if ( document.getElementById('zip').checked ) {
		if ( zips == '' ) {
			zips = Math.random() * 10000000;
		}
	} else {
		zips = "";
	}

	file_queue = this.getStats().files_queued;

	if ( file_queue == '1' ) {
		zipbk = zips;
	}

	var dpass   = document.getElementById('dpass').value;
	if ( document.getElementById('pdf').checked) {
		pdf = "1";
	}



	var i = document.getElementById('expire').value;

	swfu.setPostParams({"exp": i , "processid" : processid , "comments" : comments ,"zips" : zips , "file_queue" : file_queue ,"pdf" : pdf ,"dpass" : dpass   });



}



	


