/*NOT TEST*/
function dom_class()
{
	var obj;
	var id;
}
dom_class.prototype={
	create : function(id,type)
	{
		this.id=id;
		if(this.is()){this.destroy();}
		this.obj=document.createElement(type);
		this.obj.id=this.id;
		return this.obj;
	},
	create_or_get : function(id,type)
	{
		if(document.getElementById(id)){return document.getElementById(id);}
		this.id=id;
		if(this.is()){this.destroy();}
		this.obj=document.createElement(type);
		this.obj.id=this.id;
		this.obj.setAttribute("id",id);
		return this.obj;
	},	
	is : function (){if(document.getElementById(this.id)){return true;} return false;},
	destroy : function(id)
	{
		if(!document.getElementById(id)){return false;}
		var oldDom=document.getElementById(id);
		document.removeChild(oldDOM);
	},
	remove_all_childs:function(id)//Не работает!!!
	{
		if(!document.getElementById(id)){return false;}
		var obj=document.getElementById(id)
		var childs_will_deleted=obj.childNodes;
		for(var i=0;i<childs_will_deleted.length;i++)
		{
			var delitem=childs_will_deleted.item(i);
			if(delitem.getAttribute("id")){this.remove_all_childs(delitem.getAttribute("id"));}
			obj.removeChild(delitem);
		}		
	},
	link_out_over:function(obj,out,over)
	{
		obj.onmouseover=function(){var btn=this.getElementsByTagName("img").item(0);btn.setAttribute("src",over);}
		obj.onmouseout=function(){var btn=this.getElementsByTagName("img").item(0);btn.setAttribute("src",out);}
	}
	
}
/*		Все ссылки	
		var hrefs=document.getElementsByTagName("a");
		for(var i=0;i<hrefs.length;i++)
		{
			var href=hrefs.item(i);
			if(rel=href.getAttribute("rel"))//rel=
			{
				href.onclick=this.execute;
			}
		}
*/		
/*		Делает шаги не видимыми... Не стал делать, т.к. сначала на странице отображается всё...
		var divs=document.getElementsByTagName("div");var step=0;
		for(var i=0;i<divs.length;i++)
		{
			var div=document.divs.item(i);
			if(div.getAttribute("class")=="step"){if(step==0){div.style.display='block';}else{div.style.display='none';}step++;}
		}
*/
