// text counter function

function gotoBody( )
{
  document.form2.fnarrative.focus();
}

function gotoBody2( )
{
  document.form2.fnarrative2.focus();
}

function textCounter( field, countfield ) {
    countfield.value = field.value.length;
}

// highlight item
function setHighlight(obj, flag){
	if (flag){
	obj.className='aShadowH';
	}
	else {
	obj.className='aShadow';
	}
}

// popup for profile preview
function previewPopup(furl) {
	URL = "../previewm/indexp.cfm?" + furl + "&rand=" + Math.random();
	var saveConfirm = window.open(URL, "_blank", "height=550, width=925, status=yes, toolbar=no, menubar=no, location=no, left=25, top=25, resizable=yes, scrollbars=yes");
    if (saveConfirm == 1)
        return;
    else {
        return;
    }
}

function confirmDelete(fid)
{
	if(confirm('Are you sure you wish to permanently delete this journal entry (no undo)?  ')) location.href = "indexm.cfm?fid=" + fid + "&fdelete=yes" + "&rand=" + Math.random();
}

function WinPopUp(URL) {
	winwidth = 500; // width of the new window
	winheight = 350; // height of the new window
	winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
	wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
	var saveConfirm = window.open(URL, "_blank", 'top=' + wintop + ',left=' + winleft + ',height=' + winheight + ',width=' + winwidth + ',status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=no');
}
