function LocDT(vYear, vMonth, vDate, vHours, vMinutes)
{
	var UTCDT;
	var LocalDT;
	var strDate;
	var Meridian = "AM";
	var LocHours;
	var LocMinutes;

	UTCDT = new Date(vYear, vMonth - 1, vDate, vHours, vMinutes);
	LocalDT = AddMinutes(UTCDT, -UTCDT.getTimezoneOffset());
	
	strDate = GetMonth(LocalDT.getMonth()) + " " + LocalDT.getDate() + ", " + LocalDT.getFullYear();
	LocHours = LocalDT.getHours();
	if (LocHours > 11)
	{
		Meridian = "PM";
	}
	if ( LocHours > 12)
	{
		Meridian = "PM";
		LocHours -= 12;
	}
	if (LocHours == 0) // Midnight
	{
		LocHours = 12;
	}
	LocMinutes = LocalDT.getMinutes();
	if (LocMinutes < 10)
	{
		LocMinutes = "0" + LocMinutes;
	}
	strDate += " " + LocHours + ":" + LocMinutes + " " + Meridian;
	document.write (strDate);
}

function GetMonth(nMonth)
{
	var Months = new Array("January","February","March","April","May","June",
							"July","August","September","October","November","December");
	return Months[nMonth];
}

function AddMinutes(toDate, numMinutes)
{
	var Result = new Date(toDate.valueOf() + (numMinutes * 60000));
	return Result;
}

function PopWindow(NewURL, Width, Height, Center)
{
	var WinTop;
	var WinLeft;
	var NewWin;
	
	if (Center == true)
	{
		WinTop = (screen.height - Height) / 2;
		WinLeft = (screen.width - Width) / 2;
		NewWin = window.open(NewURL, 'Popup', config='toolbar=no,menubar=no,status=no,location=no,directories=no,scrollbars=yes,width=' + Width + ',height=' + Height + ',top=' + WinTop + ',left=' + WinLeft );
	}
	else
	{
		NewWin = window.open(NewURL, 'Popup', config='toolbar=no,menubar=no,status=no,location=no,directories=no,scrollbars=yes,width=' + Width + ',height=' + Height );
	}
}

// Makes sure we're not in a frame for pages that may be referenced from an email
function CheckTop()
{
	if (parent.location && (parent.location != window.location))
	{ 
		top.location = window.location;
	}
}

function CopyToClipboard(InText)
{
	if (window.clipboardData) 
	{
		window.clipboardData.setData("Text", InText);
	}
	else if (window.netscape) 
	{ 
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) return false;
	   
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return false;

		trans.addDataFlavor('text/unicode');

		var str = new Object();
		var len = new Object();
		str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
		var copytext=InText;
		
		str.data=copytext;
		trans.setTransferData("text/unicode",str,copytext.length*2);
	 
		var clipid=Components.interfaces.nsIClipboard;

		if (!clip) return false;

		clip.setData(trans,null,clipid.kGlobalClipboard);
	}
	return false;
}
function ShowHideObjs(objA, objB)
{
	ShowHide(objA);
	ShowHide(objB);
}
function ShowHide(objName) 
{
	var nn4 = (document.layers) ? true : false; 
	var ie = (document.all) ? true : false; 
	var dom = (document.getElementById) ? true : false;
	var obj;
	if (nn4) 
	{
		obj = document.layers[objName];
		obj.display=(obj.visibility=='none') ? 'inline' : 'none';
	} 
	else if (ie) 
	{
		obj = document.all[objName];
		obj.style.display=(obj.style.display=='none') ? 'inline' : 'none';
	}
	else if (dom)
	{
		obj = document.getElementById(objName);
		obj.style.display=(obj.style.display=='none') ? 'inline' : 'none';
	}
}
function PopWindow(NewURL, Width, Height, Center)
{
	var WinTop
	var WinLeft
 
	if (Center = true)
	{
		WinTop = (screen.height - Height) / 2;
		WinLeft = (screen.width - Width) / 2;
		var NewWin = window.open(NewURL, 'Popup', config='toolbar=no,menubar=no,status=no,location=no,directories=no,scrollbars=yes,width=' + Width + ',height=' + Height + ',top=' + WinTop + ',left=' + WinLeft );
	}
	else
	{
		var NewWin = window.open(NewURL, 'Popup', config='toolbar=no,menubar=no,status=no,location=no,directories=no,scrollbars=yes,width=' + Width + ',height=' + Height );
	}
}
function InsEmote(TargetControl, Emote) 
{
	insertTag(TargetControl, Emote);
	return;
}

//Requires Mozilla or Phoenix post 8-Jan-03

function getMozSelection() {
return document.getSelection();
}

// IE only - stores the current cursor position on any textarea activity
function storeCaret (txtarea) { 
	if (txtarea.createTextRange) { 
	txtarea.caretPos = document.selection.createRange().duplicate();
	} 
} 

// IE only - wraps selected text with lft and rgt
function WrapIE(lft, rgt) {
	strSelection = document.selection.createRange().text;
	if (strSelection!="") {
	document.selection.createRange().text = lft + strSelection + rgt;
	}
}

// Moz only - wraps selected text with lft and rgt
function wrapMoz(targetcontrol, lft, rgt) {
	var selLength = targetcontrol.textLength;
	var selStart = targetcontrol.selectionStart;
	var selEnd = targetcontrol.selectionEnd;
	if (selEnd==1 || selEnd==2) selEnd=selLength;
	var s1 = (targetcontrol.value).substring(0,selStart);
	var s2 = (targetcontrol.value).substring(selStart, selEnd)
	var s3 = (targetcontrol.value).substring(selEnd, selLength);
	targetcontrol.value = s1 + lft + s2 + rgt + s3;
}
	
// Chooses technique based on browser
function wrapTag(txtarea, lft, rgt) {
	lft = unescape(lft);
	rgt = unescape(rgt);
	if (document.all) {
	WrapIE(lft, rgt);
	}
	else if (document.getElementById) {
	wrapMoz(txtarea, lft, rgt);
	}
}

// Get a link via a prompt and wrap selected text
function wrapWithLink(txtarea) {
	var my_link = prompt("URL:","http://");
	if (my_link != null) {
	lft="[a href=\"" + my_link + "\"]";
	rgt="[/a]";
	wrapTag(txtarea, lft, rgt);
	}
	return;
}

// IE only - Insert text at caret position or at start of selected text
function insertIE (txtarea, text) {
	if (txtarea.createTextRange && txtarea.caretPos) { 
	var caretPos = txtarea.caretPos; 
	caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text+caretPos.text + ' ' : text+caretPos.text;
	} else {
	txtarea.value = txtarea.value + text; 
	}
	return;
} 

// Moz only - Insert text at caret position or at start of selected text
function insertMoz(txtarea, lft) {
	var rgt="";
	wrapTag(txtarea, lft, rgt);
	return;
}

// Switch function based on browser - Insert text at caret position or at start of selected text
function insertTag(targetcontrol, lft) {
	if (document.all) {
	insertIE(targetcontrol, lft);
	}
	else if (document.getElementById) {
	insertMoz(targetcontrol, lft);
	}
}
	
// prompt for image name. Insert image at caret position or at start of selected text
function insertImage(txtarea) {
	var my_link = prompt("IMG URL:","http://");
	if (my_link != null) {
	lft="[img src=\"" + my_link + "\" /]";
	insertTag(txtarea, lft);
	}
	return;
}

// End Processing code.

/*
written by meg hourihan
http://www.megnut.com
meg@megnut.com
	
warning: it only works for IE4+/Win and Moz1.1+
feel free to take it for your site
but leave this text in place.
any problems, let meg know.
*/
	
function mouseover(el) {
	el.className = "raise";
}
	
function mouseout(el) {
	el.className = "buttons";
}
	
function mousedown(el) {
	el.className = "press";
}
	
function mouseup(el) {
	el.className = "raise";
}
/* end meg script */