function UploadDone()
{
	var iFrame = get_obj("upload_target");
	var objFrom;
	var objTo;
	if (iFrame!=null)
	{
		objFrom=get_obj_iframe(iFrame,"newphotofile");
		objTo=get_obj("newphotofile");
		if (objFrom!=null && objTo!=null)
		{
			objTo.value=objFrom.value;
		}
		objFrom=get_obj_iframe(iFrame,"newphotoufile");
		objTo=get_obj("newphotoufile");
		if (objFrom!=null && objTo!=null)
		{
			objTo.value=objFrom.value;
		}
		objFrom=get_obj_iframe(iFrame,"newphotoresult");
		objTo=get_obj("newphotoresult");
		if (objFrom!=null && objTo!=null)
		{
			objTo.value=objFrom.value;
		}
	}
	sendRequest(5, -1, 15);
}

function UploadFile() {
	var Form = get_obj("designerForm");
	if (Form!=null)
	{
		var iFrame = get_obj("upload_target");
		if (iFrame!=null)
		{
			show_upload_progress_bar();
			if (iFrame.addEventListener)
			{
				iFrame.addEventListener("load", UploadDone, false); // firefox
			}
			else if (iFrame.attachEvent)
			{
				iFrame.attachEvent("onload", UploadDone); // IE
			}
			Form.target="upload_target";
			Form.action="ajax_photouploader.php";
			Form.submit();
		}
	}
}

function RemoveFile() {
	var obj=get_obj("photo_ofn");
	if (obj!=null)
	{
		obj.value="";
	}
	sendRequest(5, -1, 15);
}

function show_upload_progress_bar(){
	var div_objH=get_obj("uploadPhotoButton");
	var div_objS=get_obj("uploadePhotoProgress");
	if (div_objH!=null)
	{
		div_objH.style.visibility="hidden";
	}
	if (div_objS!=null)
	{
		div_objS.style.visibility="visible";
		div_objS.style.display="inline";
		setTimeout('document.images["progress_bar_img2"].src = "images/18-1.gif"', 200);
	}
	return true;
}