function ShowHide(id)
{
	var e;

	e = document.getElementById(id);

	if(e)
	{
		if(e.style.display == '')
			e.style.display = 'none';
		else
			e.style.display = '';
	}
}

function RemoveDefault(e)
{
	if(e.className == "textbox_gray")
	{
		e.className = "textbox";
		e.value     = "";
	}
}

function OpenFullImage(path)
{
	window.open("full_image.asp?p=" + path, "FullImage", "width=500,height=400,resizable=yes,scrollbars=yes");
}

function FitPic(img)
{
	var i, x, y;
	
	i = document.getElementById(img);

	x = i.width - document.body.clientWidth + 30;
	y = i.height - document.body.clientHeight + 30;
	
	window.resizeBy(x, y);
}

function RowOver(e)
{
	document.getElementById(e).style.backgroundColor = "#EFEFEF";
}

function RowOut(e, p)
{
	if(p == 0)
		document.getElementById(e).style.backgroundColor = "";
	else
		document.getElementById(e).style.backgroundColor = "#FBFAF4";
}

function SurroundText(e_name, start_tag, end_tag)
{
	var cur_range;

	document.getElementById(e_name).focus();

	cur_range = document.selection.createRange().duplicate();

	if(cur_range)
	{
		cur_range.text = start_tag + cur_range.text + end_tag;

		return false;
	}
}

function OverOutImage(imgId, imgFile)
{
	document.getElementById(imgId).src = "images\\" + imgFile;
}