﻿function validdata() {
    if (emptyField(document.getElementById("LeftControls1_txtEmail"))) {
        alert('Please Enter Email Id.');
        document.getElementById("LeftControls1_txtEmail").focus();
        document.getElementById("LeftControls1_txtEmail").select();
        return false;
    }
    if (!validEmailId(document.getElementById("LeftControls1_txtEmail").value)) {
        alert('Please Enter Valid Email Id.');
        document.getElementById("LeftControls1_txtEmail").focus();
        document.getElementById("LeftControls1_txtEmail").select();
        return false;
    }
    if (emptyField(document.getElementById("LeftControls1_txtEPwd"))) {
        alert('Please Enter Password.');
        document.getElementById("LeftControls1_txtEPwd").focus();
        document.getElementById("LeftControls1_txtEPwd").select();
        return false;
    }

    setCookie('username', "", 365);
    
    return true;
}


function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return "";
}

function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
}


function age_34() {
    if (parseFloat(document.getElementById("LeftControls1_ddlMinAge1").value) > parseFloat(document.getElementById("LeftControls1_ddlMaxAge1").value)) {
        alert('Max. Age Must Be Greater Than Min. Age.');
        return false;
    }
}
function age_look() {
    if (parseFloat(document.getElementById("LeftControls1_ddlMinAge").value) > parseFloat(document.getElementById("LeftControls1_ddlMaxAge").value)) {
        alert('Max. Age Must Be Greater Than Min. Age.');
        return false;
    }
    if (parseFloat(document.getElementById("LeftControls1_ddlMinRent").value) > parseFloat(document.getElementById("LeftControls1_ddlMaxRent").value)) {
        alert('Max. Rent Must Be Greater Than Min. Rent.');
        return false;
    }
}

function validtext() {
    if (emptyField(document.getElementById("LeftControls1_txtJoineUs"))) {
        alert('Please Enter City Name.');
        document.getElementById("LeftControls1_txtJoineUs").focus();
        document.getElementById("LeftControls1_txtJoineUs").select();
        return false;
    }
    if (document.getElementById("LeftControls1_txtJoineUs").value == "Search By City Name") {
        alert('Please enter City Name.');
        document.getElementById("LeftControls1_txtJoineUs").value = "";
        document.getElementById("LeftControls1_txtJoineUs").focus();
        document.getElementById("LeftControls1_txtJoineUs").select();
        return false;
    }
}

function cleartext2() {
    if (document.getElementById("LeftControls1_txtJoineUs").value == "Search By City Name") {
        document.getElementById("LeftControls1_txtJoineUs").value = "";
    }
}
function checkKey(b1, e) {
    if (e.keyCode == 13) {
        document.getElementById(b1).click();
        return false;
    }
}
