/**
 * this is a sample javascript that demonstrates how the Rad UPload Plus
 * applet can interact with a javascript.
 *
 * If you set the jsnotify configuration property, the applet will call 
 * the upload completed method when the file upload has been completed.
 *
 * You can call the getUploadStatus() method to determine whether the
 * upload was successfull. Possible values are 1, for success, 0 when the 
 * user has cancelled the upload and -1 when the upload failed (error).
 * 
 */

/* a usefull variable */
var upload=0;


/**
 * the response returned by the server will be passed as a parameter (s) to this
 * function. However in the case of Netscape the parameter will be empty. When using
 * netscape call the getResponse()method of the applet to access this information.
 *
 */
function uploadCompleted()
{
	
	upload = document.rup.getUploadStatus();
	if(upload==1)
	{
		/*if(confirm("The upload was successfull."))
		{
			alert(document.rup.getResponse());
		}
		*/
		
	}
	else
	{
		confirm("The upload seems to have failed - please retry your upload.");
	}
	
	return true;
}

/* NOTE!!!!! document.forms has to be the correct# so the correct values are sent to the CGI script! 0=1, 1=2, etc */

function r_getFormData()
{
    if(document.uploadfile == undefined)
    {
        return;
    }
    for(i = 0 ; i < document.uploadfile.elements.length ; i++)
    {
        document.rup.jsAddTextField(document.uploadfile.elements[i].name,
                                    document.uploadfile.elements[i].value);
    }
	
}



