	var imgAttachBlocker = new LayerBlocker(0.5);
	// 이미지 업로드 관련
	function startCallback()
	{
		// make something useful before submit (onStart)
		// startCallback이 호출될 때는 target이 임시로 생성된 div로 맞추져 있다.
		$('pictureUploadForm').submit();
		return true;
	}

	function completeCallback(response) {
		// make something useful after (onComplete)
		$('attachedPictureName').innerHTML = response;

		// 사진업로드 폼과, 실제 데이터를 전달하는 폼이 다르기 때문에,
		// 실제 데이터를 전달하는 폼에 사진이 업로드 되었음을 알려준다.
		$('isUploadedPhoto').value = 'true';
		$('UploadedPhotoName').value = response;

		$('attachedPicture').style.display = "inline";

		//파일 업로드 레이어를 없앤다.
		$('pictureUploadLayer').style.display = "none";
		imgAttachBlocker.hide();
	}

	// 이미지 파일을 첨부할 수 있도록 이미지 업로드 레이어를 화면에 보여준다.
	function fnAddPicture() {
		imgAttachBlocker.show();
		//전에 선택한 값을 지우기 위해
		$('fileSpan').innerHTML = "";
		var fileCell = new Element('input', {type: 'file', id: 'photo', name: 'photo'});
		$('fileSpan').appendChild(fileCell);
		
		$('pictureUploadLayer').style.display = 'inline';
		centerPosition( $('pictureUploadLayer') );
	}
	
	// 첨부된 이미지 파일을 제거하지 물어보는 삭제 레이어를 화면에 보여준다.
	function fnDeletePicture()
	{
		imgAttachBlocker.show();
		$('pictureDeleteLayer').style.display = 'inline';
		centerPosition( $('pictureDeleteLayer') );
	}

	//첨부된 이미지 파일을 삭제한다.	
	function fnPictureDeleteOk()
	{
		$('attachedPictureName').innerHTML = "";

		// 사진업로드 폼과, 실제 데이터를 전달하는 폼이 다르기 때문에,
		// 실제 데이터를 전달하는 폼에 사진이 업로드 되었음을 알려준다.
		$('isUploadedPhoto').value = 'false';
		$('UploadedPhotoName').value = "";

		$('attachedPicture').style.display = "none";

		// 삭제레이어 감추기.
		$('pictureDeleteLayer').style.display = "none";
		imgAttachBlocker.hide();
	}
	
	function fnUploadPicture(f) {
		if($('photo').value.length == 0)
		{
			alert('업로드할 이미지 파일을 선택해주세요.');
			return false;
		}

		return AIM.submit(f, {'onStart' : startCallback, 'onComplete' : completeCallback});
	}

	function fnPictureUpCancel()
	{
		$('pictureUploadLayer').style.display = "none";
		imgAttachBlocker.hide();
	}
		
	function fnPictureDeleteCancel()
	{
		$('pictureDeleteLayer').style.display = "none";
		imgAttachBlocker.hide();
	}	

