
//修改图片
function PhotoEdit(PhotoID,UserID)
{
	ScreenConvert();
	DialogShow("<div id=\"DialogLoading\">正在读取,请稍候...</div>",110,24,124,24);
	var PostData = null;
	if (PhotoID != null && UserID != null)
	{
		PostData = "do=photoedit&photoid=" + PhotoID + "&userid=" + UserID;
		PostRequest(window.location.protocol + "//" + window.location.host + "/AJAX/Photo.php", PostData);
	}
}

function PhotoEditSave(PhotoID,UserID)
{
	ScreenConvert();
	var objTitle = gid("txtTitle");
	var objComments = gid("txtComments");
	var PostData = null;
	var objValidator=gid("DialogValidator");

	if (PhotoID != null && UserID != null && objTitle != null && objComments != null )
	{
		var vueTitle = Trim(objTitle.value);
		var vueComments = objComments.value;
		//alert(vueComments);
		if(vueTitle == "")
		{
			objValidator.innerHTML = "<span class=\"Error\">请输入图片标题!</span>";
		}
		else if(vueTitle.length>20)
		{
			objValidator.innerHTML = "<span class=\"Error\">图片标题的长度不能超过20个字!</span>";
		}
		else if(objComments.length>500)
		{
			objValidator.innerHTML = "<span class=\"Error\">图片说明的长度不能超过500个字!</span>";
		}
		else
		{
			PostData = "do=photoeditsave&photoid=" + PhotoID + "&userid=" + UserID + "&title=" + StrCode(vueTitle) + "&comments=" + StrCode(vueComments);
			PostRequest(window.location.protocol + "//" + window.location.host + "/AJAX/Photo.php", PostData);
		}
	}
}

function PhotoText(PhotoID,Title,Comments)
{
	var objPhotoTitle = gid("spanPhotoTitle" + PhotoID);
	var objPhotoComments = gid("spanPhotoComm" + PhotoID);
	if (PhotoID != null && objPhotoTitle != null)
	{
		objPhotoTitle.innerHTML = Title;
	}
	if (PhotoID != null &&  objPhotoComments != null)
	{
		objPhotoComments.innerHTML = Comments;
	}
}

function PhotoDel(PhotoID,UserID)
{
	ScreenConvert();
	DialogShow("<div id=\"DialogLoading\">正在读取,请稍候...</div>",110,24,124,24);
	var PostData = null;
	if (PhotoID != null && UserID != null)
	{
		PostData = "do=photodelmsg&photoid=" + PhotoID + "&userid=" + UserID;
		PostRequest(window.location.protocol + "//" + window.location.host + "/AJAX/Photo.php", PostData);
	}
}

function PhotoDelSave(PhotoID,UserID)
{
	ScreenConvert();
	DialogShow("<div id=\"DialogLoading\">正在读取,请稍候...</div>",110,24,124,24);
	var PostData = null;
	if (PhotoID != null && UserID != null)
	{
		PostData = "do=photodel&photoid=" + PhotoID + "&userid=" + UserID;
		PostRequest(window.location.protocol + "//" + window.location.host + "/AJAX/Photo.php", PostData);
	}
}
