
function isNotEmpty(mytext) {
	var re = /^\s{1,}$/g; 
	if ((mytext.value.length==0) || (mytext.value==null) || ((mytext.value.search(re)) > -1)) {
		alert('Vul alle velden in aub.');
		return false;
	} 
	return true;
}
  
function Post() {
	if (isNotEmpty(document.blog_com.comment)) {
   		return true;
	} else {
		return false;
	}
}

function PostName() {
	if (isNotEmpty(document.blog_com.name)) {
		if (isNotEmpty(document.blog_com.comment)) {
	    	return true;
	    } else {
	    	return false;
	    }
	} else {
		return false;
	}
}

function TPost() {
	if (isNotEmpty(document.blog_com.comment)) {
		if (isNotEmpty(document.blog_com.subject)) {
	    	return true;
	    } else {
	    	return false;
	    }
	} else {
		return false;
	}
}

function TPostName() {
	if (isNotEmpty(document.blog_com.name)) {
		if (isNotEmpty(document.blog_com.subject)) {
			if (isNotEmpty(document.blog_com.comment)) {
		    	return true;
		    } else {
		    	return false;
		    }
	    } else {
	    	return false;
	    }
	} else {
		return false;
	}
}  

function AddLink() {
	var userInput = prompt("Vul hieronder het adres in:", "http://");
	if ((userInput != null) && (userInput != 'http://') && (userInput != '')) {
  		NewCode = '[u]' + userInput + '[/u]';
		document.blog_com.comment.value += NewCode;
	}
	document.blog_com.comment.focus();
}
	
function AddMail() {
 	var userInput = prompt("Vul hieronder het e-mail adres in:", "");
	if ((userInput != null) && (userInput != '')) {
  		NewCode = '[e]' + userInput + '[/e]';
		document.blog_com.comment.value += NewCode;
	}
	document.blog_com.comment.focus();
}

function changeTag() {
	
	var tag = document.blog_com.tag.value;
	
	if (tag == 'news') {
		document.getElementById('news_div').style.height = 'auto';
		document.getElementById('call_div').style.height = '2px';
		//document.getElementById('news_div').style.visibility = 'visible';
		//document.getElementById('call_div').style.visibility = 'collapse';
	} else if (tag == 'call') {
		document.getElementById('news_div').style.height = '2px';
		document.getElementById('call_div').style.height = 'auto';
		//document.getElementById('news_div').style.visibility = 'collapse';
		//document.getElementById('call_div').style.visibility = 'visible';
	} else {
		document.getElementById('news_div').style.height = '2px';
		document.getElementById('call_div').style.height = '2px';
		//document.getElementById('news_div').style.visibility = 'collapse';
		//document.getElementById('call_div').style.visibility = 'collapse';
	}
	
}


