﻿
var appGallery=new Object();
appGallery._width=120;
appGallery._height=90;
appGallery.aryViewPic=new Array();

appGallery.doPicLoad=function()
{
	var _html="";
	var _aryPic;
	for (var i=1;i<this.aryViewPic.length;i++ )
	{
		_aryPic=this.aryViewPic[i];
		_html+="<span class=\"thumb\"><a class=\"hand\" onclick=\"javascript:return appGallery.doPicCheck("+i+");\">"+appCommon.toUploadPic(_aryPic[2],this._width,this._height,0.5,0)+"</a></span>";

	}
	try{ if ($("PicBody")) $("PicBody").innerHTML=_html; } catch(e) { dbg.e(e); }
	appGallery.doPicCheck(1);
}

appGallery.doPicCheck=function(strer)
{
	_aryPic=this.aryViewPic[strer];
	var tmpImg=$("img_PicMain");
	//tmpImg.className="img hand hide";
	tmpImg.src=appCommon.toUploadPic(_aryPic[3],this._width,this._height,1,-1);
	//tmpImg.width=100;
	//tmpImg.height=100;
	//dbg.obj(tmpImg);
	setTimeout("appGallery.doPicResize();",500);
	var tmpTopic=$("pic_topic");
	if (tmpTopic) tmpTopic.innerHTML=_aryPic[1];
	var tmpeExplain=$("pic_explain");
	if (tmpeExplain) tmpeExplain.innerHTML=_aryPic[4];
	return false;
}

appGallery.doPicResize=function()
{
	var tmpDiv=$("PicMain");
	var tmpMaxWidth=tmpDiv.clientWidth-15;
	var tmpImg=$("img_PicMain");
	dcs.images.doResize(tmpImg,tmpMaxWidth,"");
}

appGallery.doPicView=function()
{
	dcs.images.doOpen($("img_PicMain"));
}

