function logout(){
	var logout = confirm("Are you sure you want to logout?");
	
	if(logout){
		document.location = '../../apps/views/logout.php';
		return false;
	}else{
		return false;
	}
}

/* function verify_comment(){
	var = 
} */

function comment_popup(aid,titel) {

	new Effect.Appear('comment_popup', { duration: 0.5 });
	new Effect.Appear('blackout', { duration: 0.5 });
	
	$("article_id").value = aid;
	$("article_ttle").value = titel;
	
	new Ajax.Updater('dis_comments', 'apps/views/comments.php', {
	    method: 'get', 
	    parameters: { article_id: aid, article_ttle: titel }
    });
	return false;
	
}

function comment_hide() {
	
	new Effect.Fade('comment_popup', { duration: 0.5 });
	new Effect.Fade('blackout', { duration: 0.5 });
	
	$("name").value = '';
	$("email").value = '';
	$("website").value = '';
	$("comment").value = '';
	
	$("required").style.display = 'block';
	$("comment_err").style.display = 'none';
	return false;
	
}

function add_comment(){
	
	var article_id		= $("article_id").value;
	var name			= $("name").value;
	var email			= $("email").value;
	var website			= $("website").value;
	var comment			= $("comment").value;
	var article_ttle	= $("article_ttle").value;
	
	var noerr = true;
	if(name == '' || email == '' || comment == ''){
		noerr = false;
	}
	
	if(noerr == false){
		$("required").style.display = 'none';
		$("comment_err").style.display = 'block';
		$("comment_err").innerHTML = 'ERROR: Please Fill up all the required fields!';
		new Effect.Highlight("comment_err", { startcolor: '#ffff99', endcolor: '#990000' })
	}else{	
		new Ajax.Updater('dis_comments', 'apps/views/comments.php', {
		    method: 'get', 
		    parameters: { action: 'add_comment',article_id: article_id, article_ttle: article_ttle, name: name, email: email,website: website, comment:comment }
	    });
		
		$("name").value = '';
		$("email").value = '';
		$("website").value = '';
		$("comment").value = '';
		
		$("required").style.display = 'block';
		$("comment_err").style.display = 'none';
	}
	
	return false;
	
}