selected = 'comment0';
// JavaScript Document
function changeClassIndexPage(id) {
	document.getElementById(id).className = 'comment_thumb_image';
	document.getElementById(selected).className = 'thumb_image';
}
function showSelectedComment(id, comment_id, order) {
	if (id != selected) {
		// get the animation type
		if (selected == 'comment0')
			margin_value = '-100px';
		else if (selected == 'comment1' & id == 'comment2')
			margin_value = '-220px';
		else if (selected == 'comment2' & id == 'comment1')
			margin_value = '-100px';
		else
			margin_value = '50px';

		document.getElementById(selected).className = 'comment_thumb_image';
		selected = id;
		document.getElementById(id).className = 'thumb_image';
		$('#commentImgBox').animate( {
			marginLeft :margin_value
		}, 1500, function() {
			// Animation complete.
			});
	}
	// inseret loading on title before call the ajax page
	document.getElementById('indexHeaderComment').innerHTML = '<center>loading ...</center>';
	document.getElementById('indexCommentBox').innerHTML = '';
	// change title
	ajaxPageNoLoading('commentBox', 'ajax/index_comment.ajax.php',
			'comment_id=' + comment_id);
}
/**
 * check the comment validation
 * @return
 */
function comment_valid() {
	if (document.comment.name.value == "") {
		alert("write your name");
		document.comment.name.focus();
	} else if (document.comment.email.value == "") {
		alert("write your email");
		document.comment.email.focus();
	} else if (document.comment.subject.value == "") {
		alert("write your subjecy");
		document.comment.subject.focus();
	} else if (document.comment.text.value == "") {
		alert("write your comment");
		document.comment.text.focus();
	} else
		document.comment.submit();
}
