
//Check fo the first name field------------------------
function isfirstname(fnm) {

    var str = Trim(fnm.value);
    if (str == "") {
        alert("\nPlease enter your First name")
        fnm.focus();
        return false;
    }
    if ((str.substring(0, 1) < "a" || str.substring(0, 1) > "z") && (str.substring(0, 1) < "A" || str.substring(0, 1) > "Z")) {

        alert("The first name should begin with an alphabetic character.");
        fnm.focus();
        return false;
    }
    for (var i = 1; i < str.length; i++) {
        var ch = str.substring(i, i + 1);
        if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch != ' ')) {
            alert(" invalid name entered");
            fnm.select();
            fnm.focus();
            return false;
        }
    }
    return true;
}

function isUsername(fnm) {

    var str = Trim(fnm.value);
    if (str == "") {
        alert("\nPlease enter your UserName")
        fnm.focus();
        return false;
    }
    return true;
}


function iscity(cty) {

    var str = Trim(cty.value);
    if (str == "") {
        alert("\nPlease enter your City")
        cty.focus();
        return false;
    }
    if ((str.substring(0, 1) < "a" || str.substring(0, 1) > "z") && (str.substring(0, 1) < "A" || str.substring(0, 1) > "Z")) {
        alert("The name should begin with an alphabetic character.");
        cty.focus();
        return false;
    }
    for (var i = 1; i < str.length; i++) {
        var ch = str.substring(i, i + 1);
        if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch != ' ')) {
            alert("\nInvalid name entered.");
            cty.select();
            cty.focus();
            return false;
        }
    }
    return true;
}
function chkEMail(obj, msg, lbl) {

    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (obj.value != "") {
        if (filter.test(obj.value)) {
            return true;
        }
    }
    if (obj.value == "") {
        return true;
    }
    obj.focus();
    lbl.innerHTML = msg;
    return false;
}
//check for the company name 
function iscompany(cmp) {
    var str = Trim(cmp.value);
    if (str == "") {
        alert("\nThe Company field is blank .\n\nPlease enter your Company");
        cmp.focus();
        return false;
    }

    return true;
}


//Check for the E-Mail address
function isemail(eml) {
    var str = Trim(eml.value);
    var str1 = eml.value.length;

    if (str == "") {
        alert("\nThe email field is blank .\n\nPlease enter your email id.");
        eml.focus();
        return false;

        return true;
    }

    if (str.indexOf("@") == -1 || str.indexOf(".") == -1) {
        alert("Please enter the correct E-mail ID");
        eml.focus();
        return false;
    }
    if ((str.substring(0, 1) == "@" || str.substring(0, 1) == ".") || str.substring(0, 1) == "-" || str.substring(0, 1) == "_") {
        alert("The Email ID can not begin with @ or . or - or _ ");
        eml.focus();
        return false;
    }
    if ((str.substring(str1 - 1, str1) == "@" || str.substring(str1 - 1, str1) == "." || str.substring(str1 - 1, str1) == "-")) {
        alert("The Email ID can not end with @ or . ");
        eml.focus();
        return false;
    }


    var index1 = str.indexOf("@");
    var index2 = str.indexOf(".");
    var index3 = str.indexOf("-");
    var index4 = str.indexOf("_");

    if (str.substring(index1 + 1, index1 + 2) == ".") {
        alert(". can not come immidately after @");
        eml.focus();
        return false;
    }

    if (str.substring(index1 - 1, index1) == ".") {
        alert(". can not come immidately before @");
        eml.focus();
        return false;
    }
    if ((index3 == index1 + 1) || (index4 == index1 + 1)) {
        alert("please enter the correct Email ID as no two special chars can come in sequence");
        eml.focus();
        return false;
    }
    for (var i = 0; i < str.length; i++) {
        var ch = str.substring(i, i + 1);
        if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch < "0" || "9" < ch) && (ch != '_') && ch != '-' && ch != '@' && ch != '.') {
            alert("\nThe Email field accepts letters,numbers & underscore.Please re-enter Email id. ");
            // eml.select();
            eml.focus();
            return false;
        }
    }
    return true;
}



//Check for the date field---------------------------
/**
* DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
// Declaring valid date character, minimum year and maximum year
var dtCh = "/";
var minYear = 1900;
var maxYear = 2100;

function isInteger(s) {
    var i;
    for (i = 0; i < s.length; i++) {
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function stripCharsInBag(s, bag) {
    var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary(year) {
    // February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ((!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28);
}
function DaysArray(n) {
    for (var i = 1; i <= n; i++) {
        this[i] = 31
        if (i == 4 || i == 6 || i == 9 || i == 11) { this[i] = 30 }
        if (i == 2) { this[i] = 29 }
    }
    return this
}
function isDate(dtStr) {
    var daysInMonth = DaysArray(12)
    var pos1 = dtStr.indexOf(dtCh)
    var pos2 = dtStr.indexOf(dtCh, pos1 + 1)
    var strMonth = dtStr.substring(0, pos1)
    var strDay = dtStr.substring(pos1 + 1, pos2)
    var strYear = dtStr.substring(pos2 + 1)
    strYr = strYear
    if (strDay.charAt(0) == "0" && strDay.length > 1) strDay = strDay.substring(1)
    if (strMonth.charAt(0) == "0" && strMonth.length > 1) strMonth = strMonth.substring(1)
    for (var i = 1; i <= 3; i++) {
        if (strYr.charAt(0) == "0" && strYr.length > 1) strYr = strYr.substring(1)
    }
    month = parseInt(strMonth)
    day = parseInt(strDay)
    year = parseInt(strYr)
    if (pos1 == -1 || pos2 == -1) {
        alert("The date format should be : mm/dd/yyyy");
        return false
    }
    if (strMonth.length < 1 || month < 1 || month > 12) {
        alert("Please enter a valid month");
        return false
    }
    if (strDay.length < 1 || day < 1 || day > 31 || (month == 2 && day > daysInFebruary(year)) || day > daysInMonth[month]) {
        alert("Please enter a valid day")
        return false
    }
    if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear) {
        alert("Please enter a valid 4 digit year between " + minYear + " and " + maxYear);
        return false
    }
    if (dtStr.indexOf(dtCh, pos2 + 1) != -1 || isInteger(stripCharsInBag(dtStr, dtCh)) == false) {
        alert("Please enter a valid date");
        return false
    }
    return true
}
//end of the date check function ------------------ 


//call to the checks of date for Last night block----------
function ValidDate(dt) {
    if (Trim(dt.value) == "") {
        alert('\nThe date field is blank.\n\nPlease enter date.');
        dt.focus();
        return false;
    }
    else {
        if (isDate(Trim(dt.value)) == false) {
            dt.focus();
            return false
        }
        return true
    }
    return true;
}

function CheckDate(dtStr) {
    var daysInMonth = DaysArray(12)
    var pos1 = dtStr.indexOf(dtCh)
    var pos2 = dtStr.indexOf(dtCh, pos1 + 1)
    var strMonth = dtStr.substring(0, pos1)
    var strDay = dtStr.substring(pos1 + 1, pos2)
    var strYear = dtStr.substring(pos2 + 1)
    strYr = strYear
    if (strDay.charAt(0) == "0" && strDay.length > 1) strDay = strDay.substring(1)
    if (strMonth.charAt(0) == "0" && strMonth.length > 1) strMonth = strMonth.substring(1)
    for (var i = 1; i <= 3; i++) {
        if (strYr.charAt(0) == "0" && strYr.length > 1) strYr = strYr.substring(1)
    }
    month = parseInt(strMonth)
    day = parseInt(strDay)
    year = parseInt(strYr)
    if (pos1 == -1 || pos2 == -1) {
        return false
    }
    if (strMonth.length < 1 || month < 1 || month > 12) {
        return false
    }
    if (strDay.length < 1 || day < 1 || day > 31 || (month == 2 && day > daysInFebruary(year)) || day > daysInMonth[month]) {
        return false
    }
    if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear) {
        return false
    }
    if (dtStr.indexOf(dtCh, pos2 + 1) != -1 || isInteger(stripCharsInBag(dtStr, dtCh)) == false) {
        return false
    }
    return true
}
//end of the date check function ------------------ 


//call to the checks of date for Last night block----------
function ValidDateCheck(obj, msg, lbl) {

    if (Trim(obj.value) != "") {
        if (CheckDate(Trim(obj.value)) == false) {
            lbl.innerHTML = msg;
            obj.focus();
            return false
        }
        return true
    }
    return true;
}


//End date check------------------------------------
//Check for valid date that is checked if field is not blank
function IsDateNotBlank(dt) {
    if (Trim(dt.value) != "") {
        if (isDate(Trim(dt.value)) == false) {
            alert('Please enter date value');
            dt.focus();
            return false
        }
        return true;
    }
    return true;
}


//Check for the phone number field
function isphone(phn) {
    var StrPhone = Trim(phn.value);
    if (isNaN(StrPhone)) {
        alert("Please enter numeric value in phone number field");
        phn.select();
        phn.focus();
        return false;

    }
    else {
        if (StrPhone == "") {
            alert("\nThe phone number field is blank .\n\nPlease enter phone number.");
            phn.focus();
            return false;
        }
        if ((StrPhone.substring(0, 1) < "0" || StrPhone.substring(0, 1) > "9")) {
            alert("The phone should begin with an numeric character.");
            phn.focus();
            return false;
        }
        return true;
    }
    return true;
}

function isNumOfRooms(room) {
    if (Trim(room.value) == "") {
        alert("\nNumber of rooms field is blank\n\n Please Enter nunber of rooms required");
        room.focus();
        return false;
    }
    else {
        if (isNaN(Trim(room.value))) {
            alert('Please enter numeric value for Number Of Rooms field');
            room.focus();
            return false;
        }
        return true;
    }
    return true;
}

//Function for checking the valid URL or website name
function validurl(ur) {
    var v = new RegExp();
    if (Trim(ur.value) != "") {
        v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
        if (!v.test(Trim(ur.value))) {
            alert("You must supply a valid URL.");
            ur.focus();
            return false;
        }
        return true;
    }
    return true;
}

//check for the fax number---------------
function isfax(fax) {
    var str = Trim(fax.value);
    if (str != "") {
        if (isNaN(str)) {
            alert("Please enter the numeric value in Fax field");
            fax.select();
            fax.focus();
            return false;
        }
        if ((str.substring(0, 1) < "0" || str.substring(0, 1) > "9")) {
            alert("The Fax should begin with an numeric character.");
            fax.focus();
            return false;
        }
        return true;
    }
    return true;
}

//Check for correct e-mail id-----------------


function IsEmptyLbl(obj, msg, lbl) {
    var str = Trim(obj.value);
    if (str == "") {
        lbl.innerHTML = msg;
        obj.focus();
        return false;
    }

    return true;
}

//Check for correct length----------------
function IsValidLength(obj, msg, lbl, length) {
    alert(obj.value);
    var str = Trim(obj.value.length);
    if (str > length) {
        lbl.innerHTML = msg;
        obj.focus();
        return false;
    }

    return true;
}

//Check for correct length----------------
function CheckMinLength(obj, msg, lbl, len) {
    alert(obj);
    var str = Trim(obj.value.length);
    if (str < len) {
        lbl.innerHTML = msg;
        obj.focus();
        return false;
    }

    return true;
}

//Check for a blank field
function IsEmpty(obj, msg) {

    var str = Trim(obj.value);
    if (str == "") {
        alert(msg)
        obj.focus();
        return false;
    }

    return true;
}

//Check for nmumeric value only not blank
function IsNumeric(NumVal, msg, lbl) {
    if (Trim(NumVal.value) != "") {
        var num = Trim(NumVal.value);
        if (isNaN(num)) {
            lbl.innerHTML = msg;
            NumVal.focus();
            return false;
        }
        return true;
    }
    return true;
}

//Function for check if the checkbox is checked but text box related is empty------------------
function IsChecked(checkbox, textbox, message) {
    if (checkbox.checked == true) {
        if (textbox.value == "") {
            alert(message);
            textbox.focus();
            return false;
        }
    }
    return true;
}

//Function for check if the checkbox is not checked but text box related is filled------------------
function IsNotChecked(checkbox, textbox, message) {
    if (checkbox.checked == false) {
        if (textbox.value != "") {
            alert(message);
            checkbox.focus();
            return false;
        }
    }
    return true;
}
//Check fo the  name field that should not be blank------------------------
function IsName(fnm, msg, lbl) {
    var str = Trim(fnm.value);
    if (str == "") {
        lbl.innerHTML = msg;
        fnm.focus();
        return false;
    }
    if ((str.substring(0, 1) < "a" || str.substring(0, 1) > "z") && (str.substring(0, 1) < "A" || str.substring(0, 1) > "Z")) {
        lbl.innerHTML = msg;
        fnm.focus();
        return false;
    }
    for (var i = 1; i < str.length; i++) {
        var ch = str.substring(i, i + 1);
        if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch != ' ')) {
            lbl.innerHTML = msg;
            fnm.select();
            fnm.focus();
            return false;
        }
    }
    return true;
}

//Check for the valid alphanumeric field without blank name--------------
function isValidChar(StrObj, msg) {
    var str = Trim(StrObj.value);
    if (str != "") {
        if (IsValidAlphaNumeric(str) == false) {
            //alert('\n' + msg + '\n\n it can be alphanumeric only');
            alert(msg);
            StrObj.focus();
            return false;
        }
        return true;
    }
    return true;
}

//Function for checking wether charecters are entered or not
function isValidAlpha(StrObj, msg) {
    var str = Trim(StrObj.value);
    if (str != "") {
        if (IsValidAlphaValue(str) == false) {
            //alert('\n' + msg + '\n\n It has to be in characters only');
            alert(msg);
            StrObj.focus();
            return false;
        }

        return true;
    }
    return true;
}

//Function Check for valid alphanumeric value
function IsValidAlphaNumeric(strVal) {
    var sValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "; //valid characters a supplied string can have
    strVal = new String(strVal); //Convert the value to a string
    var bReturn = true;
    var i = new Number(0);
    while ((bReturn) && (i < strVal.length)) {
        bReturn = (sValidChars.indexOf(strVal.charAt(i)) >= 0);
        i++;

    }
    return bReturn;
}


//Check for valid alphabet value
function IsValidAlphaValue(strVal) {
    var sValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "; //valid characters a supplied string can have
    strVal = new String(strVal); //Convert the value to a string
    var bReturn = true;
    var i = new Number(0);
    while ((bReturn) && (i < strVal.length)) {
        bReturn = (sValidChars.indexOf(strVal.charAt(i)) >= 0);
        i++;

    }
    return bReturn;
}
//check for valid pin number/Postal code value----------
function ispinnumber(pin) {

    var str = Trim(pin.value);
    if (isNaN(str)) {
        alert("Please enter numeric value for postal code field");
        pin.select();
        pin.focus();
        return false;
    }
    if (str == "") {
        alert("\nThe postal code is blank .\n\nPlease enter your postal code.")
        pin.focus();
        return false;
    }
    if ((str.substring(0, 1) < "0" || str.substring(0, 1) > "9")) {
        alert("The postal code should begin with an numeric character.");
        pin.select();
        pin.focus();
        return false;
    }
    return true;
}
//Function for validating a valid mobile number
function IsMobile(mobile) {
    str = Trim(mobile.value);
    //var str = document.forms[0].mobile.value;

    if (str != "") {
        if (isNaN(str)) {
            alert("Please enter numeric value in Mobile field");
            mobile.select();
            mobile.focus();
            return false;
        }

        if ((str.substring(0, 1) < "0" || str.substring(0, 1) > "9")) {
            alert("The Mobile should begin with an numeric character.");
            mobile.focus();
            return false;
        }
    }
    return true;
}
//Validating dropdown list if selected index is 0 
function IsValideSeltion(ddl, msg, lbl) {
    if (ddl.selectedIndex == 0) {
        //  alert("Please select valid value " + msg);
        lbl.innerHTML = msg;
        ddl.focus();
        return false;
    }
    return true;
}
//Hard coded section starts here------------------
//Checking if the both is selected and 
function isbothselected(chkbooth48, ddlBooth) {
    if (chkbooth48.checked == true) {
        if (ddlBooth.selectedIndex == 0) {
            alert('\nIf you have selected other field \n\nthen please select valid booth.');
            ddlBooth.focus();
            return false;
        }
        return true;
    }
    return true;
}

//Check for the booth in the dropdown list
function ischkbooth(chkotherBooth, ddlbooth1) {
    if (chkotherBooth.checked == false) {
        if (ddlbooth1.selectedIndex != 0) {
            alert('\nPlease check the 48 sq mt.& above checkbox\n\nas you have selected the value of booth from the dropdownlist  .');
            chkotherBooth.focus();
            return false;
        }
        return true;
    }
    return true;

}


//end check
//checking all the checkboxes of type booth for blank or unchecked--------------------
function ischeckbooth(chk12, chk24, chk36, chk48, chkAbove) {

    if (chk12.checked == false && chk24.checked == false && chk36.checked == false && chk48.checked == false && chkAbove.checked == false) {
        alert("Please select the type of booth");
        chk12.focus();
        return false;
    }
    return true;
}
//Check ends here----------------------------------
//Hard coded section ends here---------------------------------

function Trim(TRIM_VALUE) {
    if (TRIM_VALUE.lenth < 1) {
        return "";
    }
    TRIM_VALUE = RTrim(TRIM_VALUE);
    TRIM_VALUE = LTrim(TRIM_VALUE);
    if (TRIM_VALUE == "") {
        return "";
    }
    else {
        return TRIM_VALUE;
    }
}

function RTrim(VALUE) {
    var w_space = String.fromCharCode(32);
    var v_length = VALUE.length;
    var strTemp = "";
    if (v_length < 0) {
        return "";
    }
    var iTemp = v_length - 1;
    while (iTemp > -1) {
        if (VALUE.charAt(iTemp) == w_space) {
        }
        else {
            strTemp = VALUE.substring(0, iTemp + 1);
            break;
        }
        iTemp = iTemp - 1;
    }
    return strTemp;
}

function LTrim(VALUE) {
    var w_space = String.fromCharCode(32);
    if (v_length < 1) {
        return "";
    }
    var v_length = VALUE.length;
    var strTemp = "";
    var iTemp = 0;
    while (iTemp < v_length) {
        if (VALUE.charAt(iTemp) == w_space) {
        }
        else {
            strTemp = VALUE.substring(iTemp, v_length);
            break;
        }
        iTemp = iTemp + 1;
    }
    return strTemp;
}

//check for the title 
function isTitle(obj) {
    var str = Trim(obj.value);
    if (str == "") {
        alert("\nThe title field is blank .\n\nPlease enter title");
        obj.focus();
        return false;
    }

    return true;
}
//to validate country
function iscountry(ctry) {
    var str = Trim(ctry.value);
    if (str == "") {
        alert("\nThe Country field is blank.\n\nPlease enter Country name");
        ctry.focus();
        return false;
    }

    return true;
}

//to validate state
function isstate(state) {
    var str = Trim(state.value);
    if (str == "") {
        alert("\nThe State field is blank.\n\nPlease enter State name");
        state.focus();
        return false;
    }

    return true;
}

// JScript File

//Generating Pop-up Print Preview page
function getPrint(print_area) {
    //Creating new page
    var pp = window.open();
    //Adding HTML opening tag with <HEAD> … </HEAD> portion 
    pp.document.writeln('<HTML><HEAD><title>Print Preview</title>')
    // pp.document.writeln('<LINK href=../Styles/style.css type="text/css" rel="stylesheet">')
    //    pp.document.writeln('<LINK href="../Styles/style.css" type="text/css" rel="stylesheet">')
    //    pp.document.writeln('<LINK href="../../Styles/style.css" type="text/css" rel="stylesheet">')
    //    pp.document.writeln('<script>alert("init");</script>')
    //    pp.document.writeln("<script type='text/javascript' src='../JS/ig_shared.js'></script>")
    //    pp.document.writeln('<script>alert("initdone");</script>')
    //    pp.document.writeln("<script type='text/javascript' src='../JS/ig_webPanel.js'></script>")
    //pp.document.writeln("<script type='text/javascript' src='../JS/ig_calendar.js'></script>");
    pp.document.writeln('<base target="_self"></HEAD>')
    //Adding Body Tag
    pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0"');
    pp.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
    //Adding form Tag
    pp.document.writeln('<form method="post">');
    //Creating two buttons Print and Close within a HTML table
    pp.document.writeln("<TABLE width='100%'><TR><TD align='center'>");
    //    pp.document.writeln(document.getElementById(header).innerHTML);
    pp.document.writeln('<INPUT ID="PRINT" type="button" value="Print" ');
    pp.document.writeln('onclick="javascript:location.reload(true);window.print();">');
    pp.document.writeln("<INPUT ID='CLOSE' type='button' value='Close' onclick='window.close();'>");
    pp.document.writeln("</TD></TR><TR><TD colspan = '2'>&nbsp; </TD></TR>");
    pp.document.writeln("<TR><TD>");
    pp.document.writeln(document.getElementById(print_area).value);
    pp.document.writeln("</TD><td >&nbsp;</td></TR></table>");
    //Ending Tag of </form>, </body> and </HTML>
    pp.document.writeln('</form></body></HTML>');
}

function IsValidAlphaNumeric(strVal) {
    var sValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "; //valid characters a supplied string can have
    strVal = new String(strVal); //Convert the value to a string
    var bReturn = true;
    var i = new Number(0);
    while ((bReturn) && (i < strVal.length)) {
        bReturn = (sValidChars.indexOf(strVal.charAt(i)) >= 0);
        i++;

    }
    return bReturn;
}



//Check for a blank field
function IsEmptyLogin(obj, msg, objlblerror) {
    alert('tezt');
    var str = Trim(obj.value);
    if (str == "") {
        objlblerror.innerText = msg;
        obj.focus();
        return false;
    }

    return true;
}

//Check for a blank field
function IsEmptyValue(str, msg) {

    (str == "")
    {
        alert(msg)
        obj.focus();
        return false;
    }

    return true;
}

//To match password and confirm password fields

function matchPwd(pwd, cpwd) {
    var str = Trim(pwd.value)
    var str1 = Trim(cpwd.value)

    if (str != str1) {
        alert("Password and Confirm Password not matching, Please re-enter ! ");
        cpwd.focus();
        return false;
    }
    return true;
}

function CheckSelectionBoth(ddl, txt, index, msg) {

    //alert(ddl.selectedIndex + txt.value + index + msg);
    if (ddl.selectedIndex == index) {
        if (txt.value == "") {
            alert(msg);
            txt.focus();
            return false;
        }
    }


    if (ddl.selectedIndex == 0) {
        alert(msg);
        ddl.focus();
        return false;
    }
    return true;

}

function CheckSelectionBothDiv(ddl, txt, index, msg, div) {

    //alert(ddl.selectedIndex + txt.value + index + msg);
    // if(ddl.selectedIndex == index)
    if (ddl.value == "Others") {
        if (div.style.display == "block") {
            if (txt.value == "") {
                alert(msg);
                txt.focus();
                return false;
            }
        }
    }

    if (ddl.selectedIndex == 0) {
        alert(msg);
        ddl.focus();
        return false;
    }
    return true;

}


//Check for nmumeric value only not blank
function IsNumericRet(NumVal) {
    if (Trim(NumVal.value) != "") {
        var num = Trim(NumVal.value);
        if (isNaN(num)) {
            return false;
        }
        return true;
    }
    return true;
}

function CheckMail(txtEmailId, strMsg) {
    return true;
}

function CheckIndex(obj, msg, indx, lbl) {
    // alert(obj);
    if (indx == 0) {
        lbl.innerHTML = msg;
        obj.focus();
        return false;
    }
    return true;
}
function IsNameMsg(fnm, msg) {

    var str = Trim(fnm.value);
    if (str == "") {
        alert("\n" + msg)
        fnm.focus();
        return false;
    }
    if ((str.substring(0, 1) < "a" || str.substring(0, 1) > "z") && (str.substring(0, 1) < "A" || str.substring(0, 1) > "Z")) {
        alert(msg);
        fnm.focus();
        return false;
    }
    for (var i = 1; i < str.length; i++) {
        var ch = str.substring(i, i + 1);
        if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch != ' ')) {
            alert("\nInvalid name entered.");
            fnm.select();
            fnm.focus();
            return false;
        }
    }
    return true;
}

//Check for nmumeric value only not blank
function CheckNumericRange(NumVal, Range, msg, lbl) {
    if (Trim(NumVal.value) != "") {
        var num = Trim(NumVal.value);
        if (num > Range) {
            lbl.innerHTML = msg;
            NumVal.focus();
            return false;
        }
        return true;
    }
    return true;
}







