function confirm_deletion() {
    var answer = confirm("Delete This Entry?")
     if (answer){
        return true;
     } else {
                return false;
         }
}

function CheckAll(form) {
  for (var i = 0; i < form.elements.length; i++) {
    if(form.elements[i].type == 'checkbox'){
      form.elements[i].checked = !(form.elements[i].checked);
    }
  }
}

function popWin(URL,LEFT,TOP,WIDTH,HEIGHT) {
s = ",left="+LEFT+",top="+TOP+",width="+WIDTH+",height="+HEIGHT;
thisWindow = window.open(URL,"POPUP","location=no,scrollbars=yes,menubar=no,toolbar=no,resizable=yes"+s);
}

function extractPageName(hrefString)
{
	var arr = hrefString.split('.');
	arr = arr[arr.length-2].split('/');
	return arr[arr.length-1].toLowerCase();		
}

function setActiveMenu(arr, crtPage)
{
	for(var i=0; i < arr.length; i++)
		if(extractPageName(arr[i].href) == crtPage)
		{
			arr[i].className = "current";
			arr[i].parentNode.className = "current";
		}
}

function setPage()
{
	if(document.location.href) 
		hrefString = document.location.href;
	else
		hrefString = document.location;

	if (document.getElementById("subnav")!=null) 
		setActiveMenu(document.getElementById("subnav").getElementsByTagName("a"), extractPageName(hrefString));
}
