var ie = true;

/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, thePointerColor)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') 
	{
        return false;
    }

    var row_cells_cnt = theRow.cells.length;
    
	for (var c = 0; c < row_cells_cnt; c++) 
	{
        theRow.cells[c].bgColor = thePointerColor;
    }

    return true;
} // end of the 'setPointer()' function

function CCA(CB)
{
	if (CB.checked)
		hL(CB);
	else
		dL(CB);
}


function hL(E)
{
	if (ie)
	{
		while (E.tagName!="TR")
		{
			E=E.parentElement;
		}
	}
	else
	{
		while (E.tagName!="TR")
		{
			E=E.parentNode;
		}
	}
	
	E.className = "H";
}

function dL(E)
{
	if (ie)
	{
		while (E.tagName!="TR")
		{
			E=E.parentElement;
		}
	}
	else
	{
		while (E.tagName!="TR")
		{
			E=E.parentNode;
		}
	}
	
E.className = "L";
}

function winPop(filename,name,details)
        	{
           	     window.open(filename,name,details);
        	}
			
function DoSendEmail()
{
	if (confirm("Please be patient. Sending emails may take several seconds."))
		return true;
	else
		return false;
}

function swapImgRestore() 
{ 
  var i,x,a=document.s4_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() 
{ 
  var d=document; if(d.images){ if(!d.s4_p) d.s4_p=new Array();
    var i,j=d.s4_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.s4_p[j]=new Image; d.s4_p[j++].src=a[i];}}
}

function findObj(n, d) 
{ 
  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=findObj(n,d.layers[i].document); return x;
}

function swapImage() 
{ 
  var i,j=0,x,a=swapImage.arguments; document.s4_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.s4_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function DoEmpty()
{
	if (confirm("Are you sure you want to permanently delete this record?"))
		return true;
	else
		return false;
}
