function resetCommentValues(fieldList){
	resetSecurityNr();
	for (var i=0;i<fieldList.length;i++){
		document.getElementById(fieldList[i]).value = '';
	}
	document.getElementById('commentArea').style.display = 'none';
	document.getElementById('showHideLayer').className = 'hideLayer';
}//end function resetValues(fieldList)

function resetSecurityNr(){
	document.getElementById('imgSecureNr').src += '?' + Math.random();
}//end function resetCommentValues()

function updateComments(path, id){
	AjaxRequest.get(
    {
      'url':path,
	  'onLoading':function(req){ document.getElementById('loadingImg').style.display = "block"; }
      ,'onSuccess':function(req){ document.getElementById('loadingImg').style.display = "none"; updateField(req.responseText, id);}
    }
  );
}

function answerComments(path, id){
	var answer = encodeURIComponent(document.getElementById('answerTxt_'+id).value);
	path = path + '&answer='+answer;
	AjaxRequest.get(
    {
      'url':path,
	  'onLoading':function(req){ document.getElementById('loadingImg').style.display = "block"; }
      ,'onSuccess':function(req){ document.getElementById('loadingImg').style.display = "none"; updateField(req.responseText, id);}
    }
  );
}


function updateField(innerInfo, id){
	document.getElementById('row_'+id).innerHTML = innerInfo;
}

function showHideFormComm(layerName, actionType, obj)
{
	var background;
	//if no action specified, this function will toggle the current state	
	if (document.getElementById(layerName) == null)
		return false;
	if (actionType == 2)
	{
		 if(document.getElementById(layerName).style.display != "none"){
			new_style = "none";
			background = "hideLayer";
		}
		 else{
			new_style = "block";
			background = "showLayer";
   		}//end else
   }
   else
   	new_style = (actionType == 1) ? "block" : "none";
	if(obj != null){
		obj.className = background;
	}//end if
   	document.getElementById(layerName).style.display = new_style;
}

