﻿// JScript File
function ValidateUrl(oSrc, args) {

    var str = $get(oSrc.controltovalidate);
    var strvalue = str.value;

    if (strvalue.length != 0) {
        //Validate The value
        if (strvalue.indexOf(".") != -1 && strvalue.indexOf(".") != 0 && strvalue.indexOf(".") != strvalue.length - 1) {
            args.IsValid = true;
        }
        else {
            args.IsValid = false;
        }
    }
    else {
        // is empty 
        args.IsValid = true;
    }


}
function showPopUp(HiddenButtonID) {

    $get(HiddenButtonID).click();
    return false;

}

function ValidateFutureDate(oSrc, args) {
    var str = $get(oSrc.controltovalidate);
    var strvalue = str.value;
    var today = new Date();
    var todayvalue = new Date(today.getFullYear(), today.getMonth(), today.getDate());
    if (strvalue.length != 0) {
        //To Compare Date only without time 
        var checkingDate = new Date(strvalue);

        if (checkingDate >= todayvalue) {
            args.IsValid = true;
        }
        else {
            args.IsValid = false;
        }
    }
    else {
        // is empty 
        args.IsValid = true;
    }
}

