function editEntry(id, method) {
	makeActive (4);
	window.location.href = 'editEntry.php?id=' + id + '&method=' + method;
}

function viewEntry (id) {
	xwin ('viewEntry.php?id=' + id, 'viewEntry', 750, 550);	
}

function makeActive(id) {
	for (i = 1; i <= 8; i++)
		parent.frames.leftMenu.document.getElementById(i).type='circle';
	parent.frames.leftMenu.document.getElementById(id).type='disc';
}
<!--
var xmlhttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
	try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (E) {
		xmlhttp = false;
	}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp = new XMLHttpRequest();
}

function getElementTextNS(prefix, local, parentElem, index) {
	var result = "";
	if (prefix && isIE) {
		// IE/Windows way of handling namespaces
		result = parentElem.getElementsByTagName(prefix + ":" + local)[index];
	} else {
		// the namespace versions of this method 
		// (getElementsByTagNameNS()) operate
		// differently in Safari and Mozilla, but both
		// return value with just local name, provided 
		// there aren't conflicts with non-namespace element
		// names
		result = parentElem.getElementsByTagName(local)[index];
	}
	if (result) {
		// get text, accounting for possible
		// whitespace (carriage return) text nodes 
		if (result.childNodes.length > 1) {
			return result.childNodes[1].nodeValue;
		} else {
			return result.firstChild.nodeValue;    		
		}
	} else {
		return "n/a";
	}
}

function play (file) {
	var str =
		'<input type="hidden" id="audioStatus" value="1">' +
		'<EMBED' +
		'	align="right"' +
		'	hidden="true"' +
		'	autostart="true"' +
		'	mastersound' +
		'	id="audioFile"' +
		'	src="' + file + '"' +
		'>' +
		'</EMBED>';
	document.getElementById('audioPlay').innerHTML = str;
}

function pause () {
	var audioFile = document.getElementById('audioFile');
	if (audioFile == null) return;
	eval ('document.getElementById(\'audioFile\').' + (audioFile.PlayState == 2 ? 'Pause' : 'Play') + '()');
}
function stop () {
	var audioFile = document.getElementById('audioFile');
	if (audioFile == null) return;
	document.getElementById('audioFile').Stop();
}

function xwin(url, name, width, height, features){
  var l = (window.screen.availWidth) ? (window.screen.availWidth - width)/2 : 0;
  var t = (window.screen.availHeight) ? (window.screen.availHeight - height)/2 : 0;
  if (typeof(features) == 'string')
     features = ',' + features;

  var w = window.open(url, name, 'top=' + t + ',left=' + l + ',height=' + height + ',width=' + width + ', scrollbars=auto' + features);
  if (!w){
     return;
  }
  w.resizeTo(width, height);
  return w;
}

function MM_findObj(n, d) { //v4.01
	var
		p,
		i,
		x;
		
	if (!d) d=document;
	if (
		(p = n.indexOf("?")) > 0 &&
		parent.frames.length
	) {
		d = parent.frames[n.substring (p + 1)].document;
		n = n.substring (0, p);
	}
	if (
		!(x = d[n]) &&
		d.all
	) x = d.all[n];
	for (i=0; !x && i < d.forms.length; i++) x = d.forms[i][n];
	for (i=0; !x && d.layers && i < d.layers.length; i++) x=MM_findObj (n,d.layers[i].document);
	if (
		!x &&
		d.getElementById
	) x = d.getElementById (n);
	return x;
}
function toggle () { //v6.0
	var
		i,
		p,
		v,
		obj,
		args = toggle.arguments;
		
	for (i=0; i < (args.length-2); i += 3)
		if ((obj=MM_findObj(args[i]))!=null) {
			v=args[i+2];
			if (obj.style) {
			obj=obj.style;
			v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v;
			}
			obj.visibility=v; 
		}
}
	    
function sortBy (key, table, mode) {
	if (mode == 'ASC') mode = 'DESC';
	else mode = 'ASC';
	window.location.href = '?sortTable=' + table +  '&sortField=' + key + '&sortMode=' + mode;
}

function delId (id, table) {
	if (confirm ('Are you sure?')) window.location.href='?delId=' + id + '&table=' + table;
}
function sendText (id) {
	if (confirm ('Are you sure?')) window.location.href='?sendTextId=' + id;
}
function checkAll (object) {
	var elems = object.form.elements;
	for (var i = 0; i < elems.length; i++) {
		var elem = elems[ i ];
		if (elem.type == 'checkbox' && elem != this) {
			elem.checked = object.checked;
		}
	}
}

function debugElement(elem) {
	str = "";
	j = 0;
	for (i in elem) {
		//str+="<center><big>" + i + "</big></center><br/>\n";
		str+=i + "\n";
		j++;
		if (j==20) {
			//document.write(str);
			alert(str);
			str="";
			j = 0;
		}
	}
}

function xwin(url, name, width, height, features){
  var l = (window.screen.availWidth) ? (window.screen.availWidth - width)/2 : 0;
  var t = (window.screen.availHeight) ? (window.screen.availHeight - height)/2 : 0;
  if (typeof(features) == 'string')
     features = ',' + features;

  var w = window.open(url, name, 'top=' + t + ',left=' + l + ',height=' + height + ',width=' + width + features);
  if (!w){
     return;
  }
  w.resizeTo(width, height);
  return w;
}
