function chkForm(f, page) {
	if (document.frmDetective.fname.value == "" || isblank(document.frmDetective.fname.value))
		{
			document.frmDetective.subFlag.value = 1;
		}
	else if (document.frmDetective.findings.value == "" || isblank(document.frmDetective.findings.value))
		{
			document.frmDetective.subFlag.value = 1;
		}


else
		{

				if (document.frmDetective.subFlag.value >= 1)
					{
                                              	document.frmDetective.action = page;
						document.frmDetective.submit();
					}
				else
					{
					  	document.frmDetective.action = "results.asp";
					        document.frmDetective.target = 'results';
                                                window.open('',f.target,'width=635,height=480,scrollbars');
                                                document.frmDetective.submit();
                                                resetForm();
                                                window.location.href = page;
                                                return false;
					}
		}

}


function isblank(svalue)
{
	svalue1 = new String(svalue);
	for(var i = 0; i < svalue1.length; i++)
	{
		var c = svalue1.charAt(i);
		if((c != ' ') && (c != '\n') && (c!='\t')) return false;
	}
	return true;
}

function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

function resetForm()
{
    for (var i = 0; i < document.frmDetective.length; i++)
		{
			document.frmDetective.elements[i].value = '';
		}

}
