﻿$(document).ready(function() {
    $("#ctl00_ContentPlaceHolder1_uc_comp_det_main1_ESi18nButton1").click(Validate1);
    jQuery("#ctl00_ContentPlaceHolder1_ctl00_ctl01_LogOutButton").hide();
    jQuery("#yafprofilepersonal li:last-child").hide();
    jQuery("#ctl00_ContentPlaceHolder1_ctl00_ctl01_GuestUserMessage span").hide();
    jQuery("#ctl00_ContentPlaceHolder1_ctl00_ctl01_GuestUserMessage a").hide();
    jQuery(".menuList li.menuAccount").hide();
    jQuery(".menuList li:last-child").hide();
    jQuery("#ctl00_ContentPlaceHolder1_ctl00_ctl01_GuestUserMessage").html('<span>Welcome to TransportExchange.org Forum</span>');
});
function Validate1() {
    var returnVal = true;
    $("#main_center input[validate='true']").each(function(val, i) {
        if ($("#" + i.id).val() == "") {
            returnVal = false;
            $("#span" + i.id).remove();
            $("#" + i.id).after("<span id='span" + i.id + "' style='color:red;margin-left:2px;font-weight:bold'>*</span>");
            $("#" + i.id).css('border-style', 'solid 1px');
            $("#" + i.id).css('border-color', 'red');
            $("#" + i.id).blur(function() {
                if ($(this).val() != "") {
                    $("#" + i.id).css('border-style', 'solid 1px');
                    $("#" + i.id).css('border-color', 'black');
                }
            });
        }
    });
    /*if ($("#step11_tbEmail").val() != "") {
        returnVal = validateEmail($("#step11_tbEmail").val());
        if (returnVal == false) {

        }
    }*/
    /*$("#main_center textarea").each(function(val, i) {
        if ($("#" + i.id).val().length > 199) {
            returnVal = false;
            $("#span" + i.id).remove();
            $("#" + i.id).after("<span id='span" + i.id + "' style='color:red;margin-left:2px;font-weight:bold;font-size:10px'>Max Length(200)</span>");
            $("#" + i.id).css('border-style', 'solid 1px');
            $("#" + i.id).css('border-color', 'red');
            $("#" + i.id).blur(function() {
                if ($(this).val() != "") {
                    $("#" + i.id).css('border-style', 'solid 1px');
                    $("#" + i.id).css('border-color', 'black');
                }
            });
        }
    });*/
    /*$("#main_center select[validate='true']").each(function(val, i) {
        if ($("#" + i.id).val() == 0) {
            returnVal = false;
            $("#span" + i.id).remove();
            $("#" + i.id).after("<span id='span" + i.id + "' style='color:red;margin-left:2px;font-weight:bold'>*</span>");
            $("#" + i.id).css('border-style', 'solid 1px');
            $("#" + i.id).css('border-color', 'red');
            $("#" + i.id).blur(function() {
                if ($(this).val() != "") {
                    $("#" + i.id).css('border-style', 'solid 1px');
                    $("#" + i.id).css('border-color', 'black');
                }
            });
        }
    });*/
    return returnVal;
}
