function confirm_delete()
{
input_box=confirm("This will permanently delete this entry!\nClick OK to Continue or Cancel");
if (input_box==true)
{ 
return true; 
}
else
{
return false;
}
}

function getElementsByClassName(classname) {
    if (document.getElementsByTagName) {
         var els = document.getElementsByTagName("*");
         var c = new RegExp('/b^|' + classname + '|$/b');
         var final_array = new Array();
         var n=0;
         for (var i=0; i < els.length; i++) {
              if (els[i].className) {
                   if(c.test(els[i].className)) {
                   final_array[n] = els[i];
                   n++;
                   }
              }
         }
         return final_array;
    } else{return false;}
}
var showhide = "hidden";
function showhideAll(classArray)
{
	x = classArray;
	for (var i = 0;i<x.length;i++)
	{
		if(	showhide == "hidden")
		{
		x[i].style.display = "block";
		}
		 else
		{
		  x[i].style.display = "none";
		}
	}	
		if(	showhide == "hidden")
		{
		showhide = "showing";
		}
		 else
		{
		showhide = "hidden";
		}
	
}
function hideAll(classArray)
{
	x = classArray;
	for (var i = 0;i<x.length;i++)
	{
		  x[i].style.display = "none";
	}	
		showhide = "hidden";
}

/* 
function showhideSingle(id)
{
	if(id.style.display=="block")
	{
		id.style.display="none";
	}
	else
	{
		id.style.display="block";
	}
}
*/
function showhideSingle(ID)
{

	var changeStr;
	var theObj;
	var dispStr;
	
	if (document.getElementById) {
	//alert(ID);
	changeStr = "document.getElementById('" + ID + "')";	
		theObj = eval(changeStr);
		if (theObj) {
			//theObj.style.display = vStr;
			if(theObj.style.display == 'block')
			{
			theObj.style.display = 'none';
			}
			else
			{
			theObj.style.display = 'block';
			}
		}				
	} else if (document.all) {
	//alert('all');
		changeStr = "document.all['" + ID + "']";
		theObj = eval(changeStr);
		if (theObj) {
			//theObj.style.display = vStr;
			if(theObj.style.display == 'block')
			{
			theObj.style.display = 'none';
			}
			else
			{
			theObj.style.display = 'block';
			}
		}									
	} 



}

function hideSingle(id)
{
	id = document.getElementById(id);
		id.style.display="none";
}

function shiftOpacity(id, millisec) {
    //if an element is invisible, make it visible, else make it ivisible
    if(document.getElementById(id).style.opacity == 0) {
        opacity(id, 0, 100, millisec);
    } else {
        opacity(id, 100, 0, millisec);
    }
} 
function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

//alert('loaded');
