// <![CDATA[
var commentopen = false;

function openAddComment(x,y,z,t,u){
	if(!commentopen){
			
		if(x != 'edit'){
			document.forms.commentform.section_code.value = t;
			document.forms.commentform.sub_code.value = u;
			document.images.addcomment_tp.src = 'images/addcomment_tp.gif';
			document.forms.commentform.comment.value = '';
			document.forms.commentform.process.value = 'add';
			offset = 188;
		}else{
			document.images.addcomment_tp.src = 'images/editcomment_tp.gif';
			document.forms.commentform.comment.value = y;
			document.forms.commentform.process.value = 'edit';
			document.forms.commentform.theid.value = z;

			offset = 188*2;
		}
		commentopen= true;
		document.getElementById('addcomment').style.display = 'block';
		document.getElementById('addcomment').style.top = (tempY+0)+'px';
		document.getElementById('addcomment').style.left = (tempX-offset)+'px';
	}
}

function addComment(){
	if(document.forms.commentform.comment.value != ''){
		document.forms.commentform.submit();
	}else{
		alert('Please enter a comment beore submitting');
	}
}

function cancComment(){
	commentopen= false;
	document.getElementById('addcomment').style.display = 'none';
	document.forms.commentform.comment.value = '';
	document.forms.commentform.commenttitle.value = '';
}
// ]]>