function doUploadFile(theForm) {
	
	theForm.submit();
	formID = theForm.uploadFormId.value;
	albumID = theForm.albumID.value;
	nextFormID = parseFloat(formID) + 1;

	document.getElementById("waitIcon" + formID).src = "../gfx/uploadAnimation2.gif";
	document.getElementById("uploadFile" + formID).innerHTML = "Laddar upp, var god vänta...";
	
	nextImageUploadDiv = document.createElement("div");
	nextImageUploadDiv.className = "imageUploadDiv";
	nextImageUploadDiv.id = "imageDiv" + nextFormID;
	document.getElementById("editPhotos").appendChild(nextImageUploadDiv);
	
	nextDiv = '<form name="imageFormNumber" action="inc/uploadPhoto.php" target="imageFrameNumber" method="post" enctype="multipart/form-data"><input type="hidden" name="uploadFormId" value="Number" /><input type="hidden" name="albumID" value="' + albumID + '" /><div class="uploadSquare"><img id="waitIconNumber" src="../gfx/empty.gif" style="height: 32px; width: 32px;" alt="Väntar" /><iframe src="inc/uploadPhoto.php" name="imageFrameNumber" frameborder="0" style="width: 5px; height: 32px;"></iframe></div><div id="uploadFileNumber" class="uploadFile"><input type="file" name="myPhoto" class="forms" style="background: #fff;" onchange="doUploadFile(this.form)" /></div></form>';
	nextDiv = nextDiv.replace(/Number/g, nextFormID);
	document.getElementById("imageDiv" + nextFormID).innerHTML = nextDiv;

}

function checkNewUser(theForm) {

	if (theForm.medlemsnummer.value != "" && theForm.namn.value != "" && theForm.epost.value != "" && theForm.pass.value != "") {
		return true;
	} else {
		alert("Alla fält måste fyllas i");
		return false;
	}

}
