	try
	{	var IE = document.all?true:false;
	}catch (e)
	{	IE = true;
	}

	function submitform(idname)
	{	
		if (document.getElementById(idname).value.length == 0)
		{				
			if ('aeiou'.indexOf(idname.substring(0,1))!=-1)
				an = 'n';
			else
				an = '';
			alert("Please provide a"+an+" " + idname);alert("Please provide a " + idname);
			return false;
		}
		return true;
	}

	function confirmlink(linkname)
	{	
		if (confirm("Are you sure you want to delete this entry?"))
		{	window.location=linkname;
		}
	}

var replacedHTML = new Array();

function editComment(id, referer)
{
    el=$(id);
    replacedHTML[id] = '<p id="'+id+'">'+el.innerHTML+'</p>';
    text = el.innerHTML.stripTags();

    rephtml = "<form id=\"editform"+id+"\" class=\"text_form\" action=\"../logic/commentshandler.php\" method=\"POST\">" +
              "<div>" +
                  "<input type=\"hidden\" name=\"action\" value=\"edit\">" +
                  "<input type=\"hidden\" name=\"referer\" value=\""+referer+"\">" +
                  "<input type=\"hidden\" name=\"id\" value=\""+id+"\">" + 
                  "<textarea id=\"updatetext"+id+"\" name=\"text\" rows=\"100\" cols=\"50\" style=\"height: 8em; width: 50ex;\">"+text+"</textarea><br>" + 
                  "<table class=\"button_table\"><tr>" +
                  "<td><button id=\"updatesubmit"+id+"\" type=\"submit\">Update</button></td>" +
                  "<td><a href=\"#\" onclick=\"Element.replace('editform"+id+"', replacedHTML['"+id+"']); return false;\">Cancel</a></td>" +
                  "</table>" + 
              "</div>" +
              "</form>";

    Element.replace(id, rephtml);
    $('updatetext'+id).select();
}

function setMaxHeight(el, param)
{
    h = param.maxHeight;
    if (el.getHeight() > h)
    {
        el.style.height = h + "px";
    }
}

function UpdateEntrySummaryList(id, status_id, param) 
{
    $(status_id).update('<span>Loading entries &hellip;</span>');
    new Ajax.Updater(id,
                     '../public/entrysummarylist.php',
                     { method : 'post',
                       parameters : param,
                       //run scripts to show media players
                       evalScripts : true,
                       insertion : 'bottom',
                       onSuccess : function(transport) {
                            $(status_id).remove();
                       }
                     });
}

