addLoadEvent(animation);
function animation(){
}
addLoadEvent(addCommentForm);
function addCommentForm(){
	var applyButton = function(){
		var top_el = this.parentNode;
		var input = top_el.getElementsByTagName("input");
		var inputfalse = false;
		for (i=1;i<input.length;i++){
			if(!input[i].value)inputfalse = true;
			var check = input[i].value-1;
			if(check!=input[i].value-1)inputfalse = true;
		}
		if (inputfalse == true) {
			newAlert ("잘못된 입력입니다.");
			return false;
		}
		var style="position:absolute;";
		style=style+"top:"+input[1].value+"px;";
		style=style+"left:"+input[2].value+"px;";
		style=style+"width:"+input[3].value+"px;";
		top_el.setAttribute("style",style);
		var style="font-size:"+input[4].value+"px;";
		input[0].setAttribute("style",style);
		return false;
	}
	var change=function(){
		var top_el = this.parentNode;
        var input = top_el.getElementsByTagName("input");
		var text = document.createTextNode(input[0].value);
		var div_el = document.createElement("div");
		div_el.appendChild(text);
		this.parentNode.parentNode.appendChild(div_el);
        var style="position:absolute;";
		var top=Math.floor(input[1].value)+20;
		var left=Math.floor(input[2].value)+20;
        style=style+"top:"+top+"px;";
        style=style+"left:"+left+"px;";
        style=style+"width:"+input[3].value+"px;";
		style=style+"font-size:"+input[4].value+"px;";
        div_el.setAttribute("style",style);
		var form = this.parentNode.parentNode.parentNode.parentNode;
		var tmp = document.createElement("div");
		form.appendChild(tmp);
		tmp.appendChild(top_el);
		var cancle = function(){
			div_el.parentNode.appendChild(tmp.childNodes[0]);
			tmp.parentNode.removeChild(tmp);
			div_el.parentNode.removeChild(div_el);
			return false;
		};
		button = BTN(cancle,"돌아가기");
		div_el.appendChild(button);
		return false;
	}
	if(!document.getElementById("addCommentForm"))return false;
	top_el=document.getElementById("addCommentForm");
	var comments = getElementsByClassName2("comment",top_el);
	var commentInput = new Array();
	for(i=0;i<comments.length;i++){
		var button = BTN(applyButton,"적용");
        comments[i].appendChild(button);
		var button = BTN(change,"미리보기");
		comments[i].appendChild(button);
	}
}
function BTN(onclick,title){
	top_el = document.createElement("a");
	text=document.createTextNode(title);
	top_el.appendChild(text);
	top_el.setAttribute("href","#");
	top_el.onclick = onclick;
	return top_el;
}
addLoadEvent(artistINFOanime);
function artistINFOanime(){
	if(!getElementsByClassName2("artistINFO",document))return false;
	top_el = getElementsByClassName2("artistINFO",document);
	for (i=0;i<top_el.length;i++){
		top_el[i].onmouseover=function() {
			if(this.timeout)clearTimeout(this.timeout["height"]);
			this.setAttribute("style","overflow:hidden");
			animateElement(this,70,200,"height",2,30);
		}
		top_el[i].onmouseout=function(){
			if(this.timeout)clearTimeout(this.timeout["height"],2,30);
			animateElement(this,200,70,"height",2,30);
		}
		return false;
	}
}


