﻿// JScript File

function FeedBack()
{
    var result = true;
    var StrMsg = "<strong style=\"color:red;\">" + "!Oops Fields Missing" + "</strong><br /><br />";
    var txtEmailid = GetElement("ctl00_cphmain_userEmailId" );    
    
    if(trimAll(txtEmailid.value).length == 0)
    {
        StrMsg += " Email ID is Empty.\n";
        if(result == true)
        {
            txtEmailid.focus();
        }
        result = false;    
    }
    else
    {
        if(!validateEmail(trimAll(txtEmailid.value)))
        {
            StrMsg += " Enter Valid Email ID.\n";
            if(result == true)
            {
                txtEmailid.focus();
            }
            result = false;            
        }
    }
    if(!result)
    {
        document.getElementById("ctl00_lblErrMsg").innerHTML = StrMsg;
        document.getElementById("ctl00_btnHidden").click();
        return false;
    }
    return result;
}

function MaxLength(e , id)
{
    if(!e)e = window.event;
	var key = (typeof e.which == 'number')?e.which:e.keyCode;	
	var len = id.value.length;
	
	if(len >= 2000)
	{
	    if(key == 8 || key <= 0 )
	    {
	        return true;
	    }
	    else
	    {
	        return false;
	    }
	}
	else
	{
	    return true;
	}
}