function addbookmark()
{
	url="http://www.babeunion.com";
	title="BabeUnion - Sexy Babes";
	if (window.sidebar)
	{
		window.sidebar.addPanel(title, url, "");
	}
	else if(window.external)
	{
		window.external.AddFavorite(url, title)	;
	}
	return true;
}

function juicyframe() {
	 document.write('<iframe id="juice" frameborder="0" marginheigh="0" '
        +'marginwidth="0" width="650" height="145" scrolling="no" '
        +'src="http://www.juicyads.com/adshow.php?adzone=662"></iframe>');
}

function insertFormat(startformat,endformat) {
	// code or IE
	var textarea = document.getElementById("CommentText");
	if (document.selection) {
		textarea.focus();
		var sel = document.selection.createRange();
		// alert the selected text in textarea
		//alert(sel.text);
		// Finally replace the value of the selected text with this new replacement one
		sel.text = startformat + '' + sel.text + '' + endformat;
	} else {
	// code for Mozilla
		var textarea = document.getElementById("CommentText");
		var len = textarea.value.length;
		var start = textarea.selectionStart;
		var end = textarea.selectionEnd;
		var sel = textarea.value.substring(start, end);

		// This is the selected text and alert it
		//alert(sel);
		var replace = '' + startformat + '' + sel + '' + endformat + '';

		// Here we are replacing the selected text with this one
		textarea.value = textarea.value.substring(0,start) + replace + textarea.value.substring(end,len);

		//var currentText = document.getElementById("CommentText");
		//var textWithFormat = "" + text + "";
		//currentText.value += textWithFormat;
	}
}
function insertSmiley(smiley) {
	var currentText = document.getElementById("CommentText");
	var smileyWithPadding = "" + smiley + "";
	currentText.value += smileyWithPadding;
}


function showCommentLink(id,comments) {
	 document.write('<a href="/post-' + id + '/">'
		+comments
		+'<\/a>');
}


function showJuicyAd() {
	document.write('<center><iframe id="juice" frameborder="0" marginheight="0"'
	+' marginwidth="0" width="580" height="145" scrolling="no"'
	+' src="http://www.juicyads.com/adshow.php?adzone=662"></iframe></center>');
}

function showJuicyAdd() {
	document.write('<iframe frameborder="0" marginheight="0" marginwidth="0"'
	+' width="618" height="308" scrolling="no"'
	+' src="http://www.juicyads.com/adshow.php?adzone=4554"></iframe>');
}

function showBookmark() {
	document.write('<br />'
	+'<center><a name="bookmark"></a><a style="font-size:18pt; color:#b23232;'
	+' font-weight:bold;" onclick="javascript:return addbookmark(); return false"'
	+' href="#bookmark">Click Here to Bookmark</a></center>');
}
