var ardCommentObj={init:function(){this.createToggleLink();
this.createCharCounter()
},createToggleLink:function(){if(location.hash!="#ardCommentMsg"||document.getElementById("ardCommentSuccessMsg")){document.getElementById("ardAddComment").className="inv"
}var b=document.createElement("p");
b.setAttribute("id","ardCommmentToggleNav");
b.innerHTML='<img alt="Link: " class="ardIcon" src="/sp/layout/img/general/ardpfeil.gif" />';
b.appendChild(document.createElement("a"));
b.getElementsByTagName("a")[0].innerHTML=document.getElementById("ardCommentHeader").innerHTML;
document.getElementById("ardAddComment").removeChild(document.getElementById("ardCommentHeader"));
b.getElementsByTagName("a")[0].onclick=function(){ardCommentObj.toggleComment();
return false
};
document.getElementById("ardAddComment").parentNode.insertBefore(b,document.getElementById("ardAddComment"))
},toggleComment:function(){if(document.getElementById("ardAddComment")&&document.getElementById("ardAddComment").className=="inv"){document.getElementById("ardAddComment").className=""
}else{document.getElementById("ardAddComment").className="inv"
}},createCharCounter:function(){var b=document.createElement("p");
b.setAttribute("id","ardCommmentCharCounter");
b.className="ardDescLink";
b.style.textAlign="center";
b.innerHTML="noch 1000 Zeichen verbleibend";
document.getElementById("ardCommentText").parentNode.insertBefore(b,document.getElementById("ardCommentText").nextSibling);
document.getElementById("ardCommentText").onkeyup=function(){ardCommentObj.countChars()
}
},countChars:function(){var b=this.maxChars-document.getElementById("ardCommentText").value.length;
if(b<0){document.getElementById("ardCommentText").value=document.getElementById("ardCommentText").value.substr(0,this.maxChars);
b=0
}document.getElementById("ardCommmentCharCounter").innerHTML="noch "+b+" Zeichen verbleibend"
},maxChars:1000};
$j(document).ready(function(){ardCommentObj.init()
});
