function initObjectSWFUpload(urlWebsite, buttonId)
{
    var swfu;
	var settings = {
        flash_url : ""+urlWebsite+"system/js/swfupload/swfupload.swf",
		upload_url: ""+urlWebsite+"system/backend_frontadmin/uploadpage/", //upload path to controller action

		file_size_limit : "100 MB",
		file_types : "*.gif;*.png;*.jpg;*.GIF;*.PNG;*.JPG;",
		file_types_description : "Web Image Files",
		file_upload_limit : 10,
		file_queue_limit : 0,

        custom_settings : {
            progressTarget : "UploadProgress",
			cancelButtonId : "btnCancel"
			},
		debug: false,

        // Button settings
        button_placeholder_id: buttonId,
        button_image_url: ""+urlWebsite+"system/js/swfupload/Chose_Picture.png",
        button_width: "131",
		button_height: "25",
        button_cursor: SWFUpload.CURSOR.HAND,

		// The event handler functions are defined in handlers.js
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,
		queue_complete_handler : queueComplete	// Queue plugin event
		};

		swfu = new SWFUpload(settings);
}

function uploadSuccess(file, serverData, responseReceived)
{
    var fileName = serverData;
    if(fileName.length < 15 && fileName!='')
    {
        var str = '<img width="100" height="100" src="/themes/default/images/pagepreview/'+fileName+'"/>';//uploaded files
        document.getElementById('pageupdateimage').style.backgroundColor = '#FFFFFF';
        document.getElementById('image_name').value = fileName;
        document.getElementById('pageupdateimage').innerHTML = str;
    }
}