function openHelpWindow(pPath)
{
	var w=440,h=500;
	var win=newPWindow(pPath,"helpwin",w,h,0,0,0,0,1,0,parseInt(screen.availWidth-450),"0");
	//if((!win||win.closed)&&(typeof(ebHelpStrPopupBlocked)=="string"))
	//	alert(ebHelpStrPopupBlocked);return false;
}

function newPWindow(url,name,width,height,toolbar,location,status,scrollbars,resizable,menubar,left,top,customprops)
{
	if (left==-1 && top==-1)
	{
		ax = (screen.width-width)/2;
		ay = (screen.height-height)/2;
		left = ax;
		top = ay;
	}
	var props="";
	if(width)props+=",width="+width;
	if(height)props+=",height="+height;
	if(toolbar)props+=",toolbar="+toolbar;
	if(location)props+=",location="+location;
	if(status)props+=",status="+status;
	if(scrollbars)props+=",scrollbars="+scrollbars;
	if(resizable)props+=",resizable="+resizable;
	if(menubar)props+=",menubar="+menubar;
	if(left)props+=",screenX="+left+",left="+left;
	if(top)props+=",screenY="+top+",top="+top;
	if(customprops)props+=","+customprops;
	if(props!="")props=props.substring(1);
	var w=window.open(url,name,props);
	w.focus();
	return w;
}
function openWin(targetURL,x,y)
{
	windowLeft = screen.width/2 - x/2;
	windowTop = screen.height/2 - y/2;
	tmp = window.open(targetURL,'bulletinWin','width='+x+',height='+y+',left=' + windowLeft + ',top=' + windowTop + 'status=no,toolbar=no,scrollbars=1,menubar=no,location=no')
	
}

function round_decimals(original_number, decimals) {
    var result1 = original_number * Math.pow(10, decimals)
    var result2 = Math.round(result1)
    var result3 = result2 / Math.pow(10, decimals)
    return pad_with_zeros(result3, decimals)
}

function pad_with_zeros(rounded_value, decimal_places) {

    // Convert the number to a string
    var value_string = rounded_value.toString()
    
    // Locate the decimal point
    var decimal_location = value_string.indexOf(".")

    // Is there a decimal point?
    if (decimal_location == -1) {
        
        // If no, then all decimal places will be padded with 0s
        decimal_part_length = 0
        
        // If decimal_places is greater than zero, tack on a decimal point
        value_string += decimal_places > 0 ? "." : ""
    }
    else {

        // If yes, then only the extra decimal places will be padded with 0s
        decimal_part_length = value_string.length - decimal_location - 1
    }
    
    // Calculate the number of decimal places that need to be padded with 0s
    var pad_total = decimal_places - decimal_part_length
    
    if (pad_total > 0) {
        
        // Pad the string with 0s
        for (var counter = 1; counter <= pad_total; counter++) 
            value_string += "0"
        }
    return value_string
}

function showDiv(checkref,refStr)
{
	ref = document.getElementById(refStr);
	
	if (checkref.checked)
	{
		ref.style.display="";
	}
	else
	{
		ref.style.display="none";
	}

}


