<!--

function OpenWindow(photoname,photodesc,winref,imgwidth,imgheight)
{
	window.status='';
	winwidth = imgwidth+24
	winheight = imgheight+24
	window.open('photo_window.asp?imgsrc='+photoname+'&title='+photodesc, winref,'width='+winwidth+',height='+winheight+'directories=no,top=50,left=20,menubar=no,resizable=no,scrollbars=no,status=NO,toolbar=no,alwaysRaised=yes');
}


function PopUpWindow(URL, winref, winwidth, winheight)
{
	window.open(URL,winref,'width='+winwidth+',height='+winheight+'toolbar=0,status=1,scrollbars=1,menubar=0,location=0,resizable=0,left=10,top=10');
}


function HTMLTags(elTxtArea, tag, attributes)
{
	// Only try to select text in textarea if Browser supports createRange (ie is IE4+) 
	if (document.selection.createRange())
	{
		var str;
		var sel;
		var href;

		str = document.selection.createRange().text;
		elTxtArea.focus();

		switch (tag)
		{
			case "hr":
				sel = document.selection.createRange();	      
				sel.text = str + "<" + tag + attributes + ">";
				break;

			case "hyperlink":
				if (str != "")
				{
					href = prompt("Enter Page URL:","http://");
					if (href != null)
					{
						sel = document.selection.createRange();
						sel.text = "<a href=\"" + href + "\" target=\"_newwindow\">" + str + "<\/a>";
					}
					break;
				}

			case "mailto":
				if (str != "")
				{
					href = prompt("Enter Email Address:",str);
					if (href != null)
					{
						sel = document.selection.createRange();
						sel.text = "<a href=\"mailto:" + href + "\">" + str + "<\/a>";
					}
					break;
				}
	            
			case "RemoveHTMLTags":
				if (str != "")
				{
					sel = document.selection.createRange();
					sel.text = RemoveHTMLTags(str);
					break;
				}

			default:
				if (str != "")
				{
					sel = document.selection.createRange();
					sel.text = "<" + tag + attributes + ">" + str + "<\/" + tag + ">";
				}
		}
	}
	  
	return;
}


function RemoveHTMLTags(str)
{
	return str.replace(/<[^>]*>/g, "");
}

function toolbar_mouseover(el)
{
	el.className = "raised";
}

function toolbar_mouseout(el)
{
	el.className = "toolbarbutton";
}

function toolbar_mousedown(el)
{
	el.className = "pressed";
}	

function toolbar_mouseup(el)
{
	el.className = "raised";
}


//-->
