function pageLoaded()
{

}

function DoBold(id)
{
	//document.getElementById(id).style.fontStyle="italic";
	document.getElementById(id).style.fontWeight="bold";
	document.getElementById(id).style.cursor="pointer";
	sound('Hover');
}
function DoOut(id)
{
	//document.getElementById(id).style.fontStyle="normal";
	document.getElementById(id).style.fontWeight="normal";
	document.getElementById(id).style.cursor="default";
}
function DoClick(ctl)
{
	var b=ctl.checked;
	ctl.checked=!b;
	reportSelect();
	sound('Click');
}
function sound(noise) {
//THIS SOMETIMES CAUSES JAVASCRIPT ERROR FIRST TIME PAGE IS HIT: document.embeds[noise].play();
	var wav=eval('document.frmData.'+noise);
	if(wav!=null)
	{
		try{eval("wav.play()");}
		catch(exception){}
	}
}
function selectReport(Ncid,ReportType,Commonkey)
	{
		document.frmData.ncid.value=Ncid;
		document.frmData.reporttype.value=ReportType;
		document.frmData.comonkeyvalue.value=Commonkey;
		document.frmData.submit();
	}
	
//M Virendra send session id to delete and ncid to dispaly
//function deleteReport(Ncid)
function deleteReport(Ncid,sesstionid)
	{
		if(confirm('Permanently delete report '+Ncid+'?'))
		{
			//document.frmData.ncid.value=Ncid;
			
			document.frmData.sessionid.value=sesstionid;
			document.frmData.action="home.asp";
			document.frmData.submit();
		}
	}
		
function reportSelect()
{
	var bEnable=checkboxEnforce();
	document.frmData.btnSubmit.disabled=(!bEnable);
	sound('Click');
}

function homeSubmit()
{
	var b=checkboxEnforce();
	if(!b)
	{
		alert('Please select at least one item to include in the report.');
		return false;
	}
			
	return true;
}

function checkboxEnforce()
{
	if(document.frmData.M_Auto.checked)
		return true;
	if(document.frmData.M_PropertyDamage.checked)
		return true;
	if(document.frmData.C_Auto.checked)
		return true;
	if(document.frmData.C_PropertyDamage.checked)
		return true;
	if(document.frmData.C_BodilyInjury.checked)
		return true;
	if(document.frmData.WC.checked)
		return true;
	
	return false;	
}
