function clickLahter(todo)
{
	var fieldvalue = document.login.username.value;
	var normal = document.login.username.defaultValue;

	if(todo==1 && fieldvalue==normal) document.login.username.value="";
	if(todo==2 && !fieldvalue) document.login.username.value=normal;
}
function clickLahter2(todo)
{
	var fieldvalue = document.login.password.value;
	var normal = document.login.password.defaultValue;

	if(todo==1 && fieldvalue==normal) document.login.password.value="";
	if(todo==2 && !fieldvalue) document.login.password.value=normal;
}


function hide(id) {
           document.getElementById(id).style.visibility = "hidden";
           document.getElementById(id).innerHTML = null;
       }

       function display(box, id, itemid, pid, todo) {
           id_hide = 'comm_' + id;
           obj = document.getElementById(id_hide);
           if (typeof checked_id == 'undefined') checked_id = 0;
           if (typeof checked_box == 'undefined') checked_box = 0;

           if (box == 1) {
               text = '<form action="main.php?pID=7&do=' + itemid + '&act=answer&cid=' + id +'&pid=' + pid + '&do=' + todo + '" method="POST">Vastus: <br><textarea name="answerText" class="input" cols=50 rows=3></textarea><br><input type="submit" class="input" value="Lisa vastus" /></form>'
           } else {
               text = '<form action="main.php?pID=14&act=answer&cid=' + id +'&pic=' + itemid +'" method="POST"><input type="hidden" name="ccid" value="' + id +'"><input type="hidden" name="ppic" value="' + itemid +'"><input type="hidden" name="act" value="answer">Vastus: <br><textarea name="answerText" class="input" cols=50 rows=3></textarea><br><input type="submit" class="input" value="Lisa vastus" /></form>'
           }

           if (checked_id && checked_id != id_hide) {
               hide(checked_id);
           }
           if (obj.style.visibility == "visible" && checked_box == box) {
              hide(id_hide);
           } else {
              obj.innerHTML = text
              obj.style.visibility = "visible";
              checked_id = id_hide;
              checked_box = box;
           }
       }