﻿	
function HPropertyPage(cID,bID,init)
{
	HPropertyPage.prototype.MouseUp=function(tID)
	{
		var bindMouseUp;
		var pID;
		var temp;

		temp=GetElement(tID);
		if(temp)
		{
			bindMouseUp=temp.getAttribute("bindMouseUp");
			if(bindMouseUp!=null)
			{
				try
				{
					if(eval(bindMouseUp)==false)
					{
						return null;
					}
				}
				catch (e)
				{
					alert("错误:HPropertyPage\n描述:bindMouseUp绑定处理函数失败,\n请检查\"对象:"+tID+"的bindMouseUp\"属性。\n程序终止!");
					return null;
				}
			}
		}
		else
		{
			alert("错误:HPropertyPage\n描述:"+tID+".对象没有找到,请检查属性页ID命名\n程序终止!");
			return null;
		}
		pID=this.GetDOID(tID);
		this.DisposalDisplay(this.H_BID+pID);
		return null;
	}

	HPropertyPage.prototype.MouseOver=function(tID)
	{
		var bindMouseOver;
		bindMouseOver=GetElement(tID).getAttribute("bindMouseOver");
		if(bindMouseOver!=null)
		{
			try
			{
				if(eval(bindMouseOver)==false)
					return;
			}
			catch (e)
			{
				alert("错误:HPropertyPage\n描述:bindMouseOver绑定处理函数失败,\n请检查\"对象:"+tID+"的bindMouseOver\"属性。\n程序终止!");
				return;
			}
		}
		this.InPutOut(tID);
	}

	HPropertyPage.prototype.MouseOut =function(tID)
	{
		var bindMouseOut;
		bindMouseOut=GetElement(tID).getAttribute("bindMouseOut");
		if(bindMouseOut!=null)
		{
			try
			{
				if(eval(bindMouseOut)==false)
					return;
			}
			catch (e)
			{
				alert("错误:HPropertyPage\n描述:bindMouseOut绑定处理函数失败,\n请检查\"对象:"+tID+"的bindMouseOut\"属性。\n程序终止!");
				return;
			}
		}
		return;
	}
	
	HPropertyPage.prototype.InPutOut=function(tID)
	{
		var pID;
		pID=this.GetDOID(tID);
		this.DisposalDisplay(this.H_BID+pID);
	}

	HPropertyPage.prototype.DisposalDisplay=function(tID)
	{
		var pID;
		var temp;
		try
		{
			pID=this.GetHSID(tID);
			
			if(this.H_OM!=null)
			{
				this.ChangeStyle(this.H_OM,false);
				temp=GetElement(this.H_BID+this.H_OM);
				temp.style.display="none";
				temp=null;
				this.H_OM=null;
			}
			
			this.ChangeStyle(pID,true);
			temp=GetElement(this.H_BID+pID);
			temp.style.display="block";
			temp=null;
			this.H_OM=pID;
		}
		catch (e)
		{        
			alert("错误:HPropertyPage\n描述:"+e.message+"\n函数GetElement()未找到,\n请检查是否引用了import/DisposeUI/HGetting.he。\n程序终止!");
			return null;
		}
		return true;
	}
	
	HPropertyPage.prototype.ChangeStyle=function(pID,type)
	{
		var temp;
		var Style;
		Style=GetFirstStyle(pID);
		if(Style!=0)
		{
			temp=GetElement(this.H_CID+pID);
			if(temp)
			{
				switch(Style)
				{
					case 1:
						if(type)
						{
							temp.className=this.H_CID+"_Ex";
						}
						else
						{
							temp.className=this.H_CID+"_Pc";
						}
						return;
					break;
					
					case 2:
						if(type)
						{
							temp.className=this.H_CID+pID+"_Ex";
						}
						else
						{
							temp.className=this.H_CID+pID+"_Pc";
						}
						return;
					break;
					
					default:
					alert("错误:HPropertyPage\n描述:菜单对象"+this.H_CID+pID+"的ID名第1位错误,必须是0至2的整数。\n程序终止!");
					return;
				}
			}
			else
			{
				alert("错误:HPropertyPage\n描述:"+this.H_CID+pID+".对象没有找到,请检查ID命名\n程序终止!");
				return;
			}
		}
		return;
	}

	HPropertyPage.prototype.GetHSID=function(str)
	{
		return str.replace(this.H_BID,"");
	}
	
	HPropertyPage.prototype.GetDOID=function(str)
	{
		return str.replace(this.H_CID,"");
	}

	HPropertyPage.prototype.initialization=function(cID,bID,init)
	{
		if(cID==null || bID==null || init==null || GetString(cID).indexOf(GetString(bID))==0 || GetString(bID).indexOf(GetString(cID))==0)
		{
			alert("错误:HPropertyPage\n描述:对象初始化失败！请指定初始被选中的属性页ID。\n属性页标签和属性页ID的前缀名字，而且不能相同。");
			return;
		}
		try
		{
			if(GetElement(cID+GetString(init))==null)
			{
				alert("错误:HPropertyPage\n描述:对象"+cID+GetString(init)+".未找到,\n请检查对象是否存在!\n程序终止!");
				return null;
			}
		}
		catch (e)
		{
			alert("错误:HPropertyPage\n描述:"+e.message+"\n函数GetElement()未找到,\n请检查是否引用了import/DisposeUI/HGetting.he。\n程序终止");
			return null;
		}
		this.H_CID=cID;
		this.H_BID=bID;
		this.DisposalDisplay(this.H_BID+init);
	}
	
	this.initialization(cID,bID,init);
}

//debug.innerHTML=debug.innerHTML+"<hr>"+HPropertyPage.H_OM;
//return;
