sFeature='center:1;status=0;scroll:0;help:0;';

function procSelectDate(obj)
  {
    var theDate;
	theDate=window.showModalDialog('MsgBox.aspx?width=340&height=250&url=DateSelect.aspx','dialogWidth:340px;dialogHeight:250px;'+sFeature);
	if(theDate)
	 obj.value=theDate;
  }

 function procSelectDate1(baseUrl,obj)
  {
    var theDate;
	theDate=window.showModalDialog(baseUrl+'MsgBox.aspx?width=340&height=250&url=DateSelect.aspx','','dialogWidth:340px;dialogHeight:250px;'+sFeature);
	if(theDate)
	 obj.value=theDate;
  }

function procShowType()
{
var i,j;
for(i=0;i<TypeCount;i++)
 {
	if(arrType[i][1]==0)
	{
		document.write('<option value="'+arrType[i][0]+'">©ï'+arrTypeList[i][2]+'</option>');
		for(j=0;j<TypeCount;j++)
		{
			 if(arrTypeList[j][1]==arrTypeList[i][0])
					document.write('<option value="'+arrTypeList[i][0]+'">&nbsp;©À'+arrTypeList[j][2]+'</option>');
		}
	 }
  }
}

function procShowAllType(iSelect)
{
  procEnumType(0,iSelect,'');
}

function procEnumType(iType,iSelect,strSpace)
{
	var i,j,strIdx;
	for(i=0;i<iTypeCount;i++)
	 {
		if(arrTypeList[i][1]==iType)
		{
			if(iType==0)
				strSpace='';
			if(arrTypeList[i][0]==iSelect)
				strSelect='selected';
			else
				strSelect='';
			for(j=0;j<iTypeCount;j++)
				if(arrTypeList[j][1]==arrTypeList[i][0])
				  break;
			if(j!=iTypeCount)
			{
				if(iType==0)
					strIdx='©ï '
				else
					strIdx='©à ';
				document.write('<option value="'+arrTypeList[i][0]+'" '+strSelect+'>'+strSpace+strIdx+arrTypeList[i][2]+'&nbsp;</option>');
				procEnumType(arrTypeList[i][0],iSelect,strSpace+'&nbsp;&nbsp;&nbsp;');
			}
			else
			{
				for(j=i+1;j<iTypeCount;j++)
					if(arrTypeList[j][1]==iType)
					  break;
				if(j!=iTypeCount)
				{
					if(iType==0)
						strIdx='©Ç';
					else
						strIdx='©À ';
				}
				else
					strIdx='©¸ ';
				document.write('<option value="'+arrTypeList[i][0]+'" '+strSelect+'>'+strSpace+strIdx+arrTypeList[i][2]+'&nbsp;</option>');
			}
		 }
	  }

}


function procListType(iType,strUser,strSpace)
{
	var i,j,strIdx,strOut;
	strOut='';
	for(i=0;i<iTypeCount;i++)
	 {
		if(arrTypeList[i][1]==iType)
		{
			if(iType==0)
				strSpace='';
			for(j=0;j<iTypeCount;j++)
				if(arrTypeList[j][1]==arrTypeList[i][0])
				  break;
			if(j!=iTypeCount)
			{
				if(iType==0)
					strIdx='©ï '
				else
					strIdx='©à ';
				strOut+='<div class=menuitems><A style=font-size:9pt;line-height:14pt; href="List.aspx?user='+strUser+'&type='+arrTypeList[i][0]+'">'+strSpace+strIdx+arrTypeList[i][2]+'</a></div>';
				strOut+=procListType(arrTypeList[i][0],strUser,strSpace+'&nbsp;&nbsp;&nbsp;');
			}
			else
			{
				for(j=i+1;j<iTypeCount;j++)
					if(arrTypeList[j][1]==iType)
					  break;
				if(j!=iTypeCount)
				{
					if(iType==0)
						strIdx='©Ç';
					else
						strIdx='©À ';
				}
				else
					strIdx='©¸ ';
				strOut+='<div class=menuitems><A style=font-size:9pt;line-height:14pt; href="List.aspx?user='+strUser+'&type='+arrTypeList[i][0]+'">'+strSpace+strIdx+arrTypeList[i][2]+'</a></div>';
			}
		 }
	  }

 return strOut;
}

function resizeImage(obj,iWidth,iHeight)
{
	var x;
	/*
	if(obj.height>obj.width&&iWidth<iHeight||obj.height<obj.width&&iWidth>iHeight)
	{
		x=iWidth;
		iWidth=iHeight;
		iHeight=x;
	}*/

//	alert('ok');

    if(obj.width>obj.height)
	{
		if(obj.width>iWidth)
		{
			obj.style.width=iWidth;
			obj.style.height='';
		}
	}
	else
	{
		if(obj.height>iHeight)
		{
			obj.style.height=iHeight;
			obj.style.width='';
			
		}
	}
}
/*
function procShowLink()
{
	i=0;
	while(arrLink[i][0])
	{
		if(arrLink[i][2])
			document.write('<a href="'+arrLink[i][1]+'" target="_blank"><img src="'+arrLink[i][2]+'" border="0" alt="'+arrLink[i][0]+'"></a>');
		else
			document.write('');
		i++;
		document.write('<br><br>');
	}
}
*/

function procSetSize(objname,num)
{
var obj=document.getElementById(objname);
	if (parseInt(obj.rows)+num>=2) {
		obj.rows = parseInt(obj.rows) + num;	
	}
	/*if (num>0)
	{
		obj.width="90%";
	}*/
}

function procComment(strBaseUrl,iType,iID,iRID)
{
    window.showModalDialog(strBaseUrl+'MsgBox.aspx?width=400&height=250&url='+escape('UserComment.aspx?type='+iType+'&id='+iID+'&rid='+iRID),'','dialogWidth:380px;dialogHeight:250px;'+sFeature);
}

function procUserOrder(strBaseUrl,iType,strParam)
{
    window.showModalDialog(strBaseUrl+'MsgBox.aspx?width=400&height=420&url='+escape('UserOrder.aspx?type='+iType+'&param='+strParam),'','dialogWidth:400px;dialogHeight:420px;'+sFeature);
}

function procShowLink(i)
{
  document.write('<a href="'+arrLink[i-1]+'" target="_blank">'+arrTitle[i-1]+'</a>');
}

function procShowImage(type,i,iWidth,iHeight)
{
  document.write('<a href="'+arrLink[i-1]+'" target="_blank"><img src="../hotimage/'+type+'_'+i+'.jpg" border="0" width="'+iWidth+'" height="'+iHeight+'"></a>');
}

function procUploadPic(strUrl)
{
  window.showModalDialog('../MsgBox.aspx?width=340&height=150&url='+escape('Admin/AdminUpload.aspx?url='+strUrl),'','dialogWidth:340px;dialogHeight:150px;'+sFeature);
}

function procGetStr(str,iLen)
{
	var i,iCount;
	isHave=false;
	iCount=0;
	for(i=0;i<str.length;i++)
	{
		if(str.charCodeAt(i)>=0x8a)
			iCount+=2;
		else
			iCount++;
		if(iCount>=iLen)
			break;
	}
	return str.substring(0,i);
}

function procUserState()
{
	if(UserID>0)
	{
		window.ctlUserInfo.style.display='block';
		window.ctlUserLogin.style.display='none';
	}
	else
	{
		window.ctlUserInfo.style.display='none';
		window.ctlUserLogin.style.display='block';
	}
}
