function showError(txtField, errorMsg) {
    txtField.style.border = "1px solid #FF0000";
    txtField.placeholder = errorMsg;
}

function removeError(txtField) {
    txtField.style.border = "1px solid #cfdadd";
}
var cahrcode1 = {
    "31": "", "32": " ", "33": "!", "34": "\"", "35": "#",
    "36": "$", "37": "%", "38": "&", "39": "'", "40": "(",
    "41": ")", "42": "*", "43": "+", "44": ",", "45": "-",
    "46": ".", "47": "/", "48": "0", "49": "1", "50": "2",
    "51": "3", "52": "4", "53": "5", "54": "6", "55": "7",
    "56": "8", "57": "9", "58": ":", "59": ";", "60": "<",
    "61": "=", "62": ">", "63": "?", "64": "@",
    "91": "[", "92": "\\", "93": "]", "94": "^", "95": "_",
    "96": "`", "123": "{", "124": "|", "125": "}",
    "126": "~", "127": ""
}
//"65": "A",    
//   "66": "B",    "67": "C",    "68": "D",    "69": "E",    "70": "F",    
//   "71": "G",    "72": "H",    "73": "I",    "74": "J",    "75": "K",    
//   "76": "L",    "77": "M",    "78": "N",    "79": "O",    "80": "P",    
//   "81": "Q",    "82": "R",    "83": "S",    "84": "T",    "85": "U",    
//   "86": "V",    "87": "W",    "88": "X",    "89": "Y",    "90": "Z",


//    "97": "a",    "98": "b",    "99": "c",    "100": "d",    
//    "101": "e",    "102": "f",    "103": "g",    "104": "h",    "105": "i",    
//    "106": "j",    "107": "k",    "108": "l",    "109": "m",    "110": "n",    
//    "111": "o",    "112": "p",    "113": "q",    "114": "r",    "115": "s",    
//    "116": "t",    "117": "u",    "118": "v",    "119": "w",    "120": "x",    
//    "121": "y",    "122": "z", 

function onlyAlphabets(e, t) {

    try {
        if (window.event) {
            var charCode = window.event.keyCode;
        }
        else if (e) {
            var charCode = e.which;
        }
        else { return true; }
        if ((charCode > 47 && charCode < 58))
            return false;
        else
            return true;
    }
    catch (err) {
        alert(err.Description);
    }
}

//function onlyAlphabets(e, t) {
//    try {
//        if (window.event) {
//            var charCode = window.event.keyCode;
//        }
//        else if (e) {
//            var charCode = e.which;
//        }
//        else { return true; }
//        if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode == 32))
//            return true;
//        else
//            return false;
//    }
//    catch (err) {
//        alert(err.Description);
//    }
//}

function alphabetsOnly(e, t) {
    try {
        if (window.event) {
            var charCode = window.event.keyCode;
        }
        else if (e) {
            var charCode = e.which;
        }
        else { return true; }
        if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123))
            return true;
        else
            return false;
    }
    catch (err) {
        alert(err.Description);
    }
}

function onlyNumbers(event) {
      
    var charCode = (event.which) ? event.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;

    return true;
}
 
function onlyNumbersWithDot(e) {
      

    var charCode;
    if (e.keyCode > 0) {
        charCode = e.which || e.keyCode;
    }
    else if (typeof (e.charCode) != "undefined") {
        charCode = e.which || e.keyCode;
    }
    if (charCode == 46)
        return true
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;
    return true;
}
function ValidateMultipleMobileNo(multiplemobileField) {

    var reg = /^(\d{10},)*\d{10}$/;
    if (reg.test(multiplemobileField.value) == false) {
        multiplemobileField.style.border = "1px solid #FF0000";
        //multiplemobileField.value = "";
        multiplemobileField.placeholder = "";
        multiplemobileField.placeholder = "Please Enter the valid Mobile No";
        multiplemobileField.focus();
        return true;
    }
    else {
        return false;
    }


}


function validateEmail(emailField) {

    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    if (reg.test(emailField.value) == false) {
        emailField.style.border = "1px solid #FF0000";
        emailField.value = "";
        emailField.placeholder = "";
        emailField.placeholder = "Please Enter the valid Email Id";
        emailField.focus();
        return true;
    }
    else {
        return false;
    }
}

function validateWebsite(websiteField) {

    var txt = websiteField.value;
    var re = /(http(s)?:\\)?([\w-]+\.)+[\w-]+[.com|.in|.org]+(\[\?%&=]*)?/
    if (!re.test(txt)) {
        websiteField.style.border = "1px solid #FF0000";
        websiteField.value = "";
        websiteField.placeholder = "";
        websiteField.placeholder = "Please enter the valid url";
        websiteField.focus();
        return true;
    }
    else {
        return false;
    }
}

function validateText(txtField) {

    var letters = /^[A-Za-z]+$/;
    if (txtField.value.match(letters)) {
        return true;
    }
    else {
        return false;
    }
}

function validateTextField(txtField) {

    var letters = /^[A-Za-z\s]+$/;
    if (txtField.value.match(letters)) {
        return true;
    }
    else {
        return false;
    }
}

function validateMobileNo(number) {
    var val = number.value;
    if (/^\d{10}$/.test(val)) {
        return false;
    } else {
        number.style.border = "1px solid #FF0000";
        number.value = "";
        number.placeholder = "";
        number.placeholder = "Enter the valid Mobile No";
        number.focus();
        return true;
    }
}

function validateContactNumber(contactField) {
    
    var landline = /^[0-9]\d{2,4}-\d{6,8}$/;
    if (landline.test(contactField.value) == false) {
        contactField.style.border = "1px solid #FF0000";
        contactField.value = "";
        contactField.placeholder = "";
        contactField.placeholder = "Enter the valid Contact Number";
        contactField.focus();
        return true;
    }
    else {
        contactField.style.border = "1px solid #CCC";
        return false;
    }
}


function checkOneCheckbox(chkgroup, ddlgrp) {


    var is_checked = false;
    for (var i = 0; i < chkgroup.length; i++) {
        if (chkgroup[i].checked) {
            is_checked = true;
        }
    }

    if (!is_checked) {
        ddlgrp.style.border = "1px solid #FF0000";
        ddlgrp.focus();
        return true;

    } else {
        ddlgrp.style.border = "1px solid #CCC";
        return false;
    }
}

function checkatleastOneCheckbox(chkgroup) {


    var is_checked = false;
    for (var i = 0; i < chkgroup.length; i++) {
        if (chkgroup[i].checked) {
            is_checked = true;
        }
    }

    if (!is_checked) {
        alert("Select atleast one day");
        return true;

    } else {
        return false;
    }
}



function checkOneignitionCheckbox(chkgroup) {

    var alrt = "Select atleast one ignition type";
    var is_checked = false;
    for (var i = 0; i < chkgroup.length; i++) {
        if (chkgroup[i].checked) {
            is_checked = true;
        }
    }

    if (!is_checked) {
        alert(alrt);
        return true;

    } else {
        return false;
    }
}


function validateMobileNoLength(number) {
     
    var val = number.value;
    if (val.length == 10) {
        return false;
    } else {
        number.style.border = "1px solid #FF0000";
        number.value = "";
        number.placeholder = "";
        number.placeholder = "Enter the valid Mobile No";
        number.focus();
        return true;
    }
}

/////////////////////////////////////////////////////////////////////////

//Validate Organization

function validateOrganization() {

    if (document.getElementById('txtOrganizationName').value == "") {
        document.getElementById('txtOrganizationName').style.border = "1px solid #FF0000";
        document.getElementById('txtOrganizationName').placeholder = "Enter the Organization Name";
        document.getElementById('txtOrganizationName').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtOrganizationName').style.border = "";
    }


    if (document.getElementById('txtCompanyCode').value == "") {
        document.getElementById('txtCompanyCode').style.border = "1px solid #FF0000";
        document.getElementById('txtCompanyCode').placeholder = "Enter the Company Code";
        document.getElementById('txtCompanyCode').focus();
        return false;
    }
    else {
        document.getElementById('txtCompanyCode').style.border = "";
    }

    if (document.getElementById('txtwebsiteUrl').value == "") {
        document.getElementById('txtwebsiteUrl').style.border = "1px solid #FF0000";
        document.getElementById('txtwebsiteUrl').placeholder = "Enter the websiteUrl ";
        document.getElementById('txtwebsiteUrl').focus();
        return false;
    }
    else {
        document.getElementById('txtwebsiteUrl').style.border = "";
    }


    if (document.getElementById('txtSMSUrl').value == "") {
        document.getElementById('txtSMSUrl').style.border = "1px solid #FF0000";
        document.getElementById('txtSMSUrl').placeholder = "Enter the SMSURL";
        document.getElementById('txtSMSUrl').focus();
        return false;
    }
    else {
        document.getElementById('txtSMSUrl').style.border = "";
    }


    if (validateEmail(document.getElementById('txtSenderMail'))) {

        return false;
    }
    else {
        removeError(document.getElementById('txtSenderMail'));

    }

    //if (document.getElementById('txtSenderMail').value == "") {
    //    document.getElementById('txtSenderMail').style.border = "1px solid #FF0000";
    //    document.getElementById('txtSenderMail').placeholder = "Enter the Sender Mail";
    //    document.getElementById('txtSenderMail').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtSenderMail').style.border = "";
    //}


    //if (document.getElementById('txtSenderPassword').value == "") {
    //    document.getElementById('txtSenderPassword').style.border = "1px solid #FF0000";
    //    document.getElementById('txtSenderPassword').placeholder = "Enter the Sender Password";
    //    document.getElementById('txtSenderPassword').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtSenderPassword').style.border = "";
    //}

    //if (document.getElementById('txtSenderSubject').value == "") {
    //    document.getElementById('txtSenderSubject').style.border = "1px solid #FF0000";
    //    document.getElementById('txtSenderSubject').placeholder = "Enter the Sender Subject";
    //    document.getElementById('txtSenderSubject').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtSenderSubject').style.border = "";
    //}


    //if (document.getElementById('txtSenderCC').value == "") {
    //    document.getElementById('txtSenderCC').style.border = "1px solid #FF0000";
    //    document.getElementById('txtSenderCC').placeholder = "Enter the SenderCC";
    //    document.getElementById('txtSenderCC').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtSenderCC').style.border = "";
    //}


    //if (document.getElementById('txtHost').value == "") {
    //    document.getElementById('txtHost').style.border = "1px solid #FF0000";
    //    document.getElementById('txtHost').placeholder = "Enter the Host";
    //    document.getElementById('txtHost').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtHost').style.border = "";
    //}

    //if (document.getElementById('txtPort').value == "") {
    //    document.getElementById('txtPort').style.border = "1px solid #FF0000";
    //    document.getElementById('txtPort').placeholder = "Enter the Port";
    //    document.getElementById('txtPort').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtPort').style.border = "";
    //}

    //if (document.getElementById('txtSenderLogo').value == "") {
    //    document.getElementById('txtSenderLogo').style.border = "1px solid #FF0000";
    //    document.getElementById('txtSenderLogo').placeholder = "Select Sender Logo";
    //    document.getElementById('txtSenderLogo').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtSenderLogo').style.border = "";
    //}


    //if (document.getElementById('txtSenderLogoContentId').value == "") {
    //    document.getElementById('txtSenderLogoContentId').style.border = "1px solid #FF0000";
    //    document.getElementById('txtSenderLogoContentId').placeholder = "Enter SenderLogoContentId";
    //    document.getElementById('txtSenderLogoContentId').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtSenderLogoContentId').style.border = "";
    //}


    if (document.getElementById('txtBookingSMS').value == "") {
        document.getElementById('txtBookingSMS').style.border = "1px solid #FF0000";
        document.getElementById('txtBookingSMS').placeholder = "Enter Booking SMS";
        document.getElementById('txtBookingSMS').focus();
        return false;
    }
    else {
        document.getElementById('txtBookingSMS').style.border = "";
    }


    if (document.getElementById('txtConfirmationSMS').value == "") {
        document.getElementById('txtConfirmationSMS').style.border = "1px solid #FF0000";
        document.getElementById('txtConfirmationSMS').placeholder = "Enter ConfirmationSMS";
        document.getElementById('txtConfirmationSMS').focus();
        return false;
    }
    else {
        document.getElementById('txtConfirmationSMS').style.border = "";
    }

    if (document.getElementById('txtBillSMS').value == "") {
        document.getElementById('txtBillSMS').style.border = "1px solid #FF0000";
        document.getElementById('txtBillSMS').placeholder = "Enter BillSMS";
        document.getElementById('txtBillSMS').focus();
        return false;
    }
    else {
        document.getElementById('txtBillSMS').style.border = "";
    }

    if (document.getElementById('txtDriverSMS').value == "") {
        document.getElementById('txtDriverSMS').style.border = "1px solid #FF0000";
        document.getElementById('txtDriverSMS').placeholder = "Enter DriverSMS";
        document.getElementById('txtDriverSMS').focus();
        return false;
    }
    else {
        document.getElementById('txtDriverSMS').style.border = "";
    }

    //if (document.getElementById('txtSenderFileName').value == "") {
    //    document.getElementById('txtSenderFileName').style.border = "1px solid #FF0000";
    //    document.getElementById('txtSenderFileName').placeholder = "Enter SenderFileName";
    //    document.getElementById('txtSenderFileName').focus();
    //    return false;
    //}
    //else {
    //    document.getElementById('txtSenderFileName').style.border = "";
    //}


    if (document.getElementById('txtCancelSMS').value == "") {
        document.getElementById('txtCancelSMS').style.border = "1px solid #FF0000";
        document.getElementById('txtCancelSMS').placeholder = "Enter CancelSMS";
        document.getElementById('txtCancelSMS').focus();
        return false;
    }
    else {
        document.getElementById('txtCancelSMS').style.border = "";
    }

    if (document.getElementById('txtForgetSMS').value == "") {
        document.getElementById('txtForgetSMS').style.border = "1px solid #FF0000";
        document.getElementById('txtForgetSMS').placeholder = "Enter ForgetSMS";
        document.getElementById('txtForgetSMS').focus();
        return false;
    }
    else {
        document.getElementById('txtForgetSMS').style.border = "";
    }


    if (document.getElementById('txtVerifyCodeSMS').value == "") {
        document.getElementById('txtVerifyCodeSMS').style.border = "1px solid #FF0000";
        document.getElementById('txtVerifyCodeSMS').placeholder = "Enter VerifyCodeSMS";
        document.getElementById('txtVerifyCodeSMS').focus();
        return false;
    }
    else {
        document.getElementById('txtVerifyCodeSMS').style.border = "";
    }


    if (document.getElementById('txtTcpIP').value == "") {
        document.getElementById('txtTcpIP').style.border = "1px solid #FF0000";
        document.getElementById('txtTcpIP').placeholder = "Enter TcpIP";
        document.getElementById('txtTcpIP').focus();
        return false;
    }
    else {
        document.getElementById('txtTcpIP').style.border = "";
    }


    if (document.getElementById('txtTcpPort').value == "") {
        document.getElementById('txtTcpPort').style.border = "1px solid #FF0000";
        document.getElementById('txtTcpPort').placeholder = "Enter TcpPort";
        document.getElementById('txtTcpPort').focus();
        return false;
    }
    else {
        document.getElementById('txtAppVersionCode').style.border = "";
    }

    if (document.getElementById('txtAppVersionCode').value == "") {
        document.getElementById('txtAppVersionCode').style.border = "1px solid #FF0000";
        document.getElementById('txtAppVersionCode').placeholder = "Enter AppVersionCode";
        document.getElementById('txtAppVersionCode').focus();
        return false;
    }
    else {
        document.getElementById('txtAppVersionCode').style.border = "";
    }

    if (document.getElementById('txtDriverAppVersion').value == "") {
        document.getElementById('txtDriverAppVersion').style.border = "1px solid #FF0000";
        document.getElementById('txtDriverAppVersion').placeholder = "Enter DriverAppVersion";
        document.getElementById('txtDriverAppVersion').focus();
        return false;
    }
    else {
        document.getElementById('txtDriverAppVersion').style.border = "";
    }


    if (document.getElementById('txtBalanceSMS').value == "") {
        document.getElementById('txtBalanceSMS').style.border = "1px solid #FF0000";
        document.getElementById('txtBalanceSMS').placeholder = "Enter BalanceSMS";
        document.getElementById('txtBalanceSMS').focus();
        return false;
    }
    else {
        document.getElementById('txtBalanceSMS').style.border = "";
    }

    return true;

}
//Master Validation
//UserPassword Validation
function validateUserPassword() {

    if (document.getElementById('pwdold').value == "") {
        document.getElementById('pwdold').style.border = "1px solid #FF0000";
        document.getElementById('pwdold').placeholder = "Enter the Old Password";
        document.getElementById('pwdold').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('pwdold').style.border = "";
    }


    if (document.getElementById('pwdnew').value == "") {
        document.getElementById('pwdnew').style.border = "1px solid #FF0000";
        document.getElementById('pwdnew').placeholder = "Enter the New Password";
        document.getElementById('pwdnew').focus();
        return false;
    }
    else {
        document.getElementById('pwdnew').style.border = "";
    }

    if (document.getElementById('pwdconfirm').value == "") {
        document.getElementById('pwdconfirm').style.border = "1px solid #FF0000";
        document.getElementById('pwdconfirm').placeholder = "Enter the Confirm Password";
        document.getElementById('pwdconfirm').focus();
        return false;
    }
    else {
        document.getElementById('pwdconfirm').style.border = "";
    }


    return true;

}


//UserProfile Validation
function validateUpdateUser() {
     
    if (document.getElementById('txtFirstName').value == "") {
        document.getElementById('txtFirstName').style.border = "1px solid #FF0000";
        document.getElementById('txtFirstName').placeholder = "Enter the First Name";
        document.getElementById('txtFirstName').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtFirstName').style.border = "";
    }


    if (document.getElementById('txtLastName').value == "") {
        document.getElementById('txtLastName').style.border = "1px solid #FF0000";
        document.getElementById('txtLastName').placeholder = "Enter the Last Name";
        document.getElementById('txtLastName').focus();
        return false;
    }
    else {
        document.getElementById('txtLastName').style.border = "";
    }

    if ($('input[name=optGender]:checked').length <= 0) {
        document.getElementById('Genderalert').style.display = "block";
        return false;
    } else {
        document.getElementById('Genderalert').style.display = "none";
    }

     
    if (validateMobileNoLength(document.getElementById('txtContactNo'))) {
        return false;
    }
    else {
        removeError(document.getElementById('txtContactNo'));

      //  document.getElementById('txtContactNo').style.border = "";
    }

     

    //if (validateEmail(document.getElementById('txtEmail'))) {

    //    return false;
    //}
    //else {
    //    removeError(document.getElementById('txtEmail'));

    //}

    return true;

}


//Vehicle Type Validation
function validateVehicleType() {



    if (document.getElementById('txtType').value == "") {
        document.getElementById('txtType').style.border = "1px solid #FF0000";
        document.getElementById('txtType').placeholder = "Enter the Vehicle Type";
        document.getElementById('txtType').focus();
        return false;
    }
    else {
        document.getElementById('txtType').style.border = "1px solid #CCC";
    }

    return true;

}

//Vehicle Type Validation
function validatePlaceType() {



    if (document.getElementById('txtType').value == "") {
        document.getElementById('txtType').style.border = "1px solid #FF0000";
        document.getElementById('txtType').placeholder = "Enter the Vehicle Type";
        document.getElementById('txtType').focus();
        return false;
    }
    else {
        document.getElementById('txtType').style.border = "1px solid #CCC";
    }

    return true;

}

//Vehicle Type Validation
function validateRoleType() {



    if (document.getElementById('txtRole').value == "") {
        document.getElementById('txtRole').style.border = "1px solid #FF0000";
        document.getElementById('txtRole').placeholder = "Enter the Role Type";
        document.getElementById('txtRole').focus();
        return false;
    }
    else {
        document.getElementById('txtRole').style.border = "1px solid #CCC";
    }

    return true;

}

//SIM Provider Validation  
function validateSIMProvider() {



    if (document.getElementById('txtSIMProvider').value == "") {
        document.getElementById('txtSIMProvider').style.border = "1px solid #FF0000";
        document.getElementById('txtSIMProvider').placeholder = "Enter the SIM Provider";
        document.getElementById('txtSIMProvider').focus();
        return false;
    }
    else {
        document.getElementById('txtSIMProvider').style.border = "1px solid #CCC";
    }

    return true;

}
//Vehicle Type Validation
function validateCarType() {
    if (document.getElementById('txtCarType').value == "") {
        document.getElementById('txtCarType').style.border = "1px solid #FF0000";
        document.getElementById('txtCarType').placeholder = "Enter the Car Type";
        document.getElementById('txtCarType').focus();
        return false;
    }
    else {
        document.getElementById('txtCarType').style.border = "1px solid #CCC";
    }

    return true;

}




//Book Type Validation
function validateBookType() {
    if (document.getElementById('txtBookType').value == "") {
        document.getElementById('txtBookType').style.border = "1px solid #FF0000";
        document.getElementById('txtBookType').placeholder = "Enter the Book Type";
        document.getElementById('txtBookType').focus();
        return false;
    }
    else {
        document.getElementById('txtBookType').style.border = "1px solid #CCC";
    }

    return true;

}


//Package Type  Validation
function validatePackageType() {
    if (document.getElementById('txtPackageType').value == "") {
        document.getElementById('txtPackageType').style.border = "1px solid #FF0000";
        document.getElementById('txtPackageType').placeholder = "Enter the Package Type";
        document.getElementById('txtPackageType').focus();
        return false;
    }
    else {
        document.getElementById('txtPackageType').style.border = "1px solid #CCC";
    }

    return true;

}

//----------------------------------------------------------------

//Mapping Validation
//Car Type Validation
function validateCarTypeMapping() {
    if (document.getElementById('txtDescription').value == "") {
        document.getElementById('txtDescription').style.border = "1px solid #FF0000";
        document.getElementById('txtDescription').placeholder = "Enter the Description Name";
        document.getElementById('txtDescription').focus();
        return false;
    }
    else {
        document.getElementById('txtDescription').style.border = "1px solid #CCC";
    }

    if (document.getElementById('ddlCarType').value == "") {
        document.getElementById('ddlCarType').style.border = "1px solid #FF0000";
        document.getElementById('ddlCarType').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('ddlCarType').style.border = "";
    }
    return true;
}

//Booking Validation
function validateBookTypeMapping() {
    if (document.getElementById('txtDescription').value == "") {
        document.getElementById('txtDescription').style.border = "1px solid #FF0000";
        document.getElementById('txtDescription').placeholder = "Enter the Description Name";
        document.getElementById('txtDescription').focus();
        return false;
    }
    else {
        document.getElementById('txtDescription').style.border = "1px solid #CCC";
    }

    if (document.getElementById('ddlBookType').value == "") {
        document.getElementById('ddlBookType').style.border = "1px solid #FF0000";
        document.getElementById('ddlBookType').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('ddlBookType').style.border = "";
    }



    return true;

}


//Package Validation
function validatePackageTypeMapping() {
    if (document.getElementById('txtDescription').value == "") {
        document.getElementById('txtDescription').style.border = "1px solid #FF0000";
        document.getElementById('txtDescription').placeholder = "Enter the Description Name";
        document.getElementById('txtDescription').focus();
        return false;
    }
    else {
        document.getElementById('txtDescription').style.border = "1px solid #CCC";
    }

    if (document.getElementById('ddlPackageType').value == "") {
        document.getElementById('ddlPackageType').style.border = "1px solid #FF0000";
        document.getElementById('ddlPackageType').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('ddlPackageType').style.border = "";
    }
    return true;

}



//Regions Validation

function validateRegion() {
    if (document.getElementById('ddlcompany').value == "") {
        document.getElementById('ddlcompany').style.border = "1px solid #FF0000";
        document.getElementById('ddlcompany').focus();
        return false;
    }
    else {

        document.getElementById('ddlcompany').style.border = "";
    }
    if (document.getElementById('txtRegion').value == "") {
        document.getElementById('txtRegion').style.border = "1px solid #FF0000";
        document.getElementById('txtRegion').placeholder = "Enter the Region Name";
        document.getElementById('txtRegion').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtRegion').style.border = "";
    }

  

    return true;

}



//PlaceDetail Validation



function validatePlacedetail() {

   
    if (document.getElementById('ddlcity').value == "") {
        document.getElementById('ddlcity').style.border = "1px solid #FF0000";
        document.getElementById('ddlcity').focus();
        return false;
    }
    else {

        document.getElementById('ddlcity').style.border = "";
    }
    if (document.getElementById('txtRegion').value == "") {
        document.getElementById('txtRegion').style.border = "1px solid #FF0000";
        document.getElementById('txtRegion').placeholder = "Enter the Place Name";
        document.getElementById('txtRegion').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtRegion').style.border = "";
    }

    //if (document.getElementById('ddltype').value == "") {
    //    document.getElementById('ddltype').style.border = "1px solid #FF0000";
    //    document.getElementById('ddltype').focus();
    //    return false;
    //}
    //else {

    //    document.getElementById('ddltype').style.border = "";
    //}
    return true;

}



//---------------------------------------------------------
//New Company Validation
function validateCompany() {

    if (document.getElementById('txtCompanyName').value == "") {
        document.getElementById('txtCompanyName').style.border = "1px solid #FF0000";
        document.getElementById('txtCompanyName').placeholder = "Enter the Company Name";
        document.getElementById('txtCompanyName').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtCompanyName').style.border = "";
    }


    if (document.getElementById('txtCity').value == "") {
        document.getElementById('txtCity').style.border = "1px solid #FF0000";
        document.getElementById('txtCity').placeholder = "Enter the City";
        document.getElementById('txtCity').focus();
        return false;
    }
    else {
        document.getElementById('txtCity').style.border = "";
    }
    //if ($('input[name=optMaptype]:checked').length <= 0) {
    //    document.getElementById('Mapalert').style.display = "block";
    //    return false;
    //}
    //else {
    //    document.getElementById('Mapalert').style.display = "none";
    //}

    //if ($('input[name=optMetertype]:checked').length <= 0) {
    //    document.getElementById('statusalert').style.display = "block";
    //    return false;
    //} else {
    //    document.getElementById('statusalert').style.display = "none";
    //}
    return true;

}
// Company settings Validation

function validatesettingsCompany(value) {
     
    
    if ($('input[name=optMaptype]:checked').length <= 0) {
        document.getElementById('Mapalert').style.display = "block";
        return false;
    }
    else {
        document.getElementById('Mapalert').style.display = "none";
    }

    if ($('input[name=optMetertype]:checked').length <= 0) {
        document.getElementById('statusalert').style.display = "block";
        return false;
    } else {
        document.getElementById('statusalert').style.display = "none";
    }
    if (document.getElementById('txtSpeed').value == "") {
        document.getElementById('txtSpeed').style.border = "1px solid #FF0000";
        document.getElementById('txtSpeed').placeholder = "Enter the Speed";
        document.getElementById('txtSpeed').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtSpeed').style.border = "";
    }

    if ($('input[name=optlng]:checked').length <= 0) {
        document.getElementById('lanAlert').style.display = "block";
        return false;
    }
    else {
        document.getElementById('lanAlert').style.display = "none";
    }

    //if ($('input[name=driverAPP]:checked').length == 0) {
    //    document.getElementById('AppAlert').style.display = "block";
    //    return false;
    //} else {
    //    document.getElementById('AppAlert').style.display = "none";
    //}
     
    if (value == 0) {
        if (document.getElementById('amt1').value == "") {
            document.getElementById('amt1').style.border = "1px solid #FF0000";
            document.getElementById('amt1').placeholder = "Enter the Amount1";
            document.getElementById('amt1').focus();
            return false;
        }
        else {
            document.getElementById('amt1').style.border = "";
        }
        if (document.getElementById('amt2').value == "") {
            document.getElementById('amt2').style.border = "1px solid #FF0000";
            document.getElementById('amt2').placeholder = "Enter the Amount2";
            document.getElementById('amt2').focus();
            return false;
        }
        else {
            document.getElementById('amt2').style.border = "";
        }
        if (document.getElementById('amt3').value == "") {
            document.getElementById('amt3').style.border = "1px solid #FF0000";
            document.getElementById('amt3').placeholder = "Enter the Amount3";
            document.getElementById('amt3').focus();
            return false;
        }
        else {
            document.getElementById('amt3').style.border = "";
        }
    }
    return true;

}

// Company Cupon Validation

function validateCuponCompany() {

 
    if (document.getElementById('txtcupon').value == "") {
        document.getElementById('txtcupon').style.border = "1px solid #FF0000";
        document.getElementById('txtcupon').placeholder = "Enter the Cupon";
        document.getElementById('txtcupon').focus();
        return false;
    }
    else {
        document.getElementById('txtcupon').style.border = "";
    }

     
    if (document.getElementById('txtamount').value == "") {
        document.getElementById('txtamount').style.border = "1px solid #FF0000";
        document.getElementById('txtamount').placeholder = "Enter the Amount";
        document.getElementById('txtamount').focus();
        return false;
    }
    else {
        document.getElementById('txtamount').style.border = "";
    }
        
    return true;

}
//Group Validation
function validateGroup() {



    if (document.getElementById('txtGroup').value == "") {
        document.getElementById('txtGroup').style.border = "1px solid #FF0000";
        document.getElementById('txtGroup').placeholder = "Enter the Groupname";
        document.getElementById('txtGroup').focus();
        return false;
    }
    else {
        document.getElementById('txtGroup').style.border = "1px solid #CCC";
    }

    return true;

}
 

function validateLogin() {

    if (document.getElementById('txtUser').value == "") {
        document.getElementById('txtUser').style.border = "1px solid #FF0000";
        //document.getElementById('txtUser').placeholder = "Enter the UserName";
        document.getElementById('txtUser').focus();
        return false;
    }
    else {
        document.getElementById('txtUser').style.border = "1px solid #CCC";
    }

    if (document.getElementById('txtPwd').value == "") {
        document.getElementById('txtPwd').style.border = "1px solid #FF0000";
        document.getElementById('txtPwd').placeholder = "Enter the Password";
        document.getElementById('txtPwd').focus();
        return false;
    }
    else {
        document.getElementById('txtPwd').style.border = "1px solid #CCC";
    }

    return true;

}

//Vehicle Master
function validateVehicle() {


    if (document.getElementById('txtVehicleName').value == "") {
        document.getElementById('txtVehicleName').style.border = "1px solid #FF0000";
        document.getElementById('txtVehicleName').placeholder = "Enter the Vehicle Name";
        document.getElementById('txtVehicleName').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtVehicleName').style.border = "";
    }

    if (document.getElementById('txtCabID').value == "") {
        document.getElementById('txtCabID').style.border = "1px solid #FF0000";
        document.getElementById('txtUser').placeholder = "Enter the CabID";
        document.getElementById('txtCabID').focus();
        return false;
    }
    else {
        document.getElementById('txtCabID').style.border = "";
    }

    if (document.getElementById('txtPurchaseDate').value == "") {
        document.getElementById('txtPurchaseDate').style.border = "1px solid #FF0000";
        document.getElementById('txtPurchaseDate').focus();
        return false;
    }
    else {
        document.getElementById('txtPurchaseDate').style.border = "";
    }

    if (document.getElementById('txtownername').value == "") {
        document.getElementById('txtownername').style.border = "1px solid #FF0000";
        document.getElementById('txtownername').focus();
        return false;
    }
    else {
        document.getElementById('txtownername').style.border = ""; 
    }

    if (document.getElementById('txtownerphno').value == "") {
        document.getElementById('txtownerphno').style.border = "1px solid #FF0000";
        document.getElementById('txtownerphno').placeholder = "Enter the Mobile Number";

        document.getElementById('txtownerphno').focus();
        return false;
    }
    else if (document.getElementById('txtownerphno').value.length != 10) {
        document.getElementById('txtownerphno').style.border = "1px solid #FF0000";
        document.getElementById('txtownerphno').placeholder = "Enter the 10 digit Mobile Number";
        document.getElementById('txtownerphno').focus();
        return false;
    }
    else {
        document.getElementById('txtownerphno').style.border = "";
    }

    if (document.getElementById('txtAutodate').value == "") {
        document.getElementById('txtAutodate').style.border = "1px solid #FF0000";
        document.getElementById('txtUser').placeholder = "Enter the Owner Phno";

        document.getElementById('txtAutodate').focus();
        return false;
    }
    else {
        document.getElementById('txtAutodate').style.border = "";
    }

    if (document.getElementById('txtlandmark').value == "") {
        document.getElementById('txtlandmark').style.border = "1px solid #FF0000";
        document.getElementById('txtlandmark').placeholder = "Enter the LandMark";
        document.getElementById('txtlandmark').focus();
        return false;
    }
    else {
        document.getElementById('txtlandmark').style.border = "";
    }
    

    if (document.getElementById('txtValidfrm').value == "") {
        document.getElementById('txtValidfrm').style.border = "1px solid #FF0000";
        //document.getElementById('txtValidfrm').placeholder = "Enter the Color";
        document.getElementById('txtValidfrm').focus();
        return false;
    }
    else {
        document.getElementById('txtValidfrm').style.border = "";
    }


    if (document.getElementById('txtValidto').value == "") {
        document.getElementById('txtValidto').style.border = "1px solid #FF0000";
//document.getElementById('txtValidto').placeholder = "Enter the Location";
        document.getElementById('txtValidto').focus();
        return false;
    }
    else {
        document.getElementById('txtValidto').style.border = "";
    } 


    if (document.getElementById('ddlgroup').value == "") {
        document.getElementById('ddlgroup').style.border = "1px solid #FF0000";
       // document.getElementById('ddlgroup').placeholder = "Enter the Location";
        document.getElementById('ddlgroup').focus();
        return false;
    }
    else {
        document.getElementById('ddlgroup').style.border = "";
    }
    if (document.getElementById('ddldriver').value == "") {
        document.getElementById('ddldriver').style.border = "1px solid #FF0000";
        document.getElementById('ddldriver').focus();
        return false;
    }
    else {
        document.getElementById('ddldriver').style.border = "";
    }
    if (document.getElementById('ddlimei').value == "") {
        document.getElementById('ddlimei').style.border = "1px solid #FF0000";
        document.getElementById('ddlimei').focus();
        return false;
    }
    else {
        document.getElementById('ddlimei').style.border = "";
    }
    return true;

}

 


//Driver Master

function validateDriver() {

    if (document.getElementById('txtDriverName').value == "") {
        document.getElementById('txtDriverName').style.border = "1px solid #FF0000";
        document.getElementById('txtDriverName').placeholder = "Enter the Driver Name";
        document.getElementById('txtDriverName').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtDriverName').style.border = "";
    }

     
    if (document.getElementById('txtdateofjoineID').value == "") {
        document.getElementById('txtdateofjoineID').style.border = "1px solid #FF0000";
        document.getElementById('txtdateofjoineID').placeholder = "Enter the Date Of Joining";
        document.getElementById('txtdateofjoineID').focus();
        return false;
    }
    else {
        document.getElementById('txtdateofjoineID').style.border = "";
    }

    if (document.getElementById('txtemployeeId').value == "") {
        document.getElementById('txtemployeeId').style.border = "1px solid #FF0000";
        document.getElementById('txtemployeeId').placeholder = "Enter the Employee Id";
        document.getElementById('txtemployeeId').focus();
        return false;
    }
    else {
        document.getElementById('txtemployeeId').style.border = "";
    }

    
    if (document.getElementById('txtLicenseExpDate').value == "") {
        document.getElementById('txtLicenseExpDate').style.border = "1px solid #FF0000";
        document.getElementById('txtLicenseExpDate').placeholder = "Enter the LicenseExpDate";
        document.getElementById('txtLicenseExpDate').focus();
            return false;
        }
        else {
        document.getElementById('txtLicenseExpDate').style.border = "";
        }
    
     

    
    if (document.getElementById('txtMobNo').value == "") {
        document.getElementById('txtMobNo').style.border = "1px solid #FF0000";
        document.getElementById('txtMobNo').placeholder = "Enter the Mobile Number";
        document.getElementById('txtMobNo').focus();
            return false;
    }
    else if (document.getElementById('txtMobNo').value.length != 10) {
        document.getElementById('txtMobNo').style.border = "1px solid #FF0000";
        document.getElementById('txtMobNo').placeholder = "Enter the 10 digit Mobile Number";
        document.getElementById('txtMobNo').focus();
        return false;
    }
        else {
        document.getElementById('txtMobNo').style.border = "";
        }
     

    if (document.getElementById('ddlproof').value == "") {
        document.getElementById('ddlproof').style.border = "1px solid #FF0000";
        document.getElementById('ddlproof').focus();
        return false;
    }
    else {
        document.getElementById('ddlproof').style.border = "";
    }

    return true;

}

 

//Device Master

function validateDevice() {
      
    if (document.getElementById('txtDeviceName').value == "") {
        document.getElementById('txtDeviceName').style.border = "1px solid #FF0000";
        document.getElementById('txtDeviceName').placeholder = "Enter the Device Name";
        document.getElementById('txtDeviceName').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtDeviceName').style.border = "";
    }

    if (document.getElementById('txtIMEINo').value == "") {
        document.getElementById('txtIMEINo').style.border = "1px solid #FF0000";
        document.getElementById('txtIMEINo').placeholder = "Enter the IMEI No";
        document.getElementById('txtIMEINo').focus();
        return false;
    }
    else if (document.getElementById('txtIMEINo').value.length != 15) {
        document.getElementById('txtIMEINo').value == " ";
        document.getElementById('txtIMEINo').style.border = "1px solid #FF0000";
        document.getElementById('txtIMEINo').placeholder = "Enter the 15 digit IMEI No";
        document.getElementById('txtIMEINo').focus();
        return false;
    }
    else {
        document.getElementById('txtIMEINo').style.border = "";
    }

    if (document.getElementById('txtIMEINo2').value.length == 0)
    {
    }
    
    else if (document.getElementById('txtIMEINo2').value.length != 15) {
        document.getElementById('txtIMEINo2').value == "";
        document.getElementById('txtIMEINo2').style.border = "1px solid #FF0000";
        document.getElementById('txtIMEINo2').placeholder = "Enter the 15 digit IMEI No";
        document.getElementById('txtIMEINo2').focus();
        return false;
    }
    else {
        document.getElementById('txtIMEINo2').style.border = "";
    }

    if (document.getElementById('ddlDevice').value == "") {
        document.getElementById('ddlDevice').style.border = "1px solid #FF0000";
        document.getElementById('ddlDevice').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('ddlDevice').style.border = "";
    }


    if (document.getElementById('date1').value == "") {
        document.getElementById('date1').style.border = "1px solid #FF0000";
        //document.getElementById('txtMobNo').placeholder = "Enter the Mobine ID";
        document.getElementById('date1').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('date1').style.border = "";
    }

   
    if (document.getElementById('txtSimNo').value == "") {
        document.getElementById('txtSimNo').style.border = "1px solid #FF0000";
        document.getElementById('txtSimNo').placeholder = "Enter the Sim No";
        document.getElementById('txtSimNo').focus();
        return false;
    }
    else if (document.getElementById('txtSimNo').value.length != 10) {
        document.getElementById('txtSimNo').style.border = "1px solid #FF0000";
        document.getElementById('txtSimNo').placeholder = "Enter the 10 digit Sim No";
        document.getElementById('txtSimNo').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('txtSimNo').style.border = "";
    }

    //if (document.getElementById('txtSimSerialNo').value == "") {
    //    document.getElementById('txtSimSerialNo').style.border = "1px solid #FF0000";
    //    document.getElementById('txtSimSerialNo').placeholder = "Enter the Sim Serial No";
    //    document.getElementById('txtSimSerialNo').focus();
    //    return false;
    //}
    //else {

    //    document.getElementById('txtSimSerialNo').style.border = "";
    //}

    if (document.getElementById('ddlSimProvider').value == "") {
        document.getElementById('ddlSimProvider').style.border = "1px solid #FF0000";
        document.getElementById('ddlSimProvider').focus();
        return false;
    }
    else {

        document.getElementById('ddlSimProvider').style.border = "";
    }

    return true;

}

 
//Devivce Registeration VAlidation
function validateRegisterDevice() {

    if (document.getElementById('ddlcompany').value == "") {
        document.getElementById('ddlcompany').style.border = "1px solid #FF0000";
        document.getElementById('ddlcompany').focus();
        return false;
    }
    else {
        document.getElementById('ddlcompany').style.border = "";
    }

    if (document.getElementById('ddlgroup').value == "") {
        document.getElementById('ddlgroup').style.border = "1px solid #FF0000";
        document.getElementById('ddlgroup').focus();
        return false;
    }
    else {

        document.getElementById('ddlgroup').style.border = "";
    }

    return true;

}
//User Validation

function validateUser() {

     

    if (document.getElementById('txtFirstName').value == "") {
        document.getElementById('txtFirstName').style.border = "1px solid #FF0000";
        document.getElementById('txtFirstName').placeholder = "Enter the First Name";
        document.getElementById('txtFirstName').focus();
        return false;
    }
    else {

        document.getElementById('txtFirstName').style.border = "";
    }

    if (document.getElementById('txtLastName').value == "") {
        document.getElementById('txtLastName').style.border = "1px solid #FF0000";
        document.getElementById('txtLastName').placeholder = "Enter the Last Name";
        document.getElementById('txtLastName').focus();
        return false;
    }
    else {

        document.getElementById('txtLastName').style.border = "";
    }

    if ($('input[name=optGender]:checked').length <= 0) {
        document.getElementById('Genderalert').style.display = "block";
        return false;
    } else {
        document.getElementById('Genderalert').style.display = "none";
    }

 

    if (document.getElementById('txtContactNo').value == "") {
        document.getElementById('txtContactNo').style.border = "1px solid #FF0000";
        document.getElementById('txtContactNo').placeholder = "Enter the Contact Number";
        document.getElementById('txtContactNo').focus();
        return false;
    }
    else if (document.getElementById('txtContactNo').value.length != 10) {
        document.getElementById('txtContactNo').style.border = "1px solid #FF0000";
        document.getElementById('txtContactNo').placeholder = "Enter the 10 digit Contact Number";
        document.getElementById('txtContactNo').focus();
        return false;
    }
    else {

        document.getElementById('txtContactNo').style.border = "";
    }

    //if (validateEmail(document.getElementById('txtEmail'))) {

    //    return false;
    //}
    //else {
    //    removeError(document.getElementById('txtEmail'));

    //}

   
    if (document.getElementById('ddlRoleType').value == "") {
        document.getElementById('ddlRoleType').style.border = "1px solid #FF0000";
        document.getElementById('ddlRoleType').focus();
        return false;
    }
    else {

        document.getElementById('ddlRoleType').style.border = "";
    }
      
    if (document.getElementById('ddlRoleType').value == 3)
    {
        if (document.getElementById('ddldriver').value == "") {
            document.getElementById('ddldriver').style.border = "1px solid #FF0000";
            document.getElementById('ddldriver').focus();
            return false;
        }
        else if (document.getElementById('ddldriver').value != "")
            {

            document.getElementById('ddldriver').style.border = "";
        }
    }
    if (document.getElementById('ddlgroup').value == "") {
        document.getElementById('ddlgroup').style.border = "1px solid #FF0000";
        document.getElementById('ddlgroup').focus();
        return false;
    }
    else {

        document.getElementById('ddlgroup').style.border = "";
    }
    if (document.getElementById('txtUserName').value == "") {
        document.getElementById('txtUserName').style.border = "1px solid #FF0000";
        document.getElementById('txtUserName').placeholder = "Enter the UserName";
        document.getElementById('txtUserName').focus();
        return false;
    }
    else {

        document.getElementById('txtUserName').style.border = "";

    }

    if (document.getElementById('pwdPassword').value == "") {
        document.getElementById('pwdPassword').style.border = "1px solid #FF0000";
        document.getElementById('pwdPassword').placeholder = "Enter the Last Name";
        document.getElementById('pwdPassword').focus();
        return false;
    }
    else {

        document.getElementById('pwdPassword').style.border = "";
    }

 
    if ($('input[name=optstatus]:checked').length <= 0) {
        document.getElementById('statusalert').style.display = "block";
        return false;
    } else {
        document.getElementById('statusalert').style.display = "none";
    }

    return true;
 
}


//City Validation

function validateCity() {

    if (document.getElementById('txtCity').value == "") {
        document.getElementById('txtCity').style.border = "1px solid #FF0000";
        document.getElementById('txtCity').placeholder = "Enter the City Name";
        document.getElementById('txtCity').focus();
        return false;
    }
    else {
        document.getElementById('txtCity').style.border = "";
    }
    return true;
}
 

//-----------------------------------------------------------

//CallCenter Vaidation 
//Validate New Booking
function validateNewBooking(val,val1,val2)
{
    if (val2 == 0) {
        if (document.getElementById('txtphnumber1').value == "") {
            document.getElementById('txtphnumber1').style.border = "1px solid #FF0000";
            document.getElementById('txtphnumber1').placeholder = "Enter the Phone Number";
            document.getElementById('txtphnumber1').focus();

        }
        else if (document.getElementById('txtphnumber1').value.length != 10) {
            document.getElementById('txtphnumber1').style.border = "1px solid #FF0000";
            document.getElementById('txtphnumber1').placeholder = "Enter the 10 digit Mobile Number";
            document.getElementById('txtphnumber1').focus();

        }
        else {

            document.getElementById('txtphnumber1').style.border = "";
        }
    }
    else {
        if (document.getElementById('txtphnumber').value == "") {
            document.getElementById('txtphnumber').style.border = "1px solid #FF0000";
            document.getElementById('txtphnumber').placeholder = "Enter the Phone Number";
            document.getElementById('txtphnumber').focus();

        }
        else if (document.getElementById('txtphnumber').value.length != 10) {
            document.getElementById('txtphnumber').style.border = "1px solid #FF0000";
            document.getElementById('txtphnumber').placeholder = "Enter the 10 digit Mobile Number";
            document.getElementById('txtphnumber').focus();

        }
        else {

            document.getElementById('txtphnumber').style.border = "";
        }
    }
    if (document.getElementById('txtName').value == "") {
        document.getElementById('txtName').style.border = "1px solid #FF0000";
        document.getElementById('txtName').placeholder = "Enter the Name";
        document.getElementById('txtName').focus();
        
    }
    else {

        document.getElementById('txtName').style.border = "";
    }

    if (document.getElementById('txtpickupdate').value == "") {
        document.getElementById('txtpickupdate').style.border = "1px solid #FF0000";
        document.getElementById('txtpickupdate').placeholder = "Enter the PickUpDate";
        document.getElementById('txtpickupdate').focus();
         
    }
    else {

        document.getElementById('txtpickupdate').style.border = "";
    }
    if (document.getElementById('txtpickupTime').value == "") {
        document.getElementById('txtpickupTime').style.border = "1px solid #FF0000";
        document.getElementById('txtpickupTime').placeholder = "Enter the PickUpTime";
        document.getElementById('txtpickupTime').focus();
       
    }
    else {

        document.getElementById('txtpickupTime').style.border = "";
    }



    if (document.getElementById('ddlcartype').value == "") {
        document.getElementById('ddlcartype').style.border = "1px solid #FF0000";
        document.getElementById('ddlcartype').focus();
         
    }
    else {

        document.getElementById('ddlcartype').style.border = "";
    }
    if (document.getElementById('ddlbooktype').value == "") {
        document.getElementById('ddlbooktype').style.border = "1px solid #FF0000";
        document.getElementById('ddlbooktype').focus();
        
    }
    else {

        document.getElementById('ddlbooktype').style.border = "";
    }
    
  

      
    if (val == undefined)
    {
        document.getElementById('ddllandmark').style.border = "1px solid #FF0000";
        document.getElementById('ddllandmark').placeholder = "Select Landmark";
        document.getElementById('ddllandmark').focus();
         
    }
        else
        {

        document.getElementById('ddllandmark').style.border = "";
    }
    if (document.getElementById('txtFromLocation').value == "") {
        document.getElementById('txtFromLocation').style.border = "1px solid #FF0000";
        document.getElementById('txtFromLocation').placeholder = "Enter the From Location";
        document.getElementById('txtFromLocation').focus();
        
    }
    else {

        document.getElementById('txtFromLocation').style.border = "";
    }
    if (val1 != 2) {
        document.getElementById('ddldriver').style.border = "1px solid #FF0000";
        document.getElementById('ddldriver').placeholder = "Select Driver";
        document.getElementById('ddldriver').focus();
        
    }
    else {

        document.getElementById('ddldriver').style.border = "";
    }
    return true;
}

function validateNewBookingOnMap(val) {
  



    if (val == undefined || val=="") {
        document.getElementById('ddllandmark').style.border = "1px solid #FF0000";
        document.getElementById('ddllandmark').placeholder = "Select Landmark";
        document.getElementById('ddllandmark').focus();
        return false;

    }
    else {

        document.getElementById('ddllandmark').style.border = "";
    }
    return true;
}
//validateAssignBooking
 function validateAssignBooking()
 {
       
     if ($('input[name=optBklst]:checked').length <= 0) {
         document.getElementById('bklst').style.display = "block";
         return false;
     } else {
         document.getElementById('bklst').style.display = "none";
     }

     if ($('input[name=optdrLst]:checked').length <= 0) {
         document.getElementById('drlst').style.display = "block";
         return false;
     } else {
         document.getElementById('drlst').style.display = "none";
     }
     return true;

 }

 //validateAssignBooking
 function validateCancelBooking() {
       
     if ($('input[name=optBklst]:checked').length <= 0) {
         document.getElementById('bklst').style.display = "block";
         return false;
     } else {
         document.getElementById('bklst').style.display = "none";
     }

     return true;

 }


//-----------------------------------------------------------

// Tariff Validation
//Tariff Master Validation
function validateTariffMaster() {

    if (document.getElementById('ddlcar').value == "") {
        document.getElementById('ddlcar').style.border = "1px solid #FF0000";
        document.getElementById('ddlcar').focus();
        return false;
    }
    else {
        
        document.getElementById('ddlcar').style.border = "";
    }

    if (document.getElementById('ddlbook').value == "") {
        document.getElementById('ddlbook').style.border = "1px solid #FF0000";
        document.getElementById('ddlbook').focus();
        return false;
    }
    else {

        document.getElementById('ddlbook').style.border = "";
    }

    if (document.getElementById('txtMinimumKm').value == "" ){
        document.getElementById('txtMinimumKm').style.border = "1px solid #FF0000";
        document.getElementById('txtMinimumKm').placeholder = "Enter the Minimum Kilo Meter";
        document.getElementById('txtMinimumKm').focus();
    return false;
}
else {
   
        document.getElementById('txtMinimumKm').style.border = "";
}

    if (document.getElementById('txtDaystartfare').value == "") {
        document.getElementById('txtDaystartfare').style.border = "1px solid #FF0000";
        document.getElementById('txtDaystartfare').placeholder = "Enter the Day Start Fare";
        document.getElementById('txtDaystartfare').focus();
        return false;
    }
    else {

        document.getElementById('txtDaystartfare').style.border = "";
    }

    if (document.getElementById('txtAdditionaldayfare').value == "") {
        document.getElementById('txtAdditionaldayfare').style.border = "1px solid #FF0000";
        document.getElementById('txtAdditionaldayfare').placeholder = "Enter the Additional Day Fare";
        document.getElementById('txtAdditionaldayfare').focus();
        return false;
    }
    else {

        document.getElementById('txtAdditionaldayfare').style.border = "";
    }
    if (document.getElementById('txtwaitingfare').value == "") {
        document.getElementById('txtwaitingfare').style.border = "1px solid #FF0000";
        document.getElementById('txtwaitingfare').placeholder = "Enter the Waiting Fare";
        document.getElementById('txtwaitingfare').focus();
        return false;
    }
    else {

        document.getElementById('txtwaitingfare').style.border = "";
    }

    //if (document.getElementById('txtridefare').value == ""){
    //    document.getElementById('txtridefare').style.border = "1px solid #FF0000";
    //    document.getElementById('txtridefare').placeholder = "Enter the Ride Fare";
    //    document.getElementById('txtridefare').focus();
    //    return false;
    //}
    //else {

    //    document.getElementById('txtridefare').style.border = "";
    //}
    return true;
}



//Validate Pannic Status

function validatePanic()
{
      
    if (document.getElementById('ddlstatus').value == "") {
        document.getElementById('ddlstatus').style.border = "1px solid #FF0000";
        document.getElementById('ddlstatus').focus();
        return false;
    }
    else if (document.getElementById('ddlstatus').value == "0") {
        document.getElementById('ddlstatus').style.border = "1px solid #FF0000";
        document.getElementById('ddlstatus').focus();
        return false;
    }
    else {

        document.getElementById('ddlstatus').style.border = "";
    }

    if (document.getElementById('cmnts').value == "") {
        document.getElementById('cmnts').style.border = "1px solid #FF0000";
        document.getElementById('cmnts').placeholder = "Enter the Comments";
        document.getElementById('cmnts').focus();
        return false;
    }
    else {

        document.getElementById('cmnts').style.border = "";
    }
    return true;

}


//Validate Place Details

function validatePlacedetails() {

    if (document.getElementById('place').value == "") {
        document.getElementById('place').style.border = "1px solid #FF0000";
        document.getElementById('place').placeholder = "Enter the Place Name";
        document.getElementById('place').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('place').style.border = "";
    }


    return true;

}
function validateAddPlacedetails() {

    if (document.getElementById('ddllandmark').value == "") {
        document.getElementById('ddllandmark').style.border = "1px solid #FF0000";
        document.getElementById('ddllandmark').placeholder = "Enter the Place Name";
        document.getElementById('ddllandmark').focus();
        return false;
    }
    else {
        //document.getElementById('txtVehicleName').style.border = "1px solid #CCC";
        document.getElementById('ddllandmark').style.border = "";
    }


    return true;

}


//---------------------------------------------------------------------------------------------