<!-- //Begin to hide script contents from old browsers.


function doGlobalLoad(sender)
{
	sender.setformfocus();
	if (window.doLocalLoad)
	{
		doLocalLoad();
	}
	if (window.opener && !window.opener.closed)
	{
		if (document.getElementById("closebtn"))
		{
			document.getElementById("closebtn").style.display='block';
		}
		if (document.getElementById("returnbtn"))
		{
			document.getElementById("returnbtn").style.display='none';
		}
	}
	else
	{
		if (document.getElementById("returnbtn"))
		{
			document.getElementById("returnbtn").style.display='block';
		}
		if (document.getElementById("closebtn"))
		{
			document.getElementById("closebtn").style.display='none';
		}
	}
}
function setformfocus()
{
	//if (document.forms.length>0) document.forms[0].elements[0].focus();
	var username=document.getElementById('username');
	if (username)
	{
		username.focus();
	}
}

function confirm_delete(str)
{
	if (str)
	{
		str=' '+str;
	}
	var result=confirm('Are you Sure you want to delete'+str+'?');
	return result;
}
function formatDecimal(num)
{
	var decimals=2;
	var tmpnum=num;
	tmpnum *= Math.pow(10, decimals);
	tmpnum = Math.floor(tmpnum);
	tmpnum /= Math.pow(10, decimals);
	var tmpstr=new String(tmpnum);
	// round it to 2 decimal places
	//tmpnum = "" + ((Math.round(tmpnum * 100)) / 100);

	var dec1 = tmpstr.substring(tmpstr.length-3, tmpstr.length-2);
	var dec2 = tmpstr.substring(tmpstr.length-2, tmpstr.length-1);

	if (dec1 != '.') 
	{
		 // adds trailing zeroes if necessary
		if (dec2 == '.') tmpstr += "0";
		else tmpstr += ".00";	
	}
	return tmpstr;
}


//-->
