/* Image handler v1.0 by skai 2006 */

function openNewWindow(img)
{
	imgSrc = document.getElementById(img).src;
	imgAlt = document.getElementById(img).alt;
	w = window.open("", "fullscreen=no", "width=800, height=600, left=100, top=100, screenX=100, screenY=100");
	newSrc = imgSrc.replace("_resize", "");
	w.document.write("<html><head><title>");
	w.document.write(imgAlt);
	w.document.write("</title></head><body bgcolor=#000000 topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 marginheight=0><img src="+newSrc+" onclick=window.close();></body></html>");
}

/* HTML tag creator by skai 2006 */

function addTag(text)
{
	txt = document.add_blog.blog_text;
	
	if( txt.createTextRange && txt.caretPos )
	{
		caretPos = txt.caretPos;
		caretPos.text = caretPos.text.charAt( caretPos.text.length-1 ) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txt.focus();
		
	}
	else
	{
		txt.value += text;
		txt.focus();
	}
}
