function ValidateForm(form){
	if(form.post_title.value==''){
		alert('Please enter a title')
		form.post_title.focus()
		return false
	}
	if(form.post_body.value==''){
		alert('You have not entered anything in your post')
		form.post_body.focus()
		return false
	}
	return true

}




function shortCuts() {
	if (event.ctrlKey != true) return;
	strSelection = document.selection.createRange().text;
	if (event.keyCode == 1) MakeLink();
	if (event.keyCode == 2) MakeBold(2);
	if (event.keyCode == 20) MakeItalic(2);
	
}

function MakeLink() {
	strSelection = document.selection.createRange().text
	if (strSelection == "") document.text_form.body.focus()
	strHref = prompt("Enter the hyperlink you want to link to:","http://")
	if (strHref == null) return;
	document.selection.createRange().text = "<a href=\"" + strHref + "\" target=_blank>" + strSelection + "</a>"
	return;
}


function MakeBold(from) {
	strSelection = document.selection.createRange().text
	if (strSelection == "") {
		document.text_form.body.focus()
		if (from == 2) document.text_form.body.select()
		strSelection = document.selection.createRange().text
		document.selection.createRange().text = strSelection + "<b></b>"
	}	
	else document.selection.createRange().text = "<b>" + strSelection + "</b>"
	return;
}

function MakeItalic(from) {
	strSelection = document.selection.createRange().text
	if (strSelection == "") {
		document.text_form.body.focus()
		if (from == 2) document.text_form.body.select()
		strSelection = document.selection.createRange().text
		document.selection.createRange().text = strSelection + "<i></i>"
	}
	else document.selection.createRange().text = "<i>" + strSelection + "</i>"
	return;
}

