// Left Nav Sliders
// Code is now included in nav_left.php

function addComment(){
  var myAjax = new Ajax('/dev/commenting_system.php',{method: 'post', data:$('comment'), update: $('commenting_system')}).request();
}

function updateComment(id){
 $('id').value = id;
  var myAjax = new Ajax('/dev/commenting_system_backend.php',{method: 'post', data:$('comment'), update: $('comments')}).request();
}

function setParent(pID){
	$('parentID').value = pID;
}

function sortComment(view){
 $('view').value = view;
 $('isAjaxBack').value = 'false';
 var myAjax = new Ajax('/dev/commenting_system_backend.php',{method: 'post', data:$('comment'), update: $('comments')}).request();
}

function myClipboard(contentID){
	  var myAjax = new Ajax('/lib/handler.myclipboard.php',{update: $('myclipboard'),method: 'post', postBody:"content="+contentID}).request();
}

function emailPage(contentID){
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var address = document.forms['f'].elements['emailaddress'].value;
	if(reg.test(address) == false) {
		alert('Invalid Email Address');
		}else{
		var myAjax = new Ajax('/lib/handler.emailpage.php',{update: $('email'),method: 'post', data:$('f')}).request();
	}
}

function toggleMe(a){
	var e=document.getElementById(a);
	if(!e)return true;
	if(e.style.display=="none"){
		e.style.display="block"
		} else {
		e.style.display="none"
	}
	return true;
}

function jumpToAnchor(){
	window.location = "#comment";
}