function EmailReport(strLink,strWindowName)
{
	window.open("EmailReports.asp?link=" + strLink,strWindowName,"width=510,height=290")
}


function EmailInvoice(strLink,strWindowName)
{
	window.open("../acc/EmailInvoice.asp?link=" + strLink,strWindowName,"width=510,height=290")
}

function openReportResultsWindow(strTargetWindow, nWidth, nHeight)
{
	window.open("", strTargetWindow, "width=" + nWidth + ",height=" + nHeight + ",resizable=yes,toolbar=no,scrollbars=yes,top=15,left=15") ;
}

function getSelectedOptionIndex(optOptionGroup)
{
		
	if ( optOptionGroup != null && optOptionGroup.length == null )
	{
		if ( optOptionGroup.checked == true )
			return 0 ;
		else
			return -1 ;
	}
	else if ( optOptionGroup != null && optOptionGroup.length != null )
	{
		for ( i = 0 ; i < optOptionGroup.length ; i++ )
		{
			if ( optOptionGroup[i].checked == true )
				return i ;
		}
		return -1 ;
	}
}

function getSelectedOptionValue(optOptionGroup)
{
	var selIndex = getSelectedOptionIndex(optOptionGroup) ;
	if ( selIndex == -1 )
	{
		return "No item selected" ;
	}
	else
	{
		if ( selIndex == 0 && optOptionGroup.length == null )
		{
			return optOptionGroup.value ;
		}
		else if ( selIndex > -1 && optOptionGroup.length != null )
		{
			return optOptionGroup(selIndex).value ;
		}
	}
}