//<A href="" target="main"></A>
if ( typeof(DOMCreater) == 'undefined' ) DOMCreater = function() {};

DOMCreater = 
{
	createA : function(href,target,text,onclick) {
		var a=document.createElement("A");
		if(href!=null)   a.href=href;	
		if(target!=null) a.target=target;	
		if(text!=null)   a.innerHTML=text;
		
		if(onclick!=null){
			if (isMSIE){
				a.onclick=onclick;
			}else{
				//a.onclick=onclick;
				a.setAttribute("onclick", onclick);
			}
		}
		return a;
	},

	//<img src="../images/hogehoge.gif" alt="ALT" width="52" height="17" />
	createImg : function(src,width,height,alt,border) {
		
		prIMG = new Image();
		prIMG.src = src;
		
		var img=document.createElement("IMG");
		var num = Math.ceil(Math.random()*1000);
		img.id = num;
		img.name = num;
		img.className = num;
		if(src!=null)    img.setAttribute("src", src);
		if(width!=null)  img.setAttribute("width",width);
		if(height!=null) img.setAttribute("height",height);
		if(alt!=null)    img.setAttribute("alt",alt);
		if(border!=null) img.setAttribute("border",border);

		return img;
	}

};
