
@{
    Layout = null;
}

<html>
<head>
    <title>UPES | Applicant Dashboard | Edit Application </title>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!--Style-->
    <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,700,800,900" rel="stylesheet">
    <link href="../css/component.css" rel="stylesheet" />
    <link href="../css/main.css" rel="stylesheet" />
    <link href="../css/ApplicationTemplate.css" rel="stylesheet" />
    <style>
        .ImageSize {
            color: red;
            padding: 10px 0 0 0;
            font-size: 13px;
            text-align: center;
        }

        .LabelList.d-flex {
            align-items: center;
        }

        .EditSubTitle {
        }

        .EditSubTitle {
            font-size: 16px;
            padding: 10px 0;
        }

        form {
            margin: 0;
        }
    </style>
</head>
<body>
    <!--Application Template-->
    <header class="position-relative">
        <section class="HeaderPanel HeaderBanner">
            <div class="plr70">
                <div class="headerInner">
                    <a href="/">
                        <img src="../img/application/upes logo.png" class="img-fluid" alt="Logo" />
                    </a>
                </div>
            </div>
        </section>

    </header>
    @using (Html.BeginForm("editapplication", "Application", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        <main role="main" class="ApplicationTemplate">
            <section class="FormTemplate formBlkStyle EditApplication">
                <div class="FormPosition">
                    <div class="TitlePanel text-center">
                        <h1 class="fontExBold ApplicationTitle">Edit Application Form</h1>
                    </div>
                    <!--Form Panel-->
                    <div class="FormPanel">
                        <div class="FormPanelInner noborder  row no-gutters justify-content-end">
                            <div class="text-right">
                                <a href="/Application" class=" backstyle">Back</a>
                            </div>
                        </div>


                        <div class="FormPanelInner noborder  ">
                            <div class="PanelForTile d-flex no-gutters align-items-center justify-content-center">
                                <div class="editProfile">
                                    <div class="avatar-upload">
                                        <div  style="display:none;" class="avatar-edit">
                                            @*<input type='file' accept=".png, .jpg, .jpeg" />*@
                                            <input  type="file" onchange="ValidateSizeEdit(this)"
                                                   data-title="upload files" id="filephoto" name="filephoto" accept="image/jpeg,image/jpg,image/png">
                                            <label for="filephoto"></label>
                                        </div>
                                        <div class="avatar-preview">
                                            <div id="imagePreview" style="background-image: url(../profileimages/@ViewBag.p_image);">
                                            </div>
                                        </div>
                                        <div class="Error">
                                            <p style="display:none;" class="ImageSize">Image size should be below 50 KB </p>
                                        </div>
                                    </div>
                                </div>

                                <div style="display:none;" class="UploadPanel ">
                                    <button type="button" class="btn btn-primary UploadBtn" id="Fileupload">Upload</button>
                                </div>
                            </div>
                        </div>
                        <!--PanelOne-->

                        <div class="FormPanelInner noborder " id="PersonalDetails">
                            <div class="PanelForTile d-flex no-gutters align-items-center">
                                <h2 class="fontExBold ApplicationSubTitle col-6">Personal Details</h2>
                            </div>
                            <div class="EditBlk">
                                <div class="form-group plr7  LabelList d-flex">
                                    <span class="col-4">First Name:</span>  <label type="text" class=" LabelForEdit col-8" />@ViewBag.fname
                                </div>
                                <div class="form-group plr7 LabelList d-flex">
                                    <span class="col-4">Middle Name:</span> <label type="text" class=" LabelForEdit col-8" />@ViewBag.mname
                                </div>
                                <div class="form-group plr7  LabelList d-flex">
                                    <span class="col-4">Last Name:</span>  <label type="text" class=" LabelForEdit  col-8" />@ViewBag.lname

                                </div>
                                <div class="form-group plr7 LabelList d-flex">
                                    <span class="col-4">Date of Birth:</span>  <label type="text" class=" LabelForEdit  col-8" />@ViewBag.dob
                                </div>
                                <div class="form-group plr7 LabelList d-flex">
                                    <span class="col-4">Email ID:</span>  <label type="text" class=" LabelForEdit  col-8" />@ViewBag.email
                                </div>
                                <div class="form-group plr7 LabelList d-flex">
                                    <span class="col-4">Mobile Number:</span>  <label type="text" class=" LabelForEdit  col-8" />@ViewBag.mobile
                                </div>
                                <div class="form-group plr7 LabelList d-flex">
                                    <span class="col-4">Selected Course:</span>  <label type="text" class=" LabelForEdit  col-8" />@ViewBag.course
                                </div>
                            </div>
                        </div>
                        <!--PanelTwo-->
                        <div class="FormPanelInner">
                            <div class="PanelForTile d-flex no-gutters align-items-center">
                                <h2 class="fontExBold ApplicationSubTitle col-6">Academic Details</h2>
                                <div class="EditList col-6 d-flex justify-content-end">
                                    <button type="button" id="btnedit" class="btn btn-primary  BtnForlist EditBtnStyle" onclick="return EditBtn()">Edit</button>
                                    @*<button class="btn btn-primary  BtnForlist SaveBtnStyle" style="display:none;" onclick="return saveeditform()">Save</button>*@
                                </div>
                            </div>
                            <div id="labelcont_2">
                                <p class="form-text fontMedium">How did you know about UPES?</p>
                                <p> @ViewBag.sourse @ViewBag.coachingcenter @ViewBag.othercoachingcenter</p>


                                @if (ViewBag.nationality == "indian")
                                {

                                    <h2 class="fontBold EditSubTitle">10th class Details</h2>

                                    <div class="ClassDetails  ">
                                        <div class="form-group plr7 LabelList d-flex">

                                            <span class="col-4 fontMedium">Year of Passing : </span>
                                            <label class="LabelForEdit col-8 ">
                                                @ViewBag.tenthyearofpassing
                                            </label>
                                        </div>
                                        <div class="form-group plr7 LabelList d-flex">
                                            <span class="col-4 fontMedium">Marks : </span>
                                            <label class="LabelForEdit col-8 ">@ViewBag.tenthmarks</label>
                                        </div>
                                    </div>
                                    <h2 class="fontBold EditSubTitle">12th class Details</h2>
                                    <div class="ClassDetails">
                                        <div class="form-group plr7 LabelList d-flex">
                                            <span class="col-4 fontMedium">Year of Passing : </span>
                                            <label class="LabelForEdit col-8 ">
                                                @ViewBag.twelveyearofpassing
                                            </label>
                                        </div>
                                        @if (ViewBag.twelveyearofpassing != "2019")
                                        {
                                            <div class="col-6 plr7">
                                                <p class="form-text fontMedium">Total Marks : @ViewBag.twelvemarks</p>
                                                @if (ViewBag.twelvemarkspcm != "")
                                                {
                                                    <p class="form-text fontMedium">PCM Marks : @ViewBag.twelvemarkspcm</p>
                                                }
                                            </div>
                                        }
                                    </div>
                                    if (ViewBag.ugpg == "PG")
                                    {
                                        <div class="FormRadioOptions">
                                            <p class="fontMedium form-text">Graduation Details</p>

                                            <div class="ClassDetails row mlr">
                                                <div class="col-6 plr7">

                                                    <p class="form-text fontMedium">Year of Passing : @ViewBag.ugyearofpassing</p>
                                                </div>
                                                @if (ViewBag.ugyearofpassing != "2019")
                                                {
                                                    <div class="col-6 plr7">
                                                        <p class="form-text fontMedium">Marks : @ViewBag.ugmarks</p>
                                                        @*<p class="form-text fontMedium">College : @ViewBag.ugcollege</p>*@
                                                    </div>
                                                }
                                            </div>
                                        </div>
                                    }
                                }


                                else
                                {

                                    <div class="ClassDetails">
                                        <div class="form-group plr7 LabelList d-flex">
                                            <span class="col-4 fontMedium">Highest Educational Qualification: </span>
                                            <label class="LabelForEdit col-8 ">
                                                @ViewBag.hiedcationunrivalue

                                            </label>
                                        </div>
                                        <div class="form-group plr7 LabelList d-flex">
                                            <span class="col-4 fontMedium">Country Studied </span>
                                            <label class="LabelForEdit col-8 ">
                                                @ViewBag.countrystudied

                                            </label>
                                        </div>
                                        <div class="form-group plr7 LabelList d-flex">
                                            <span class="col-4 fontMedium">School / College Name </span>
                                            <label class="LabelForEdit col-8 ">
                                                @ViewBag.twelvecollege

                                            </label>
                                        </div>
                                    </div>

                                }
                            </div>
                            <div id="editablecont_2" style="display:none;">
                                <div class="FormRadioOptions">
                                    <div style="display:none;">
                                        <p class="form-text fontMedium">Nationality?</p>
                                        <div class="row radioInner">
                                            <label>
                                                <input type="radio" id="radnantionindian" value="indian" class="Radiostyle" name="nation" checked onclick="checknation('indian');" /><span>Indian Resident </span>
                                            </label>
                                            <label class="noPadding">
                                                <input type="radio" id="radnantionnri" value="nri" class="Radiostyle" name="nation" onclick="checknation('nri')" /><span>NRI/International Students</span>
                                            </label>
                                        </div>

                                    </div>

                                    <select class="FormStyle" id="country" name="country">

                                        <option value="0">select country</option>
                                    </select>

                                    <div id="divindian">

                                        <select class="FormStyle" id="state" name="state">

                                            <option value="0">select state</option>
                                        </select>


                                        <select class="FormStyle" id="city" name="indiancity">
                                            <option value="0">Select City</option>
                                        </select>

                                    </div>

                                    <div id="divnri" style="display:none">

                                        <div class="col-sm-6 form-group">

                                            <input placeholder="City" type="text" class="form-control FormStyle" id="nricity" name="nricity" />
                                        </div>

                                    </div>


                                </div>
                                <div class="FormRadioOptions">
                                    <p class="form-text fontMedium">How did you know about UPES?</p>
                                    <select class="FormStyle selectpickers" id="source" name="source"></select>
                                    <select class="FormStyle selectpickers" style="display:none;" id="coachingcentre" name="coachingcentre"></select>
                                    <input type="text" class="form-control FormStyle" style="display:none;" placeholder="Enter the Coaching Institute's Name" name="othercoachingcentre" id="othercoachingcentre" />
                                    <div class="FormRadioOptions" id="divindianexam" style="display:none">
                                        <p class="fontMedium form-text">Your Mode of Application</p>
                                        <div class="row radioInner RadioList no-gutters">
                                            <div class="col-6 RadioListStyle">
                                                <label class="noPadding">
                                                    <input type="radio" value="exam" onclick="onappclick(1)" class="Radiostyle" name="radapplicationmade" checked /><span>Through UPES Entrance Exam</span>
                                                </label>
                                            </div>
                                            <div class="col-6 RadioListStyle" id="divpgmadeofexam" style="display:none">
                                                <label class="noPadding">
                                                    <input type="radio" value="pgnonexam" onclick="onappclick(2)" class="Radiostyle" name="radapplicationmade" /><span>Through Non Exam</span>
                                                </label>
                                            </div>

                                            <div id="divugmadeofexam" class="col-md-12 nonexam_third">
                                                <div class="col-6 RadioListStyle ne sd_22 sd_20 sd_19 sd_23 sd_12 sd_18 sd_6 sd_17 sd_15">


                                                    <label class="noPadding">
                                                        <input type="radio" value="non_exam_ug" onclick="onappclick(2)" class="Radiostyle" name="radapplicationmade" /><span>Through Non Exam</span>
                                                    </label>
                                                </div>
                                                <div class="col-6 RadioListStyle ne sd_2">
                                                    <label class="noPadding">
                                                        <input type="radio" value="non_exam_jee" onclick="onappclick(2)" class="Radiostyle" name="radapplicationmade" /><span>Through IIT JEE Scores</span>
                                                    </label>
                                                </div>

                                                <div class="col-6 RadioListStyle ne sd_8">
                                                    <label class="noPadding">
                                                        <input type="radio" value="non_exam_uceed" onclick="onappclick(2)" class="Radiostyle" name="radapplicationmade" /><span>Through UCEED/JEE mains Scores</span>
                                                    </label>
                                                </div>

                                                @*<div class="col-6 RadioListStyle">
                                                        <label class="noPadding">
                                                            <input type="radio" value="non_exam_jee" onclick="onappclick(2)" class="Radiostyle" name="radapplicationmade" /><span>JEE mains</span>
                                                        </label>
                                                    </div>*@

                                                <div class="col-6 RadioListStyle ne sd_16">
                                                    <label class="noPadding">
                                                        <input type="radio" value="non_exam_clat" onclick="onappclick(2)" class="Radiostyle" name="radapplicationmade" /><span>Through CLAT Scores</span>
                                                    </label>
                                                </div>

                                                <div class="col-6 RadioListStyle ne sd_3">
                                                    <label class="noPadding">
                                                        <input type="radio" value="non_exam_clat_lsat" onclick="onappclick(2)" class="Radiostyle" name="radapplicationmade" /><span>Through CLAT/LSAT Scores</span>
                                                    </label>
                                                </div>


                                                <div class="col-6 RadioListStyle bm">
                                                    <label class="noPadding">
                                                        <input type="radio" value="non_exam_board_merit" onclick="onappclick(2)" class="Radiostyle bm" name="radapplicationmade" /><span>Through Board Merit</span>
                                                    </label>
                                                </div>

                                            </div>


                                        </div>
                                        <div class="form-group" id="divappmade" style="display:none">
                                            <input type="text" id="jeescore" name="jeescore" class="form-control FormStyle" placeholder="Enter Score" />
                                        </div>
                                    </div>

                                    <div id="divindian2page">

                                        <div class="FormRadioOptions">
                                            <p class="fontMedium form-text">10th class Details * </p>
                                            <div class="row radioInner">
                                                <label>
                                                    <input type="radio" class="Radiostyle" value="Percentage" name="tenthmarktype" checked onclick="checkperten('per')" /><span>Percentage</span>
                                                </label>
                                                <label class="noPadding">
                                                    <input type="radio" class="Radiostyle" value="CGPA" name="tenthmarktype" onclick="checkperten('cgpa')" /><span>CGPA</span>
                                                </label>
                                            </div>
                                            <div class="ClassDetails row mlr">
                                                <div class="col-6 plr7">
                                                    <select class="FormStyle" id="tenthyearofpassing" name="tenthyearofpassing"></select>
                                                </div>
                                                <div class="col-6 plr7" id="divtenper">
                                                    <input type="text" onkeypress="return isNumberKey(event)" name="tenthper" id="tenthper" class="form-control FormStyle" maxlength="5" placeholder="Marks in Percentage *" />
                                                </div>
                                                <div class="col-6 plr7" id="divtencgpa" style="display:none">
                                                    <input type="text" onkeypress="return isNumberKey(event)" name="tenthcgpa" id="tenthcgpa" class="form-control FormStyle" maxlength="5" placeholder="Marks in CGPA *" />
                                                </div>

                                            </div>
                                        </div>
                                        <div class="FormRadioOptions">
                                            <p class="fontMedium form-text">12th class Details *</p>
                                            <p class="form-MediumText fontMedium">Are you appearing for exams this academic year?</p>
                                            <div class="row radioInner">
                                                <label>
                                                    <input type="radio" id="radtwyes" value="Yes" class="Radiostyle" name="radtwappear" onclick="bindyear('yes');" /><span>Yes</span>
                                                </label>
                                                <label class="noPadding">
                                                    <input type="radio" id="radtwno" value="No" class="Radiostyle" name="radtwappear" checked onclick="bindyear('no');" /><span>No</span>
                                                </label>
                                            </div>
                                            <div class="ClassDetails row mlr">
                                                <div class="col-6 plr7">
                                                    <select class="FormStyle" id="twyearofpassing" name="twyearofpassing">
                                                        <option value="0">Year of Passing *</option>
                                                        @*<option>2019</option>*@

                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="FormRadioOptions">

                                            <div id="dvtw">
                                                <p class="fontMedium form-text">Marks *</p>
                                                @*<p class="form-MediumText fontMedium">Are you appearing for exams this academic year?</p>*@

                                                <div class="ClassDetails row mlr">
                                                    <div class="col-6 plr7 ">
                                                        <input type="text" onkeypress="return isNumberKey(event)" id=twper name="twper" class="form-control FormStyle" maxlength="5" placeholder="Marks in Percentage *" />
                                                    </div>
                                                    <div class="col-6 plr7 ">
                                                        <input type="text" onkeypress="return isNumberKey(event)" id=twpcm name="twpcm" class="form-control FormStyle" maxlength="5" placeholder="PCM/PCB Percentage" />
                                                    </div>
                                                </div>
                                            </div>

                                        </div>


                                        <div class="mt30">
                                            <input type="text" name="twsclclg" id="twsclclg" class="form-control FormStyle" placeholder="Name of School/College *" />
                                        </div>

                                    </div>
                                    <div id="divnri2page" style="display:none">
                                        <div class="mt30">
                                            <input type="text" name="hiedcationunri" id="hiedcationunri" class="form-control FormStyle" placeholder="Highest Educational Qualification *" />
                                        </div>

                                        <select class="FormStyle" name="nricountry" id="nricountry">

                                            <option value="0">select country</option>
                                        </select>

                                        <div class="mt30">
                                            <input type="text" name="nriclgname" id="nriclgname" class="form-control FormStyle" placeholder="Name of School/College *" />
                                        </div>

                                    </div>
                                    <div id="divpg" style="display:none">
                                        <br />
                                        <p class="form-text fontMedium">Graduation Details *</p>
                                        <p class="form-MediumText fontMedium">Are you appearing for exams this academic year?</p>
                                        <div class="row radioInner">
                                            <label>
                                                <input type="radio" value="yes" id="radugyes" class="Radiostyle" name="radpgapp" checked onclick="pgappearing('yes');" /><span>Yes</span>
                                            </label>
                                            <label class="noPadding">
                                                <input type="radio" value="no" id="radugno" class="Radiostyle" name="radpgapp" onclick="pgappearing('nopg');" /><span>No</span>
                                            </label>
                                        </div>


                                        <select class="FormStyle selectpickers" id="pgyearofappearing" name="pgyearofappearing">
                                            <option value="0">Year of Passing *</option>
                                        </select>


                                        <div class="form-group" id="divpgper" style="display:none">
                                            <input type="text" class="form-control FormStyle" onkeypress="return isNumberKey(event)" maxlength="5" placeholder="Graduation Percentage (%)(XX.XX) *" name="pgpercentage" id="pgpercentage" />
                                        </div>


                                    </div>
                                </div>

                            </div>
                            <!--Panel Four-->
                            <div>
                                <div class="PanelForTile d-flex no-gutters align-items-center">
                                    <h2 class="fontExBold ApplicationSubTitle col-6">Category Details</h2>
                                    @*<div class="EditList col-6 d-flex justify-content-end">
                                            <button class="btn btn-primary  BtnForlist EditBtnStyle">Edit</button>
                                            <button class="btn btn-primary  BtnForlist SaveBtnStyle">Save</button>
                                        </div>*@
                                </div>
                                <div id="labelcont_3">
                                    <div class="Pref_Spl CategoryPanel">
                                        <p class="fontMedium form-text">Preferred Program Specialisations</p>
                                        <p>@ViewBag.program1 <br /> @ViewBag.program2 <br /> @ViewBag.program3</p>
                                    </div>

                                    <div class="FormRadioOptions CategoryPanel">

  @if (ViewBag.nationality == "indian")
                                        {
                                            @*<p>Category: @ViewBag.category</p>*@
                                            <p>Domicle of Uttarkand: @ViewBag.domicile</p>
                                        }
                                        <p class="form-text fontMedium">Address</p>
                                        <p>@ViewBag.address1</p>
                                        <p>@ViewBag.address2</p>
                                        <p>@ViewBag.address3</p>

                                        <p>@ViewBag.city</p>
                                        <p>@ViewBag.state @ViewBag.pincode</p>

                                        <p>@ViewBag.nricity</p>
                                        <p>@ViewBag.country</p>
                                    </div>
                                    @if (ViewBag.appcat != "")
                                    {
                                        <div class="FormRadioOptions ">
                                            <p class="fontMedium form-text">Your Mode of Application</p>
                                            <p>@ViewBag.appcat</p>
                                            @*<p>@ViewBag.appcat  - Score @ViewBag.jeescore</p>*@

                                        </div>
                                    }

                                    @if (ViewBag.appcat == "Exam" && ViewBag.examcity1 != "0")
                                    {
                                        <div class="FormRadioOptions CategoryPanel">
                                            <p class="form-text fontMedium">Exam City</p>
                                            <p>Preference 1 @ViewBag.examcity1</p>
                                            <p>Preference 2 @ViewBag.examcity2</p>
                                        </div>
                                    }
                                </div>

                                <div id="editablecont_3" style="display:none">
                                    <div class="Pref_Spl CategoryPanel">
                                        <p class="fontMedium form-text">Preferred Specialisations (You can select upto 3)</p>
                                        <div class="SplList">
                                            <div class="FormRadioOptions Scroll">
                                                <div id="divbindheckbox" class="SplRadiostyle">

                                                </div>


                                            </div>
                                        </div>
                                    </div>
                                    <div id="examcity" style="display:none;">
                                        <p class="fontMedium form-text">Select Exam City *</p>
                                        <p class="fontMedium form-text">Preference 1 *</p>

                                        <select class="FormStyle selectpickers" id="examcity1" name="examcity1"></select>

                                        <p class="fontMedium form-text">Preference 2 *</p>
                                        <select class="FormStyle selectpickers" id="examcity2" name="examcity2"></select>
                                    </div>
                                    <div id="divpage4indian">
                                        <div class="FormRadioOptions CategoryPanel">
                                            <p class="fontMedium form-text">Category *</p>
                                            <div class="row radioInner RadioList no-gutters">
                                                <div class="col-4 RadioListStyle">
                                                    <label class="noPadding">
                                                        <input type="radio" class="Radiostyle" name="caste" checked value="1" /><span>General</span>
                                                    </label>
                                                </div>
                                                <div class="col-4 RadioListStyle">
                                                    <label class="noPadding">
                                                        <input type="radio" class="Radiostyle" name="caste" value="5" /><span>Differently Abled</span>
                                                    </label>
                                                </div>
                                                <div class="col-4 RadioListStyle">
                                                    <label class="noPadding">
                                                        <input type="radio" class="Radiostyle" name="caste" value="3" /><span>OBC</span>
                                                    </label>
                                                </div>
                                                <div class="col-4 RadioListStyle">
                                                    <label class="noPadding">
                                                        <input type="radio" class="Radiostyle" name="caste" value="2" /><span>SC</span>
                                                    </label>
                                                </div>
                                                <div class="col-4 RadioListStyle">
                                                    <label class="noPadding">
                                                        <input type="radio" class="Radiostyle" name="caste" value="4" /><span>ST</span>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="FormRadioOptions CategoryPanel">
                                            <p class="form-text fontMedium">Are you a Domicile of Uttarakhand? *</p>
                                            <div class="row radioInner RadioList no-gutters">
                                                <div class="col-4 RadioListStyle">
                                                    <label class="noPadding">
                                                        <input type="radio" value="Yes" class="Radiostyle" name="domicile" /><span>Yes</span>
                                                    </label>
                                                </div>
                                                <div class="col-4 RadioListStyle">
                                                    <label class="noPadding">
                                                        <input type="radio" value="No" class="Radiostyle" name="domicile" checked /><span>No</span>
                                                    </label>
                                                </div>
                                            </div>
                                            <p class="form-text fontMedium">Enter your Address *</p>
                                            <div class="form-group  ">
                                                <input type="text" id="address1" name="address1" maxlength="50" class="form-control FormStyle" placeholder="House No *" />
                                            </div>
                                            <div class="form-group">
                                                <input type="text" id="address2" name="address2" maxlength="50" class="form-control FormStyle" placeholder="C/O *" />
                                            </div>
                                            <div class="form-group">
                                                <input type="text" id="address3" name="address3" maxlength="50" class="form-control FormStyle" placeholder="Address *" />
                                            </div>
                                            <div class="form-group col-6 noPadding">
                                                <input type="text" name="pincode" id="pincode" maxlength="6" class="form-control FormStyle" onkeyup="if (/\D/g.test(this.value)) this.value = this.value.replace(/\D/g,'')" placeholder="Pincode " onkeypress="return isNumber(event);" />
                                            </div>



                                        </div>

                                    </div>
                                    <div id="divpage4nri" style="display:none;">

                                        <div class="form-group">
                                            <input type="text" id="nriaddress" class="form-control FormStyle" placeholder="Address *" name="nriaddress" />
                                        </div>

                                    </div>
                                </div>

                                <div id="declartionText" class="row radioInner declartionText" style="display:none;">
                                    <label>
                                        <input type="radio" id="declare" class="Radiostyle" name="dec1" /><span>

                                            I declare that the information provided by me on this application form is true and correct to the best of my knowledge and belief. I have also read the <a style="text-decoration:underline;color:inherit;" target="_blank" href="/home/termsandconditions">terms & conditions </a>and understood the eligibility criteria and thereby confirm that I fulfill the criteria.
                                        </span>
                                    </label>
                                </div>
                                <div class="FormButtonStyle row no-gutters justify-content-center">
                                    <div class="text-center">
                                        <button type="submit" id="btnupdate" class="btn btn-primary BtnStyle" style="display:none;" onclick="return saveedit();">Update</button>
                                    </div>
                                </div>

                            </div>


                        </div>

                    </div>
                </div>
            </section>
        </main>

        <!--Helpline Chat-->
        <div class="helplineChatPanel ">
            <div class="plr70">
                <div class="helplineChatInner fontBold ">
                    <a id="helplineCrop" href="tel:+91 18001028737">
                        <img src="../img/application/helpline.png" class="img-fluid" alt="helpline" />
                        <span>Helpline</span>
                    </a>
                    <div class="Number">
                        <a href="tel:+9118001028737">
                            +91 18001028737
                        </a>
                    </div>
                    <a href="javascript:void(0);" onclick="openChat();">
                        <img src="../img/application/chat.png" class="img-fluid" alt="helpline" />
                        <span>Chat</span>
                    </a>
                </div>
            </div>
        </div>

        <!--Footer-->
        <footer>
            <section class="FooterPanel">
                <div class="foot_Btm foot_Btm_Height">
                    <div class="plr70">
                        <div class="footBtmRow foot_Btm_Height row align-items-center no-gutters">
                            <div class="col-sm-6 copyRights">
                                <h5 style="display:inline;" class="text-uppercase fontBold">
                                    &copy; @DateTime.Now.Year UPES. All Rights Reserved.
                                </h5>
                                <span> <a style="color:#000;text-decoration:underline;" class="text-uppercase fontBold" target="_blank" href="/home/termsandconditions">Terms and Conditions</a></span>
                            </div>
                            <div class="col-sm-6 SocialIcon d-flex justify-content-end align-items-center">
                                <p class="text-uppercase fontBold">Follow Us On:</p>
                                <div class="social_icon_menus">
                                    <a href="https://www.facebook.com/UniversityofPetroleumandEnergyStudies" target="_blank">
                                        <img src="../img/application/facebook-black.png" class="img-fluid" />
                                    </a>
                                    <a href="https://twitter.com/UPESDehradun" target="_blank">
                                        <img src="../img/application/twitter-black.png" class="img-fluid" />
                                    </a>
                                    <a href="https://www.instagram.com/upes_dehradun/" target="_blank">
                                        <img src="../img/application/insta-black.png" class="img-fluid" />
                                    </a>
                                    <a href="https://www.youtube.com/user/UPESUniversity/featured" target="_blank">
                                        <img src="../img/application/youtube-black.png" class="img-fluid" />
                                    </a>
                                    <a href="https://www.linkedin.com/school/university-of-petroleum-and-energy-studies/" target="_blank">
                                        <img src="../img/application/linkedin-black.png" class="img-fluid" />
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </footer>
        <input type="hidden" id="hdnvalidImage" value="yes" name="hdnvalidImage" />
        <input type="hidden" id="hdncid" name="cid" />
        <input type="hidden" id="twelvecollege" name="twelvecollege" />
        <input type="hidden" id="tenthmarkfinal" name="tenthmarkfinal" />
        <input type="hidden" id="sourcetext" name="sourcetext" />
        <input type="hidden" id="coachinginstitutetext" name="coachinginstitutetext" />
        <input type="hidden" id="othercoachinginstitutetext" name="othercoachinginstitutetext" />
        <input type="hidden" value="@ViewBag.appcat" name="hdnexammode" id="hdnexammode" />
        <input type="hidden" value="@ViewBag.p_image" name="hdnfileupload" id="hdnfileupload" />
        <input type="hidden" value="@ViewBag.appcat" name="hdnexammodeapp" id="hdnexammodeapp" />
        <input type="hidden" value="@ViewBag.courseid" name="hdncourseid" id="hdncourseid" />
        <input type="hidden" value="@ViewBag.Nationality" name="hdntype" id="hdntype" />
        <input type="hidden" value="@ViewBag.ugpg" name="hdnstudytype" id="hdnstudytype" />
        <input type="hidden" value="@ViewBag.tenthyearofpassing" name="bnd_tenthyearofpassing" id="bnd_tenthyearofpassing" />
        <input type="hidden" value="@ViewBag.tenthmarks" name="bnd_tenthmarks" id="bnd_tenthmarks" />
        <input type="hidden" value="@ViewBag.twelveyearofpassing" name="bnd_twelveyearofpassing" id="bnd_twelveyearofpassing" />
        <input type="hidden" value="@ViewBag.twelvemarks" name="bnd_twelvemarks" id="bnd_twelvemarks" />
        <input type="hidden" value="@ViewBag.twelvemarkspcm" name="bnd_twelvemarkspcm" id="bnd_twelvemarkspcm" />
        <input type="hidden" value="@ViewBag.ugpg" name="bnd_ugpg" id="bnd_ugpg" />
        <input type="hidden" value="@ViewBag.ugyearofpassing" name="bnd_ugyearofpassing" id="bnd_ugyearofpassing" />
        <input type="hidden" value="@ViewBag.ugmarks" name="bnd_ugmarks" id="bnd_ugmarks" />
        <input type="hidden" value="@ViewBag.hiedcationunrivalue" name="bnd_hiedcationunri" id="bnd_hiedcationunri" />
        <input type="hidden" value="@ViewBag.countrystudied" name="bnd_countrystudied" id="bnd_countrystudied" />
        <input type="hidden" value="@ViewBag.countrystudiedid" name="bnd_countrystudiedid" id="bnd_countrystudiedid" />
        <input type="hidden" value="@ViewBag.twelvecollege" name="bnd_twelvecollege" id="bnd_twelvecollege" />
        <input type="hidden" value="@ViewBag.program1" name="bnd_program1" id="bnd_program1" />
        <input type="hidden" value="@ViewBag.program2" name="bnd_program2" id="bnd_program2" />
        <input type="hidden" value="@ViewBag.program3" name="bnd_program3" id="bnd_program3" />
        <input type="hidden" value="@ViewBag.address1" name="bnd_address1" id="bnd_address1" />
        <input type="hidden" value="@ViewBag.address2" name="bnd_address2" id="bnd_address2" />
        <input type="hidden" value="@ViewBag.address3" name="bnd_address3" id="bnd_address3" />
        <input type="hidden" value="@ViewBag.examcity1" name="bnd_examcity1" id="bnd_examcity1" />
        <input type="hidden" value="@ViewBag.examcity2" name="bnd_examcity2" id="bnd_examcity2" />
        <input type="hidden" value="@ViewBag.city" name="bnd_city" id="bnd_city" />
        <input type="hidden" value="@ViewBag.state" name="bnd_state" id="bnd_state" />
        <input type="hidden" value="@ViewBag.pincode" name="bnd_pincode" id="bnd_pincode" />
        <input type="hidden" value="@ViewBag.address1" name="bnd_nriaddress" id="bnd_nriaddress" />
        <input type="hidden" value="@ViewBag.nricity" name="bnd_nricity" id="bnd_nricity" />
        <input type="hidden" value="@ViewBag.country" name="bnd_country" id="bnd_country" />
        <input type="hidden" value="@ViewBag.countryid" name="bnd_countryid" id="bnd_countryid" />
        <input type="hidden" value="@ViewBag.sourseid" name="bnd_sourseid" id="bnd_sourseid" />
        <input type="hidden" value="@ViewBag.coachingcenterid" name="bnd_coachingcenterid" id="bnd_coachingcenterid" />
        <input type="hidden" value="@ViewBag.othercoachingcenter" name="bnd_othercoaching" id="bnd_othercoaching" />
        <input type="hidden" value="@ViewBag.stateid" name="bnd_stateid" id="bnd_stateid" />
        <input type="hidden" value="@ViewBag.cityid" name="bnd_cityid" id="bnd_cityid" />



        <script type="text/javascript" src="../Scripts/component.js"></script>



        <script type="text/javascript" src="../Scripts/upes-appliaction.js"></script>



        <script>




            $(document).ready(function () {

                var hdnexammode = $("#hdnexammode").val();
                var selCourseid = $("#hdncourseid").val();
                var selCourseid = $("#hdncourseid").val();
                var c_id = $("#hdncourseid").val();
                var typenat = $("#hdntype").val();
                

                if (typenat == "indian") {
                    $("#divindianexam").show();
                    $('#divpage4indian').show();
                    $('#divpage4nri').hide();
                    $("#radnantionindian").attr("checked", true);

                }
                else if (typenat == "nri") {
                    $("#divindianexam").hide();

                    $('#divpage4indian').hide();
                    $('#divpage4nri').show();
                    $("#radnantionnri").attr("checked", true);
                }


                $(".ne").hide();
                var c_id = $("#cource").val();

                if (c_id != "0") {

                    bindcheckbox(c_id);
                }
                var study = $("input[name='radstudy']:checked").val();

                if (c_id == "2" || c_id == "16") {

                    $("#twpcm").attr("placeholder", "PCM/PCB Percentage *");
                }
                else {

                    $("#twpcm").attr("placeholder", "PCM/PCB Percentage");
                }
                if (study == "UG") {
                    $(".ne").hide();
                    $(".bm").hide();
                    $(".sd_" + this.value).show();
                    var selid = this.value;
                    if (selid == "8" || selid == "3" || selid == "20") {
                        $(".bm").show();
                    }
                    //$("#radtwno").trigger('click');
                }
                else if (study = "PG")
                {
                    //$("#radtwno").trigger('click');
                    //$("#radugyes").trigger('click');  
                    // alert(study + selected_course);
                }



                bindcheckbox(c_id);
                bindcoaching();
                bindExamCity();
                bindyear10th();
                bindsource();
                bindstate();
                bindcdata();
                checknation(typenat);



                //bind defaults
                var bnd_coachingcenterid = $("#bnd_coachingcenterid").val();
                var bnd_sourseid = $("#bnd_sourseid").val();
                var bnd_countryid = $("#bnd_countryid").val();
                var bnd_nricity = $("#bnd_nricity").val();
                var bnd_pincode = $("#bnd_pincode").val();
                var bnd_nriaddress = $("#bnd_nriaddress").val();
                var bnd_state = $("#bnd_state").val();
                var bnd_city = $("#bnd_city").val();
                var bnd_examcity2 = $("#bnd_examcity2").val();
                var bnd_examcity1 = $("#bnd_examcity1").val();
                var bnd_address3 = $("#bnd_address3").val();
                var bnd_address2 = $("#bnd_address2").val();
                var bnd_address1 = $("#bnd_address1").val();
                var bnd_program3 = $("#bnd_program3").val();
                var bnd_program2 = $("#bnd_program2").val();
                var bnd_program1 = $("#bnd_program1").val();
                var bnd_twelvecollege = $("#bnd_twelvecollege").val();
                var bnd_countrystudied = $("#bnd_countrystudied").val();
                var bnd_countrystudied = $("#bnd_countrystudied").val();
                var bnd_countrystudiedid = $("#bnd_countrystudiedid").val();
                var bnd_ugmarks = $("#bnd_ugmarks").val();
                var bnd_ugyearofpassing = $("#bnd_ugyearofpassing").val();
                var bnd_ugpg = $("#bnd_ugpg").val();
                var bnd_twelvemarkspcm = $("#bnd_twelvemarkspcm").val();
                var bnd_twelvemarks = $("#bnd_twelvemarks").val();
                var bnd_tenthmarks = $("#bnd_tenthmarks").val();
                var bnd_tenthyearofpassing = $("#bnd_tenthyearofpassing").val();
                var bnd_stateid = $("#bnd_stateid").val();
                var bnd_cityid = $("#bnd_cityid").val();
                var bnd_hiedcationunri =  $("#bnd_hiedcationunri").val();
             
                $("#country option[value='" + bnd_countryid + "']").attr("selected", true);
                $("#nricity").val(bnd_nricity);
                $("#source option[value='" + bnd_sourseid + "']").attr("selected", true);
                if (bnd_sourseid == "3") {

                    $("#coachingcentre").show();
                }

                $("#coachingcentre option[value='" + bnd_coachingcenterid + "']").attr("selected", true);

                if (bnd_coachingcenterid == "others") {

                    $("#othercoachingcentre").show();
                }
                $("#othercoachingcentre").val(bnd_othercoaching);
              //  alert(bnd_hiedcationunri);
                $("#hiedcationunri").val(bnd_hiedcationunri);
                $("#nriclgname").val(bnd_twelvecollege);
                $("#nricountry option[value='" + bnd_countrystudiedid + "']").attr("selected", true);
                $("#nriaddress").val(bnd_nriaddress);

                $("#state option[value='" + bnd_stateid + "']").attr("selected", true);
                bindcityload(bnd_stateid,bnd_cityid);
                
         
                $("#tenthyearofpassing option[value='" + bnd_tenthyearofpassing + "']").attr("selected", true);
                $("#tenthper").val(bnd_tenthmarks);
                if (study == "PG") {
                    $("#radtwno").trigger('click');
                }

                $("#twyearofpassing option[value='" + bnd_tenthyearofpassing + "']").attr("selected", true);
                $("#twper").val(bnd_twelvemarks);
                $("#twpcm").val(bnd_twelvemarkspcm); 
                $("#twsclclg").val(bnd_twelvecollege); 
                $("#twyearofpassing option[value='" + bnd_ugyearofpassing + "']").attr("selected", true);
                $("#examcity1 option[value='" + bnd_examcity1 + "']").attr("selected", true);
                $("#examcity2 option[value='" + bnd_examcity2 + "']").attr("selected", true);
                $("#address1").val(bnd_address1);
                $("#address2").val(bnd_address2);
                $("#address3").val(bnd_address3);
                $("#pgpercentage").val(bnd_ugmarks);


                
            });

            function bindcityload(statesel, bnd_cityid) {

                var serviceURLcity = '/Home/bindcity';
                $.ajax({
                    url: serviceURLcity,
                    type: "GET",
                    dataType: "HTML",
                    data: {
                        stateid: statesel
                    },
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {

                            $("#city").html(data);
                            $("#city option[value='" + bnd_cityid + "']").attr("selected", true);
                        }
                        else {
                            console.log("Error:bindcity")
                        }
                        console.log("Error:bindcity2")

                    }
                });
            }
            function readURL(input) {
                if (input.files && input.files[0]) {
                    var reader = new FileReader();
                    reader.onload = function (e) {
                        $('#imagePreview').css('background-image', 'url(' + e.target.result + ')');
                        $('#imagePreview').hide();
                        $('#imagePreview').fadeIn(650);
                    }
                    reader.readAsDataURL(input.files[0]);
                }
            }
            $("#filephoto").change(function () {
                readURL(this);
            });
            $('#Fileupload').click(function () { $('#filephoto').trigger('click'); });

            function EditBtn() {
                $("#declartionText").show();
                $("#btnupdate").show();
                $("#labelcont_3").hide();
                $("#editablecont_3").show();
                $("#labelcont_2").hide();
                $("#editablecont_2").show();
                $("#btnedit").hide();
                $(".avatar-edit").show();
                //bindalldataonedit();
            }
            function saveedit() {


                var applicationmade = $("input[name='radapplicationmade']:checked").val();
                var jeescore = $("#jeescore").val();
                var typeofnation = $("#hdntype").val();

                var country = $("#country").val();
                var state = $("#state").val();
                var indiancity = $("#city").val();
                var nricity = $("#nricity").val();
                var course = $("#hdncourseid").val();

                var source = $("#source").val();
                var sourcetext = $("#source :selected").text();
                var coachinginstitute = $("#coachingcentre").val();
                var coachinginstitutetext = $("#coachingcentre :selected").text();
                var othercoachinginstitute = $("#othercoachingcentre").val();
                var othercoachinginstitutetext = $("#othercoachingcentre").text();
                var othercoachinginstitute_wo_space = $("#othercoachingcentre").val().replace(/ /g, '').length;
                var applicationmade = $("input[name='radapplicationmade']:checked").val();
                var jeescore = $("#jeescore").val();
                var alphabetsOnly = /^[a-zA-Z ]*$/;
                var validimage = $("#hdnvalidImage").val();


                $("#sourcetext").val(sourcetext);
                if (source == "3") {

                    $("#coachinginstitutetext").val(coachinginstitutetext);
                }
                else {

                    $("#coachinginstitutetext").val("");
                }

                if (coachinginstitute == "others") {
                    $("#othercoachinginstitutetext").val(othercoachinginstitutetext);
                }

                else {
                    $("#othercoachinginstitutetext").val("");

                }
                if (validimage == "No") {
                    $(".ImageSize").show();
                    return false;
                }

                else {
                    $(".ImageSize").hide();

                }
                if (typeofnation == "indian") {


                    //  alert(typeofnation);
                    if (country == "0") {
                        $(".validation").remove();
                        $("#country").focus();
                        $("#country").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please select Country</p>");
                        return false;
                    }


                    if (state == "0") {
                        $(".validation").remove();
                        $("#state").focus();
                        $("#state").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please select state</p>");
                        return false;
                    }

                    if (indiancity == "0") {
                        $(".validation").remove();
                        $("#city").focus();
                        $("#city").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please select city</p>");
                        return false;
                    }

                }
                else if (typeofnation == "nri") {

                    if (country == "0") {
                        $(".validation").remove();
                        $("#country").focus();
                        $("#country").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please select Country</p>");
                        return false;
                    }

                    if (nricity != "") {

                        if (!(alphabetsOnly.test((nricity)))) {
                            $(".validation").remove();
                            $("#nricity").focus();
                            $("#nricity").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid City Name</p>");
                            return false;
                        }
                    }
                }

                if (source == "0") {

                    $(".validation").remove();
                    $('#source').focus();
                    $('#source').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Select Source</p>");
                    return false;
                }
                if (source == "3") {

                    if (coachinginstitute == "0") {

                        $(".validation").remove();
                        $('#coachingcentre').focus();
                        $('#coachingcentre').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Select the Coaching Institute's Name</p>");
                        return false;
                    }

                    if (coachinginstitute == "others") {

                        if (othercoachinginstitute.length == 0) {
                            $(".validation").remove();
                            $('#othercoachingcentre').focus();
                            $('#othercoachingcentre').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter the Coaching Institute's Name</p>");
                            return false;
                        }

                        if (othercoachinginstitute_wo_space == 0) {
                            $(".validation").remove();
                            $('#othercoachingcentre').focus();
                            $('#othercoachingcentre').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter the Coaching Institute's Name</p>");
                            return false;
                        }
                    }
                }
                var entrancetype = $("#hdnexammode").val();
                var course = $('#hdncourseid').val();
                //nation
                var typeofnation = $("#hdntype").val();

                //10th
                var tenthmarktype = $("input[name='tenthmarktype']:checked").val();
                var tenthyearofpassing = $("#tenthyearofpassing").val();
                var tenthmarkper = $("#tenthper").val();
                var inttenthmarkper = parseInt(tenthmarkper);
                var tenthmarkcgpa = $("#tenthcgpa").val();
                var tenthcgpa2percentage = parseFloat(tenthmarkcgpa);
                tenthcgpa2percentage = tenthcgpa2percentage * 9.5;
                var inttenthcgpa2percentage = parseInt(tenthcgpa2percentage);
                //12th
                var twyearofpassing = $("#twyearofpassing").val();
                var twper = $("#twper").val();
                var inttwper = parseInt(twper);
                var twelvpcmpercentage = $("#twpcm").val();
                var inttwelvpcmpercentage = parseInt(twelvpcmpercentage);
                var twsclclg = $('#twsclclg').val();
                var twelfthappearing = $("input[name='radtwappear']:checked").val();
                // alert(twelfthappearing);

                //nri

                var nriedu = $("#hiedcationunri").val();
                var nricountry = $("#nricountry").val();
                var nriclgname = $("#nriclgname").val();
                //grd
                var study = $("input[name='radstudy']:checked").val();
                var pgappearing = $("input[name='radpgapp']:checked").val();
                var pgyearofappearing = $("#pgyearofappearing").val();
                var pgpercentage = $("#pgpercentage").val();
                var intpgpercentage = parseInt(pgpercentage);

                var isPercentage = /(^100(\.0{ 1, 2}) ? $) | (^ ([1 - 9]([0 - 9]) ?| 0)(\.[0 - 9]{ 1, 2}) ? $)/;


                if (typeofnation == "indian") {

                    //10th
                    if (tenthyearofpassing == "0") {
                        $(".validation").remove();
                        $("#tenthyearofpassing").focus();
                        $("#tenthyearofpassing").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Select Year of Passing</p>");
                        return false;
                    }

                    if (tenthmarktype == "Percentage") {
                        if (inttenthmarkper == "") {
                            $(".validation").remove();
                            $("#tenthper").focus();
                            $("#tenthper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Marks in Percentage</p>");
                            return false;
                        }
                        var result = validatepercentage(tenthmarkper);
                        if (!(result)) {
                            // alert(result);
                            $(".validation").remove();
                            $("#tenthper").focus();
                            $("#tenthper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid Percentage</p>");
                            return false;
                        }

                        if (course == "1" || course == "2") {
                            if (inttenthmarkper < 60) {
                                $(".validation").remove();
                                $("#tenthper").focus();
                                $("#tenthper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met :Eligibility criteria is minimum 60%.</p>");
                                return false;
                            }
                        }

                        else if ((course == "3") && (entrancetype == "non_exam_board_merit")) {
                            if (inttenthmarkper < 85) {
                                $(".validation").remove();
                                $("#tenthper").focus();
                                $("#tenthper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met :Eligibility criteria is minimum 85%.</p>");
                                return false;
                            }

                        }
                        else if (course == "8" && entrancetype == "non_exam_board_merit") {
                            if (inttenthmarkper < 65) {
                                $(".validation").remove();
                                $("#tenthper").focus();
                                $("#tenthper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 65%.</p>");
                                return false;
                            }

                        }
                        else {
                            if (inttenthmarkper < 50) {
                                $(".validation").remove();
                                $("#tenthper").focus();
                                $("#tenthper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 50%.</p>");
                                return false;
                            }

                        }

                        $("#tenthmarkfinal").val(tenthmarkper);
                    }

                    else if (tenthmarktype == "CGPA") {

                        if (tenthmarkcgpa == "") {
                            $(".validation").remove();
                            $("#tenthcgpa").focus();
                            $("#tenthcgpa").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Marks in CGPA</p>");
                            return false;
                        }
                        var resultCGPA = validatecgpa(tenthmarkcgpa);
                        if (resultCGPA == false) {
                            $(".validation").remove();
                            $("#tenthcgpa").focus();
                            $("#tenthcgpa").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter valid Marks in CGPA</p>");
                            return false;
                        }
                        if (tenthmarkcgpa == "") {
                            $(".validation").remove();
                            $("#tenthcgpa").focus();
                            $("#tenthcgpa").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Marks in CGPA</p>");
                            return false;
                        }

                        if (course == "1" || course == "2") {
                            if (inttenthcgpa2percentage < 60) {
                                $(".validation").remove();
                                $("#tenthcgpa").focus();
                                $("#tenthcgpa").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 60%.</p>");
                                return false;
                            }
                        }
                        else if (course == "3" && entrancetype == "non_exam_board_merit") {
                            if (inttenthcgpa2percentage < 85) {
                                $(".validation").remove();
                                $("#tenthcgpa").focus();
                                $("#tenthcgpa").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 85%.</p>");
                                return false;
                            }

                        }
                        else if (course == "8" && entrancetype == "non_exam_board_merit") {
                            if (inttenthcgpa2percentage < 65) {
                                $(".validation").remove();
                                $("#tenthcgpa").focus();
                                $("#tenthcgpa").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 65%.</p>:");
                                return false;
                            }
                        }
                        else {

                            if (inttenthcgpa2percentage < 50) {
                                $(".validation").remove();
                                $("#tenthcgpa").focus();
                                $("#tenthcgpa").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 50%.</p>");
                                return false;
                            }
                        }

                        $("#tenthmarkfinal").val(tenthcgpa2percentage);
                    }

                    //12th
                    if (twyearofpassing == "0") {
                        $(".validation").remove();
                        $("#twyearofpassing").focus();
                        $("#twyearofpassing").after("<p class='validation' style='color:red;margin-bottom:0px;'>Year of Passing</p>");
                        return false;
                    }


                    if (twelfthappearing == "No") {

                        if (twyearofpassing <= tenthyearofpassing) {
                            $(".validation").remove();
                            $("#twyearofpassing").focus();
                            $("#twyearofpassing").after("<p class='validation' style='color:red;margin-bottom:0px;'>Select Valid Year of Passing</p>");
                            return false;

                        }

                        if ((twyearofpassing - tenthyearofpassing) < 2) {
                            $(".validation").remove();
                            $("#twyearofpassing").focus();
                            $("#twyearofpassing").after("<p class='validation' style='color:red;margin-bottom:0px;'>Select Valid Year of Passing</p>");
                            return false;

                        }

                        // 12 overall percentage
                        if (twper == "") {
                            $(".validation").remove();
                            $("#twper").focus();
                            $("#twper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Marks in Percentage </p>");
                            return false;
                        }
                        var resulttw = validatepercentage(twper);
                        if (!(resulttw)) {
                            $(".validation").remove();
                            $("#twper").focus();
                            $("#twper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid Percentage </p>");
                            return false;
                        }

                        if (course == "1" || course == "2") {
                            if (inttwper < 60) {
                                $(".validation").remove();
                                $("#twper").focus();
                                $("#twper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 60%.</p>");
                                return false;
                            }
                        }
                        else if (course == "3" && entrancetype == "non_exam_board_merit") {
                            if (inttwper < 85) {
                                $(".validation").remove();
                                $("#twper").focus();
                                $("#twper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 85%.</p>");
                                return false;
                            }

                        }
                        else if (course == "8" && entrancetype == "non_exam_board_merit") {
                            if (inttwper < 65) {
                                $(".validation").remove();
                                $("#twper").focus();
                                $("#twper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 65%.</p>");
                                return false;
                            }
                        }
                        else {
                            if (inttwper < 50) {
                                $(".validation").remove();
                                $("#twper").focus();
                                $("#twper").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 50%.</p>");
                                return false;
                                return false;
                            }

                        }
                        // if (course == "2" || course == "21" || course == "22" || course == "20" || course == "16" || course == "17") {
                        if (course == "16" || course == "2") {
                            // 12 PCM percentage
                            if (twelvpcmpercentage == "") {
                                $(".validation").remove();
                                $("#twpcm").focus();
                                $("#twpcm").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter PCM Percentage</p>");
                                return false;
                            }
                        }

                        var resulttwpcm = validatepercentage(twelvpcmpercentage);
                        if (twelvpcmpercentage != "") {
                            if (!(resulttwpcm)) {
                                $(".validation").remove();
                                $("#twpcm").focus();
                                $("#twpcm").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid Percentage </p>");
                                return false;
                            }
                        }

                        if (course == "2") {
                            if (inttwelvpcmpercentage < 60) {
                                $(".validation").remove();
                                $("#twpcm").focus();
                                $("#twpcm").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 60%.</p>");
                                return false;
                            }
                        }
                        //else if (course == "3" && entrancetype == "non_exam_board_merit") {
                        //    if (twelvpcmpercentage < 85) {
                        //        $(".validation").remove();
                        //        $("#twpcm").focus();
                        //        $("#twpcm").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met</p>");
                        //        return false;
                        //    }

                        //}
                        //else if (course == "8" && entrancetype == "non_exam_board_merit") {
                        //    if (twelvpcmpercentage < 65) {
                        //        $(".validation").remove();
                        //        $("#twpcm").focus();
                        //        $("#twpcm").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met</p>");
                        //        return false;
                        //    }
                        //}
                        else if (course == "16") {
                            if (inttwelvpcmpercentage < 50) {
                                $(".validation").remove();
                                $("#twpcm").focus();
                                $("#twpcm").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 50%.</p>");
                                return false;
                            }

                        }

                    }



                    if (twsclclg == "") {


                        $(".validation").remove();
                        $("#twsclclg").focus();
                        $("#twsclclg").after("<p class='validation' style='color:red;margin-bottom:0px;'>Name of School/College</p>");
                        return false;
                    }

                    $("#twelvecollege").val(twsclclg);


                    nricountry = "0";

                }


                else if (typeofnation == "nri") {


                    if (nriedu == "") {
                        $(".validation").remove();
                        $("#hiedcationunri").focus();
                        $("#hiedcationunri").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please enter your Highest Educational Qualification </p>");
                        return false;
                    }

                    if (nricountry == "0") {
                        $(".validation").remove();
                        $("#nricountry").focus();
                        $("#nricountry").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please select the country studied</p>");
                        return false;
                    }
                    if (nriclgname.length == 0 || nriclgname == "") {
                        $(".validation").remove();
                        $("#nriclgname").focus();
                        $("#nriclgname").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please enter the  name of the school/college studied</p>");
                        return false;
                    }
                    $("#twelvecollege").val(nriclgname);
                }



                if (study == "PG") {

                    if (twelfthappearing == "Yes") {
                        $(".validation").remove();
                        $("#twyearofpassing").focus();
                        $("#twyearofpassing").after("<p class='validation' style='color:red;margin-bottom:0px;'>Select Valid Year of Passing</p>");
                        return false;
                    }


                    if (pgyearofappearing == "0") {

                        $(".validation").remove();
                        $('#pgyearofappearing').focus();
                        $('#pgyearofappearing').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Select Year</p>");
                        return false;
                    }
                    if (pgappearing == "yes") {

                        if ((2019 - twyearofpassing) < 3) {
                            $(".validation").remove();
                            $("#pgyearofappearing").focus();
                            $("#pgyearofappearing").after("<p class='validation' style='color:red;margin-bottom:0px;'>Select Valid Year of Passing</p>");
                            return false;
                        }
                    }
                    if (pgappearing == "no") {
                        //alert(pgyearofappearing);
                        if (pgyearofappearing <= twyearofpassing) {
                            $(".validation").remove();
                            $("#pgyearofappearing").focus();
                            $("#pgyearofappearing").after("<p class='validation' style='color:red;margin-bottom:0px;'>Select Valid Year of Passing</p>");
                            return false;

                        }
                        if ((pgyearofappearing - twyearofpassing) < 3) {
                            $(".validation").remove();
                            $("#pgyearofappearing").focus();
                            $("#pgyearofappearing").after("<p class='validation' style='color:red;margin-bottom:0px;'>Select Valid Year of Passing</p>");
                            return false;

                        }
                        if (pgpercentage == "") {

                            $(".validation").remove();
                            $('#pgpercentage').focus();
                            $('#pgpercentage').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Graduation Percentage</p>");
                            return false;
                        }
                        var resultPG = validatepercentage(pgpercentage);
                        if (!(resultPG)) {

                            $(".validation").remove();
                            $("#pgpercentage").focus();
                            $("#pgpercentage").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid Percentage </p>");
                            return false;
                        }
                        if (course == 1) {
                            if (intpgpercentage < 60) {
                                $(".validation").remove();
                                $("#pgpercentage").focus();
                                $("#pgpercentage").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 60%.</p>");
                                return false;
                            }

                        }

                        else {
                            if (intpgpercentage < 50) {
                                $(".validation").remove();
                                $("#pgpercentage").focus();
                                $("#pgpercentage").after("<p class='validation' style='color:red;margin-bottom:0px;'>Eligibility criteria not met:Eligibility criteria is minimum 50%.</p>");
                                return false;
                            }
                        }
                    }

                }

                //indian
                var caste = $("input[name='caste']:checked").val();
                var domicile = $("input[name='domicile']:checked").val();
                //  var applicationmade = $("input[name='radapplicationmade']:checked").val();

                var address1 = $("#address1").val();
                var address2 = $("#address2").val();
                var address3 = $("#address3").val();
                var pincode = $("#pincode").val();
                var pcity = $("#pcity").val();
                var pstate = $("#pstate").val();
                var file = $("#filephoto").val();
                var examcity1 = $("#examcity1").val();
                var examcity2 = $("#examcity2").val();
                // var jeescore = $("#jeescore").val();

                //nri address
                var nriaddress = $("#nriaddress").val();
                var examtype = $("#hdnexammodeapp").val();
                // alert(nriaddress);

                //common
                var favorite = [];

                $.each($("input[name='chkpgm']:checked"), function () {
                    favorite.push($(this).val());
                });

                //alert(favorite.length);

                $("#hdncid").val(favorite.join(","));

                var cid = $("#hdncid").val();

                if (cid == "") {
                    $(".validation").remove();
                    $(".SplList").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please select the prefered Program Specialisations  </p>");
                    // alert("please select program");
                    return false;
                }
                if (favorite.length>3) {
                    $(".validation").remove();
                    $(".SplList").after("<p class='validation' style='color:red;margin-bottom:0px;'> You can select a maximum of 3 programs only </p>");
                    // alert("please select program");
                    return false;
                }
                if (examtype == "Exam") {
                    if (examcity1 == "0") {
                        $(".validation").remove();
                        $("#examcity1").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Select Prefered Exam City </p>");
                        return false;
                    }
                    if (examcity2 == "0") {
                        $(".validation").remove();
                        $("#examcity2").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Select Prefered Exam City </p>");
                        return false;
                    }
                    if (examcity1 == examcity2) {
                        $(".validation").remove();
                        $("#examcity2").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Select Other City </p>");
                        return false;
                    }
                }
                console.log(typeofnation)

                if (typeofnation == "indian") {

                    if (address1 == "") {
                        $(".validation").remove();
                        $("#address1").focus();
                        $("#address1").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Address Line 1 </p>");
                        return false;
                    }

                    if (address2 == "") {
                        $(".validation").remove();
                        $("#address2").focus();
                        $("#address2").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Address Line 2 </p>");
                        return false;
                    }

                    if (pincode == "") {
                        $(".validation").remove();
                        $("#pincode").focus();
                        $("#pincode").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter pincode</p>");
                        return false;
                    }

                    if (pincode.length != 6) {
                        $(".validation").remove();
                        $("#pincode").focus();
                        $("#pincode").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter valid pincode</p>");
                        return false;
                    }

                    if (pstate == "0") {
                        $(".validation").remove();
                        $("#pstate").focus();
                        $("#pstate").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Select State</p>");
                        return false;
                    }
                    if (pcity == "0") {
                        $(".validation").remove();
                        $("#pcity").focus();
                        $("#pcity").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter City</p>");
                        return false;
                    }
                }

                else if (typeofnation == "nri") {

                    if (nriaddress == "") {
                        $(".validation").remove();
                        $("#nriaddress").focus();
                        $("#nriaddress").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Your Address </p>");
                        return false;
                    }

                    if (!isNaN(nriaddress)) {

                        $(".validation").remove();
                        $("#nriaddress").focus();
                        $("#nriaddress").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid Address</p>");
                        return false;
                    }

                    if (SplCharaterExists(nriaddress)) {

                        $(".validation").remove();
                        $("#nriaddress").focus();
                        $("#nriaddress").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid Address</p>");
                        return false;
                    }
                }

                else {

                }


                if (document.getElementById('declare').checked == false) {

                    $(".validation").remove();
                    $(".declartionText").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please check the declaration</p>");
                    return false;

                }


                $(".validation").remove();

            }
        </script>
        <script type="text/javascript">
            $("#state").change(function () {

                var stateid = $("#state").val();
                var serviceURLcity = '/Home/bindcity';
                $.ajax({
                    url: serviceURLcity,
                    type: "GET",
                    dataType: "HTML",
                    data: {
                        stateid: stateid
                    },
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {

                            $("#city").html(data);

                        }
                        else {
                            console.log("Error:bindcity")
                        }
                        console.log("Error:bindcity2")

                    }
                });

            });
            $("#tenthyearofpassing").change(function () {
                var ugpg = $("#hdnstudytype").val();
                var seltenyear = $("#tenthyearofpassing").val();

                if (seltenyear == "2017" && ugpg == "UG") {
                    $("#radtwyes").trigger('click');
                    //  bindyear('yes');


                    $("#radtwno").attr('disabled', 'disabled');
                    $("#radtwno").addClass('disbla');
                }

                else if (seltenyear != "2017" && ugpg == "UG") {
                    $("#radtwno").trigger('click');
                    // bindyear('yes');
                    $('#radtwno').prop("disabled", false);
                    $("#radtwno").trigger('click');
                    $("#radtwno").removeClass('disbla');

                }
                else {
                    bindyear('no');
                }

            });
            $("#twyearofpassing").change(function () {
                var ugpg = $("#hdnstudytype").val();
                var seltwyear = $("#twyearofpassing").val();
                if (ugpg == "PG" && seltwyear == "2016") {

                    $("#radugyes").trigger('click');
                    $("#radugno").attr('disabled', 'disabled');
                    $("#radugno").addClass('disbla');
                    //pgappearing('yes');
                }
                else if (ugpg == "PG" && seltwyear != "2016") {
                    //alert("ss");
                    event.preventDefault();
                    $('#radugno').prop("disabled", false);
                    $("#radugno").trigger('click');
                    $("#radugno").removeClass('disbla');

                    //pgappearing('nopg');


                }
            });
            $("#source").change(function () {

                $("#coachingcentre").hide();
                $("#othercoachingcentre").val('');
                $("#othercoachingcentre").hide();
                var selSource = $("#source").val();
                if (selSource == "3") {
                    $("#coachingcentre").show();

                }
                else {

                    $("#coachingcentre").hide();
                    $("#othercoachingcentre").val('');
                    $("#othercoachingcentre").hide();
                    $('#coachingcentre [value=0]').attr('selected', 'true');
                }

            });
            $("#coachingcentre").change(function () {
                $("#othercoachingcentre").val('');
                $("#othercoachingcentre").hide();
                var selCoachingIns = $("#coachingcentre").val();
                if (selCoachingIns == "others") {
                    $("#othercoachingcentre").show();

                }
                else {
                    $("#othercoachingcentre").val('');
                    $("#othercoachingcentre").hide();


                }

            });
            function bindExamCity() {

                var examode = $("input[name='radapplicationmade']:checked").val();
                var typeofnat = $("#hdntype").val();
                var examtype = $("#hdnexammodeapp").val();

                //console.log("mmsess:" + sessionexamode);
                if (examtype == "1" && typeofnat != "nri") {

                    $("#examcity").show();
                    //console.log("mmhere:" + examtype);
                }
                else if (examtype == "" || examtype == undefined) {
                    if (examode == "exam" && typeofnat != "nri") {

                        $("#examcity").show();

                    }

                }

                else if (examtype == "Exam" && typeofnat != "nri") {
                    $("#examcity").show();
                }



                else {
                    //console.log("mmhere2:" + examtype);
                    $("#examcity").hide();
                }
                var serviceURL = '/Home/bindexamcity';
                $.ajax({
                    url: serviceURL,
                    type: "GET",
                    dataType: "HTML",
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {

                            //console.log(data);
                            $("#examcity1").html(data);
                            $("#examcity2").html(data);
                        }
                        else {

                            console.log("err:examcity");
                        }
                        //  alert(data);
                        console.log("err:examcity2");
                    }
                });


            }
            function bindcoaching() {
                var serviceURL = '/Home/bindcoaching';
                $.ajax({
                    url: serviceURL,
                    type: "GET",
                    dataType: "HTML",
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {


                            $("#coachingcentre").html(data);

                        }
                        else {
                            console.log("err:coachingcentre");
                        }
                        //  alert(data);
                        console.log("err:coachingcentre2");
                    }

                });
            }

            function bindsource() {
                //bind bindenquirysource
                var serviceURL = '/Home/bindenquirysource';
                $.ajax({
                    url: serviceURL,
                    type: "GET",
                    dataType: "HTML",
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {


                            $("#source").html(data);

                        }
                        else {
                            console.log("Error:bindenquirysource")
                        }
                        console.log("Error:bindenquirysource2")

                    }
                });
            }
            function bindstate() {
                var serviceURLstate = '/Home/bindstate';
                $.ajax({
                    url: serviceURLstate,
                    type: "GET",
                    dataType: "HTML",
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {

                            // $("#pstate").html(data);
                            $("#state").html(data);

                        }
                        else {
                            console.log("Error:bindstate")
                        }
                        console.log("Error:bindstate2")

                    }
                });
            }
            function bindyear10th() {

                var ugpg = $("#hdnstudytype").val();

                var minyear = "2017";
                if (ugpg == "PG") {
                    minyear = "2014";
                    $("#radtwyes").attr('disabled', 'disabled');
                    $("#radtwyes").addClass('disbla');
                }

                else {

                    !$("#radtwyes").attr('disabled');
                    $("#radtwyes").removeClass('disbla');
                }

                var typeofapp = "tenth";
                var serviceURLyear10th = '/Home/bindyearnew';
                $.ajax({
                    url: serviceURLyear10th,
                    type: "GET",
                    dataType: "HTML",
                    data: {
                        type: typeofapp,
                        minyear: minyear
                    },
                    async: false,
                    success: function (data) {
                        // alert(data);

                        if (data != "") {

                            $("#tenthyearofpassing").html(data);
                            //bindyear('no');
                        }
                        else {
                            console.log("Error:bindyearnew")
                        }
                        console.log("Error:bindyearnew2")

                    }
                });
            }
            function bindyear(typeofapp) {
                
                var ugpg = $("#hdnstudytype").val();
                if (typeofapp == 'yes') {

                    $("#dvtw").hide();
                    $("#twper").val("");

                }
                if (typeofapp == 'no') {

                    $("#dvtw").show();
                    $("#twper").val("");
                }

                var seltenyear = $("#tenthyearofpassing").val();
              
                    seltenyear = parseInt((seltenyear));
                if (seltenyear == 0) {
                    if (ugpg == "UG") {
                        seltenyear = 2017;
                    }
                    else {

                        seltenyear = 2014;
                    }
                }
                seltenyear = seltenyear + 2;
                var minyear = seltenyear;
                console.log(seltenyear);
                console.log(minyear);
                if (typeofapp == "no" && ugpg == "UG") {

                    typeofapp = "noapplyingug";
                }

                else if (typeofapp == "no" && ugpg == "PG") {
                    typeofapp = "noapplyingpg";
                }

                console.log("bindyearnew:" + typeofapp);
                console.log("bindyearnew:" + minyear);
                var serviceURLyear = '/Home/bindyearnew';
                $.ajax({
                    url: serviceURLyear,
                    type: "GET",
                    dataType: "HTML",
                    data: {
                        type: typeofapp,
                        minyear: minyear
                    },
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {
                            console.log(data);
                            $("#twyearofpassing").html('');
                            $("#twyearofpassing").html(data);
                            console.log(data);
                            pgappearing('yes')

                            //console.log(minyear);
                        }
                        else {
                            //alert("Error");
                            console.log("Error bindyearnew");
                        }
                        //  alert(data);

                    }
                });
            }
            function pgappearingnew(val, minyear) {
                var typenat = $("#hdntype").val();

                var ugupg = $("#hdnstudytype").val();

                console.log(typenat);
                console.log(ugupg);

                if (typenat == "nri" && ugupg == "PG") {
                    minyear = 2000;
                }
                var serviceURLyear = '/Home/bindyearnew';
                $.ajax({
                    url: serviceURLyear,
                    type: "GET",
                    dataType: "HTML",
                    data: {
                        type: val,
                        minyear: minyear
                    },
                    async: false,
                    success: function (data) {
                        if (data != "") {
                            if (val == "yes") {

                                $("#divpgper").hide();

                                $("#pgpercentage").val('');
                            }
                            else if (val == "nopg") {
                                $("#divpgper").show();
                            }
                            //console.log(data);
                            $("#pgyearofappearing").html('');
                            $("#pgyearofappearing").html(data);

                        }
                        else {
                            // alert("Error");
                        }
                        //  alert(data);

                    }
                });
            }
            function pgappearing(val) {
                var seltwyear = $("#twyearofpassing").val();
                seltwyear = parseInt((seltwyear));
                if (seltwyear == 0) {
                    seltwyear = 2015;
                }
                seltwyear = seltwyear + 3;
                var minyear = seltwyear;
                console.log(val);
                console.log(minyear);
                pgappearingnew(val, minyear);

            }
            function bindcdata() {
                var type = $("#hdnstudytype").val();

                if (type == "PG") {

                    $("#divpg").show();
                    $("#divpgmadeofexam").show();
                    $("#divugmadeofexam").hide();


                }

                else if (type == "UG") {

                    $("#divappmade").hide();
                    $("#jeescore").val('');
                    $("#divpg").hide();
                    $("#divpgmadeofexam").hide();
                    $("#divugmadeofexam").show();
                }

            }
            function checknation(val) {

                var serviceURLcountry = '/Home/bindnricountry';




                if (val == "indian") {
                    loadcountry(val);
                    $("#divindianphone").show();
                    $("#divindian").show();
                    $("#divnri").hide();
                    $("#hdntype").val('indian');
                    $("#divindianexam").show();
                    $('#divpage4indian').show();
                    $('#divpage4nri').hide();
                    $("#divindianexam").hide();
                    $('#divindian2page').show();
                    $('#divnri2page').hide();
                    callcurrency('inr');

                }

                else if (val == "nri") {

                    //  alert("ddd");
                    $("#divnriphone").show();
                    $("#divindianphone").hide();
                    $("#divindian").hide();
                    $("#divnri").show();
                    $("#hdntype").val('nri');
                    $("#state").val('0');
                    $("#city").val('0');
                    $("#divotp").hide();
                    $("#divindianexam").hide();

                    $("#jeescore").val('');
                    $("#otpcheckp").hide();
                    $('#divindian2page').hide();
                    $('#divnri2page').show();
                    loadcountry(val);
                    bindnricountrystudy();
                    callcurrency('usd');
                    $("#hdnexammode").val("0");
                    $("#divindianexam").hide();
                    $('#divpage4indian').hide();
                    $('#divpage4nri').show();
                }
            }
            function bindnricountrystudy() {
                var serviceURLcountry = '/Home/bindnricountrystudy';
                $.ajax({
                    url: serviceURLcountry,
                    type: "GET",
                    dataType: "HTML",
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {



                            $("#nricountry").html(data);

                        }


                        else {
                            //  alert("Error");
                            console.log("Error in bindnricountrystudy");
                        }
                        //  alert(data);

                    }
                });


            }
            function loadcountry(val) {
                bindnricountrystudy();

                var serviceURLcountry = '/Home/bindnricountry';
                $.ajax({
                    url: serviceURLcountry,
                    type: "GET",
                    dataType: "HTML",
                    data: {
                        type: val
                    },
                    async: false,
                    success: function (data) {
                        //  alert(data);

                        if (data != "") {

                            $("#country").html(data);
                            //$("#country").text(   ).attr("selected", "selected");


                        }
                        else {
                            //  alert("Error");
                        }
                        //  alert(data);

                    }
                });


            }
            function onappclick(val) {

                //alert(val);
                $("#hdnexammode").val(val);
                $("#hdnexammodeapp").val(val);
                if (val == 1) {
                    $("#divappmade").hide();
                    $("#jeescore").val('');
                    $("#examcity").show();

                }
                else if (val == 2) {
                    $("#examcity").hide();
                    var examode = $("input[name='radapplicationmade']:checked").val();

                    $("#hdnexammode").val(examode);

                    if (examode == "pgnonexam") {
                        // alert(examode);
                        $("#divappmade").hide();
                        $("#jeescore").val('');

                    }

                    else if (examode == "non_exam_ug") {
                        //alert('www');
                        $("#divappmade").hide();
                        $("#jeescore").val('');
                    }
                    else if (examode == "non_exam_board_merit") {
                        //alert('www');
                        $("#divappmade").hide();
                        $("#jeescore").val('');

                    }

                    else {
                        $("#divappmade").show();
                        $("#jeescore").val('');
                    }

                }

            }
            function bindcheckbox(c_id) {
                var c_id = $("#hdncourseid").val();
                var serviceURLcheckbox = '/Home/bindprogramedit';
                $.ajax({

                    url: serviceURLcheckbox,
                    type: "GET",
                    dataType: "HTML",

                    data: {
                        c_id: c_id
                    },

                    async: false,
                    success: function (data) {

                        //alert(data);

                        if (data != "") {

                            $("#divbindheckbox").html(data);

                            var limit = 3;
                            $('input.single-checkbox').click(function () {
                                if ($(this).siblings(':checked').length >= limit) {
                                    this.checked = false;

                                }
                            });


                            // checkpgm();

                        }
                        else {
                            $("#divbindheckbox").html('');
                        }
                        //  console.log(data);

                    }
                });


            }
            function checkpgm() {

                var textappend = "";
                var i, chks = document.getElementsByName('chk[]');


                for (i = 0; i < chks.length; i++) {



                    if (chks[i].checked) {

                        // console.log(chks[i].value);
                        textappend += textappend + ",";

                        return true;
                    }

                    else {
                        alert('No item selected');
                        //console.log(chks[i].value);
                        return false;
                    }
                }







            }
            function checkperten(val) {
                //  alert(val);

                if (val == "per") {

                    $("#divtenper").show();
                    $("#divtencgpa").hide();



                    $("#tenthcgpa").val('');





                }
                else if (val = "cgpa") {


                    $("#divtenper").hide();
                    $("#divtencgpa").show();

                    $("#tenthper").val('');
                }



            }
            function callcurrency(currency) {

                // alert(currency);

                var serviceURLcountry = '/Home/checkpaymentamount';
                $.ajax({
                    url: serviceURLcountry,
                    type: "GET",
                    dataType: "HTML",
                    data: {
                        currency: currency
                    },
                    async: false,
                    success: function (data) {
                        //alert(data);

                        if (data != "") {

                            $("#spncurrency").html(data);
                        }

                        //  alert(data);

                    }
                });

            }
            function openChat() {
                
				<!--window.open("http://ameyo.delhi.upes.ac.in:8888/ameyochatjs/defaultChat/chatOfflinePage.html", "popupWindow", "width=600, height=720, scrollbars=yes");-->
			window.open('https://app1.mioot.com/5069/livechat2.html','mioot chat software','toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=570, height=450, screenX=10, screenY=10')
            }
            function ValidateSizeEdit(file) {

                var FileSize = file.files[0].size; // in KB

                console.log(FileSize);
                console.log(FileSize * 1024);
                if (FileSize > 50000) {
                    console.log("sss");
                    $(".validation").remove();
                    $(".ImageSize").show();
                    $("#hdnvalidImage").val("No");
                    return false;
                }

                else {
                    console.log("yyy");
                    $(".ImageSize").hide();
                    $("#hdnvalidImage").val("Yes");
                    return;


                }
            }




           


        </script>
    }
	<!--Start of SuperBot Chat Script-->

<script type="text/javascript">

window.$superbot||(function(d,s){var sb=$superbot=function(c){sb._.push(c)},$=sb.s=d.createElement(s),e=d.getElementsByTagName(s)[0];sb.set=function(o){sb.set._.push(o)};sb._=[];sb.set._=[];$.async=!0;$.setAttribute("charset","utf-8");$.src="https://app.superbot.works/agent.js?a=bZm18BXLDz&l=en";sb.t=+new Date;$.type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");

</script>

<!--End of SuperBot Chat Script-->
</body>

</html>

