function uploadimg (theform,ajaxAction,ajaxTarget){
inputArr = form.getInputs(theform, text, [imgTitle, imgDesc]);
document.write(inputArr);
defaultAction=theform.action;
defaultTarget=theform.target;
theform.action=ajaxAction;
theform.target=ajaxTarget;
theform.submit(); //Submit the form.
//Then display a loading message to the user.
setStatus ("Please wait while your image uploads...","showimg");
new Effect.Appear('showimg');
theform.action=defaultAction;
theform.target=defaultTarget;
}