// Set Focus
function fokus(){
	try
	{
		document.frmBlog.myEntry.focus();
	}
	catch(err)
	{}
}

// Entry Length
function entryLength()
{
	if(document.frmBlog.myEntry.value.length < 1 || document.frmBlog.myEntry.value.length > 3000)
	{
		alert("Entries can neither be blank nor exceed 3000 characters.\nYour message is "+document.frmBlog.myEntry.value.length+" character(s).\nPlease edit your entry and try again.");
		document.frmBlog.myEntry.focus();
		return(false);
	}
	document.frmBlog.send.value = "Posting...";
	document.frmBlog.send.disabled = true;
	document.frmBlog.submit();
}

// Smiley Addition
function addSmiley(smiley)
{
	//document.frmBlog.myEntry.value = document.frmBlog.myEntry.value+smiley;
	//document.frmBlog.myEntry.focus();
	
	var m;
	var f=document.forms['myEntry'];
	if(f){
		m = f.message;
	}else {
		m = document.getElementById('myEntry');
	}

	if(!m) {
		return;
	}

	if(document.selection){
		m.focus();
		sel=document.selection.createRange();
		sel.text=smiley;
	}else if( m.selectionStart || m.selectionStart=="0" ) {
		var s=m.selectionStart;
		var e=m.selectionEnd;
		m.value=m.value.substring(0,s)+smile+m.value.substring(e,m.value.length);
	}else{
		m.value += smiley;
	}
}

// Google Tracker
//var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write("\<script src='http://www.google-analytics.com/ga.js' type='text/javascript'>\<\/script>" );

if (typeof(_gat) == "object") { 
	var pageTracker = _gat._getTracker("UA-3216877-1");
	pageTracker._initData();
	pageTracker._trackPageview();
} 
