// Disable Right Click
function mousedown() {
    return false;
}
function mouseup(e) {
    if (e != null && e.type == "mouseup") {
        if (e.which == 2 || e.which == 3) {
            return false;
        } 
    } 
}
function contextMenu() {
    return false;
}
if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = mousedown;
}
else {
    document.onmouseup = mouseup;
}
document.oncontextmenu = contextMenu;
document.ondragstart = new Function("return false")
document.onselectstart = new Function("return false")
// Disable Right Click Ends
function ajaxMTCaste(txtValue) {
    document.Form1.mtcaste.value = document.Form1.ddlcaste.value;
}
function ajaxFunctionMT() {
    var xmlHttp;
    document.Form1.ddlcaste.value = "";
    var id = document.Form1.ddlreligion.value;
    try {  // Firefox, Opera 8.0+, Safari  
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {  // Internet Explorer  
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
            var content = xmlHttp.responseText;
            var cntParts = content.split("~");
            var ids = cntParts[1];
            var prdts = cntParts[0];

            var idList = ids.split(",");
            var prdtList = prdts.split(",");
            var i;
            document.getElementById("ddlcaste").options.length = 0;
            document.Form1.ddlcaste.options[0] = new Option("Select One", 0);
            for (i = 0; i < prdtList.length; i++) {
                document.Form1.ddlcaste.options[i + 1] = new Option(prdtList[i], idList[i]);
            }
        }
    }
    xmlHttp.open("GET", "entry.aspx?mtca=" + id, true);
    xmlHttp.send(null);
}
function matribasic() {
    if (txt('txtname', 'Enter Name') == false)
        return false;
    if ((document.getElementById("ddlday").selectedIndex == 0) || (document.getElementById("ddlmonth").selectedIndex == 0) || (document.getElementById("ddlyear").selectedIndex == 0)) {
        alert("Enter Day");
        document.getElementById("ddlday").focus();
        return false;
    }
    else {
        var mandageField = false;
        var date = document.Form1.ddlday;
        var month = document.Form1.ddlmonth;
        var year = document.Form1.ddlyear;
        if (document.Form1.rdlsex[0].checked == true) {
            mandageField = calculateAge(date.options[date.selectedIndex].value, month.options[month.selectedIndex].value, year.options[year.selectedIndex].value, 21, 100);
        }
        else if (document.Form1.rdlsex[1].checked == true) {
            mandageField = calculateAge(date.options[date.selectedIndex].value, month.options[month.selectedIndex].value, year.options[year.selectedIndex].value, 18, 100);
        }
        else {
            alert("Enter Gender");
            document.getElementById("rdlsex").focus();
            return false;
        }
        if (!mandageField) {
            document.getElementById("ddlday").focus();
            return false;
        }
    }
    if (ddl('ddlheight', 'Select Height') == false)
        return false;
    if (ddl('ddlweight', 'Select Weight') == false)
        return false;
    if (ddl('ddlmarital', 'Select Marital Status') == false)
        return false;
    if (ddl('ddlmothertongue', 'Select Mother Tongue') == false)
        return false;
    if (ddl('ddlreligion', 'Select Religion') == false)
        return false;
    if (ddl('ddlcaste', 'Select Caste') == false)
        return false;
    if (ddl('ddlbloodgrp', 'Select Bloodgroup') == false)
        return false;
    if (ddl('ddlbodytype', 'Select Body Type') == false)
        return false;
    if (ddl('ddlcomplexion', 'Select Complexion') == false)
        return false;
    if (ddl('ddlphysical', 'Select Physical Status') == false)
        return false;
    if (txt('txtabtme', 'Enter About Me') == false)
        return false;
    if (chk('chklang', 'Select Languages Known') == false)
        return false;
    if (txt('txtstd', 'Enter STD Code') == false)
        return false;
    if (txt('txtland', 'Enter Landline No.') == false)
        return false;
    if (txt('txtcntperson', 'Enter Contact Person') == false)
        return false;
    if (ddl('ddlcreate', 'Select Profile Created By') == false)
        return false;
    if (txt('txtadd1', 'Enter Address') == false)
        return false;
    if (ddl('ddldiet', 'Select Diet') == false)
        return false;
    if (ddl('ddlsmoke', 'Select Smoking Status') == false)
        return false;
    if (ddl('ddldrink', 'Select Drinking Status') == false)
        return false;
    if (ddl('ddleduc', 'Select Education') == false)
        return false;
    if (ddl('ddlempin', 'Select Employed In') == false)
        return false;
    if (ddl('ddlocc', 'Select Occupation') == false)
        return false;
    if (ddl('ddlNtvCountry', 'Select Native Country') == false)
        return false;
    if (ddl('ddlstate', 'Select State') == false)
        return false;
    if (ddl('ddlNtvDistrict', 'Select District') == false)
        return false;
    if (ddl('ddlannuinc', 'Select Annual Income') == false)
        return false;
    if (ddl('ddlcountrylive', 'Select Country') == false)
        return false;
    return true;
}
function matrientry() {
    if (txt('txtname', 'Enter Name') == false)
        return false;
    if ((document.getElementById("ddlday").selectedIndex == 0) || (document.getElementById("ddlmonth").selectedIndex == 0) || (document.getElementById("ddlyear").selectedIndex == 0)) {
        alert("Enter Day");
        document.getElementById("ddlday").focus();
        return false;
    }
    else {
        var mandageField = false;
        var date = document.Form1.ddlday;
        var month = document.Form1.ddlmonth;
        var year = document.Form1.ddlyear;
        if (document.Form1.rdlsex[0].checked == true) {
            mandageField = calculateAge(date.options[date.selectedIndex].value, month.options[month.selectedIndex].value, year.options[year.selectedIndex].value, 21, 100);
        }
        else if (document.Form1.rdlsex[1].checked == true) {
            mandageField = calculateAge(date.options[date.selectedIndex].value, month.options[month.selectedIndex].value, year.options[year.selectedIndex].value, 18, 100);
        }
        else {
            alert("Enter Gender");
            document.getElementById("rdlsex").focus();
            return false;
        }
        if (!mandageField) {
            document.getElementById("ddlday").focus();
            return false;
        }
    }
    if (ddl('ddlheight', 'Select Height') == false)
        return false;
    if (ddl('ddlmarital', 'Select Marital Status') == false)
        return false;
    if (ddl('ddlmothertongue', 'Select Mother Tongue') == false)
        return false;
    if (ddl('ddlreligion', 'Select Religion') == false)
        return false;
    if (ddl('ddlcaste', 'Select Caste') == false)
        return false;
    if (txt('txtstd', 'Enter STD Code') == false)
        return false;
    if (txt('txtland', 'Enter Landline No.') == false)
        return false;
    if (txt('txtcntperson', 'Enter Contact Person') == false)
        return false;
    if (ddl('ddlcreate', 'Select Profile Created By') == false)
        return false;
    return true;
}
function chk(ctrl, msg) {
    if ((document.getElementById(ctrl + '_0').checked == false) && (document.getElementById(ctrl + '_1').checked == false) && (document.getElementById(ctrl + '_2').checked == false) && (document.getElementById(ctrl + '_3').checked == false) && (document.getElementById(ctrl + '_4').checked == false) && (document.getElementById(ctrl + '_5').checked == false)) {
        alert(msg);
        document.getElementById(ctrl).focus();
        return false;
    }
    return true;
}
function txt(ctrl, msg) {
    if (document.getElementById(ctrl).value == "") {
        alert(msg);
        document.getElementById(ctrl).focus();
        return false;
    }
    return true;
}
//dropdown validation for selection
function ddl(ctrl, msg) {
    if (document.getElementById(ctrl).value == 0) {
        alert(msg);
        document.getElementById(ctrl).focus();
        return false;
    }
    return true;
}
//dropdown validation for selection
function ddl1(ctrl, msg) {
    if (document.getElementById(ctrl).value == -1) {
        alert(msg);
        document.getElementById(ctrl).focus();
        return false;
    }
    return true;
}
function calculateAge(dd, mm, yy, minAge, maxAge) {
    main = "valid"
    dd = parseInt(dd);
    mm = parseInt(mm);
    yy = parseInt(yy);
    if ((mm < 1) || (mm > 12) || (dd < 1) || (dd > 31) || (yy < 1) || (mm == "") || (dd == "") || (yy == ""))
        main = "Invalid"
    else if (((mm == 4) || (mm == 6) || (mm == 9) || (mm == 11)) && (dd > 30))
        main = "Invalid"
    else if (mm == 2) {
        if (dd > 29)
            main = "Invalid"
        else if ((dd > 28) && (!leapYear(yy)))
            main = "Invalid"
    }
    else if ((yy > 9999) || (yy < 0))
        main = "Invalid"
    else
        main = main
    if (main == "valid") {
        var days;
        try {
            //days = new Date('2000','11','22');	
            days = new Date();
        }
        catch (error) {
            days = new Date();
        }
        gdate = days.getDate()
        gmonth = days.getMonth()
        gyear = days.getFullYear(); //days.getYear()	

        gyear = parseInt(gyear);
        age = gyear - yy;
        gmonth = parseInt(gmonth);
        if ((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
            age = age
        }
        else {
            if (mm <= (gmonth)) {
                age = age
            }
            else {
                age = age - 1
            }
        }
        if (age == 0)
            age = age
        if (age < minAge) {
            alert("You should have a minimum of " + minAge + " years to register with us");
            document.Form1.profInt_AGE.value = age
            return false;
        }
        else if (age > maxAge) {
            alert("You should have a maximum of " + maxAge + " years to register with us");
            document.Form1.profInt_AGE.value = age
            return false;
        }
        else {
            document.Form1.profInt_AGE.value = age
            return true;
        }
    }
    else {
        document.Form1.profInt_AGE.value = 0
        return false;
    }
}

function leapYear(yyyy) {
    if (((yyyy % 4 == 0) && (yyyy % 100 != 0)) || (yyyy % 400 == 0))
        return true
    else
        return false
}

function checkStartDate() {
    var startDate = document.Form1.ddlday.selectedIndex;
    var startMonth = document.Form1.ddlmonth.selectedIndex;
    var startYear = document.Form1.ddlyear.options[document.Form1.ddlyear.selectedIndex].text;
    if ((startMonth == 4 || startMonth == 6 || startMonth == 9 || startMonth == 11) && (startDate > 30)) {
        alert("Selected Date is incorrect for selected month");
        document.Form1.ddlday.selectedIndex = 0;
        document.Form1.ddlmonth.selectedIndex = 0;
        document.Form1.ddlyear.selectedIndex = 0;
        document.Form1.ddlday.focus();
        return false;
    } //if
    else if ((startMonth == 2) && (startDate > 29)) {
        alert("Selected Date is incorrect for selected month");
        document.Form1.ddlday.selectedIndex = 0;
        document.Form1.ddlmonth.selectedIndex = 0;
        document.Form1.ddlyear.selectedIndex = 0;
        document.Form1.ddlday.focus();
        return false;
    }
    else if ((startYear != 'Year') && (startMonth == 2) && (startDate == 29) && (!leapYear(startYear))) {
        alert("Selected Date is incorrect for selected month");
        document.Form1.ddlday.selectedIndex = 0;
        document.Form1.ddlmonth.selectedIndex = 0;
        document.Form1.ddlyear.selectedIndex = 0;
        document.Form1.ddlday.focus();
        return false;
    }
    return true;
}
// Have Children or not
function callMaritalCond(str1, str2) {
    var obj1 = eval('document.Form1.' + str1);
    var obj2 = eval('document.Form1.' + str2);
    for (var i = 0; i < obj1.length; i++) {
        if ((obj1[i].selected && i == 0) || obj1.selectedIndex == 1) {
            obj2.selectedIndex = 0;
            obj2.disabled = true;
        }
        else if (obj2.disabled) {
            obj2.disabled = false;
        }
        break;
    }
}

//List Box Bind Ajax
function AjaxValueLB() {
    var selValue = new Array();
    for (j = 0; j < document.Form1.lbcaste.length; j++) {
        if (document.Form1.lbcaste.options[j].selected) {
            selValue += "," + document.Form1.lbcaste.options[j].text;
        }
        document.Form1.mtcaste.value = selValue;
    }
}
function AjaxBindLB() {
    var xmlHttp;
    document.Form1.lbcaste.value = "";
    var id = document.Form1.ddlreligion.value;
    try {
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
            var content = xmlHttp.responseText;
            var cntParts = content.split("~");
            var ids = cntParts[1];
            var prdts = cntParts[0];

            var idList = ids.split(",");
            var prdtList = prdts.split(",");
            var i;
            document.getElementById("lbcaste").options.length = 0;
            for (i = 0; i < prdtList.length; i++) {
                document.Form1.lbcaste.options[i] = new Option(prdtList[i], idList[i]);
            }
        }
    }
    xmlHttp.open("GET", "personality.aspx?mtca=" + id, true);
    xmlHttp.send(null);
}
//Checking UserName
function ValidateNum(e) {
    var keyCode = window.event.which ? window.event.which : window.event.keyCode;
    if (parseInt(keyCode) == 95 || parseInt(keyCode) == 46)
    { return true; } // _ underscore
    if (parseInt(keyCode) == 9 || parseInt(keyCode) == 8)
    { return true; }
    if (parseInt(keyCode) >= 48 && parseInt(keyCode) <= 57)
    { return true; } // 0 to 9
    if (parseInt(keyCode) >= 64 && parseInt(keyCode) <= 90)
    { return true; } // A to Z
    if (parseInt(keyCode) >= 97 && parseInt(keyCode) <= 122)
    { return true; } // a to z
    return false;
}

//button click
function validate() {
    var logid = document.Form1.txtusername.value;
    if (logid.length == 0) {
        alert("Enter Your Login Id");
        document.Form1.txtusername.focus();
        return false;
    }
    else if (logid.length < 5) {
        alert("Your ID must be between 5 and 30 characters long");
        document.Form1.txtusername.focus();
        return false;
    }
    var pass = document.Form1.txtpwdreg.value;
    if (pass.length == 0) {
        alert("Enter password");
        document.Form1.txtpwdreg.focus();
        return false;
    }
    var conPass = document.Form1.txtconfpwd.value;
    if (conPass.length == 0) {
        alert("Enter confirm password");
        document.Form1.txtconfpwd.focus();
        return false;
    }
    if (conPass != pass) {
        alert("Both Passwords are not matching");
        return false;
    }
    var variable = document.Form1.txtemail.value;
    if (variable.length == 0) {
        alert("Enter Your Email Id");
        document.Form1.txtemail.focus();
        return false;
    }
    //var emailID=document.Form1.txtemail;
    var emailfilter = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
    if (emailfilter.test(document.Form1.txtemail.value) == false) {
        document.Form1.txtemail.value = "";
        document.Form1.txtemail.focus();
        return false;
    }
    return true;
}
/*function MatrimonialPopUp(arg,arg1)
{
var moredetailswin = window.open(arg1 +"?View=" + arg ,"detailswindow","height=500,width=850,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes;");
return(false);
}*/
//Popup window Opening //viewmyprofile
function MatrimonialPopUp(QueryString, PageName, PWidth, PHeight) {
    var moredetailswin = window.open(PageName + "?View=" + QueryString, "detailswindow", "height=" + PHeight + "px,width=" + PWidth + "px,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes;");
    return (false);
}
function dispBigImage(src) {
    try {
        document.getElementById("imgbig").src = src;
    }
    catch (e) {
        document.getElementById("imgbig").src = src;
    }
}

function PersonalityValidate() {
    if (ddl('ddlflytype', 'Select Family Type') == false)
        return false;
    if (ddl1('ddlbronum', 'Select No. of Brothers') == false)
        return false;
    if (ddl1('ddlsisnum', 'Select No. of Sisters') == false)
        return false;
    if (ddl('ddlagefrm', 'Select Age from') == false)
        return false;
    if (ddl('ddlageto', 'Select Age to') == false)
        return false;
    if (ddl('ddlhtfrm', 'Select Height from') == false)
        return false;
    if (ddl('ddlhtto', 'Select Height to') == false)
        return false;
    if (txt('lbedu', 'Select Education') == false)
        return false;
    if (txt('lbocc', 'Select Occupation') == false)
        return false;
    if (ddl('ddlmtongue', 'Select Mother Tongue') == false)
        return false;
    if (txt('txtabtprtnr', 'Enter About Partner') == false)
        return false;
    return true;
}
function validchgpwd() {
    if (txt('txtPwd', 'Enter Old Password') && txt('txtNewPwd', 'Enter New Password') && txt('txtCnfmPwd', 'Confirm New Password') == true)
        if (document.getElementById('txtNewPwd').value == document.getElementById('txtCnfmPwd').value) {
        return true;
    }
    else {
        alert('Both password are not matching');
        document.getElementById('txtNewPwd').value = "";
        document.getElementById('txtCnfmPwd').value = "";
        document.getElementById('txtNewPwd').focus();
    }
    return false;
}
function txtcheck(ctrl, msg) {
    if (document.getElementById(ctrl).value == msg)
        document.getElementById(ctrl).value = "";
}
function email(ctrl, msg) {
    var emailfilter = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
    if (emailfilter.test(document.getElementById(ctrl).value) == false) {
        alert(msg);
        document.getElementById(ctrl).value = "";
        document.getElementById(ctrl).focus();
        return false;
    }
    return true;
}
function chktest(ctrl, n, msg) {
    var i;
    for (i = 0; i < n; i++)
        if (document.getElementById(ctrl + '_' + i).checked == true)
        return true;
    alert(msg);
    return false;
}
function interestvalidation() {
    if (txt('txtName', 'Enter Name') && email('txtEmail', 'Invalid Email-Id') && txt('txtAddress', 'Enter Address') == true) {
        txtcheck('txtCtryCode', ' ');
        txtcheck('txtStdCode', 'STD Code');
        txtcheck('txtPhone', 'Phone Number');
        return true;
    }
    return false;
}
function requestvalidation() {
    if (txt('txtName', 'Enter Name') && email('txtEmail', 'Invalid Email-Id') && chktest('chkRequest', '8', 'Select Request') == true) {
        if ((txt('txtCtryCode', 'Enter Country Code') && txtchk('txtStdCode', 'STD Code', 'Enter STD Code') && txtchk('txtPhone', 'Phone Number', 'Enter Telephone Number')) || (txt('txtMobile', 'Enter Mobile Number')) == true) {
            txtcheck('txtCtryCode', ' ');
            txtcheck('txtStdCode', 'STD Code');
            txtcheck('txtPhone', 'Phone Number');
            return true;
        }
    }
    return false;
}

function txtchk(ctrl, Condition, msg) {
    if (document.getElementById(ctrl).value == Condition) {
        alert(msg);
        document.getElementById(ctrl).focus();
        return false;
    }
    return true;
}

function matriedit() {
    if (txt('txtname', 'Enter Name') == false)
        return false;
    if ((document.getElementById("ddlday").selectedIndex == 0) || (document.getElementById("ddlmonth").selectedIndex == 0) || (document.getElementById("ddlyear").selectedIndex == 0)) {
        alert("Enter Day");
        document.getElementById("ddlday").focus();
        return false;
    }
    else {
        var mandageField = false;
        var date = document.Form1.ddlday;
        var month = document.Form1.ddlmonth;
        var year = document.Form1.ddlyear;
        if (document.Form1.rdlsex[0].checked == true) {
            mandageField = calculateAge(date.options[date.selectedIndex].value, month.options[month.selectedIndex].value, year.options[year.selectedIndex].value, 21, 100);
        }
        else if (document.Form1.rdlsex[1].checked == true) {
            mandageField = calculateAge(date.options[date.selectedIndex].value, month.options[month.selectedIndex].value, year.options[year.selectedIndex].value, 18, 100);
        }
        else {
            alert("Enter Gender");
            document.getElementById("rdlsex").focus();
            return false;
        }
        if (!mandageField) {
            document.getElementById("ddlday").focus();
            return false;
        }
    }
    if (ddl('ddlheight', 'Select Height') == false)
        return false;
    if (ddl('ddlweight', 'Select Weight') == false)
        return false;
    if (ddl('ddlmarital', 'Select Marital Status') == false)
        return false;
    if (ddl('ddlmothertongue', 'Select Mother Tongue') == false)
        return false;
    if (ddl('ddlreligion', 'Select Religion') == false)
        return false;
    if (ddl('ddlcaste', 'Select Caste') == false)
        return false;
    if (ddl('ddlbloodgrp', 'Select Bloodgroup') == false)
        return false;
    if (ddl('ddlbodytype', 'Select Body Type') == false)
        return false;
    if (ddl('ddlcomplexion', 'Select Complexion') == false)
        return false;
    if (ddl('ddlphysical', 'Select Physical Status') == false)
        return false;
    if (txt('txtabtme', 'Enter About Me') == false)
        return false;
    if (chk('chklang', 'Select Languages Known') == false)
        return false;
    if (txt('txtcntperson', 'Enter Contact Person') == false)
        return false;
    if (ddl('ddlcreate', 'Select Profile Created By') == false)
        return false;
    if (txt('txtadd1', 'Enter Address') == false)
        return false;
    if (ddl('ddldiet', 'Select Diet') == false)
        return false;
    if (ddl('ddlsmoke', 'Select Smoking Status') == false)
        return false;
    if (ddl('ddldrink', 'Select Drinking Status') == false)
        return false;
    if (ddl('ddleduc', 'Select Education') == false)
        return false;
    if (ddl('ddlempin', 'Select Employed In') == false)
        return false;
    if (ddl('ddlocc', 'Select Occupation') == false)
        return false;
    if (ddl('ddlannuinc', 'Select Annual Income') == false)
        return false;
    if (ddl('ddlcountrylive', 'Select Country') == false)
        return false;
    return true;
}

//List Box Bind Ajax
function AjaxValueLBpart() {
    var selValue = new Array();
    for (var j = 0; j < document.Form1.lbcaste.length; j++) {
        if (document.Form1.lbcaste.options[j].selected) {
            selValue += "," + document.Form1.lbcaste.options[j].text;
        }
        document.Form1.mtcastepart.value = selValue;
    }
}
//Refer this site validation
function matri_refer_validate() {
    if (txt('tbRecName', 'Enter Recepient Name') && txt('tbRecEma', 'Enter Recepient Email') && email('tbRecEma', 'Recepient email-id is Invalid') && txt('tbYouName', 'Enter Your Name') && txt('tbYouEma', 'Enter Your Email') && email('tbYouEma', 'Your email-id is Invalid') && txt('tbCom', 'Comment Pls..!') == true)
        return true;
    return false;
}
function hidevisible(ctrl, show) {//debugger;
    if (show == 0) {
        document.getElementById(ctrl).style.visibility = "hidden";
        document.getElementById(ctrl).style.display = "none";
    }
    else if (show == 1) {
        document.getElementById(ctrl).style.visibility = "visible";
        document.getElementById(ctrl).style.display = "block";
    }
}
function SelectPayment() {
    if (document.getElementById('rblpayment_1').checked == true) {
        hidevisible('divPayment', 1);
        document.getElementById('divPaymentLbl').innerHTML = "DD Number";
    }
    else if (document.getElementById('rblpayment_2').checked == true) {
        hidevisible('divPayment', 1);
        document.getElementById('divPaymentLbl').innerHTML = "Cheque Details";
    }
    else if (document.getElementById('rblpayment_3').checked == true) {
        hidevisible('divPayment', 1);
        document.getElementById('divPaymentLbl').innerHTML = "Bank Remittance Details";
    }
    else if (document.getElementById('rblpayment_4').checked == true) {
        hidevisible('divPayment', 1);
        document.getElementById('divPaymentLbl').innerHTML = "Franchisee Details";
    }
    else if (document.getElementById('rblpayment_0').checked == true) {
        hidevisible('divPayment', 0);
    } 
}

function PaidSelect() {
    if (document.getElementById('divPaymentPnl').style.visibility == "hidden")
        hidevisible('divPaymentPnl', 1);
    else
        hidevisible('divPaymentPnl', 0);
}

function PaidValidate() {
    debugger;
    if (CheckPaid() && rdoPayment('rblPayment', 'Select Payment Method') == true)
        return true;
    return false;
}

function CheckPaid() {
    if ((document.getElementById('rblpayment_1').checked == true) || (document.getElementById('rblpayment_2').checked == true)
	|| (document.getElementById('rblpayment_3').checked == true) || (document.getElementById('rblpayment_4').checked == true)) {
        if (txt('txtPayment', 'Enter Details') == false)
            return false;
    }
    return true;
}
function rdoPayment(ctrl, msg) {
    if (document.getElementById('rblpayment_0').checked == true)
        return true;
    if (document.getElementById('rblpayment_1').checked == true)
        return true;
    if (document.getElementById('rblpayment_2').checked == true)
        return true;
    if (document.getElementById('rblpayment_3').checked == true)
        return true;
    if (document.getElementById('rblpayment_4').checked == true)
        return true;
    alert(msg);
    return false;
}	
