
function showHide(entryID, htmlObj, linkType)
{
	extTextDivID = ('extText' + (entryID));
	extLinkDivID = ('extLink' + (entryID));

	if (linkType == 'close')
	{
		document.getElementById(extTextDivID).style.display = "none";
		document.getElementById(extLinkDivID).style.display = "block";
		htmlObj.blur();
	}
	else
	{
		document.getElementById(extTextDivID).style.display = "block";
		document.getElementById(extLinkDivID).style.display = "none";
		htmlObj.blur();
	}
}


function field_focus()
{
	if (document.forms.length > 0)
	{
		if (document.box)
		{
			document.box.title.focus();
		}
		else if(document.member_search)
		{
			document.member_search.keyword.focus();
		}
		else if(document.postoffice)
		{
			document.postoffice.from.focus();
		}
		else if(document.entry_page_prefs)
		{
			document.entry_page_prefs.elements['12'].focus();
		}
		else if(document.rss_templates)
		{
			document.rss_templates.elements['1'].focus();
		}
		else if(document.cp_search)
		{
			document.cp_search.elements['1'].focus();
		}
		else if (document.forms['0'].elements['0'])
		{
			if (document.forms['0'].elements['0'].type == 'text')
			{
				document.forms['0'].elements['0'].focus();
			}
		}
	}
}

if(document.images){
    
var pmachine_on = new Image();
pmachine_on.src = "images/pmlogo_on.jpg";

var pmachine_off = new Image();
pmachine_off.src = "images/pmlogo_off.jpg";

var visit_on = new Image();
visit_on.src = "images/sitevisit_on.jpg";

var visit_off = new Image();
visit_off.src = "images/sitevisit_off.jpg";

var home_on = new Image();
home_on.src = "images/main_on.jpg";

var home_off = new Image();
home_off.src = "images/main_off.jpg";

var manual_on = new Image();
manual_on.src = "images/help_on.jpg";

var manual_off = new Image();
manual_off.src = "images/help_off.jpg";

var logout_on = new Image();
logout_on.src = "images/exit_on.jpg";

var logout_off = new Image();
logout_off.src = "images/exit_off.jpg";
}


function pmachine_light(){
if (document.images){
	document.images.pmachine.src = pmachine_on.src;}
window.status = "--> control panel home";
}
function pmachine_dim(){
if (document.images){
	document.images.pmachine.src = pmachine_off.src;}
window.status = "";
}
function visit_light(){
if (document.images){
	document.images.visit.src = visit_on.src;}
window.status = "--> visit your site";
}
function visit_dim(){
if (document.images){
	document.images.visit.src = visit_off.src;}
window.status = "";
}
function home_light(){
if (document.images){
	document.images.home.src = home_on.src;}
window.status = "--> control panel home";
}
function home_dim(){
if (document.images){
	document.images.home.src = home_off.src;}
window.status = "";
}
function manual_light(){
if (document.images){
	document.images.manual.src = manual_on.src;}
window.status = "--> user manual";
}
function manual_dim(){
if (document.images){
	document.images.manual.src = manual_off.src;}
window.status = "";
}
function logout_light(){
if (document.images){
	document.images.logout.src = logout_on.src;}
window.status = "--> logout";
}
function logout_dim(){
if (document.images){
	document.images.logout.src = logout_off.src;}
window.status = "";
}

function prefDoc(){
window.open("", "prefdoc", "width=520,height=320,toolbar=0,status=0,scrollbars=1,location=0,menubar=1,resizable=1");}

function variableDoc(){
window.open("", "variabledoc", "width=520,height=360,toolbar=0,status=0,scrollbars=1,location=0,menubar=1,resizable=1");}

function templateDoc(){
window.open("", "templatedoc", "width=525,height=150,toolbar=0,status=0,scrollbars=1,location=0,menubar=1,resizable=1");}

function templateOrig(){
window.open("", "templateorig", "width=660,height=480,toolbar=0,status=0,scrollbars=1,location=0,menubar=1,resizable=1");}

function fixNetscapesBug(){ window.location.reload() }
function FixIt(){ if (document.layers) window.onresize = fixNetscapesBug } window.onload = FixIt

function imageopen(){
window.open("", "imageupload", "width=400,height=545,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0");}

function messageopen(){
window.open("", "messageview", "width=400,height=545,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0");}


function imageBrowser(loc,x,y){
window.open(loc, "imagebrowser", "width="+x+",height="+y+",toolbar=0,status=0,scrollbars=1,location=0,menubar=1,resizable=1");}


// pull-down menu navigation 
 function viewby(index) {
   document.titleselect.submit()
 }

function erase(box) {
   if (box.defaultValue == box.value)
       box.value = ""
} 

var isFocused;
function pMcode(code) {

    if (isFocused == "blurb") {
        document.box.blurb.value += code;
        document.box.blurb.focus();
    }
    if (isFocused == "body") {
        document.box.body.value += code;
        document.box.body.focus();
    }
    if (isFocused == "more") {
        document.box.more.value += code;
        document.box.more.focus();
    }
    if (isFocused == "custom1") {
        document.box.custom1.value += code;
        document.box.custom1.focus();
    }
    if (isFocused == "custom2") {
        document.box.custom2.value += code;
        document.box.custom2.focus();
    }
    if (isFocused == "custom3") {
        document.box.custom3.value += code;
        document.box.custom3.focus();
    }
}

function closeNgo(URL) 
{
	opener.location = URL;
	window.close();
}


function flip(which)
{
	var cur = which.value;
	var nam = which.name;
	
	if (cur == "AM") {
	document.forms.box[nam].value = "PM";
	document.forms.box[nam].blur();	
	}
	
	if (cur == "PM") {
	document.forms.box[nam].value = "";
	document.forms.box[nam].blur();	
	}
	if (cur == "") {
	document.forms.box[nam].value = "AM";
	document.forms.box[nam].blur();	
	}	
}


function ToggleAll(e)
    {
	if (e.checked) {
	    CheckAll();
	}
	else {
	    ClearAll();
	}
}

function CheckAll()
    {
  
	var ml = document.editmlst;
	var len = ml.elements.length;
	for (var i = 0; i < len; i++) {
	    var e = ml.elements[i];
		var name_array=e.name.split("["); 
	    if (name_array[0] == "row") {
		e.checked = true;
	    }
	}
	ml.toggleAll.checked = true;
}

function ClearAll()
    {
	var ml = document.editmlst;
	var len = ml.elements.length;
	for (var i = 0; i < len; i++) {
	    var e = ml.elements[i];
	    var name_array=e.name.split("["); 
	    if (name_array[0] == "row") {
		e.checked = false;
	    }
	}
	ml.toggleAll.checked = false;
}

