function DG_Res()
{
	DG_Object.call(this);
}

DG_CF.DG_ResFont=function(){return new DG_ResFont();}
function DG_ResFont()
{
	DG_Res.call(this);
	var myself=this;
	this.DgType="DG_ResFont";
	this.PP=new Array(4);
	this.SetFont=function(o)
	{
		if(!o)return;
		o.SS(24,myself.PP[0]);
		o.SS(26,myself.PP[1]);
		o.SS(25,myself.PP[2]);
		o.SS(27,myself.PP[3]);
	}
	this.GetDefault=function(id)
	{
		switch(id)
		{
			case 0: return "Arial";
			case 1: return 12;
			case 2: return false;
			case 3: return false;
		}
	}
	this.PD=function(id)
	{
		switch(id)
		{
			case 0: return {t:"str",n:"FontName",d:"font family name"};
			case 1: return {t:"int",n:"FontSize",d:"font size, in pixels"};
			case 2: return {t:"bool",n:"IsBold",d:"bold font"};
			case 3: return {t:"bool",n:"IsItalic",d:"bold italic"};
		}
	}
	this.InitProps();
}

DG_CF.DG_ResImgList=function(){return new DG_ResImgList();}
function DG_ResImgList()
{
	DG_Res.call(this);
	var myself=this;
	this.DgType="DG_ResImgList";
	this.PP=new Array(4);
	this.GetDefault=function(id)
	{
	}
	this.PD=function(id)
	{
		switch(id)
		{
			case 0: return {t:"str",n:"ImgUrl",d:"url of the image list bitmap"};
			case 1: return {t:"int",n:"ImgNum",d:"number of images in the list"};
			case 2: return {t:"int",n:"Width",d:"width of a single image"};
			case 3: return {t:"int",n:"Height",d:"height of a single image"};
		}
	}
	this.CreateImg=function(po,n,l,t)
	{
		var w=myself.PP[2];
		var h=myself.PP[3];
		var div = DG_CreateDiv(po,{w:w,h:h,l:l,t:t});
		div.SS(19,1);
		var src=myself.PP[0];
		var img=DG_CreateImg(div, {l:0,t:0,src:src});
		img.SS(23,0);
		var dx=-n*w;
		img.SS(12,dx);
		img.SS(23,1);
	}
	this.SetImg=function(o)//object of DG_Img type
	{
		if(!o)return;
		o.DIV.SS(21,{l:0,t:0,r:0,b:0});
		o.PP[0]=myself.PP[0];
	}
	this.InitProps();
}

function DG_Bmp()
{
	DG_Res.call(this);
	var myself=this;
	this.PP=new Array(3);
	
	this.Init=function()
	{
		var img = DG_CreateImg(p,d);
	}
	this.GetDefault=function(id)
	{
		switch(id)
		{
			case 0: return "";
		}
	}	
	this.PD=function(id)
	{
		switch(id)
		{
			case 0: return {t:"url",n:"ImageUrl",d:"url"};
		}
	}
}

DG_CF.DG_Rect=function(){return new DG_Rect();}
function DG_Rect()
{
	DG_Object.call(this);
	var myself=this;
	this.PP=new Array(3);
	
	this.RenderObj=function(r)
	{
		var div = this.DIV;
		var p0=this.PP[0];if(p0)div.SS(0,p0);
		var p1=this.PP[1];if(p1)div.SS(3,p1);
	}
	this.GetDefault=function(id)
	{
		switch(id)
		{
			case 0: return "";
			case 1: return "";
		}
	}	
	this.PD=function(id)
	{
		switch(id)
		{
			case 0: return {t:"clr",n:"bgColor",d:"background color"};
			case 1: return {t:"clr",n:"borderColor",d:"border color"};
		}
	}
}

DG_CF.DG_A=function(){return new DG_A();}
function DG_A()
{
	DG_Object.call(this);
	var myself=this;
	this.PP=new Array(4);
	var m_a;
	this.RenderObj=function(r)
	{
		var url=this.PP[0];
		var onclick=this.PP[3];
		if(!url)return;
		m_a=DG_CreateAnchor(this.DIV,{link:url,value:this.PP[1]});
		DG_SetDomProps(m_a,this.PP[2]);
		if(onclick)m_a.onclick=onclick;
	}
}

DG_CF.DG_Img=function(){return new DG_Img();}
function DG_Img()
{
	DG_Object.call(this);
	var myself=this;
	this.PP=new Array(4);
	this.PPN=["","","","alpha correction"];
	var m_img;
	this.RenderObj=function(r)
	{
		var url=this.PP[0];
		var onclick=this.PP[1];
		if(!url)return;
		if(myself.PP[3])
			m_img=DG_CreateImg(this.DIV,{pngSrc:url});
		else
			m_img=DG_CreateImg(this.DIV,{src:url});
		DG_SetDomProps(m_img,this.PP[2]);
		if(onclick)m_img.onclick=onclick;
	}
}

DG_CF.DG_Span=function(){return new DG_Span();}
function DG_Span()
{
	DG_Object.call(this);
	var myself=this;
	this.PP=new Array(1);
	var m_span;
	this.RenderObj=function(r)
	{
		var id=this.PP[0];
		if(!id)return;
		m_span=DG_Obj(id);
		if(!m_span)return;
		m_span.SS(18,1);
		var padding=this.PP[1];
		m_span.SS(12,padding);
		m_span.SS(13,padding);
		m_span.SS(5,this.DIV.W-2*padding);
		m_span.SS(6,this.DIV.H-2*padding);
		myself.DIV.SS(19,1);
		myself.DIV.appendChild(m_span);
	}
}

DG_CF.DG_IFrame=function(){return new DG_IFrame();}
function DG_IFrame()
{
	DG_Object.call(this);
	var myself=this;
	this.PP=new Array(3);
	var m_fr;
	this.RenderObj=function(r)
	{
		var url=this.PP[0];if(!url)return;
		m_fr=DG_NewIFrame(this.DIV,{s60:url,s5:r.w,s6:r.h,s61:this.PP[1],s62:this.PP[2]});
	}
	this.GetDefault=function(id)
	{
		switch(id)
		{
			case 1: return 0;
			case 2: return 0;
		}
	}
	this.InitProps();	
}
