function getLoginDetails(abc)
{
    if (abc == "")
    {
        document.getElementById("noLog").style.display = "inline";
        document.getElementById("yesLog").style.display = "none";
    }
    if (abc != "")
    {
        document.getElementById("noLog").style.display = "none";
        document.getElementById("yesLog").style.display = "inline";
    }
}

function funcLogin()
{
    if (document.frmLogin.txt_username.value == "")
    {
        alert("Enter user name");
        document.frmLogin.txt_username.focus();
        return  ;
    }
    else if (document.frmLogin.txt_password.value == "")
    {
        alert("Enter user password");
        document.frmLogin.txt_password.focus();
        return;
    }
    else
    {
        document.frmLogin.action = "common/login.asp?act=login";
        document.frmLogin.submit();
    }
}

function funcLogout()
{
    document.frmLogin.action = "common/login.asp?act=logout";
    document.frmLogin.submit();
}

function page()
{
    alert("Sorry, you are not authorised to view this page.");
}

function valPoll()
{
    var totRad = document.FrmPoll.poll_answer.length;
    var selected = 0;

    for (var i=0; i<totRad; i++)
    {
        if (document.FrmPoll.poll_answer[i].checked == true)
            selected = selected + 1;
    }

    if (selected == 0)
    {
        alert("Select an answer");
    }

    if (selected == 1)
    {
        document.FrmPoll.submit();
    }
}

function funcSearch()
{
    if (document.frmSearch.txtsearch.value == "")
    {
        alert("Enter search keyword");
        document.frmSearch.txtsearch.focus();
        return;
    }
    else
    {
        document.frmSearch.submit();
    }
}

function funcSearchDir()
{
    if (document.frmSearchDir.txtsearchDir.value == "")
    {
        alert("Enter search keyword");
        document.frmSearch.txtsearchDir.focus();
        return;
    }
    else
    {
        document.frmSearchDir.submit();
    }
}

function funcFaqSearch()
{
    if (document.frmFAQSearch.txtFaqSearch.value == "")
    {
        alert("Enter search keyword");
        document.frmFAQSearch.txtFaqSearch.focus();
        return false;
    }
    else
    {
        document.frmFAQSearch.hidFaqSrc.value = "faqSrchSub";
        document.frmFAQSearch.submit();
    }
}

function echeck(str) {

    var at = "@"
    var dot = "."
    var lat = str.indexOf(at)
    var lstr = str.length
    var ldot = str.indexOf(dot)
    if (str.indexOf(at) == -1) {
        alert("Invalid E-mail ID")
        return false
    }

    if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {
        alert("Invalid E-mail ID")
        return false
    }

    if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) {
        alert("Invalid E-mail ID")
        return false
    }

    if (str.indexOf(at, (lat + 1)) != -1) {
        alert("Invalid E-mail ID")
        return false
    }

    if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {
        alert("Invalid E-mail ID")
        return false
    }

    if (str.indexOf(dot, (lat + 2)) == -1) {
        alert("Invalid E-mail ID")
        return false
    }

    if (str.indexOf(" ") != -1) {
        alert("Invalid E-mail ID")
        return false
    }

    return true
}