﻿var pagesize = 10;
var currentpage = 0;
var skip = 0;
var take = pagesize;
var newstype = 1;
var pager = 0;

var dpagesize = 10;
var dcurrentpage = 0;
var dskip = 0;
var dtake = dpagesize;
var dpager = 0;
var title = "";

var cpagesize = 15;
var ctake = cpagesize;

function succeded(r, i, e) {
    switch (i) {
        case "loadaboutus":
            var loadaboutus = r.d;
            if ($.cookie('lang') == "1") {
                $(e).html(loadaboutus[0].LDescription);
            }
            else {
                $(e).html(loadaboutus[0].Description);
            }
            break;
        case "loadform":
            var loadform = r.d;
            if ($.cookie('lang') == "1") {
                $(e).html(loadform[0].LDescription);
                $("#formcontent").html(loadform[0].LForm);
            } else {
                $(e).html(loadform[0].Description);
                $("#formcontent").html(loadform[0].Form);
            }
            break;
        case "loadtitleform":
            var titleform = r.d;

            if ($.cookie('lang') == "1") {
                $(e).html(titleform[0].LTitle);
            } else {
                $(e).html(titleform[0].Title);
            }
            break;
        case "loadstaff":
            // $("#right").css({ 'display': 'none' });
            var loadstaff = r.d;
            if ($.cookie('lang') == "1") {
                $(e).html(loadstaff[0].LDescription);
            }
            else {
                $(e).html(loadstaff[0].Description);
            }

            // $("#right").show("slow");
            break;
        case "loadrecruit":
            // $("#right").css({ 'display': 'none' });
            var loadrecruit = r.d;
            if ($.cookie('lang') == "1") {
                $(e).html(loadrecruit[1].LDescription);
            }
            else {
                $(e).html(loadrecruit[1].Description);
            }

            // $("#right").show("slow");
            break;
        case "loadpartner":
            //$("#right").css({ 'display': 'none' });
            var loadpartner = r.d;
            if ($.cookie('lang') == "1") {
                $(e).html(loadpartner[0].LDescription);
            }
            else {
                $(e).html(loadpartner[0].Description);
            }

            //   $("#right").show("slow");
            break;
        case "loadnews":
            var loadnews = r.d;
            $("#newscontent").animate({ 'opacity': '0.1' }, 500, function () {
                var tmp = "";
                for (var i = 0; i < loadnews.length; i++) {
                    if ($.cookie('lang') == "1") {
                        var ttitle = "";
                        var tdescription = "";
                        var url = "";

                        if (loadnews[i].LUrlRewrite == "" || loadnews[i].LUrlRewrite == "null") {
                            url = loadnews[i].UrlRewrite;
                        }
                        else {
                            url = loadnews[i].LUrlRewrite;
                        }
                        if (loadnews[i].LTitle == "") {
                            ttitle = loadnews[i].Title;
                        }
                        else {
                            ttitle = loadnews[i].LTitle;
                        }
                        if (loadnews[i].LDescription == "") {
                            tdescription = loadnews[i].Description;
                        }
                        else {
                            tdescription = loadnews[i].LDescription;
                        }
                        if (loadnews[i].Image != "") {
                            tmp += "<div><div style='float:left; height:90px; overflow:hidden'><img width='120px'  alt=\"" + encode(title) + "\" src='" + loadnews[i].Image + "' /></div><div style='float:left; width:430px; padding-left:10px'><div><b style='font-size:13px'><a name='" + loadnews[i].Id + "' href='tin-tuc-su-kien/" + loadnews[i].Id + "/" + url + "' style='text-decoration:none; line-height:20px; color:#A50000 '>" + ttitle + "</a></b></div><div style=' line-height:20px;text-align:justify'>" + tdescription + "</div></div></div><div style='clear:both'>&nbsp;</div>";
                        } else {
                            tmp += "<div><div style='float:left; width:550px; padding-left:10px'><div><b style='font-size:13px'><a name='" + loadnews[i].Id + "' href='tin-tuc-su-kien/" + loadnews[i].Id + "/" + url + "' style='text-decoration:none; line-height:20px; color:#A50000 '>" + ttitle + "</a></b></div><div style=' line-height:20px;text-align:justify'>" + tdescription + "</div></div></div><div style='clear:both'>&nbsp;</div>";
                        }
                    }
                    else {
                        if (loadnews[i].Image != "") {
                            tmp += "<div><div style='float:left; height:90px; overflow:hidden'><img width='120px' alt=\"" + encode(title) + "\" src='" + loadnews[i].Image + "' /></div><div style='float:left; width:430px; padding-left:10px'><div><b style='font-size:13px'><a name='" + loadnews[i].Id + "' href='tin-tuc-su-kien/" + loadnews[i].Id + "/" + loadnews[i].UrlRewrite + "' style='text-decoration:none; line-height:20px; color:#A50000  '>" + loadnews[i].Title + "</a></b></div><div style=' line-height:20px;text-align:justify'>" + loadnews[i].Description + "</div></div></div><div style='clear:both'>&nbsp;</div>";
                        }
                        else
                            tmp += "<div><div style='float:left; width:550px; padding-left:10px'><div><b style='font-size:13px'><a name='" + loadnews[i].Id + "' href='tin-tuc-su-kien/" + loadnews[i].Id + "/" + loadnews[i].UrlRewrite + "' style='text-decoration:none; line-height:20px; color:#A50000  '>" + loadnews[i].Title + "</a></b></div><div style=' line-height:20px; text-align:justify'>" + loadnews[i].Description + "</div></div></div><div style='clear:both'>&nbsp;</div>";
                    }
                }
                tmp += "<div id='back'  onclick=\"currentpage=currentpage-1; skip = pagesize * (currentpage - 1); take = pagesize; loadnews('#newscontent', newstype); if(currentpage==1){$('#backpager').css('display','none');$('#nextpager').css('display','block');}\" style='color:white;float:left; cursor:hand; cursor:pointer; background:#840000 ' class='iconcorner '>Quay lại</div><div id='next' onclick=\"currentpage=currentpage+1; skip = pagesize * (currentpage - 1); take = pagesize; loadnews('#newscontent', newstype); if (currentpage >= pager) {$('#next').css('display','none');$('#back').css('display','block');}\" style='color:white;float:left;cursor:hand; cursor:pointer; background:#840000' class='iconcorner'>Trang tiếp</div><div style='clear:both'></div>";
                $(e).html(tmp);
                if ($.cookie('lang') == "1") {
                    $("#next").html("Next");
                    $("#back").html("Back");
                }
                else {
                    $("#next").html("Trang tiếp");
                    $("#back").html("Quay lại");
                }
                if (pager == 0) {
                    $('#next').css('display', 'none');
                }
                else {
                    $('#next').css('display', 'block');
                }

                if (currentpage == 1) {
                    $('#back').css('display', 'none');
                }
                else {
                    $('#back').css('display', 'block');
                }
                if (currentpage > pager) {
                    $('#next').css('display', 'none');
                }
            });
            $("#newscontent").animate({ opacity: 1 }, 1000);

            //            if (pager == 0) { $('#next').css('display', 'none'); }
            //            if (currentpage == 1) { $('#back').css('display', 'none'); }


            break;
        case "loadsharednews":
            var loadnews = r.d;
            $("#newscontent").animate({ 'opacity': '0.1' }, 500, function () {
                var tmp = "";
                for (var i = 0; i < loadnews.length; i++) {
                    if ($.cookie('lang') == "1") {
                        var ttitle = "";
                        var tdescription = "";
                        var url = "";

                        if (loadnews[i].LUrlRewrite == "" || loadnews[i].LUrlRewrite == "null") {
                            url = loadnews[i].UrlRewrite;
                        }
                        else {
                            url = loadnews[i].LUrlRewrite;
                        }
                        if (loadnews[i].LTitle == "") {
                            ttitle = loadnews[i].Title;
                        }
                        else {
                            ttitle = loadnews[i].LTitle;
                        }
                        if (loadnews[i].LDescription == "") {
                            tdescription = loadnews[i].Description;
                        }
                        else {
                            tdescription = loadnews[i].LDescription;
                        }
                        if (loadnews[i].Image != "") {
                            tmp += "<div><div style='float:left; height:90px; overflow:hidden'><img width='120px' src='" + loadnews[i].Image + "' /></div><div style='float:left; width:430px; padding-left:10px'><div><b style='font-size:13px'><a name='" + loadnews[i].Id + "' href='chia-se-kinh-nghiem/" + loadnews[i].Id + "/" + url + "' style='text-decoration:none; line-height:20px; color:#A50000 '>" + ttitle + "</a></b></div><div style=' line-height:20px'>" + tdescription + "</div></div></div><div style='clear:both'>&nbsp;</div>";
                        }
                        else {
                            tmp += "<div><div style='float:left; width:550px; padding-left:10px'><div><b style='font-size:13px'><a name='" + loadnews[i].Id + "' href='chia-se-kinh-nghiem/" + loadnews[i].Id + "/" + url + "' style='text-decoration:none; line-height:20px; color:#A50000 '>" + ttitle + "</a></b></div><div style=' line-height:20px'>" + tdescription + "</div></div></div><div style='clear:both'>&nbsp;</div>";
                        }
                    }
                    else {
                        if (loadnews[i].Image != "") {
                            tmp += "<div><div style='float:left; height:90px; overflow:hidden'><img width='120px' src='" + loadnews[i].Image + "' /></div><div style='float:left; width:430px; padding-left:10px'><div><b style='font-size:13px'><a name='" + loadnews[i].Id + "' href='chia-se-kinh-nghiem/" + loadnews[i].Id + "/" + loadnews[i].UrlRewrite + "' style='text-decoration:none; line-height:20px; color:#A50000  '>" + loadnews[i].Title + "</a></b></div><div style=' line-height:20px'>" + loadnews[i].Description + "</div></div></div><div style='clear:both'>&nbsp;</div>";
                        }
                        else {
                            tmp += "<div><div style='float:left; width:550px; padding-left:10px'><div><b style='font-size:13px'><a name='" + loadnews[i].Id + "' href='chia-se-kinh-nghiem/" + loadnews[i].Id + "/" + loadnews[i].UrlRewrite + "' style='text-decoration:none; line-height:20px; color:#A50000  '>" + loadnews[i].Title + "</a></b></div><div style=' line-height:20px'>" + loadnews[i].Description + "</div></div></div><div style='clear:both'>&nbsp;</div>";
                        }
                    }
                }
                tmp += "<div id='back'  onclick=\"currentpage=currentpage-1; skip = pagesize * (currentpage - 1); take = pagesize; loadsharednews('#newscontent', newstype); if(currentpage==1){$('#backpager').css('display','none');$('#nextpager').css('display','block');}\" style='color:white;float:left; cursor:hand; cursor:pointer; background:#840000 ' class='iconcorner '>Quay lại</div><div id='next' onclick=\"currentpage=currentpage+1; skip = pagesize * (currentpage - 1); take = pagesize; loadsharednews('#newscontent', newstype); if (currentpage >= pager) {$('#next').css('display','none');$('#back').css('display','block');}\" style='color:white;float:left;cursor:hand; cursor:pointer; background:#840000' class='iconcorner'>Trang tiếp</div><div style='clear:both'></div>";
                $(e).html(tmp);
                if ($.cookie('lang') == "1") {
                    $("#next").html("Next");
                    $("#back").html("Back");
                }
                else {
                    $("#next").html("Trang tiếp");
                    $("#back").html("Quay lại");
                }
                if (pager == 0) {
                    $('#next').css('display', 'none');
                }
                else {
                    $('#next').css('display', 'block');
                }

                if (currentpage == 1) {
                    $('#back').css('display', 'none');
                }
                else {
                    $('#back').css('display', 'block');
                }
                if (currentpage > pager) {
                    $('#next').css('display', 'none');
                }
            });
            $("#newscontent").animate({ opacity: 1 }, 1000);

            //            if (pager == 0) { $('#next').css('display', 'none'); }
            //            if (currentpage == 1) { $('#back').css('display', 'none'); }


            break;
        case "totalpage":
            var totalpage = r.d;
            pager = totalpage;
            // loadnews('#newscontent', newstype);

            break;
        case "newsbyid":
            var newsbyid = r.d;
            var ttitle = "";
            var tdescription = "";
            var tcontent = "";
            if ($.cookie('lang') == "1") {

                if (newsbyid[0].LTitle == "") {
                    ttitle = newsbyid[0].Title;
                }
                else {
                    ttitle = newsbyid[0].LTitle;
                }

                if (newsbyid[0].LDescription == "") {
                    tdescription = newsbyid[0].Description;
                }
                else {
                    tdescription = newsbyid[0].LDescription;
                }

                if (newsbyid[0].LContent == "") {
                    tcontent = newsbyid[0].Content;
                }
                else {
                    tcontent = newsbyid[0].LContent;
                }
            }
            else {
                ttitle = newsbyid[0].Title;
                tdescription = newsbyid[0].Description;
                tcontent = newsbyid[0].Content;
            }
            var tmp = "<div style='font-size:17px; font-weight:bold; line-heigth:20px;text-align:justify'>" + ttitle + "</div>";
            tmp += "<div style='clear:both'>&nbsp;</div><div style='font-size:14px; font-weight:bold; line-heigth:20px;text-align:justify'>" + tdescription + "</div>";
            tmp += "<div style='clear:both'></div><div style=' line-height:20px;text-align:justify'>" + tcontent + "</div>";
            tmp += "<div style='font-size:12px; font-weight:bold; text-transform: uppercase; color:#840000; padding-top:10px' id='lblothernews'>Các tin khác</div>";
            tmp += "<div >__________________________________________________________</div>";
            tmp += "<div id='detailpager'></div><div style='clear:both'>&nbsp;</div>";
            tmp += "<div id='goback' onclick=\"dcurrentpage=dcurrentpage-1; dskip = dpagesize * (dcurrentpage - 1); dtake = dpagesize; othernewsbyid('#detailpager', " + newsbyid[0].Id + ", newstype); if(dcurrentpage==1){$('#goback').css('display','none');$('#gonext').css('display','block');}\" style='cursor:pointer; cursor:hand;color:#840000; float:left; padding-right:20px'>...Quay lại</div><div id='gonext' onclick=\"dcurrentpage=dcurrentpage+1; dskip = dpagesize * (dcurrentpage - 1); dtake = dpagesize;  othernewsbyid('#detailpager', " + newsbyid[0].Id + ", newstype); if (dcurrentpage >= dpager) {$('#gonext').css('display','none');$('#goback').css('display','block');}\"  style='color:#840000; float:left; cursor:pointer; cursor:hand'>Xem tiếp...</div>";
            $(e).html(tmp);
            $('#gonext').click(function () {
                return false;
            });
            $('#goback').click(function () {
                return false;
            });
            othernewsbyid("#detailpager", newsbyid[0].Id, newstype);
            break;
        case "newssharedbyid":
            var newsbyid = r.d;
            var ttitle = "";
            var tdescription = "";
            var tcontent = "";
            if ($.cookie('lang') == "1") {

                if (newsbyid[0].LTitle == "") {
                    ttitle = newsbyid[0].Title;
                }
                else {
                    ttitle = newsbyid[0].LTitle;
                }

                if (newsbyid[0].LDescription == "") {
                    tdescription = newsbyid[0].Description;
                }
                else {
                    tdescription = newsbyid[0].LDescription;
                }

                if (newsbyid[0].LContent == "") {
                    tcontent = newsbyid[0].Content;
                }
                else {
                    tcontent = newsbyid[0].LContent;
                }
            }
            else {
                ttitle = newsbyid[0].Title;
                tdescription = newsbyid[0].Description;
                tcontent = newsbyid[0].Content;
            }
            var tmp = "<div style='font-size:17px; font-weight:bold; line-heigth:20px;text-align:justify'>" + ttitle + "</div>";
            tmp += "<div style='clear:both'>&nbsp;</div><div style='font-size:14px; font-weight:bold; line-heigth:20px;text-align:justify'>" + tdescription + "</div>";
            tmp += "<div style='clear:both'></div><div style=' line-height:20px;text-align:justify'>" + tcontent + "</div>";
            tmp += "<div style='font-size:12px; font-weight:bold; text-transform: uppercase; color:#840000; padding-top:10px' id='lblothernews'>Các tin khác</div>";
            tmp += "<div >__________________________________________________________</div>";
            tmp += "<div id='detailpager'></div><div style='clear:both'>&nbsp;</div>";
            tmp += "<div id='goback' onclick=\"dcurrentpage=dcurrentpage-1; dskip = dpagesize * (dcurrentpage - 1); dtake = dpagesize; othernewssharedbyid('#detailpager', " + newsbyid[0].Id + ", newstype); if(dcurrentpage==1){$('#goback').css('display','none');$('#gonext').css('display','block');}\" style='cursor:pointer; cursor:hand;color:#840000; float:left; padding-right:20px'>...Quay lại</div><div id='gonext' onclick=\"dcurrentpage=dcurrentpage+1; dskip = dpagesize * (dcurrentpage - 1); dtake = dpagesize;  othernewssharedbyid('#detailpager', " + newsbyid[0].Id + ", newstype); if (dcurrentpage >= dpager) {$('#gonext').css('display','none');$('#goback').css('display','block');}\"  style='color:#840000; float:left; cursor:pointer; cursor:hand'>Xem tiếp...</div>";
            $(e).html(tmp);
            $('#gonext').click(function () {
                return false;
            });
            $('#goback').click(function () {
                return false;
            });
            othernewssharedbyid("#detailpager", newsbyid[0].Id, newstype);
            break;
        case "othernewsbyid":
            var other = r.d;
            var tmp = "<ul>";
            if ($.cookie('lang') == "1") {
                var ttitle = "";
                var turl = ""
                for (var i = 0; i < other.length; i++) {
                    if (other[i].LTitle == "") {
                        ttitle = other[i].Title;
                        turl = other[i].UrlRewrite;
                    }
                    else {
                        ttitle = other[i].LTitle;
                        turl = other[i].LUrlRewrite;
                    }
                    tmp += "<li><a style='text-decoration:none;color:black' onclick=\"totaldpage(''," + other[i].Id + ", " + newstype + ");dcurrentpage=1;newsbyid('#newsdetailcontent'," + other[i].Id + ")\" href='/tin-tuc-su-kien/" + other[i].Id + "/" + turl + "'>" + ttitle + "</a> <span style='color:#A50000'>(" + formatdateno(other[i].CreatedOnDate) + ")</li>";
                }
            }
            else {
                for (var i = 0; i < other.length; i++) {
                    tmp += "<li><div style='font-size:12px;'><div style='float:left; padding-top:7px'><img src='/images/web/mod/icon.png' /></div><div align='left' style='float:left; padding-left:5px; line-height:20px; width:500px;'><a  style='text-decoration:none; color:black' onclick=\"totaldpage(''," + other[i].Id + ", " + newstype + ");dcurrentpage=1;newsbyid('#newsdetailcontent'," + other[i].Id + ")\" href='/tin-tuc-su-kien/" + other[i].Id + "/" + other[i].UrlRewrite + "'>" + other[i].Title + "</a> <span style='color:#A50000'>(" + formatdateno(other[i].CreatedOnDate) + ")</div></div><div style='clear:both;'></div></li>";
                }
            }
            tmp += "</ul>";
            $(e).html(tmp);
            if (dpager == 0) { $('#gonext').css('display', 'none'); }
            else { $('#gonext').css('display', 'block'); }
            if (dcurrentpage == 1) { $('#goback').css('display', 'none'); }
            else { $('#goback').css('display', 'block'); }
            if (dcurrentpage > dpager) {
                $('#gonext').css('display', 'none');
            }
            $("#right").show("slow");
            $('#scrollbar1').tinyscrollbar();
            loadlang();
            break;
        case "othernewssharedbyid":
            var other = r.d;
            var tmp = "<ul>";
            if ($.cookie('lang') == "1") {
                var ttitle = "";
                var turl = ""
                for (var i = 0; i < other.length; i++) {
                    if (other[i].LTitle == "") {
                        ttitle = other[i].Title;
                        turl = other[i].UrlRewrite;
                    }
                    else {
                        ttitle = other[i].LTitle;
                        turl = other[i].LUrlRewrite;
                    }
                    tmp += "<li><a style='text-decoration:none;color:black' onclick=\"totaldpage(''," + other[i].Id + ", " + newstype + ");dcurrentpage=1;newssharedbyid('#newsdetailcontent'," + other[i].Id + ")\" href='/chia-se-kinh-nghiem/" + other[i].Id + "/" + turl + "'>" + ttitle + "</a> <span style='color:#840000'>(" + formatdateno(other[i].CreatedOnDate) + ")</li>";
                }
            }
            else {
                for (var i = 0; i < other.length; i++) {
                    tmp += "<li><div style='font-size:12px;'><div style='float:left; padding-top:7px'><img src='/images/web/mod/icon.png' /></div><div align='left' style='float:left; padding-left:5px; line-height:20px; width:500px;'><a  style='text-decoration:none; color:black' onclick=\"totaldpage(''," + other[i].Id + ", " + newstype + ");dcurrentpage=1;newssharedbyid('#newsdetailcontent'," + other[i].Id + ")\" href='/chia-se-kinh-nghiem/" + other[i].Id + "/" + other[i].UrlRewrite + "'>" + other[i].Title + "</a> <span style='color:#A50000'>(" + formatdateno(other[i].CreatedOnDate) + ")</div></div><div style='clear:both;'></div></li>";
                }
            }
            tmp += "</ul>";
            $(e).html(tmp);
            if (dpager == 0) { $('#gonext').css('display', 'none'); }
            else { $('#gonext').css('display', 'block'); }
            if (dcurrentpage == 1) { $('#goback').css('display', 'none'); }
            else { $('#goback').css('display', 'block'); }
            if (dcurrentpage > dpager) {
                $('#gonext').css('display', 'none');
            }
            $("#right").show("slow");
            $('#scrollbar1').tinyscrollbar();
            loadlang();
            break;
        case "totaldpage":
            dpager = r.d;
            break;
        case "loadhotnews":
            var loadhotnews = r.d;
            var tmp = "";
            for (var i = 0; i < loadhotnews.length; i++) {
                if ($.cookie('lang') == "1") {
                    if (loadhotnews[i].LTitle != "")
                        tmp += "<div style='font-size:12px;width: 580px;'><div style='float:left; padding-top:7px'><img src='/images/web/mod/icon.png' /></div><div align='left' style='float:left; padding-left:5px; width: 515px;line-height:20px'><a style='color:#343434' href='/tin-tuc-su-kien/" + loadhotnews[i].Id + "/" + loadhotnews[i].LUrlRewrite + "'>" + loadhotnews[i].LTitle + "</a></div></div><div style='clear:both; padding-top:5px'></div>";
                    else
                        tmp += "<div style='font-size:12px;width: 580px;'><div style='float:left; padding-top:7px'><img src='/images/web/mod/icon.png' /></div><div align='left' style='float:left; padding-left:5px; width: 515px;line-height:20px'><a style='color:#343434' href='/tin-tuc-su-kien/" + loadhotnews[i].Id + "/" + loadhotnews[i].UrlRewrite + "'>" + loadhotnews[i].Title + "</a></div></div><div style='clear:both; padding-top:5px'></div>";
                }
                else
                    tmp += "<div style='font-size:12px;width: 580px;'><div style='float:left; padding-top:7px'><img src='/images/web/mod/icon.png' /></div><div align='left' style='float:left; padding-left:5px; width: 515px;line-height:20px'><a style='color:#343434' href='/tin-tuc-su-kien/" + loadhotnews[i].Id + "/" + loadhotnews[i].UrlRewrite + "'>" + loadhotnews[i].Title + "</a></div></div><div style='clear:both; padding-top:5px'></div>";
            }
            $(e).html(tmp);
            $('#scrollbar1').tinyscrollbar({ sizethumb: 15 });
            break;
        case "leftmenu":
            var leftmenu = r.d;
            $(e).html(leftmenu);
            var a = $.cookie('test');
            loadicon($.cookie('test'));
            
            $("#accordion").accordion({
                autoHeight: false,
                active: parseInt(a)
            });

            break;
        case "loadlongleftmenu":
            var longleftmenu = r.d;
            $(e).html(longleftmenu);
            var b = $.cookie('longtest');

            loadlongicon($.cookie('longtest'));

            //            $("#longaccordion").accordion({
            //                autoHeight: false,
            //                active: parseInt(b)
            //            });
            break;
        case "loadupcoming":
            var loadupcoming = r.d;            
            var tmp = "";
            for (var i = 0; i < loadupcoming.length; i++) {

                if ($.cookie('lang') == "1") {
                    var tmindex = "";
                    switch (titleupcoming(loadupcoming[i].Parent).toLowerCase()) {
                        case "ceo master":
                            //tmindex = 0;
                            tmindex = "ceo-master";
                            break;
                        case "quản lý dự án":
                            //tmindex = 1;
                            tmindex = "quan-ly-du-an";
                            break;
                        case "luyện thi pmp":
                            //tmindex = 2;
                            tmindex = "luyen-thi-pmp";
                            break;
                        case "chứng chỉ ctfl":
                        case "chứng chỉ ctal":
                            //tmindex = 3;
                            tmindex = "kiem-dinh-phan-mem";
                            break;
                        case "quản trị rủi ro":
                            //tmindex = 4;
                            tmindex = "quan-tri-rui-ro";
                            break;
                        case "kỹ năng mềm":
                            tmright = loadupcoming[i].Value;
                            //tmindex = 5;
                            tmindex = "ky-nang-mem";
                            break;
                        case "đào tạo doanh nghiệp":
                            tmright = loadupcoming[i].Value;
                            // tmindex = 6;
                            tmindex = "dao-tao-doanh-nghiep";
                            break;
                        case "quản trị kinh doanh":
                            tmindex = 0;
                            $.cookie('activesubmenu', '0', { expires: datef });
                            break;

                    }

                    if (loadupcoming[i].LText != "") {

                        tmp += "<div style='font-size:12px;width: 182px; padding-left:10px;'><div style='float:left; padding-top:7px'><img src='/images/web/mod/icon.png' /></div><div align='left' style='float:left; padding-left:5px; width: 170px;line-height:20px'><a style='color:#343434; text-decoration:underline' href='/chuong-trinh-dao-tao-fmit/1/" + tmindex + "/" + loadupcoming[i].EntryID + "/lich-khai-giang'>" + titleupcoming(loadupcoming[i].LParent) + '</a><br/>KG (' + loadupcoming[i].LText + ")</div></div><div style='clear:both; padding-top:5px'></div>";
                    }
                    else {

                        tmp += "<div style='font-size:12px;width: 182px;padding-left:10px; '><div style='float:left; padding-top:7px'><img src='/images/web/mod/icon.png' /></div><div align='left' style='float:left; padding-left:5px; width: 170px;line-height:20px'><a style='color:#343434; text-decoration:underline' href='/chuong-trinh-dao-tao-fmit/1/" + tmindex + "/" + loadupcoming[i].EntryID + "/lich-khai-giang'>" + titleupcoming(loadupcoming[i].Parent) + '</a><br/>KG (' + loadupcoming[i].Text + ")</div></div><div style='clear:both; padding-top:5px'></div>";
                    }
                }
                else {
                    var tmindex = 0;
                    var datef = new Date();
                    datef.setTime(datef.getTime() + (3600 * 60 * 1000));
                    $.cookie('activesubmenu', '1', { expires: datef });

                    var tmright = "";
                    tmright = titleupcoming(loadupcoming[i].Parent);
                    switch (titleupcoming(loadupcoming[i].Parent).toLowerCase()) {
                        case "ceo master":
                            //tmindex = 0;
                            tmindex = "ceo-master";
                            break;
                        case "quản lý dự án":
                            //tmindex = 1;
                            tmindex = "quan-ly-du-an";
                            break;
                        case "luyện thi pmp":
                            //tmindex = 2;
                            tmindex = "luyen-thi-pmp";
                            break;
                        case "chứng chỉ ctfl":
                        case "chứng chỉ ctal":
                            //tmindex = 3;
                            tmindex = "kiem-dinh-phan-mem";
                            break;
                        case "quản trị rủi ro":
                            //tmindex = 4;
                            tmindex = "quan-tri-rui-ro";
                            break;
                        case "kỹ năng mềm":
                            tmright = loadupcoming[i].Value;
                            //tmindex = 5;
                            tmindex = "ky-nang-mem";
                            break;
                        case "đào tạo doanh nghiệp":
                            tmright = loadupcoming[i].Value;
                            // tmindex = 6;
                            tmindex = "dao-tao-doanh-nghiep";
                            break;
                        case "quản trị kinh doanh":
                            tmindex = 0;
                            $.cookie('activesubmenu', '0', { expires: datef });
                            break;

                    }

                    tmp += "<div style='font-size:12px;width: 182px;padding-left:10px;'><div style='float:left; padding-top:7px'><img src='/images/web/mod/icon.png' /></div><div align='left' style='float:left; padding-left:5px; width: 170px;line-height:20px'><a style='color:#343434; text-decoration:underline' href='/chuong-trinh-dao-tao-fmit/0/" + tmindex + "/" + loadupcoming[i].EntryID + "/lich-khai-giang'>" + tmright + '</a><br/>KG (' + loadupcoming[i].Text + ")</div></div><div style='clear:both; padding-top:5px'></div>";
                }
            }
            $(e).html(tmp);
            $('#scrollbar2').tinyscrollbar({ sizethumb: 15 });
            break;
        case "listsbyid":
            var listsbyid = r.d;
            var tmp = "";
            if ($.cookie('lang') == "1") {
                if (listsbyid[0].LValue != "") {

                    tmp += listsbyid[0].LDescription;
                    if (titleupcoming(listsbyid[0].LParent) == "undefined") {
                        $("#lblcsubdetail").html(listsbyid[0].LValue);
                    }
                    else {
                        //                        switch (titleupcoming(listsbyid[0].LParent).toLowerCase()) {
                        //                            case "kỹ năng mềm":
                        //                            case "đào tạo doanh nghiệp":
                        //                            case "kiểm định phần mềm":
                        //                                $("#lblcsubdetail").html("<div><div style='float:left; padding-top:15px'>" + listsbyid[0].LValue + "</div> <div style='float:right; font-weight:normal; font-size:13px'><div><div id='imgtop' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='float:left; padding-top:15px'><img style='border:0px' src='../../../../images/web/icon-dky.png' /></div><div style='float:left; padding-top:15px'><a id='divsignup' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='color:black' href='/dang-ky-hoc'> Sign up for this course</a></div></div></div></div>");
                        //                                break;
                        //                            default:
                        $("#lblcsubdetail").html("<div><div style='float:left; padding-top:15px'>" + titleupcoming(listsbyid[0].LParent) + "  <img src='../../../../images/web/path-icon.png' />  " + listsbyid[0].LValue + "</div> <div style='float:right; font-weight:normal; font-size:13px'><div><div id='imgtop' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='float:left; padding-top:15px'><img style='border:0px' src='../../../../images/web/icon-dky.png' /></div><div style='float:left; padding-top:15px'><a id='divsignup' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='color:black' href='/dang-ky-hoc'> Sign up for this course</a></div></div></div></div>");
                        //                                break;
                        //                        }

                    }
                }
                else {
                    tmp += listsbyid[0].Description;
                    if (titleupcoming(listsbyid[0].Parent) == "undefined") {
                        $("#lblcsubdetail").html(listsbyid[0].Value);
                    }
                    else {
                        //                        switch (titleupcoming(listsbyid[0].Parent).toLowerCase()) {
                        //                            case "kỹ năng mềm":
                        //                            case "đào tạo doanh nghiệp":
                        //                            case "kiểm định phần mềm":
                        //                                $("#lblcsubdetail").html("<div><div style='float:left; padding-top:15px'>" + listsbyid[0].Value + "</div> <div style='float:right; font-weight:normal; font-size:13px'><div><div id='imgtop' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='float:left; padding-top:15px'><img style='border:0px' src='../../../../images/web/icon-dky.png' /></div><div style='float:left;padding-top:15px'><a id='divsignup' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='color:black' href='/dang-ky-hoc'>Đăng ký khóa học này</a></div></div></div></div>");
                        //                                break;
                        //                            default:

                        $("#lblcsubdetail").html("<div><div style='float:left; padding-top:15px'>" + titleupcoming(listsbyid[0].Parent) + "  <img src='../../../../images/web/path-icon.png' />  " + listsbyid[0].Value + "</div> <div style='float:right; font-weight:normal; font-size:13px'><div><div id='imgtop' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='float:left; padding-top:15px'><img style='border:0px' src='../../../../images/web/icon-dky.png' /></div><div style='float:left;padding-top:15px'><a id='divsignup' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='color:black' href='/dang-ky-hoc'>Đăng ký khóa học này</a></div></div></div></div>");
                        //                                break;
                        //                        }

                    }
                }
            }
            else {
                tmp += listsbyid[0].Description;

                if (titleupcoming(listsbyid[0].Parent) == "undefined") {
                    $("#lblcsubdetail").html(listsbyid[0].Value);
                }
                else {
                    //                    switch (titleupcoming(listsbyid[0].Parent).toLowerCase()) {
                    //                        case "kỹ năng mềm":
                    //                        case "đào tạo doanh nghiệp":
                    //                        case "kiểm định phần mềm":
                    //                            $("#lblcsubdetail").html("<div><div style='float:left; padding-top:15px'>" + listsbyid[0].Value + "</div> <div style='float:right; font-weight:normal; font-size:13px'> <div><div id='imgtop' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='float:left; padding-top:15px'><img style='border:0px' src='../../../../images/web/icon-dky.png' /></div><div style='float:left;padding-top:15px'><a id='divsignup' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\"  style='color:black' href='/dang-ky-hoc'>Đăng ký khóa học này</a></div></div></div></div>");
                    //                            break;
                    //                        default:
                    $("#lblcsubdetail").html("<div><div style='float:left; padding-top:15px'>" + titleupcoming(listsbyid[0].Parent) + "  <img src='../../../../images/web/path-icon.png' />  " + listsbyid[0].Value + "</div> <div style='float:right; font-weight:normal; font-size:13px'> <div><div id='imgtop' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\" style='float:left; padding-top:15px'><img style='border:0px' src='../../../../images/web/icon-dky.png' /></div><div style='float:left;padding-top:15px'><a id='divsignup' onmouseover=\"$('#imgtop').css({ 'padding-top': '0px' });\"  onmouseout=\"$('#imgtop').css({ 'padding-top': '15px' });\"  style='color:black' href='/dang-ky-hoc'>Đăng ký khóa học này</a></div></div></div></div>");
                    //                            break;
                    //                    }

                }
            }

            $(e).html(tmp);
            divsignuphover();
            break;
        case "loadpayment":
            var loadpayment = r.d;
            if ($.cookie('lang') == "1") {
                var tmp = "<option value='0' title='0'>[Choosing form of payment]</option>";
                for (var i = 0; i < loadpayment.length; i++) {
                    tmp += "<option value='" + loadpayment[i].LText + "' title='" + loadpayment[i].LText + "'>" + loadpayment[i].LText + "</option>";
                }
                $(e).html(tmp);
            }
            else {
                var tmp = "<option value='0' title='0'>[Chọn hình thức thanh toán]</option>";
                for (var i = 0; i < loadpayment.length; i++) {
                    tmp += "<option value='" + loadpayment[i].Text + "' title='" + loadpayment[i].Text + "'>" + loadpayment[i].Text + "</option>";
                }
                $(e).html(tmp);
            }

            break;
        case "loadstudying":
            var loadstudying = r.d;
            if ($.cookie('lang') == "1") {
                var tmp = "<option value='0' title='0'>[Choosing attendant program]</option>";
                for (var i = 0; i < loadstudying.length; i++) {
                    var course = loadstudying[i].LParent.split('.');

                    tmp += "<option value='" + course[course.length - 1] + "' title='" + loadstudying[i].Text + "'>" + course[course.length - 1] + "</option>";
                    // tmp += "<option value='" + loadstudying[i].LText + "' title='" + loadstudying[i].EntryID + "'>" + loadstudying[i].LText + "</option>";
                }
                $(e).html(tmp);
            }
            else {
                var tmp = "<option value='0' title='0'>[Chọn chương trình tham dự]</option>";
                for (var i = 0; i < loadstudying.length; i++) {
                    var course = loadstudying[i].Parent.split('.');
                    tmp += "<option value='" + course[course.length - 1] + "' title='" + loadstudying[i].Text + "'>" + course[course.length - 1] + "</option>";
                }
                $(e).html(tmp);
            }

            break;
        case "loadlink":
            var loadlink = r.d;

            if ($.cookie('lang') == "1") {
                var tmp = "<option value='0' title='0'>---Links web---</option>";
                for (var i = 0; i < loadlink.length; i++) {
                    tmp += "<option value='" + (i + 1) + "' title='" + loadlink[i].Text + "'>" + loadlink[i].Text + "</option>";
                }
            }
            else {
                var tmp = "<option value='0' title='0'>---Các web liên kết---</option>";
                for (var i = 0; i < loadlink.length; i++) {
                    tmp += "<option value='" + (i + 1) + "' title='" + loadlink[i].Text + "'>" + loadlink[i].Text + "</option>";
                }
            }

            $(e).html(tmp);
            break;
        case "addstudying":
            var addstudying = r.d;
            if (addstudying > 0) {
                if ($.cookie('lang') == "1") {
                    alert("successful registration.");
                }
                else {
                    alert("Bạn đã đăng ký thành công.");
                }
                clearstudying();
            }
            else {
                if ($.cookie('lang') == "1") {
                    alert("Registration failed, please try again.");
                }
                else {
                    alert("Đăng ký thất bại, hãy thử lại.");
                }
            }
            break;
        case "addnewsletter":
            var addnewsletter = r.d;
            if (addnewsletter == -2) {
                if ($.cookie('lang') == "1") {
                    alert("Email is existed, please enter other email.");
                }
                else {
                    alert("Email này đã được đăng ký rồi, xinh hãy nhập email khác.");
                }
            }
            else {
                if (addnewsletter > 0) {
                    if ($.cookie('lang') == "1") {
                        alert("successful registration.");
                    }
                    else {
                        alert("Bạn đã đăng ký thành công.");
                    }
                    clearnewsletter();
                }
                else {
                    if ($.cookie('lang') == "1") {
                        alert("Registration failed, please try again.");
                    }
                    else {
                        alert("Đăng ký thất bại, hãy thử lại.");
                    }
                }
            }
            break;
        case "mailfmitexchange":
            var mailfmitexchangea = r.d;
            if (mailfmitexchangea == true) {
                if ($.cookie('lang') == "1") {
                    alert("successful registration.");
                }
                else {
                    alert("Bạn đã đăng ký thành công.");
                }
                $("#Email").val('');
                $("#FullName").val('');
                $("#Company").val('');
                $("#Position").val('');
                $("#Address").val('');
                $("#PhoneNumber").val('');
            }
            else {
                if ($.cookie('lang') == "1") {
                    alert("Registration failed, please try again.");
                }
                else {
                    alert("Đăng ký thất bại, hãy thử lại.");
                }
                // alert("Đăng ký thất bại xin hãy thử lại."); 
            }
            break;
        case "mailceomaster":
            var mailceomaster = r.d;
            if (mailceomaster == true) {
                if ($.cookie('lang') == "1") {
                    alert("successful registration.");
                }
                else {
                    alert("Bạn đã đăng ký thành công.");
                }
                $("#FullName").val('');
                $('#Position').val('');
                $("#Address").val('');
                $('#Email').val('');
                $("#PhoneNumber").val('');
                $("#Noicongtac").val('');
                $("#Chuyenmon").val('');
                //alert("Bạn đã đăng ký thành công.");
            }
            else {
                if ($.cookie('lang') == "1") {
                    alert("Registration failed, please try again.");
                }
                else {
                    alert("Đăng ký thất bại, hãy thử lại.");
                }
                //    alert("Đăng ký thất bại xin hãy thử lại."); 
            }
            break;
        case "mailistqb":
            var mailistqb = r.d;
            if (mailistqb == true) {
                if ($.cookie('lang') == "1") {
                    alert("successful registration.");
                }
                else {
                    alert("Bạn đã đăng ký thành công.");
                }
                $("#Email").val('');
                $("#FullName").val('');
                $('#Address').val('');
                $('#PhoneNumber').val('');
                $("#namsinh").val('');
            }
            else {
                if ($.cookie('lang') == "1") {
                    alert("Registration failed, please try again.");
                }
                else {
                    alert("Đăng ký thất bại, hãy thử lại.");
                }
            }
            break;
        case "mailpmp":
            var mailpmp = r.d;
            if (mailpmp == true) {
                if ($.cookie('lang') == "1") {
                    alert("successful registration.");
                }
                else {
                    alert("Bạn đã đăng ký thành công.");
                }
                $("#Email").val('');
                $("#FullName").val('');
                $('#Address').val('');
                $('#PhoneNumber').val('');
                $("#Company").val('');
                $("#Position").val('');
            }
            else {
                if ($.cookie('lang') == "1") {
                    alert("Registration failed, please try again.");
                }
                else {
                    alert("Đăng ký thất bại, hãy thử lại.");
                }
            }
            break;
        case "mailceo":
            var mailpmp = r.d;
            if (mailpmp == true) {
                if ($.cookie('lang') == "1") {
                    alert("successful registration.");
                }
                else {
                    alert("Bạn đã đăng ký thành công.");
                }
                $("#Email").val('');
                $("#FullName").val('');
                $("#Address").val('');
                $("#PhoneNumber").val('');
                $("#Company").val('');
                $("#Position").val('');
            }
            else {
                if ($.cookie('lang') == "1") {
                    alert("Registration failed, please try again.");
                }
                else {
                    alert("Đăng ký thất bại, hãy thử lại.");
                }
            }
            break;
        case "headerbanner":
            var headerbanner = r.d;
            if ($.cookie('lang') == "1") {
                if (headerbanner[0].LDescription != "")
                    $(e).html(headerbanner[0].LDescription);
                else
                    $(e).html(headerbanner[0].Description);
            }
            else {
                $(e).html(headerbanner[0].Description);
            }
            break;
        case "loadscheduling":
            var scheduling = r.d;
            var tmp = "";
            for (var i = 0; i < scheduling.length; i++) {
                if (scheduling[i].IsActived == true && scheduling[i].HasChildren == 0) {
                    tmp += scheduling[i].Text + ",";
                }
                else if (scheduling[i].IsActived == true && scheduling[i].HasChildren == 1) {
                    loadscheduling("", scheduling[i].EntryID);
                }
            }
            // alert(tmp);
            break;
        case "addfaq":
            var addfaq = r.d;
            if (addfaq > 0) {
                if ($.cookie('lang') == "1") {
                    alert("Send successful.");
                }
                else {
                    alert("Gửi thành công.");
                }
            }
            else {
                if ($.cookie('lang') == "1") {
                    alert("Send failed, please try again.");
                }
                else {
                    alert("Gửi thất bại, xin hãy gửi lại.");
                }
            }
            break;
        case "unsubscribe":
            var unsubscribe = r.d;
            if (unsubscribe == true) {
                $(e).html("<b>Hủy thành công</b>");
            }
            else {
                $(e).html("<b>Hủy thất bại. Hãy thử lại.</b>");
            }
            break;
        case "loadhomecontent":
            var loadhomecontent = r.d;
            if ($.cookie('lang') == "1") {
                $(e).html(loadhomecontent[0].LContent);
            }
            else {
                $(e).html(loadhomecontent[0].Content);
            }
            break;
        case "getdeletedform":
            var getdeletedform = r.d;

            if (getdeletedform.length > 0) {
                if (getdeletedform[0].IsDeleted == true) {
                    $("#chkceo").css({ 'display': 'block' });
                }
                else {
                    $("#chkceo").css({ 'display': 'none' });
                }
                if (getdeletedform[1].IsDeleted == true) {
                    $("#ckexchange").css({ 'display': 'block' });
                }
                else {
                    $("#ckexchange").css({ 'display': 'none' });
                }
                if (getdeletedform[2].IsDeleted == true) {
                    $("#chkistqb").css({ 'display': 'block' });
                } else {
                    $("#chkistqb").css({ 'display': 'none' });
                }
                if (getdeletedform[3].IsDeleted == true) {
                    $("#chkpmp").css({ 'display': 'block' });
                } else {
                    $("#chkpmp").css({ 'display': 'none' });
                }
                if (getdeletedform[4].IsDeleted == true) {
                    $("#chkceomaster").css({ 'display': 'block' });
                } else {
                    $("#chkceomaster").css({ 'display': 'none' });
                }
            }
            break;
        case "getanswerfaq":
            var getanswer = r.d;
            $("#answerfaq").animate({ 'opacity': '0.1' }, 500, function () {
                if (getanswer.length > 0) {
                    var tmp = "";
                    //                    if ($.cookie('lang') == "1") {
                    //                        for (var i = 0; i < getanswer.length; i++) {
                    //                            tmp += "<div><b style='line-height:15px'>" + ((currentpage - 1) * pagesize + (i + 1)) + ". " + getanswer[i].Question + " </b><br/>( Sender: " + getanswer[i].FullName + " )</div><div onclick=\"$('#divAnswer" + (i + 1) + "').show();$('#divAnswerMore" + (i + 1) + "').hide();\" id='divAnswerMore" + (i + 1) + "' style='padding:left:20px; line-height:15px; padding-top:5px'><b style='text-decoration:underline'>Answer </b>: " + getanswer[i].Description + " <a  style='text-decoration:underline; cursor:hand; cursor:pointer' id='ansdetail'>More...</a></div><div id='divAnswer" + (i + 1) + "' style='display:none;padding:left:20px; line-height:15px; padding-top:5px'><b style='text-decoration:underline'>Answer </b>: " + getanswer[i].Answer + "</div><div style='clear:both'>&nbsp;</div>";
                    //                        }

                    //                    }
                    //                    else {
                    //                        for (var i = 0; i < getanswer.length; i++) {
                    //                            tmp += "<div><b style='line-height:15px'>" + ((currentpage - 1) * pagesize + (i + 1)) + ". " + getanswer[i].Question + " </b><br/>( Người gửi: " + getanswer[i].FullName + " )</div><div onclick=\"$('#divAnswer" + (i + 1) + "').show();$('#divAnswerMore" + (i + 1) + "').hide();\" id='divAnswerMore" + (i + 1) + "'  id='divAnswerMore" + (i + 1) + "' style='padding:left:20px; line-height:15px; padding-top:5px'><b style='text-decoration:underline'>Trả lời </b>: " + getanswer[i].Description + " <a   style='text-decoration:underline; cursor:hand; cursor:pointer' id='ansdetail'>Chi tiết...</a></div><div  id='divAnswer" + (i + 1) + "' style='display:none;padding:left:20px; line-height:15px; padding-top:5px'><b style='text-decoration:underline'>Trả lời </b>: " + getanswer[i].Answer + "</div><div style='clear:both'>&nbsp;</div>";
                    //                        }
                    //                    }
                    if ($.cookie('lang') == "1") {
                        for (var i = 0; i < getanswer.length; i++) {
                            $(e).append("<div><b style='line-height:15px'>" + ((currentpage - 1) * pagesize + (i + 1)) + ". " + getanswer[i].Question + " </b><br/>( Sender: " + getanswer[i].FullName + " )</div><div onclick=\"$('#divAnswer" + ((currentpage - 1) * pagesize + (i + 1)) + "').show();$('#divAnswerMore" + ((currentpage - 1) * pagesize + (i + 1)) + "').hide();\" id='divAnswerMore" + ((currentpage - 1) * pagesize + (i + 1)) + "' style='padding:left:20px; line-height:15px; padding-top:5px'><b style='text-decoration:underline'>Answer </b>: " + getanswer[i].Description + " <a  style='text-decoration:underline; cursor:hand; cursor:pointer' id='ansdetail'>More...</a></div><div id='divAnswer" + ((currentpage - 1) * pagesize + (i + 1)) + "' style='display:none;padding:left:20px; line-height:15px; padding-top:5px'><b style='text-decoration:underline'>Answer </b>: " + getanswer[i].Answer + "</div><div style='clear:both'>&nbsp;</div>");
                        }

                    }
                    else {
                        for (var i = 0; i < getanswer.length; i++) {
                            $(e).append("<div><b style='line-height:15px'>" + ((currentpage - 1) * pagesize + (i + 1)) + ". " + getanswer[i].Question + " </b><br/>( Người gửi: " + getanswer[i].FullName + " )</div><div onclick=\"$('#divAnswer" + ((currentpage - 1) * pagesize + (i + 1)) + "').show();$('#divAnswerMore" + ((currentpage - 1) * pagesize + (i + 1)) + "').hide();\" id='divAnswerMore" + ((currentpage - 1) * pagesize + (i + 1)) + "'  id='divAnswerMore" + (i + 1) + "' style='padding:left:20px; line-height:15px; padding-top:5px'><b style='text-decoration:underline'>Trả lời </b>: " + getanswer[i].Description + " <a   style='text-decoration:underline; cursor:hand; cursor:pointer' id='ansdetail'>Chi tiết...</a></div><div  id='divAnswer" + ((currentpage - 1) * pagesize + (i + 1)) + "' style='display:none;padding:left:20px; line-height:15px; padding-top:5px'><b style='text-decoration:underline'>Trả lời </b>: " + getanswer[i].Answer + "</div><div style='clear:both'>&nbsp;</div>");
                        }
                    }

                    if (!$("#back").length) {
                        $("#pageingcontainer").append("<div id='back'  onclick=\"currentpage=currentpage-1; skip = pagesize * (currentpage - 1); take = pagesize; getanswerfaq('#answerfaq'); if(currentpage==1){$('#backpager').css('display','none');$('#nextpager').css('display','block');}\" style='color:white;float:left; cursor:hand; cursor:pointer; background:#840000 ' class='iconcorner '>Quay lại</div><div id='next' onclick=\"currentpage=currentpage+1; skip = pagesize * (currentpage - 1); take = pagesize; getanswerfaq('#answerfaq'); if (currentpage >= pager) {$('#next').css('display','none');$('#back').css('display','block');}\" style='color:white;float:left;cursor:hand; cursor:pointer; background:#840000' class='iconcorner'>Xem tiếp</div><div style='clear:both'></div>");
                        if ($.cookie('lang') == "1") {
                            $("#next").html("More");
                            $("#back").html("Back");
                        }
                        else {
                            $("#next").html("Xem tiếp");
                            $("#back").html("Quay lại");
                        }
                    }
                    //                    tmp += "<div id='back'  onclick=\"currentpage=currentpage-1; skip = pagesize * (currentpage - 1); take = pagesize; getanswerfaq('#answerfaq'); if(currentpage==1){$('#backpager').css('display','none');$('#nextpager').css('display','block');}\" style='color:white;float:left; cursor:hand; cursor:pointer; background:#840000 ' class='iconcorner '>Quay lại</div><div id='next' onclick=\"currentpage=currentpage+1; skip = pagesize * (currentpage - 1); take = pagesize; getanswerfaq('#answerfaq'); if (currentpage >= pager) {$('#next').css('display','none');$('#back').css('display','block');}\" style='color:white;float:left;cursor:hand; cursor:pointer; background:#840000' class='iconcorner'>Trang tiếp</div><div style='clear:both'></div>";
                    //                    $(e).html(tmp);
                    if (pager == 0) {
                        $('#next').css('display', 'none');
                    }
                    else {
                        $('#next').css('display', 'block');
                    }

                    if (currentpage == 1) {
                        $('#back').css('display', 'none');
                    }
                    else {
                        $('#back').css('display', 'none');
                    }
                    if (currentpage > pager) {
                        $('#next').css('display', 'none');
                    }
                }
                else {
                    $("#answerfaqtitle").css({ 'display': 'none' });
                }
            });
            $("#answerfaq").animate({ opacity: 1 }, 1000);
            break;
        case "totalanswerpage":
            var totalanswerpage = r.d;
            pager = totalanswerpage;

            break;
        case "getnewsletter":
            var getnewsletter = r.d;
            $(e).html(getnewsletter);
            break;
        case "getcoo":
            var getcoo = r.d;

            break;
        case "getqcform":
            var gqc = r.d;
            if (gqc[0].IsDeleted == true) {
                $(e).html(gqc[0].Description);
            }
            else {
                $("#qccontainer").css({ 'display': 'none' });
            }
            break;
        case "loadcustomer":
            var getanswer = r.d;
            $("#answerfaq").animate({ 'opacity': '0.1' }, 500, function () {
                if (getanswer.length > 0) {
                    var tmp = "";

                    if ($.cookie('lang') == "1") {
                        for (var i = 0; i < getanswer.length; i++) {
                            if (getanswer[i].Company != "")
                                $("#thead").append("<tr><td align='center'>" + ((currentpage - 1) * cpagesize + (i + 1)) + "</td><td><b style='line-height:15px'>" + getanswer[i].Company + "</td><td align='center'><img src='" + getanswer[i].Logo + "' /></td></tr>");
                        }

                    }
                    else {
                        for (var i = 0; i < getanswer.length; i++) {
                            if (getanswer[i].Company != "")
                                $("#thead").append("<tr><td  align='center'>" + ((currentpage - 1) * cpagesize + (i + 1)) + "</td><td><b style='line-height:15px'>" + getanswer[i].Company + "</td><td  align='center'><img src='" + getanswer[i].Logo + "' /></td></tr>");
                        }
                    }

                    if (!$("#back").length) {
                        $("#pageingcontainer").append("<div id='back'  onclick=\"currentpage=currentpage-1; skip = cpagesize * (currentpage - 1); ctake = cpagesize; loadcustomer('#answerfaq',''); if(currentpage==1){$('#backpager').css('display','none');$('#nextpager').css('display','block');}\" style='color:white;float:left; cursor:hand; cursor:pointer; background:#840000 ' class='iconcorner '>Quay lại</div><div id='next' onclick=\"currentpage=currentpage+1; skip = cpagesize * (currentpage - 1); ctake = cpagesize; loadcustomer('#answerfaq',''); if (currentpage >= pager) {$('#next').css('display','none');$('#back').css('display','block');}\" style='color:white;float:left;cursor:hand; cursor:pointer; background:#840000' class='iconcorner'>Xem tiếp</div><div style='clear:both'></div>");
                        if ($.cookie('lang') == "1") {
                            $("#next").html("More");
                            $("#back").html("Back");
                        }
                        else {
                            $("#next").html("Xem tiếp");
                            $("#back").html("Quay lại");
                        }
                    }
                    if (pager == 0) {
                        $('#next').css('display', 'none');
                    }
                    else {
                        $('#next').css('display', 'block');
                    }

                    if (currentpage == 1) {
                        $('#back').css('display', 'none');
                    }
                    else {
                        $('#back').css('display', 'none');
                    }
                    if (currentpage > pager) {
                        $('#next').css('display', 'none');
                    }
                }

            });
            $("#answerfaq").animate({ opacity: 1 }, 1000);
            break;
        case "totalcustomerpage":
            var totalanswerpage = r.d;
            pager = totalanswerpage;
    }
}

function titleupcoming(param) {
    var arr = param.split('.');
    var str = "";
    if (arr.length == 8) {
        //        str += arr[3] + " <img src='../../../../images/web/path-icon.png' /> " + arr[7];
        str += arr[7];
    }
    else if (arr.length == 6) {
        str += arr[5];
    }
    else {
        str += arr[3];
    }
    return str;
}
function loadpicture(e, src) {

    $(e).html('<div id="slide"><img height="430px" width="680px" src="' + src + '" /></div>');
    $("#slide").css({ 'opacity': '0.1' });
    $("#slide").animate({ opacity: 1 }, 1000);
}
//coo
function getcoo(e, coo) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/SubMenuCookie";
    varData = '{"coo":"' + coo + '"}';
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    varAsync = false;
    CallService("getcoo", e, succeded);
}
//customer
function loadcustomer(e, title) {
    skip = pagesize * (currentpage - 1);
    varType = "POST";
    varUrl = "../services/aboutus.asmx/GetCustomer";
    varContentType = "application/json; charset=utf-8";
    if (title == "undefined") {
        varData = '{"skip":' + skip + ',"take":' + ctake + ',"title":""}';
    }
    else
        varData = '{"skip":' + skip + ',"take":' + ctake + ',"title":"' + title + '"}';
    varDataType = "json";
    varProcessData = true;
    CallService("loadcustomer", e, succeded);
}
function totalcustomerpage(e, title) {
    varType = "POST";
    varUrl = "../services/aboutus.asmx/CountCustomerPager";
    varContentType = "application/json; charset=utf-8";
    if (title == "undefined") {
        varData = '{"pagesize":' + cpagesize + ',"title":""}';
    }
    else
        varData = '{"pagesize":' + cpagesize + ',"title":"' + title + '"}';

    varDataType = "json";
    varProcessData = true;
    CallService("totalcustomerpage", e, succeded);
}
//newsletter
function getnewsletter(e, email) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetNewsletterMail";
    varData = '{"email":"' + email + '"}';
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("getnewsletter", e, succeded);
}
//form
function getdeletedform(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetDeletedForm";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("getdeletedform", e, succeded);
}
function getqcform(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetQCForm";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("getqcform", e, succeded);
}
//homecontent
function loadhomecontent(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetHomeContent";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadhomecontent", e, succeded);
}
//newsletter
function unsubscribe(e, email, actived) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/UpdateActivedStatusNewsletterByEmail";
    varData = '{"email":"' + email + '","actived":"' + actived + '"}';
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("unsubscribe", e, succeded);
}
//FAQ
function addfaq(e, name, phone, email, question) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/AddFAQ";
    varData = '{"name":"' + encode(name) + '","phone":"' + encode(phone) + '","email":"' + encode(email) + '","question":"' + encode(question) + '"}';
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("addfaq", e, succeded);
}
function getanswerfaq(e) {
    skip = pagesize * (currentpage - 1);
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetAnswerFAQ";
    varData = '{"skip":' + skip + ',"take":' + take + '}';
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("getanswerfaq", e, succeded);
}
function totalanswerpage(e) {

    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/CountTotalFAQPager";
    varContentType = "application/json; charset=utf-8";
    varData = '{"pagesize":' + pagesize + '}';

    varDataType = "json";
    varProcessData = true;
    CallService("totalanswerpage", e, succeded);
}
//end
function loadform(e, id) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/LoadForm";
    varData = '{"id":' + id + '}';
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadform", e, succeded);
}
function loadtitleform(e, id) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/LoadForm";
    varData = '{"id":' + id + '}';
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadtitleform", e, succeded);
}
function loadaboutus(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/LoadAboutUs";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadaboutus", e, succeded);
}
function loadstaff(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/LoadStaff";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadstaff", e, succeded);
}
function loadrecruit(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/LoadRecruit";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadrecruit", e, succeded);
}
function loadpartner(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/LoadPartner";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadpartner", e, succeded);
}
function loadnews(e, type) {
    skip = pagesize * (currentpage - 1);
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetHNews";
    varContentType = "application/json; charset=utf-8";
    //varData = '{"newstype":' + type + ',"skip":' + skip + ',"take":' + take + '}';
    varData = '{"newstype":' + type + ',"skip":' + skip + ',"take":' + take + ',"title":"' + title + '"}';
    // alert(varData);
    varDataType = "json";
    varProcessData = true;
    CallService("loadnews", e, succeded);
}
function loadsharednews(e, type) {
    skip = pagesize * (currentpage - 1);
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetSharedNews";
    varContentType = "application/json; charset=utf-8";
    //varData = '{"newstype":' + type + ',"skip":' + skip + ',"take":' + take + '}';
    varData = '{"newstype":' + type + ',"skip":' + skip + ',"take":' + take + ',"title":"' + title + '"}';
    // alert(varData);
    varDataType = "json";
    varProcessData = true;
    CallService("loadsharednews", e, succeded);
}
function loadhotnews(e, type, take) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetHotNews";
    varContentType = "application/json; charset=utf-8";
    varData = '{"newstype":' + type + ',"take":' + take + '}';
    varDataType = "json";
    varProcessData = true;
    CallService("loadhotnews", e, succeded);
}
function loadupcoming(e, actived,cityid) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetUpcomming";
    varContentType = "application/json; charset=utf-8";
    varData = '{"actived":' + actived + ',"cityId":' + cityid + '}';

    varDataType = "json";
    varProcessData = true;
    CallService("loadupcoming", e, succeded);
}
function loadleftmenu(e, parentId, type) {
    varType = "POST";
    if ($.cookie('lang') == "1") {
        varUrl = "../../../../services/aboutus.asmx/leftemenu";
    }
    else
        varUrl = "../../../../services/aboutus.asmx/leftmenu";
    varContentType = "application/json; charset=utf-8";
    varData = '{"parentId":' + parentId + ',"type":' + type + '}';
    varDataType = "json";
    varProcessData = true;
    varAsync = false;
    CallService("leftmenu", e, succeded);


}
function loadlongleftmenu(e, parentId, type) {
    varType = "POST";
    if ($.cookie('lang') == "1") {
        varUrl = "../../../../services/aboutus.asmx/leftemenu";
    }
    else
        varUrl = "../../../../services/aboutus.asmx/leftmenu";
    varContentType = "application/json; charset=utf-8";
    varData = '{"parentId":' + parentId + ',"type":' + type + '}';
    varDataType = "json";
    varProcessData = true;
    varAsync = false;
    CallService("loadlongleftmenu", e, succeded);


}
function totalpage(e, type) {
    newstype = type;
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/CountTotalPager";
    varContentType = "application/json; charset=utf-8";
    varData = '{"newstype":' + type + ',"pagesize":' + pagesize + ',"title":"' + title + '"}';
    // alert(varData);
    varDataType = "json";
    varProcessData = true;
    CallService("totalpage", e, succeded);
}
function totalsharedpage(e, type) {
    newstype = type;
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/CountTotalSharedPager";
    varContentType = "application/json; charset=utf-8";
    varData = '{"newstype":' + type + ',"pagesize":' + pagesize + ',"title":"' + title + '"}';
    // alert(varData);
    varDataType = "json";
    varProcessData = true;
    CallService("totalpage", e, succeded);
}
function totaldpage(e, id, type) {
    newstype = type;
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/CountTotalDPager";
    varContentType = "application/json; charset=utf-8";
    varData = '{"id":' + id + ',"newstype":' + type + ',"pagesize":' + dpagesize + '}';
    varDataType = "json";
    varProcessData = true;
    CallService("totaldpage", e, succeded);
}
function totaldsharedpage(e, id, type) {
    newstype = type;
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/CountTotalDSharedPager";
    varContentType = "application/json; charset=utf-8";
    varData = '{"id":' + id + ',"newstype":' + type + ',"pagesize":' + dpagesize + '}';
    varDataType = "json";
    varProcessData = true;
    CallService("totaldpage", e, succeded);
}
function newsbyid(e, id) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetNewsById";
    varContentType = "application/json; charset=utf-8";
    varData = '{"id":' + id + '}';
    varDataType = "json";
    varProcessData = true;
    CallService("newsbyid", e, succeded);
}
function newssharedbyid(e, id) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetNewsById";
    varContentType = "application/json; charset=utf-8";
    varData = '{"id":' + id + '}';
    varDataType = "json";
    varProcessData = true;
    CallService("newssharedbyid", e, succeded);
}
function othernewsbyid(e, id, type) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetOtherNews";
    varContentType = "application/json; charset=utf-8";
    varData = '{"id":' + id + ',"newstype":' + type + ',"skip":' + dskip + ',"take":' + dtake + '}';
    varDataType = "json";
    varProcessData = true;
    CallService("othernewsbyid", e, succeded);
}
function othernewssharedbyid(e, id, type) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetOtherNewsShared";
    varContentType = "application/json; charset=utf-8";
    varData = '{"id":' + id + ',"newstype":' + type + ',"skip":' + dskip + ',"take":' + dtake + '}';
    varDataType = "json";
    varProcessData = true;
    CallService("othernewssharedbyid", e, succeded);
}
function listsbyid(e, id) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetListsByEntryId";
    varContentType = "application/json; charset=utf-8";
    varData = '{"entryId":' + id + '}';
    varDataType = "json";
    varProcessData = true;
    CallService("listsbyid", e, succeded);
}

function loadlink(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetAllLinks";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadlink", e, succeded);
}
function loadpayment(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetAllPayment";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadpayment", e, succeded);
}
function loadstudying(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetAllStudying";
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadstudying", e, succeded);
}
function loadscheduling(e, parentid) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetScheduling";
    varData = '{"parentid":' + parentid + '}';
    varContentType = "application/json; charset=utf-8";
    varDataType = "json";
    varProcessData = true;
    CallService("loadscheduling", e, succeded);
}
function contactform(e) {
    $("#right").css({ 'display': 'none' });
    var tmp = '<div style="padding: 0px 10px 10px 0px;  float:left; font-size:12px" align="left"><div id="lblcontactus1" style="font-size:12px; font-weight:bold; color:#8D1312">(*): Thông tin phải nhập</div><div style="clear:both">&nbsp;</div>';
    tmp += '<div  id="lblcontactus2" >Tên bạn(<span style="color:#8D1312">*</span>):</div><div><input style="width:210px" id="fullname" type="text" /></div><div style="clear:both; padding-bottom:7px"></div>';
    tmp += '<div  id="lblcontactus3" >Địa chỉ email(<span style="color:#8D1312">*</span>):</div><div><input style="width:210px" id="email" type="text" /></div><div style="clear:both; padding-bottom:7px"></div>';
    tmp += '<div  id="lblcontactus4" >Điện thoại(<span style="color:#8D1312">*</span>):</div><div><input style="width:210px" id="email" type="text" /></div><div style="clear:both; padding-bottom:7px"></div>';
    tmp += '<div  id="lblcontactus5" >Chủ đề(<span style="color:#8D1312">*</span>):</div><div><input style="width:210px" id="title" type="text" /></div><div style="clear:both; padding-bottom:7px"></div>';
    tmp += '<div  id="lblcontactus6" >Nội dung(<span style="color:#8D1312">*</span>):</div><div><textarea id="content" style="height:100px; width:210px"></textarea></div>';
    tmp += '<div><div style="clear:both">&nbsp;</div><div><div class="iconcornerborder gray " style="float:left; min-width:20px; cursor:hand; cursor:pointer"  id="newssave">Gởi email</div><div class="iconcornerborder gray " style="float:left; min-width:20px; cursor:hand; cursor:pointer"  id="newssave">Nhập lại</div><div id="message" style="float:left"></div></div></div></div>';
    $(e).html(tmp);
    $("#right").show("slow");
    //$('#scrollbar1').tinyscrollbar();
}

function loadlang() {
    if ($.cookie('lang') == "1") {
        $("#next").html("Next");
        $("#back").html("Back");
        $("#lblSearch1").css({ 'font-size': '10px', 'padding-right': '5px' });
        $("#newslettername").val("Full Name:");
        $("#search").val("Keyword...");
        $("#lblEn").html(CoreLangEnUk.lblEn);
        $("#lblVn").html(CoreLangEnUk.lblVn);
        $("#lblSearch").html(CoreLangEnUk.lblSearch);
        $("#lblcontactus").html('<a onclick="activemenu(6)" onmouseover="activemenuhover(6)" onmouseout="activemenu($.cookie(\'abc\'))" id="hrefcontactus" href="/lien-he">' + CoreLangEnUk.lblcontactus + '</a>');
        $("#lblccontactus").html('<a style="color:#A50000" href="/lien-he">' + CoreLangEnUk.lblcontactus + '</a>');
        $("#lblcourses").html(CoreLangEnUk.lblcourses);
        $("#lblforum").html(CoreLangEnUk.lblforum);

        $("#lblhome").html('<a onclick="activemenu(1)" onmouseover="activemenuhover(1)" onmouseout="activemenu($.cookie(\'abc\'))" id="hrefhome" href="/trang-chu">' + CoreLangEnUk.lblhome + '</a>');
        $("#lblhotnews").html(CoreLangEnUk.lblhotnews);
        $("#lblintro").html(CoreLangEnUk.lblintro);
        $("#lblcintro").html(CoreLangEnUk.lblcintro);
        $("#lblnews").html('<a  onclick="activemenu(3)" onmouseover="activemenuhover(3)" onmouseout="activemenu($.cookie(\'abc\'))" id="hrefnews" href="/tin-tuc-su-kien">' + CoreLangEnUk.lblnews + '</a>');
        $("#lblcnews").html('<a style="color:#A50000" href="/tin-tuc-su-kien">' + CoreLangEnUk.lblnews + '</a>');
        //$("#lblrecruit").html('onclick="activemenu(5)" onmouseover="activemenuhover(5)" onmouseout="activemenu($.cookie(\'abc\'))"  id="hrefrecruit" <a href="/tuyen-dung">' + CoreLangEnUk.lblrecruit + '</a>');
        $("#lblrecruit").html('<a  onclick="activemenu(5)" onmouseover="activemenuhover(5)"   onmouseout="activemenu($.cookie(\'abc\'))" id="hrefrecruit"  href="/tuyen-dung">' + CoreLangEnUk.lblrecruit + '</a>');
        $("#lblnewsletter").html(CoreLangEnUk.lblnewsletter);
        $("#lblregister").html(CoreLangEnUk.lblregister);
        $("#lblregisterstudying").html(CoreLangEnUk.lblregisterstudying);
        $("#lblSearch").html(CoreLangEnUk.lblSearch);
        $("#lblSearch1").html(CoreLangEnUk.lblSearch1);
        $("#lblstaff").html('<a onclick="activemenu(4)" onmouseover="activemenuhover(4)" onmouseout="activemenu($.cookie(\'abc\'))" id="hrefstaff" href="/khach-hang">' + CoreLangEnUk.lblstaff + '</a>');
        $("#lblstudent").html(CoreLangEnUk.lblstudent);
        $("#lblfmitexchange").html(CoreLangEnUk.lblfmitexchange);
        $("#lblshortprogram").html(CoreLangEnUk.lblshortprogram);
        $("#lbllongprogram").html(CoreLangEnUk.lbllongprogram);

        $("#lblbothome").html('<a style="color:#343434" href="/trang-chu">' + CoreLangEnUk.lblbothome + '</a>');
        $("#lblbotintro").html("<a style='color:#343434' href='gioi-thieu/fmit'>" + CoreLangEnUk.lblbotintro + "</a>");
        $("#lblbotnews").html('<a style="color:#343434" href="/tin-tuc-su-kien">' + CoreLangEnUk.lblbotnews + '</a>');
        $("#lblbotstaff").html('<a style="color:#343434" href="/khach-hang">' + CoreLangEnUk.lblbotstaff + "</a>");
        $("#lblbotstudent").html(CoreLangEnUk.lblbotstudent);
        $("#lblbotforum").html(CoreLangEnUk.lblbotforum);
        $("#lblbotcontactus").html('<a style="color:#343434" href="/lien-he">' + CoreLangEnUk.lblbotcontactus + '</a>');
        $("#lblmorecontactus").html(CoreLangEnUk.lblmorecontactus);

        $("#lblbotrecruit").html('<a style="color:#343434" href="/tuyen-dung">' + CoreLangEnUk.lblbotrecruit + '</a>');

        //contact form
        $("#lblcontactus1").html(CoreLangEnUk.lblcontactus1);
        $("#lblcontactus2").html(CoreLangEnUk.lblcontactus2);
        $("#lblcontactus3").html(CoreLangEnUk.lblcontactus3);
        $("#lblcontactus4").html(CoreLangEnUk.lblcontactus4);
        $("#lblcontactus5").html(CoreLangEnUk.lblcontactus5);
        $("#lblcontactus6").html(CoreLangEnUk.lblcontactus6);
        //end
        $("#lblmonthlyevent").html(CoreLangEnUk.lblmonthlyevent);
        $("#lblmonthlyexchange").html('<a style="color:black" href="/fmit-exchange">' + CoreLangEnUk.lblmonthlyexchange + '</a>');
        $("#lblmonthlyceo").html('<a style="color:black" href="/hocthu">' + CoreLangEnUk.lblmonthlyceo + '</a>');
        $("#lblmonthlyistqb").html('<a  style="color:black" href="/istqb">' + CoreLangEnUk.lblmonthlyistqb + '</a>');
        $("#lblmonthlypmp").html('<a  style="color:black" href="/pmp">' + CoreLangEnUk.lblmonthlypmp + '</a>');
        $("#lblmonthlyceomaster").html('<a  style="color:black" href="/ceo">Ceo Master</a>');
        //
        //
        $(".lblbtncontactus1").html(CoreLangEnUk.lblbtncontactus1);
        $(".lblbtncontactus2").html(CoreLangEnUk.lblbtncontactus2);
        //registration
        $("#lblregistertitle").html(CoreLangEnUk.lblregistertitle);
        $("#lblregistername").html(CoreLangEnUk.lblregistername);
        $("#lblregistermail").html(CoreLangEnUk.lblregistermail);
        $("#lblregisterphone").html(CoreLangEnUk.lblregisterphone);
        $("#lblregisteraddress").html(CoreLangEnUk.lblregisteraddress);
        $("#lblregistercompany").html(CoreLangEnUk.lblregistercompany);
        $("#lblregisterposition").html(CoreLangEnUk.lblregisterposition);
        $("#lblregisterprogram").html(CoreLangEnUk.lblregisterprogram);
        $("#lblregisternumber").html(CoreLangEnUk.lblregisternumber);
        $("#lblregisterpayment").html(CoreLangEnUk.lblregisterpayment);
        $("#lblstudyingcontent").html(CoreLangEnUk.lblstudyingcontent);
        $("#lblfaqcontent").html(CoreLangEnUk.lblfaqcontent);
        $("#lblqc").html(CoreLangEnUk.lblqc);
        //
        $("#lblsubfmit").html("<img src='../../../../../images/web/icon-submenu.png' />&nbsp;<a style='color:white' href='/gioi-thieu/fmit'>" + CoreLangEnUk.lblsubfmit + "</a>");
        $("#lblsubpartner").html("<img src='../../../../../images/web/icon-submenu.png' />&nbsp;<a style='color:white' href='/gioi-thieu/partner'>" + CoreLangEnUk.lblsubpartner + "</a>");
        //
        $("#lblsetfaq").html(CoreLangEnUk.lblsetfaq);
        $("#lblsetfaqtitle").html(CoreLangEnUk.lblsetfaqtitle);
        $("#lblanswerfaq").html(CoreLangEnUk.lblanswerfaq);
        $("#lblfootphone").html(CoreLangEnUk.lblfootphone);

        $("#lblothernews").html(CoreLangEnUk.lblothernews);
        $("#lblshared").html('<a style="color:#A50000" href="/chia-se-kinh-nghiem">' + CoreLangEnUk.lblshared + '</a>');
        $("#lblsearch").html(CoreLangEnUk.lblsearch);
        $("#lblsupport").html(CoreLangEnUk.lblsupport);
        wblur("newslettername", "Full Name:");
        $("#newslettername").focus(function () {
            wfocus("newslettername", "Full Name:");
        });
        $("#newslettername").blur(function () {
            wblur("newslettername", "Full Name:");
        });
        wblur("newsletteremail", "Email:");
        $("#newsletteremail").focus(function () {
            wfocus("newsletteremail", "Email:");
        });
        $("#newsletteremail").blur(function () {
            wblur("newsletteremail", "Email:");
        });
        wblur("search", "Keyword...");
        $("#search").focus(function () {
            wfocus("search", "Keyword...");
        });
        $("#search").blur(function () {
            wblur("search", "Keyword...");
        });
        $("#lblfootfmit").html(CoreLangEnUk.lblfootfmit);
        $("#lblfootfmitstreet").html(CoreLangEnUk.lblfootfmitstreet);
        $("#lblsubnews").html(CoreLangEnUk.lblsubnews);
        $("#lblsubfmitexchange").html(CoreLangEnUk.lblsubfmitexchange);
        $("#lblsubistqb").html(CoreLangEnUk.lblsubistqb);
        $("#lblsubpmp").html(CoreLangEnUk.lblsubpmp);
        $("#lblcoursestphcm").html(CoreLangEnUk.lblcoursestphcm);
    }
    else {
        $("#next").html("Xem tiếp");
        $("#back").html("Quay lại");
        $("#lblqc").html(CoreLangVi.lblqc);
        $("#lblSearch1").css({ 'font-size': '10px', 'padding-right': '10px' });
        $("#lblEn").html(CoreLangVi.lblEn);
        $("#lblVn").html(CoreLangVi.lblVn);
        $("#lblSearch").html(CoreLangVi.lblSearch);
        $("#lblcontactus").html('<a  onclick="activemenu(6)" onmouseover="activemenuhover(6)"  onmouseout="activemenu($.cookie(\'abc\'))" id="hrefcontactus"  href="/lien-he">' + CoreLangVi.lblcontactus + '</a>');
        $("#lblccontactus").html('<a style="color:#A50000" href="/lien-he">' + CoreLangVi.lblcontactus + '</a>');
        $("#lblcourses").html(CoreLangVi.lblcourses);
        $("#lblforum").html(CoreLangVi.lblforum);
        $("#lblhome").html('<a  onclick="activemenu(1)" onmouseover="activemenuhover(1)" onmouseout="activemenu($.cookie(\'abc\'))" id="hrefhome" href="/trang-chu">' + CoreLangVi.lblhome + '</a>');
        $("#lblhotnews").html(CoreLangVi.lblhotnews);
        $("#lblintro").html(CoreLangVi.lblintro);
        $("#lblcintro").html(CoreLangVi.lblcintro);
        $("#lblnews").html('<a  onclick="activemenu(3)" onmouseover="activemenuhover(3)"   onmouseout="activemenu($.cookie(\'abc\'))" id="hrefnews" href="/tin-tuc-su-kien">' + CoreLangVi.lblnews + '</a>');
        $("#lblcnews").html('<a style="color:#A50000" href="/tin-tuc-su-kien">' + CoreLangVi.lblnews + '</a>');
        $("#lblnewsletter").html(CoreLangVi.lblnewsletter);
        $("#lblregister").html(CoreLangVi.lblregister);
        $("#lblregisterstudying").html(CoreLangVi.lblregisterstudying);
        $("#lblSearch").html(CoreLangVi.lblSearch);
        $("#lblSearch1").html(CoreLangVi.lblSearch1);
        $("#lblstaff").html('<a  onclick="activemenu(4)" onmouseover="activemenuhover(4)"  onmouseout="activemenu($.cookie(\'abc\'))" id="hrefstaff" href="/khach-hang">' + CoreLangVi.lblstaff + "</a>");
        $("#lblstudent").html(CoreLangVi.lblstudent);
        $("#lblfmitexchange").html(CoreLangVi.lblfmitexchange);
        $("#lblshortprogram").html(CoreLangVi.lblshortprogram);
        $("#lbllongprogram").html(CoreLangVi.lbllongprogram);
        $("#lblrecruit").html('<a  onclick="activemenu(5)" onmouseover="activemenuhover(5)"   onmouseout="activemenu($.cookie(\'abc\'))" id="hrefrecruit"  href="/tuyen-dung">' + CoreLangVi.lblrecruit + '</a>');
        $("#lblbotrecruit").html('<a style="color:#343434" href="/tuyen-dung">' + CoreLangVi.lblbotrecruit + '</a>');
        //bottom
        $("#lblbothome").html('<a style="color:#343434" href="/trang-chu">' + CoreLangVi.lblbothome + '</a>');
        $("#lblbotintro").html("<a style='color:#343434' href='/gioi-thieu/fmit'>" + CoreLangVi.lblbotintro + '</a>');
        $("#lblbotnews").html('<a style="color:#343434" href="/tin-tuc-su-kien">' + CoreLangVi.lblbotnews + '</a>');
        $("#lblbotstaff").html('<a style="color:#343434" href="/khach-hang">' + CoreLangVi.lblbotstaff + '</a>');
        $("#lblbotstudent").html(CoreLangVi.lblbotstudent);
        $("#lblbotforum").html(CoreLangVi.lblbotforum);
        $("#lblbotcontactus").html('<a style="color:#343434" href="/lien-he">' + CoreLangVi.lblbotcontactus + '</a>');
        $("#lblmorecontactus").html(CoreLangVi.lblmorecontactus);
        //contact form
        $("#lblcontactus1").html(CoreLangVi.lblcontactus1);
        $("#lblcontactus2").html(CoreLangVi.lblcontactus2);
        $("#lblcontactus3").html(CoreLangVi.lblcontactus3);
        $("#lblcontactus4").html(CoreLangVi.lblcontactus4);
        $("#lblcontactus5").html(CoreLangVi.lblcontactus5);
        $("#lblcontactus6").html(CoreLangVi.lblcontactus6);
        //end
        $("#lblmonthlyevent").html(CoreLangVi.lblmonthlyevent);
        $("#lblmonthlyexchange").html('<a  style="color:black" href="/fmit-exchange">' + CoreLangVi.lblmonthlyexchange + '</a>');
        $("#lblmonthlyceo").html('<a  style="color:black" href="/hocthu">' + CoreLangVi.lblmonthlyceo + '</a>');
        $("#lblmonthlyistqb").html('<a  style="color:black" href="/istqb">' + CoreLangVi.lblmonthlyistqb + '</a>');
        $("#lblmonthlypmp").html('<a style="color:black" href="/pmp">' + CoreLangVi.lblmonthlypmp + '</a>');
        $("#lblmonthlyceomaster").html('<a  style="color:black" href="/ceo">Ceo Master</a>');
        //
        $(".lblbtncontactus1").html(CoreLangVi.lblbtncontactus1);
        $(".lblbtncontactus2").html(CoreLangVi.lblbtncontactus2);
        //registration
        $("#lblregistertitle").html(CoreLangVi.lblregistertitle);
        $("#lblregistername").html(CoreLangVi.lblregistername);
        $("#lblregistermail").html(CoreLangVi.lblregistermail);
        $("#lblregisterphone").html(CoreLangVi.lblregisterphone);
        $("#lblregisteraddress").html(CoreLangVi.lblregisteraddress);
        $("#lblregistercompany").html(CoreLangVi.lblregistercompany);
        $("#lblregisterposition").html(CoreLangVi.lblregisterposition);
        $("#lblregisterprogram").html(CoreLangVi.lblregisterprogram);
        $("#lblregisternumber").html(CoreLangVi.lblregisternumber);
        $("#lblregisterpayment").html(CoreLangVi.lblregisterpayment);
        $("#lblstudyingcontent").html(CoreLangVi.lblstudyingcontent);
        $("#lblfaqcontent").html(CoreLangVi.lblfaqcontent);
        $("#lblanswerfaq").html(CoreLangVi.lblanswerfaq);
        //
        $("#lblothernews").html(CoreLangVi.lblothernews);
        $("#lblsearch").html(CoreLangVi.lblsearch);
        $("#lblsubfmit").html("<img src='../../../../images/web/icon-submenu.png' />&nbsp;<a style='color:white' href='/gioi-thieu/fmit'>" + CoreLangVi.lblsubfmit + "</a>");
        $("#lblsubpartner").html("<img src='../../../../images/web/icon-submenu.png' />&nbsp;<a style='color:white' href='/gioi-thieu/partner'>" + CoreLangVi.lblsubpartner + "</a>");
        //
        $("#lblsetfaq").html(CoreLangVi.lblsetfaq);
        $("#lblsetfaqtitle").html(CoreLangVi.lblsetfaqtitle);
        $("#lblshared").html('<a style="color:#A50000" href="/chia-se-kinh-nghiem">' + CoreLangVi.lblshared + '</a>');
        $("#lblsupport").html(CoreLangVi.lblsupport);
        $("#lblfootphone").html(CoreLangVi.lblfootphone);

        wblur("newslettername", "Họ và tên:");
        $("#newslettername").focus(function () {
            wfocus("newslettername", "Họ và tên:");
        });
        $("#newslettername").blur(function () {
            wblur("newslettername", "Họ và tên:");
        });
        wblur("newsletteremail", "Email:");
        $("#newsletteremail").focus(function () {
            wfocus("newsletteremail", "Email:");
        });
        $("#newsletteremail").blur(function () {
            wblur("newsletteremail", "Email:");
        });
        wblur("search", "Từ khóa...");
        $("#search").focus(function () {
            wfocus("search", "Từ khóa...");
        });
        $("#search").blur(function () {
            wblur("search", "Từ khóa...");
        });
        $("#lblfootfmit").html(CoreLangVi.lblfootfmit);
        $("#lblfootfmitstreet").html(CoreLangVi.lblfootfmitstreet);

        $("#lblsubnews").html(CoreLangVi.lblsubnews);
        $("#lblsubfmitexchange").html(CoreLangVi.lblsubfmitexchange);
        $("#lblsubistqb").html(CoreLangVi.lblsubistqb);
        $("#lblsubpmp").html(CoreLangVi.lblsubpmp);
        $("#lblcoursestphcm").html(CoreLangVi.lblcoursestphcm);
    }
}
function submenu(e) {
    if (!$("#" + e).length) {
        $(document.body).append("<div  id='" + e + "'><div  onmouseover=\"activemenuhover(2)\" onmouseout=\"activemenu($.cookie(\'abc\'))\" onclick=\"$.cookie('test', '10');activemenu(2);\" id='lblsubfmit'><div>FMIT</div></div><div  onmouseover=\"activemenuhover(2)\" onmouseout=\"activemenu($.cookie(\'abc\'))\" onclick=\"$.cookie('test', '10');activemenu(2)\" id='lblsubpartner'>Đối tác</div></div>");
        var offset = $("#lblintro").offset();
        x = offset.left;
        y = offset.top;
        $("#" + e).mouseleave(function () {
            $("#" + e).hide("slow");
            $("#" + e).remove();
        });
    }
    loadlang();
    $("#" + e).css({ 'opacity': '0.9', 'position': 'absolute', 'top': (y + 25), 'left': x, 'background': '#9b1417', 'width': '115px', 'color': 'white', 'display': 'none' });
    $('body').click(function (event) {
        if (!$(event.target).closest("#" + e).length) {
            $("#" + e).remove();

        };
    });
}
function loadlongicon(a) {
    if (a == null) {
        a = "1";
    }

    switch (parseInt(a)) {

        case 0:
            $("#longicon0").attr("src", "/images/web/left/icon-menu1.png");

            break;
        default:
            $("#longicon0").attr("src", "/images/web/left/icon-menu2.png");

            break;
    }
}
function loadicon(a) {
    if (a == null) {
        a = "10";
    }

    switch (parseInt(a)) {

        case 0:
            $("#icon0").attr("src", "/images/web/left/icon-menu1.png");
            $("#icon1").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon2").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon3").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon4").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon5").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon6").attr("src", "/images/web/left/icon-menu2.png");
            break;
        case 1:
            $("#icon0").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon1").attr("src", "/images/web/left/icon-menu1.png");
            $("#icon2").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon3").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon4").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon5").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon6").attr("src", "/images/web/left/icon-menu2.png");
            break;
        case 2:
            $("#icon0").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon1").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon2").attr("src", "/images/web/left/icon-menu1.png");
            $("#icon3").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon4").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon5").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon6").attr("src", "/images/web/left/icon-menu2.png");
            break;
        case 3:
            $("#icon0").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon1").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon2").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon3").attr("src", "/images/web/left/icon-menu1.png");
            $("#icon4").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon5").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon6").attr("src", "/images/web/left/icon-menu2.png");
            break;
        case 4:
            $("#icon0").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon1").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon2").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon3").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon4").attr("src", "/images/web/left/icon-menu1.png");
            $("#icon5").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon6").attr("src", "/images/web/left/icon-menu2.png");
            break;
        case 5:
            $("#icon0").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon1").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon2").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon3").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon4").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon5").attr("src", "/images/web/left/icon-menu1.png");
            $("#icon6").attr("src", "/images/web/left/icon-menu2.png");
            break;
        case 6:
            $("#icon0").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon1").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon2").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon3").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon4").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon5").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon6").attr("src", "/images/web/left/icon-menu1.png");
            break;
        default:
            $("#icon0").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon1").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon2").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon3").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon4").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon5").attr("src", "/images/web/left/icon-menu2.png");
            $("#icon6").attr("src", "/images/web/left/icon-menu2.png");
            break;
    }
}

function formceo(e) {
    var tmp = '';
    tmp += '<div style="margin-left: 180px; margin-right: 50px">';
    tmp += '<table cellspacing="0" cellpadding="0" border="0">';
    tmp += '<tr>';
    tmp += '<td valign="top" align="center">';
    tmp += '<div class="form">';
    tmp += '<div>';
    tmp += '<table width="100%" cellspacing="0" cellpadding="0">';
    tmp += '<tr><td colspan="2" height="5"></td></tr>';
    tmp += '<tr>';
    tmp += '<td colspan="2" align="center">';
    tmp += '<p style="font-size: 20px; font-weight: bold; color: #830909;">FORM ĐĂNG KÝ LỚP HỌC THỬ CEO MIỄN PHÍ</p>';
    tmp += '<p style="font-size: 13px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif">Người tham dự cần điền đầy đủ thông tin bên dưới:';
    tmp += '</td>';
    tmp += '</tr>';
    tmp += '<tr><td colspan="2" height="5"></td></tr>';
    tmp += '<tr style="font-size: 13px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;">';
    tmp += '<td align="right" height="30">Họ tên: <span class="required">(*) </span>:</td>';
    tmp += '<td style="padding-left: 5px;" height="30"><input size="12" class="textbox" name="FullName" id="FullName" type="text"></td>';
    tmp += '</tr>';
    tmp += '<tr style="font-size: 13px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;">';
    tmp += '<td align="right" height="30">Giới tính: <span class="required">(*) </span>:</td>';
    tmp += '<td style="padding-left: 5px;" height="30">';
    tmp += '<input type="radio" name="Gioitinh" value="Nam" checked="yes" />Nam';
    tmp += '<input type="radio" name="Gioitinh" value="Nu" />Nữ';
    tmp += '</td>';
    tmp += '</tr>';
    tmp += '';
}
function link(e) {

}
function validstudying() {
    var msg = '';
    if ($.cookie('lang') == "1") {
        msg += CoreLangEnUk.lblchkinfo;
    }
    else {
        msg += CoreLangVi.lblchkinfo;
    }
    var check = true;
    var filter = new RegExp("^[0-9a-zA-Z.]+@[0-9a-zA-Z]+[\.]{1}[0-9a-zA-Z]+[\.]?[0-9a-zA-Z]+$");

    if ($.trim($("#fullname").val()) == "") {
        if ($.cookie('lang') == "1") {
            msg = msg + "\n -" + CoreLangEnUk.lblfullnameinfo;
        }
        else {
            msg = msg + "\n -" + CoreLangVi.lblfullnameinfo;
        }
        check = false;
    }
    if (!filter.test($.trim($("#email").val()))) {
        msg = msg + "\n -Email"
        check = false;
    }
    if ($.trim($("#phone").val()) == "") {
        if ($.cookie('lang') == "1") {
            msg = msg + "\n -" + CoreLangEnUk.lblPhoneinfo;
        }
        else {
            msg = msg + "\n -" + CoreLangVi.lblPhoneinfo;
        }
        check = false;
    }
    if ($.trim($("#address").val()) == "") {
        if ($.cookie('lang') == "1") {
            msg = msg + "\n -" + CoreLangEnUk.lblAddressinfo;
        }
        else {
            msg = msg + "\n -" + CoreLangVi.lblAddressinfo;
        }
        check = false;
    }
    if ($.trim($("#register").val()) == "") {
        if ($.cookie('lang') == "1") {
            msg += "\n -Number of attendees";
        }
        else {
            msg = msg + "\n -Số người tham dự"
        }
        check = false;
    }
    else {
        if (isNaN(parseInt($.trim($("#register").val())))) {

            if ($.cookie('lang') == "1") {
                msg += "\n -Number of attendees invalid";
            }
            else {
                msg = msg + "\n -Số người tham dự không hợp lệ";
            }
            check = false;
        }
    }
    if (getAttributeOnSelectOption("#payment", 'value') == "0") {

        if ($.cookie('lang') == "1") {
            msg += "\n -Choosing form of payment";
        }
        else {
            msg = msg + "\n -Chọn hình thức thanh toán"
        }
        check = false;
    }
    if (getAttributeOnSelectOption("#studying", 'value') == "0") {

        if ($.cookie('lang') == "1") {
            msg += "\n -Choosing attendant program";
        }
        else {
            msg = msg + "\n -Chọn chương trình tham dự"
        }
        check = false;
    }

    if (check == false)
        alert(msg);
    else {
        addstudying('');
    }
    //    return check;
}
function addstudying(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/AddStudying";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + encode($("#fullname").val()) + '","email":"' + encode($("#email").val()) + '","phone":"' + encode($("#phone").val()) + '","address":"' + encode($("#address").val()) + '","company":"' + encode($("#company").val()) + '","position":"' + encode($("#role").val()) + '","program":"' + encode(getAttributeOnSelectOption("#studying", 'value')) + " - " + encode(getAttributeOnSelectOption("#studying", 'title')) + '","number":"' + $("#register").val() + '","payment":"' + encode(getAttributeOnSelectOption("#payment", 'value')) + '"}';

    varDataType = "json";
    varProcessData = true;
    CallService("addstudying", e, succeded);
}
function clearstudying() {
    $("#fullname").val('');
    $("#email").val('');
    $("#phone").val('');
    $("#address").val('');
    $("#role").val('');
    $("#register").val('');
    $("#company").val('');
}
function clearcontactus() {
    $("#fullname").val('');
    $("#email").val('');
    $("#phone").val('');
    $("#title").val('');
    $("#content").val('');

}
function validcontactus() {
    var msg = 'Bạn vui lòng kiểm tra các thông tin: ';
    var check = true;
    var filter = new RegExp("^[0-9a-zA-Z.]+@[0-9a-zA-Z]+[\.]{1}[0-9a-zA-Z]+[\.]?[0-9a-zA-Z]+$");

    if ($.trim($("#fullname").val()) == "") {
        msg = msg + "\n -Họ Tên"
        check = false;
    }
    if (!filter.test($.trim($("#email").val()))) {
        msg = msg + "\n -Email"
        check = false;
    }
    if ($.trim($("#phone").val()) == "") {
        msg = msg + "\n -Điện thoại"
        check = false;
    }
    if ($.trim($("#title").val()) == "") {
        msg = msg + "\n -Tiêu đề"
        check = false;
    }
    if ($.trim($("#txtcontent").val()) == "") {
        msg = msg + "\n -Nội dung"
        check = false;
    }


    if (check == false)
        alert(msg);
    else {
        //addstudying('');
    }
    //    return check;
}
function addnewsletter(e) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/AddNewsletter";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + encode($("#newslettername").val()) + '","email":"' + encode($("#newsletteremail").val()) + '"}';

    varDataType = "json";
    varProcessData = true;
    CallService("addnewsletter", e, succeded);
}
function clearnewsletter() {
    $("#newslettername").val('');
    $("#newsletteremail").val('');
}
function validnewsletter() {
    var msg = 'Bạn vui lòng kiểm tra các thông tin: ';
    var check = true;
    var filter = new RegExp(/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]+$/);

    if ($.trim($("#newslettername").val()) == "") {
        msg = msg + "\n -Họ và Tên"
        check = false;
    }
    else {
        if ($.trim($("#newslettername").val()) == "Họ và tên:" || $.trim($("#newslettername").val()) == "Full Name:") {
            msg = msg + "\n -Họ và Tên"
            check = false;
        }
    }
    if (!filter.test($.trim($("#newsletteremail").val()))) {
        msg = msg + "\n -Email"
        check = false;
    }
    if (check == false)
        alert(msg);
    else {
        addnewsletter('');
    }
}
//form
function mailfmitexchange(e, name, company, position, address, email, phonenumber,place, date, subject) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/Exchange";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + name + '","company":"' + company + '","position":"' + position + '","address":"' + address + '","email":"' + email + '","phone":"' + phonenumber + '","place":"' + place + '","date":"' + date + '","subject":"' + encode(subject) + '"}';
    
    varDataType = "json";
    varProcessData = true;
    CallService("mailfmitexchange", e, succeded);
}
function mailceomaster(e, name, gender, birthday, address, email, phonenumber, congtac, position, major, subject) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/CeoMaster";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + name + '","gender":"' + gender + '","birthday":"' + birthday + '","address":"' + address + '","email":"' + email + '","phone":"' + phonenumber + '","congtac":"' + congtac + '","position":"' + position + '","major":"' + major + '","subject":"' + subject + '"}';

    varDataType = "json";
    varProcessData = true;
    CallService("mailceomaster", e, succeded);
}
function mailistqb(e, name, birthday, address, email, phonenumber, date, subject) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/ISTQB";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + name + '","birthday":"' + birthday + '","address":"' + address + '","email":"' + email + '","phone":"' + phonenumber + '","date":"' + date + '","subject":"' + subject + '"}';

    varDataType = "json";
    varProcessData = true;
    CallService("mailistqb", e, succeded);
}
function mailpmp(e, name, company, position, address, email, phonenumber, subject) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/PMP";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + name + '","company":"' + company + '","position":"' + position + '","address":"' + address + '","email":"' + email + '","phone":"' + phonenumber + '","subject":"' + subject + '"}';

    varDataType = "json";
    varProcessData = true;
    CallService("mailpmp", e, succeded);
}
function mailceo(e, name, company, position, address, email, phonenumber, source, subject) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/Ceo";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + name + '","company":"' + company + '","position":"' + position + '","address":"' + address + '","email":"' + email + '","phone":"' + phonenumber + '","source":"' + source + '","subject":"' + subject + '"}';

    varDataType = "json";
    varProcessData = true;
    CallService("mailceo", e, succeded);
}
function mailctfl(e, name, company, position, address, email, phonenumber, source, subject) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/Ctfl";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + name + '","company":"' + company + '","position":"' + position + '","address":"' + address + '","email":"' + email + '","phone":"' + phonenumber + '","source":"' + source + '","subject":"' + subject + '"}';
    varDataType = "json";
    varProcessData = true;
    CallService("mailceo", e, succeded);
}
function maildragonpower(e, name, company, position, address, email, phonenumber, source, subject) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/DragonPower";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + name + '","company":"' + company + '","position":"' + position + '","address":"' + address + '","email":"' + email + '","phone":"' + phonenumber + '","source":"' + source + '","subject":"' + subject + '"}';
    varDataType = "json";
    varProcessData = true;
    CallService("mailceo", e, succeded);
}
function maildondau(e, name, company, position, address, email, phonenumber, source, subject) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/DonDauThachThuc";
    varContentType = "application/json; charset=utf-8";
    varData = '{"name":"' + name + '","company":"' + company + '","position":"' + position + '","address":"' + address + '","email":"' + email + '","phone":"' + phonenumber + '","source":"' + source + '","subject":"' + subject + '"}';
    varDataType = "json";
    varProcessData = true;
    CallService("mailceo", e, succeded);
}
//end

function activemenu(i) {

    var datef = new Date();
    datef.setTime(datef.getTime() + (3600 * 60 * 1000));
    $.cookie('abc', i, { expires: datef });
    switch (i) {
        case "1":
            $("#hrefhome").css({ 'color': '#ff9900' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        case "2":
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': '#ff9900' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        case "3":
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': '#ff9900' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        case "4":
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': '#ff9900' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        case "5":
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': '#ff9900' });
            break;
        case "6":
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': '#ff9900' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        default:
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
    }
}
function activemenuhover(i) {
    switch (i) {
        case 1:
            $("#hrefhome").css({ 'color': '#ff9900' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        case 2:
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': '#ff9900' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        case 3:
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': '#ff9900' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        case 4:
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': '#ff9900' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
        case 5:
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': 'white' });
            $("#hrefrecruit").css({ 'color': '#ff9900' });
            break;
        case 6:
            $("#hrefhome").css({ 'color': 'white' });
            $("#lblintro").css({ 'color': 'white' });
            $("#hrefnews").css({ 'color': 'white' });
            $("#hrefstaff").css({ 'color': 'white' });
            $("#hrefcontactus").css({ 'color': '#ff9900' });
            $("#hrefrecruit").css({ 'color': 'white' });
            break;
    }
}
//banner adv
function headerbanner(e, parent) {
    varType = "POST";
    varUrl = "../../../../services/aboutus.asmx/GetBannerByParent";
    varContentType = "application/json; charset=utf-8";
    varData = '{"parent":"' + parent + '"}';
    varDataType = "json";
    varProcessData = true;
    CallService("headerbanner", e, succeded);
}
//edn
function divsignuphover() {
    $("#divsignup").mouseover(function () {
        $("#divsignup").css({ 'color': '#990003' });
    });
    $("#divsignup").mouseout(function () {
        $("#divsignup").css({ 'color': 'black' });
    });
}
function reloadurl(url, fl) {
    var arr = url.split('/');
    if (arr.length == 8) {
        var tmp = arr[0] + "/" + arr[1] + "/" + arr[2] + "/" + arr[3] + "/" + fl + "/" + arr[5] + "/" + arr[6] + "/" + arr[7];
        redirect(tmp);
    }
    else {
        window.location.reload();
    }
}
function changecookie(name, v) {
    var datef = new Date();
    datef.setTime(datef.getTime() + (3600 * 60 * 1000));
    $.cookie(name, v, { expires: datef });

}
function topactive(url) {
    var datef = new Date();
    datef.setTime(datef.getTime() + (3600 * 60 * 1000));
    var arr = url.split('/');
    var tmp = 0;

    switch (arr[3]) {
        case "trang-chu":
            tmp = 1;
            break;
        case "gioi-thieu":
            tmp = 2;
            break;
        case "tin-tuc-su-kien":
            tmp = 3;
            break;
        case "khach-hang":
            tmp = 4;
            break;
        case "tuyen-dung":
            tmp = 5;
            break;
        case "lien-he":
            tmp = 6;
            break;
    }
    if (arr.length == 8) {
        tmp = 0;
    }

    $.cookie('abc', tmp, { expires: datef });

}

function activetitle(e) {
    $("#666").css({ 'color': 'red' });
}
function qc(e) {
    if (!$("#" + e).length) {
        $(document.body).append("<div id='" + e + "'></div>");
    }
    $("#" + e).css({ 'position': 'fixed', 'right': 0, 'bottom': 0 });
}
