﻿
var versionMediaGo = 9.123; // last-modified
var currentLink = window.location + '';
var IsUseLazyload = false;
var feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18484929";
//  'http://www.go.vn/diendan/forumdisplay.php?776-Gop-y-xay-dung-Mang-Viet-Nam-Go-vn';
var domain_notifyHandler = "http://notify.go.vn/Handler/";
var domain_notifyWeb     = "http://notify.go.vn/";
var mygo_UrlLink = "http://my.go.vn/";
var mygo_UrlMedia = "http://static.gox.vn/media/homepage/";
var mygo_club_Word = "club";
var mygo_club_Url = 'http://clubs.go.vn/';
var mygo_friend_Url = 'http://my.go.vn/home.aspx';
var CHANGING_DOMAIN = true;
var searchUrl = "http://search.go.vn/results.aspx";
var UrlGoSearch = "search.go.vn";

//var searchNewsURL = "http://news.go.vn/search.htm";
var govn_url = "http://www.go.vn";
var govnRegisterUrl = "http://go.vn/accounts/account.register.aspx";
var mygo_loading = '<div class="aligncenter" style="text-align:center"><img src="http://static.gox.vn/media/homepage/images/awaiting.gif" alt="loading" border="0" /></div>';
var noteLoadFlag = true;
var friendLoadFlag = true;
var messageLoadFlag = true;
var mygo_value_text = "Tìm kiếm";
var mygo_urlStatic = "http://static.gox.vn/media/";
/*auto show notify*/
var go_notify_isPageLoad = true;
var hideShowNotifyContent = 10000;
var delayloadCountNotify = 30000; // 30 s
var go_notify_delayPageLoad = 10000;
var mygoSuggestFlag = true;
var go_search_defaultVal = "all";

function IsSiteHaveBanner() {
    var loc = window.location.href;
    loc = loc.toLowerCase();
    var siteArr = ['www.go.vn', 'play.go.vn', 'vivo.go.vn', 'music.go.vn'];

    var portalUrl = "http://www.go.vn/";
    for (var i = 0; i < siteArr.length; i++) {
        if (loc.indexOf(siteArr[i]) != -1 || loc == portalUrl)
            return true;

    }
    return false;
}
//if (!IsSiteHaveBanner() && IsUseLazyload) {
//    $.getScript("http://static.gox.vn/media/blogs/jquery/jquery.lazyload.js?v=5", function() {
//        $('img').lazyload({
//                //                 effect: "fadeIn",                 
//                //                 threshhold: 0
//            });
//    });
//}

// append css to header
function mygo_appendCss(url) {
    var head = document.getElementsByTagName('head')[0];
    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.type = 'text/css';
    link.href = mygo_urlStatic + url + "?v=" + versionMediaGo;
    head.appendChild(link);
}
if (navigator.userAgent.indexOf('MSIE 6.0') != -1) {
    mygo_appendCss("portal/css/ie6.css");
    document.write("<script src=\"" + mygo_urlStatic + "homepage\/js\/fixPNG-min.js\" type=\"text\/javascript\"><\/script>");
}

// doi domain
function replaceByDomain(val) {
    if (val)
    if (CHANGING_DOMAIN) {
        val = val.toLowerCase();
        return val.replace('goonline.vn', 'go.vn');           
       } else {
        return val;
    }
    return val;
}  
// start Object UrlLink
var obj_MyGoActive = {
    "http://edu": "http://edu.go.vn/pages/ca-nhan/",
    "http://photos": "http://photos.go.vn/MyPhotos/",
    "http://blogs": "http://blogs.go.vn",
    "http://music": "http://music.go.vn/me/album",
    "http://clips": "http://clips.go.vn/pages/myvideo"
};
var obj_MyGoActiveQly = {
    accinfo: "http://my.go.vn/accinfo",
    friends: "http://my.go.vn/friends",
    accPrivacy: "http://my.go.vn/accPrivacy"
};
if (typeof mygo_obj == "undefined")
    var mygo_obj = { "accountId": -1, "viewPubName": null, "loginUrl": "http://go.vn/accounts/account.login.aspx?sid=660006&ur=http%3a%2f%2fwww.go.vn%2fPortal.aspx&m=1", "logoutUrl": null, "searchOption": "all" };
if (typeof mygo_obj.searchOption !== "undefined")
    var mygo_searchOption = mygo_obj.searchOption;
else
    var mygo_searchOption = go_search_defaultVal;
var mygo_currentUrl = window.location.href; 

function getFeedBackLink() {
    feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18484929";
    var pathName = window.location + "";
    if (pathName.toLowerCase().indexOf("my.go.vn")!=-1) 
        feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18601000";
    else if (pathName.toLowerCase().indexOf("blogs.go.vn") != -1)
        feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18484369";
    else if (pathName.toLowerCase().indexOf("ioe.go.vn") != -1)
        feedBackLinkDefault = "http://www.go.vn/diendan/newthread.php?do=newthread&f=856";
    else if (pathName.toLowerCase().indexOf("music.go.vn") != -1)
        feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18487686";
    else if (pathName.toLowerCase().indexOf("clubs.go.vn") != -1)
        feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18452385";
    else if (pathName.toLowerCase().indexOf("photos.go.vn") != -1)
        feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18426044";
    else if (pathName.toLowerCase().indexOf("clips.go.vn") != -1)
        feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18672609";
    else if (pathName.toLowerCase().indexOf("edu.go.vn") != -1)
        feedBackLinkDefault = "http://www.go.vn/diendan/newthread.php?do=newthread&f=856";   
    else if (pathName.toLowerCase().indexOf("content.go.vn") != -1)
        feedBackLinkDefault = "http://www.go.vn/diendan/newthread.php?do=newthread&f=121";  
    else
        feedBackLinkDefault = "http://www.go.vn/diendan/newreply.php?noquote=1&do=newreply&p=18484929";

}
getFeedBackLink();
function notify_MygoToolbar()    
{
    var AccountId = mygo_obj.accountId;
   
    var mygo_logoutUrl = mygo_obj.logoutUrl;
    var mygo_loginUrl = mygo_obj.loginUrl;
   // var mygo_linkSearchOption;
   
    
    if(mygo_loginUrl == "" || mygo_loginUrl == null){
        mygo_loginUrl = "http://go.vn/accounts/account.login.aspx";
    }
   
    switch(mygo_searchOption) {               
        case "photo":
        mygo_value_text = "Tìm kiếm ảnh";
        break;
        case "music":
        mygo_value_text ="Tìm kiếm bài hát";
        break;
        case "clip":
        mygo_value_text ="Tìm kiếm clip";
        break;
        case "news":
        mygo_value_text ="Tìm kiếm tin tức";
        break;
        case "edu":
        mygo_value_text ="Tìm kiếm bài giảng";
        break;
        case "shop":
        mygo_value_text ="Tìm kiếm sản phẩm";
        break;
        case "forum":
        mygo_value_text ="Tìm kiếm diễn đàn";
        break;
        case "blog":
        mygo_value_text ="Tìm kiếm bài viết";
        break;
        case "missteen":
        mygo_value_text ="Tìm kiếm thí sinh";
        break;
        case "club":
        mygo_value_text = "Tìm kiếm hội nhóm";
        break;
        case "thanhvien":
        mygo_value_text ="Tìm kiếm thành viên";
        break;
}// end function notify_MygoToolbar() 

     if(mygo_logoutUrl == null || mygo_logoutUrl == "")
     {
        mygo_logoutUrl = "?logout=true";
     }
     else{
        var param;
        var newStr = mygo_logoutUrl + "";
        if(newStr.indexOf("?")!= -1){
            param= "&logout=true";
        }
        else{
            param= "?logout=true";
        }
        var hash = newStr.split("#");
        if(hash.length == 2)
        {
            mygo_logoutUrl = hash[0] + param + "#" + hash[1];
        }
        else
        {
            mygo_logoutUrl = newStr+param;
        }
    }
var strNotify_Start  =  "<div id='Notify_TopIndex' align='center' class ='notify_body'>"; //mygo_loginUrl = mygo_loginUrl.replace("http", "https");

var Notify_NotLogin  =  "<div id='isNotLogin' class='notify_TopIndex'>";
    Notify_NotLogin +=      "<div class='notify_index2'>";
    Notify_NotLogin += "<a href='" + govnRegisterUrl + "' id ='notify_DK'>Đăng ký</a>";
    Notify_NotLogin +=          "<a href='" + mygo_loginUrl + "' id = 'notify_DN'>Đăng nhập</a>";
    Notify_NotLogin += "</div>";
    if (typeof mygo_obj.IsHideFormSearch != "undefined") {
        if (mygo_obj.IsHideFormSearch == false)
        // if (mygo_currentUrl.indexOf(UrlGoSearch) == -1) 
        {
            Notify_NotLogin += "<div class='notify_top_search'>";
            Notify_NotLogin += "<input name='keyword' type='text' value='" + mygo_value_text + "' id='txtTopSearch' width='160px'/>";
            Notify_NotLogin += "<input name='page' type='hidden' value='" + mygo_searchOption + "'/>";
            Notify_NotLogin += "<button id ='btnTopSearch'></button>";
            Notify_NotLogin += "</div>";
        }
    }
    else {
        Notify_NotLogin += "<div class='notify_top_search'>";
        Notify_NotLogin += "<input name='keyword' type='text' value='" + mygo_value_text + "' id='txtTopSearch' width='160px'/>";
        Notify_NotLogin += "<input name='page' type='hidden' value='" + mygo_searchOption + "'/>";
        Notify_NotLogin += "<button id ='btnTopSearch'></button>";
        Notify_NotLogin += "</div>";
    }
    Notify_NotLogin +=      "<ul>";
    Notify_NotLogin +=          "<li class='notify_mvn'>";
    Notify_NotLogin +=              "<span class='notify_drop_index'>";
    Notify_NotLogin +=                  "<a href='javascript:void(0);' id='contentlink1' rel='subcontent1'>&nbsp;</a>";
    Notify_NotLogin +=              "</span>";
    Notify_NotLogin +=              "<span class='notify_mvn_a'>";
    Notify_NotLogin +=                  "<a href='http://www.go.vn' id ='notify_ActiveMVN'>Mạng Việt nam</a>";
    Notify_NotLogin +=              "</span>";
    Notify_NotLogin +=          "</li>";
    Notify_NotLogin +=      "</ul>";
    Notify_NotLogin +=  "</div>"; // End NotLogin  

var Notify_Login  = "<div class='notify_TopIndex'>";
  //  Notify_Login +=     "<div class='notify_index2'><a href='" + mygo_logoutUrl + "'>Thoát</a></div>";
    Notify_Login +=     "<div class='notify_index'><a href='javascript:void(0);' id='contentlink2' rel='subcontent2'><span id ='notify_ActiveQly'>Quản lý</span></a></div>";
    if (typeof mygo_obj.IsHideFormSearch != "undefined") {
        if (mygo_obj.IsHideFormSearch == false)
        // if (mygo_currentUrl.indexOf(UrlGoSearch) == -1) 
        {
            Notify_Login += "<div class='notify_top_search'>";
            Notify_Login += "<input name='keyword' type='text' value='" + mygo_value_text + "' id='txtTopSearch'/>";
            Notify_Login += "<input name='page' type='hidden' value='" + mygo_searchOption + "'/>";
            Notify_Login += "<button id = 'btnTopSearch'></button>";
            Notify_Login += "</div>";
        }
    }
    else {
        Notify_Login += "<div class='notify_top_search'>";
        Notify_Login += "<input name='keyword'  type='text' value='" + mygo_value_text + "' id='txtTopSearch' width='160px'/>";
        Notify_Login += "<input name='page' type='hidden' value='" + mygo_searchOption + "'/>";
        Notify_Login += "<button id = 'btnTopSearch'></button>";
        Notify_Login += "</div>";
    }
   
    Notify_Login +=     "<ul class ='notify_UserHeader'>";
    Notify_Login +=         "<li class='notify_mvn'>";
    Notify_Login +=             "<span class='notify_drop_index'><a href='javascript:void(0);' id='contentlink1' rel='subcontent1'>&nbsp;</a></span>";
    Notify_Login +=             "<span class='notify_mvn_a'><a href='http://www.go.vn' id ='notify_Active_mvnLog'>Mạng Việt nam</a></span>";
    Notify_Login +=         "</li>"; // Hiển thị bạn bè

    Notify_Login += "<li class='notify_friend_index' id='FriendClubBox'>";
    if (currentLink.indexOf(mygo_club_Word) != -1)
        Notify_Login += "<a href=\"" + mygo_club_Url + "clubtab.aspx\" class='textClub'> HỘI NHÓM</a>";
    else
        Notify_Login += "<a href=\"" + mygo_friend_Url + "\" class='textFriend'> BẠN BÈ</a>";
    // notify_drop_index
    Notify_Login += "<span class='dropArrow'><a rel='subFriendClubBox' id='FriendClubCurrentLink' href='javascript:void(0);'>&nbsp;</a></span>"; /*
    Notify_Login +=             "<div class='notify_warning_tooltip fnotify'>"
    Notify_Login +=                 "<img src='"+mygo_UrlMedia+"images/backgrounds/note_red_left.gif' width='2' height='12' class='notify_fl'/>"
    Notify_Login +=                 "<div class='notify_cont_warning_tooltip'></div>"
    Notify_Login +=                  "<img src='" + mygo_UrlMedia + "images/backgrounds/note_red_right.gif' width='2' height='12' class='notify_fl'/>"
    Notify_Login +=                 "<div style='clear:both'></div>"
    Notify_Login +=             "</div>"
    */
    // Notify_Login +=             "<a href='"  + mygo_UrlLink +  "home.aspx' rel=''>Bạn bè</a>"
    Notify_Login += "</li>"; // end hiển bạn bè
    Notify_Login +=         "<li class='notify_menu_user_index'>";
    Notify_Login +=             "<a href='"  + mygo_UrlLink +  "?id=" + AccountId + "' class ='notify_ActiveCss'>";
    Notify_Login +=                 "<img src='http://farm01.go.vn/avatar/store/account/" + parseInt((AccountId) / 1000000) + "/" + parseInt((AccountId) / 1000) + "/" + parseInt((AccountId) / 1) + "/" + AccountId + ".png.28.28.cache' class ='notify_ava_index'/>";
    var go_viewPubName = mygo_obj.viewPubName;
    if (go_viewPubName) {
        if (go_viewPubName.length > 23)
            go_viewPubName = go_viewPubName.substring(0, 23);
    }
    else go_viewPubName = '';
    Notify_Login += "" + go_viewPubName + "";
    Notify_Login +=             "</a>";
    Notify_Login +=         "</li>"; // Hiển thị số Notify
    Notify_Login +=         "<li class='notify_list_user_index'>";
    Notify_Login +=             "<ul>";
    Notify_Login +=                 "<li class='notify_icon_index' id='notify_IDNote'>";
    Notify_Login +=                     "<div class='notify_countNote usernotify' style ='margin-left:13px;'>";
    Notify_Login +=                         "<img src='" + mygo_UrlMedia + "images/backgrounds/note_red_left.gif' width='2' height='12' class='notify_fl'/>";
    Notify_Login +=                         "<div class='notify_warning_Note' id ='notify_IDcountNote'></div>";
    Notify_Login +=                         "<img src='" + mygo_UrlMedia + "images/backgrounds/note_red_right.gif' width='2' height='12' class='notify_fl'/>";
    Notify_Login +=                         "<div style='clear:both'></div>";
    Notify_Login +=                     "</div>";
    Notify_Login +=                     "<a href='javascript:void(0);' class='Note_index' id='contentlink6' rel='subcontent6' data-tooltip='sticky2'>&nbsp;</a>";
    Notify_Login +=                 "</li>";
    Notify_Login +=                 "<li class='notify_icon_index' id='notify_IDFriend'>";
    Notify_Login +=                     "<div class='notify_countFriend usernotify' style ='margin-left:16px;'>";
    Notify_Login +=                         "<img src='" + mygo_UrlMedia + "images/backgrounds/note_red_left.gif' width='2' height='12' class='notify_fl'/>";
    Notify_Login +=                         "<div class='notify_warning_Friend' id ='notify_IDcountFriend'></div>";
    Notify_Login +=                         "<img src='" + mygo_UrlMedia + "images/backgrounds/note_red_right.gif' width='2' height='12' class='notify_fl'/>";
    Notify_Login +=                         "<div style='clear:both'></div>";
    Notify_Login +=                     "</div>";
    Notify_Login +=                     "<a href='javascript:void(0);' class='Friend_index' id='contentlink5' rel='subcontent5' data-tooltip='sticky3'> &nbsp; </a>";
    Notify_Login +=                 "</li>";
    Notify_Login +=                 "<li class='notify_icon_index' id='notify_IDMess'>";
    Notify_Login +=                     "<div class='notify_countMess usernotify' style ='margin-left:18px;'>";
    Notify_Login +=                         "<img src='" + mygo_UrlMedia + "images/backgrounds/note_red_left.gif' width='2' height='12' class='notify_fl'/>";
    Notify_Login +=                         "<div class='notify_warning_Mess' id ='notify_IDcountMess'></div>";
    Notify_Login +=                         "<img src='" + mygo_UrlMedia + "images/backgrounds/note_red_right.gif' width='2' height='12' class='notify_fl'/>";
    Notify_Login +=                         "<div style='clear:both'></div>";
    Notify_Login +=                     "</div>";
    Notify_Login +=                     "<a href='javascript:void(0);' class='Mess_index' id='contentlink4' rel='subcontent4' data-tooltip='sticky1'>&nbsp;</a>";
    Notify_Login +=                 "</li>";
    Notify_Login +=             "</ul>";
    Notify_Login +=         "</li>";
    Notify_Login +=     "</ul>";
    Notify_Login += "</div>"; //ToolTip
    Notify_Login += "<div id='mystickytooltip' class='stickytooltip' align='center'>";
    Notify_Login +=     "<div id='sticky1' align='center' class='atip' style=\"display: none;\">";
    Notify_Login +=         "<div class='cont_sticky'> Tin nhắn </div>";
    Notify_Login +=     "</div>";
    Notify_Login += "<div id='sticky2' align='center' class='atip' style=\"display: none;\">";
    Notify_Login +=         "<div class='cont_sticky'> Thông báo </div>";
    Notify_Login +=     "</div>";
    Notify_Login += "<div id='sticky3' align='center' class='atip' style=\"display: none;\">";
    Notify_Login +=         "<div class='cont_sticky'> Kết bạn </div>";
    Notify_Login +=     "</div>";
    Notify_Login += "</div>";
    var strNotify_End = "</div>"; //

    //FriendClub
    var FriendClubSubString = "<div class='friendClubBox'  id='subFriendClubBox' style='visibility:hidden;'>";
    FriendClubSubString += "<div class='friendClubBoxContent'> ";
    FriendClubSubString += '  <div class="lblmapservice99">Cập nhật hoạt động</div>';
    FriendClubSubString += '    <div class="notify_listservice notify_listserviceContent">';
    FriendClubSubString += '      <a class="" href="' + mygo_friend_Url + '">Bạn bè';
    FriendClubSubString += '       </a>';
    FriendClubSubString += '       <a class="" href="' + mygo_club_Url + 'clubtab.aspx">Hội nhóm</a> ';
    FriendClubSubString += '       </div>';
    FriendClubSubString +=          "</div>";
    FriendClubSubString +=     "</div>"; // subcontent1
var Notify_Mapservice=  "<div class='notify_mapservice' id='subcontent1' style='visibility:hidden;'>";
    Notify_Mapservice +=    "<div class='notify_padmapservice'>";
    Notify_Mapservice +=        "<ul>";
    Notify_Mapservice +=            "<li class='notify_colservice'>";
    Notify_Mapservice +=                "<div class='notify_tabservice'><img src='" + mygo_UrlMedia + "images/backgrounds/t_edu.gif' alt=''/></div>";
    Notify_Mapservice +=                "<div class='notify_hotservice'>";
    Notify_Mapservice +=                    "<a href='http://edu.go.vn'>";
    Notify_Mapservice +=                        "<img src='"+mygo_UrlMedia+"images/backgrounds/hot_service.gif' alt='' width='163' height='70' border='0'/>";
    Notify_Mapservice +=                    "</a>";
    Notify_Mapservice +=                "</div>";
    Notify_Mapservice +=                "<div class='notify_listservice'>";
    Notify_Mapservice +=                    "<a href='http://edu.go.vn/' class='active'>goEdu <img src='" + mygo_UrlMedia + "images/backgrounds/hot_icon.gif' alt='' width='22' height='9' style ='border:0;'></a>";
    Notify_Mapservice +=                    "<a href='http://ioe.go.vn/'>IOE</a>"; //Notify_Mapservice +=                    "<a href='http://ae.go.vn/'>Audition English</a>"
  //  Notify_Mapservice +=                    "<a href='http://viet.go.vn/index.php/Trang_Ch%C3%ADnh'>goViệt</a>"
    Notify_Mapservice +=                "</div>";
    Notify_Mapservice +=            "</li>";
    Notify_Mapservice +=            "<li class='notify_vline_service notify_colservice' style='margin-right:8px;'>&nbsp;</li>";
    Notify_Mapservice +=            "<li class='notify_colservice'>";
    Notify_Mapservice +=                    "<div class='notify_tabservice'><img src='" + mygo_UrlMedia + "images/backgrounds/t_entertainment.gif' alt=''/></div>";
    Notify_Mapservice +=                    "<div class='notify_hotservice'>";
    Notify_Mapservice +=                        "<a href='http://play.go.vn/'><img src='" + mygo_UrlMedia + "images/backgrounds/hot_service3.gif' alt='' width='163' height='70' border='0'/></a>";
    Notify_Mapservice +=                    "</div>";
    Notify_Mapservice +=                    "<div class='notify_listservice'>"; // Notify_Mapservice +=                        "<a href='http://play.go.vn/' class='active'>goPlay <img src='" + mygo_UrlMedia + "images/backgrounds/hot_icon.gif' alt='' width='22' height='9' style ='border:0;'></a>"
    Notify_Mapservice += "<a href='http://music.go.vn/'>Âm nhạc</a>";
    Notify_Mapservice += "<a href='http://vivo.go.vn/' class='active'>Phim Online   <img src='" + mygo_UrlMedia + "images/backgrounds/new_icon.gif' alt='' width='22' height='9' style ='border:0;'></a>";
    Notify_Mapservice += "<a href='http://news.go.vn/'>Tin tức</a>";
    Notify_Mapservice +=                        "<a href='http://www.go.vn/news/'>Blogs</a>";
    Notify_Mapservice += "<a href='http://shop.go.vn/'>Shopping</a>";
    Notify_Mapservice += "<a href='http://www.go.vn/chodientu' class='active'>Chợ Điện Tử eBay  <img src='" + mygo_UrlMedia + "images/backgrounds/new_icon.gif' alt='' width='22' height='9' style ='border:0;'></a>";
    Notify_Mapservice += "<a href='http://play.go.vn/social-games'>Trò chơi</a>"; //  Notify_Mapservice += "<a href='http://mobile.go.vn/'>goMobile</a>"
    Notify_Mapservice += "<a href='http://diendan.go.vn/'>Diễn đàn</a>";
    Notify_Mapservice += "<a href='http://content.go.vn/'>goContent</a>";
    Notify_Mapservice +=                    "</div>";
    Notify_Mapservice +=            "</li>";
    Notify_Mapservice +=            "<li class='notify_vline_service notify_colservice' style='margin-right:8px;'>&nbsp;</li>";
    Notify_Mapservice +=            "<li class='notify_colservice'>";
    Notify_Mapservice +=                "<div class='notify_tabservice'><img src='" + mygo_UrlMedia + "images/backgrounds/t_relation.gif' alt='' /></div>";
    Notify_Mapservice +=                "<div class='notify_hotservice'>";
    Notify_Mapservice +=                    "<a href='http://my.go.vn'><img src='" + mygo_UrlMedia + "images/backgrounds/hot_service2.gif' alt='' width='163' height='70' border='0'></a>";
    Notify_Mapservice +=                "</div>";
    Notify_Mapservice +=                "<div class='notify_listservice'>";
    Notify_Mapservice +=                    "<a href='http://my.go.vn/home.aspx' class='active'>myGo <img src='" + mygo_UrlMedia + "images/backgrounds/new_icon.gif' alt='' width='22' height='9' style ='border:0;'/></a>";
    Notify_Mapservice +=                    "<a href='http://mobile.go.vn/'>goMobile</a>";
    Notify_Mapservice +=                    "<a href='http://tv.go.vn/'>goTV</a>"; //    Notify_Mapservice +=                    "<a href='http://missteen.go.vn'>MissTeen</a>"
//    Notify_Mapservice += "<a href='http://1400.go.vn/'>1400</a>"
//    Notify_Mapservice += "<a href=\"http://location.go.vn\">goLocation</a>"
    Notify_Mapservice +=                "</div>";
    Notify_Mapservice +=            "</li>";
    Notify_Mapservice +=        "</ul>";
    Notify_Mapservice +=        "<div style='clear:both'></div>";
    Notify_Mapservice +=    "</div>";
    Notify_Mapservice +="</div>";
    var Notify_Box  =   "<div class='notify_CssBox' id ='notify_IDBoxMess'>";
    Notify_Box +=       "<div class='notify_cssdiv1'>";
    Notify_Box +=           "<span class='notify_cssdiv1_font'>Tin nhắn</span>"; //    Notify_Box +=           "<a href ='javascript:void(0);'><span class='notify_cssWriteMess'>Viết tin nhắn</span></a>"
    Notify_Box +=       "</div>";
    Notify_Box +=       "<div class='notify_cssdiv2' id='notify_MessageContent'>"; // <%-- Tin nhắn ở đây--%>
    Notify_Box +=       "</div>";
    Notify_Box +=       "<div class='notify_cssdiv3'>";
    Notify_Box += "<a href='http://mail.go.vn/?_task=mail&_mbox=INBOX'><div class='notify_cssdiv3_font'>Xem tất cả</div></a>";
    Notify_Box +=       "</div>";
    Notify_Box +=   "</div>"; //Note
    Notify_Box +=   "<div class='notify_CssBox' id='notify_IDBoxNote'>";
    Notify_Box +=       "<div class='notify_cssdiv1'><span class='notify_cssdiv1_font'>Thông báo</span></div>";
    Notify_Box +=       "<div class='notify_cssdiv2' id='notify_NoteContent'>"; //<%--Thông báo ở đây--%>
    Notify_Box +=       "</div>";
    Notify_Box +=       "<div class='notify_cssdiv3'>";
    Notify_Box +=           "<a href='http://my.go.vn/NotifyViewAll.aspx'><div class='notify_cssdiv3_font'>Xem tất cả</div></a>";
    Notify_Box +=       "</div>";
    Notify_Box +=   "</div> "; //Friend
    Notify_Box +=   "<div class='notify_CssBox' id='notify_IDBoxFriend'>";
    Notify_Box +=       "<div class='notify_cssdiv1'><span class='notify_cssdiv1_font'>Kết bạn</span></div>";
    Notify_Box +=       "<div class='notify_cssdiv2' id='notify_FriendContent'>"; // <%--  Lời mời kết bạn ở đây--%>"
    Notify_Box +=       "</div>";
    Notify_Box +=       "<div class='notify_cssdiv3'>";
    Notify_Box +=           "<a href='"  + mygo_UrlLink +  "Friends.aspx#MyFriendRequest'><div class='notify_cssdiv3_font'>Xem tất cả</div></a>";
    Notify_Box +=       "</div>";
    Notify_Box +=   "</div>"; //Tab Quản lý
var Notify_Qly =    "<div class='notify_cpnel_index' id='subcontent2' style='visibility:hidden;'>";
    Notify_Qly += "<div class='notify_cont_cpnel_index notify_padmapservice'>";
    Notify_Qly +=           "<ul>";
    Notify_Qly +=               "<li class='notify_username_index'>";
    Notify_Qly +=                   "<div class='myGo_Home_avatar'>";
    Notify_Qly +=                       "<a href='"  + mygo_UrlLink +  "?id=" + AccountId + "'>";
    Notify_Qly +=                           "<img src='http://farm01.go.vn/avatar/store/account/" + parseInt((AccountId) / 1000000) + "/" + parseInt((AccountId) / 1000) + "/" + parseInt((AccountId) / 1) + "/" + AccountId + ".png.50.50.cache' class ='notify_ava_cpnel'/>";
    Notify_Qly +=                       "</a>";
    Notify_Qly +=                   "</div>";
    Notify_Qly +=                   "<div class='myGo_Home_name'>";
    Notify_Qly += "<a class='welcomeBoxName' style ='line-height:15px !important;' href='" + mygo_UrlLink + "?id=" + AccountId + "'>" + mygo_obj.viewPubName + "</a>";
    Notify_Qly += "<a href='" + mygo_UrlLink + "accinfo.aspx#info' class='go_header_taikhoan' style='color: #3D3D3D !important;font-weight: normal !important;'> Tài khoản</a>";
    Notify_Qly +=                   "</div>";
    Notify_Qly +=                   "<div style='clear:both'></div>";
    Notify_Qly +=               "</li>";
    Notify_Qly += "<li class='notify_listservice notify_listserviceContent'>";
    
    Notify_Qly += "<a href='" + mygo_UrlLink + "friends.aspx'>Bạn bè</a>";
    Notify_Qly += "<a href='" + mygo_UrlLink + "group.aspx'>Hội nhóm</a>";
    Notify_Qly +=                   "<a href='"  + mygo_UrlLink +  "accPrivacy.aspx'>Cài đặt</a>";
    Notify_Qly += "<a href='" + mygo_UrlLink + "notifyViewAll.aspx' style=\"border-bottom: medium none;\">Thông báo</a>";
    Notify_Qly += "<a href='" + feedBackLinkDefault + "'>Báo lỗi</a>";
    Notify_Qly += "</li>";
    Notify_Qly += "<li class='notify_listservice notify_listserviceContent'>";
    
    Notify_Qly += "<a href='" + mygo_logoutUrl + "'>Thoát</a>";
    Notify_Qly += "</li>";
    Notify_Qly +=           "</ul>";
    Notify_Qly +=           "<div style='clear:both'></div>";
    Notify_Qly +=       "</div>";
    Notify_Qly +=   "</div>";
    var elmGoHeader="notify_HeaderAppend";
    /* Chua dang nhap*/
    if (AccountId == null || AccountId < 1 || AccountId == "") {
        var html = strNotify_Start + Notify_NotLogin + Notify_Mapservice + strNotify_End;
        if (document.getElementById(elmGoHeader))
            $("#notify_HeaderAppend").append(html);
        else
            document.write(html);
        if (mygo_currentUrl.indexOf("http://go.vn/accounts/account.register.aspx") != -1) {
            $("#notify_DK").addClass("notify_active");
        }
        else {
            if (mygo_currentUrl.indexOf("http://go.vn/accounts/account.login.aspx") != -1) {
                $("#notify_DN").addClass("notify_active");
            }
            else {
                $("#notify_ActiveMVN").addClass("active");
            }
        }
    }
    else {
        var html = strNotify_Start + Notify_Login + FriendClubSubString + Notify_Mapservice + Notify_Box + Notify_Qly + strNotify_End;
        if (document.getElementById(elmGoHeader))
            $("#notify_HeaderAppend").append(html);
        else
            document.write(html);
        var curUrl = mygo_currentUrl + "";
        
        var ArraySubDomainGo = curUrl.split(".");
        if (ArraySubDomainGo != -1) {
            var subDomain = ArraySubDomainGo[0];
            if (curUrl.indexOf(obj_MyGoActive[subDomain]) != -1 || curUrl.indexOf("AvatarStep") != -1 || curUrl.indexOf("accinfo.aspx?tab=contact")!=-1) {
                $(".notify_ActiveCss").addClass("active");// active trang toi
            }
            else {
                if (curUrl.indexOf(obj_MyGoActiveQly.accinfo) != -1 || curUrl.indexOf(obj_MyGoActiveQly.friends) != -1 || curUrl.indexOf(obj_MyGoActiveQly.accPrivacy) != -1) {
                    $("#notify_ActiveQly").addClass("active"); // tab quan ly
                }
                else {      
                    $("#notify_Active_mvnLog").addClass("active");// tab mang viet nam
                }
            }
        }
    }
       
}
// bind go header html
notify_MygoToolbar();

function go_initSearch() {
    var href = '';
    switch (mygo_searchOption) {
            case "club":
            if (typeof mygo_obj.IsSocialPortal != "undefined")
                href = searchUrl + "?page=" + mygo_searchOption + "&keyword=" + go_urlencode($("input[name=keyword]").val()) + "&fcname=SocialPortal";
            else
                href = searchUrl + "?page=" + mygo_searchOption + "&keyword=" + go_urlencode($("input[name=keyword]").val()) + "";
            break;
        default:
            href = searchUrl + "?page=" + mygo_searchOption + "&keyword=" + go_urlencode($("input[name=keyword]").val()) + "";
            break;
    }
    document.location.href = href;
}

function getKeyWordData(key) {

    $.ajax({
        url: "http://search.go.vn/Service/AutoSuggestionjsonp",
        data: { page: mygo_searchOption, keywork: key },
        contentType: 'application/json',
        dataType: "jsonp",
        success: function (result) {
          // autoSuggestSearch(result);
        } ,
        timeout: 5000 //1 s
    });


}
function autoSuggestSearchURL() {
    autoSuggestWithVietnamese();
    return;
    var url = "http://search.go.vn/Service/AutoSuggestionjsonp";
    var page = mygo_searchOption;
    //page = 'blog';
    if (page == null || page == '') page = 'all';
    $("#txtTopSearch").autoSuggest(url,
    {
        asHtmlID: "mygo-topsearch",
        queryParam: "q",
        extraParams: "&page=" + page+"&limit=15&timestamp=1315277392935",
        minChars: 1,
        matchCase: false,
        selectedItemProp: "Title",
        selectedValuesProp: "Keyword",
        searchObjProps: "Title",
        retrieveLimit: 10,
        startText: mygo_value_text,
        emptyText:"",
        preFill: {},
        limitText: "",
        selectionLimit: 10,
        neverSubmit: false,
        ajaxcallback: true,
        keyDelay: 200,
        resultClick: function (data) {

            var key = data.attributes.Title;
            var keyWork = data.attributes.Keyword;
            var num = data.num;
            $("#as-selection-" + num).remove();
            $("#mygo-topsearch").val(key);
            getKeyWordData(keyWork);
            go_initSearch();
        },        
         timeout:5000 //1 s
    });
}

function autoSuggestWithVietnamese() {
    $.getScript("http://static.gox.vn/media/notify/script/jquery.autocomplete.js", function () {
        // Xóa dữ liệu cũ
        try {
            $("#txtTopSearch").unautocomplete().flushCache();
        }
        catch (Error)
    { }
        // Load dữ liệu mới theo từng phân hệ
        var page = mygo_searchOption;
        //page = 'blog';
        if (page == null || page == '') page = 'all';
        var url = "http://search.go.vn/Service/AutoSuggestionjsonp?page=" + page;

        $("#txtTopSearch").autocomplete(url, {
            dataType: "jsonp",
            width: 173,
            contentType: 'application/json',
            max: 15,
            parse: function (data) {
                return $.map(data, function (row, index) {
                    return {
                        data: row,
                        value: index.toString(),
                        result: row.Keyword
                    };
                });
            },
            formatItem: function (item) { return item.Title; }
        }).result(function (event, data, formatted) {
            go_initSearch();
        });
    });      
}

//
function go_urlencode(str) {
    str = (str + '').toString();
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').
        replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
}

function mygo_focusAndBlur(selector) {
    $(selector).focus(function () {
        var val = $(this).val();
        //val = val.toLowerCase();
        if (val.indexOf(mygo_value_text) != -1)
            val = '';
        else if (val == '')
            val = mygo_value_text;
        $(this).val(val);
    }).blur(function () {
        if ($(this).val() == '')
            $(this).val(mygo_value_text);
    });
}

$("#notify_IDMess").click(function(){
    if($("#notify_IDBoxMess").css('visibility') == 'hidden'){
        $(".notify_CssBox").hide();
        $("#notify_IDBoxNote").css('visibility','hidden');
        $("#notify_IDBoxFriend").css('visibility','hidden');
        $("#notify_IDBoxMess").show();  
        $("#notify_IDBoxMess").css('visibility','visible');

        $(".Mess_index").addClass("Mess_index_active");
        $(".Note_index").removeClass("Note_index_active");
        $(".Friend_index").removeClass("Friend_index_active");
        loadMessage();
        loadCountMessage("0");
    }
    else {
        $(".notify_CssBox").css('visibility', 'hidden');
        $(".Mess_index").removeClass("Mess_index_active");
    }
});


$("#notify_IDNote").click(function(){
    if($("#notify_IDBoxNote").css('visibility') == 'hidden'){
        $(".notify_CssBox").hide();
        $("#notify_IDBoxMess").css('visibility','hidden');
        $("#notify_IDBoxFriend").css('visibility','hidden');
        $("#notify_IDBoxNote").show();
        $("#notify_IDBoxNote").css('visibility','visible');

        $(".Note_index").addClass("Note_index_active");
        $(".Mess_index").removeClass("Mess_index_active");
        $(".Friend_index").removeClass("Friend_index_active");
        loadNote();
        loadCountNote("0");
    }
    else {
        $(".notify_CssBox").css('visibility', 'hidden');
        $(".Note_index").removeClass("Note_index_active");
    }
});

$("#notify_IDFriend").click(function(){
    if($("#notify_IDBoxFriend").css('visibility') == 'hidden'){
        $(".notify_CssBox").hide();
        $("#notify_IDBoxMess").css('visibility','hidden');
        $("#notify_IDBoxNote").css('visibility','hidden');
        $("#notify_IDBoxFriend").show();
        $("#notify_IDBoxFriend").css('visibility','visible');

        $(".Friend_index").addClass("Friend_index_active");
        $(".Note_index").removeClass("Note_index_active");
        $(".Mess_index").removeClass("Mess_index_active");
        loadFriend();
        loadCountFriend('0');
    }
    else {
        $(".notify_CssBox").css('visibility', 'hidden');
        $(".Friend_index").removeClass("Friend_index_active");
    }   
});

$('html,body' + ':not(.notify_CssBox)').click(function () { //Click anywhere and...
        $(".notify_CssBox").hide(); //hide subpanel
        $("#notify_IDBoxMess").css('visibility', 'hidden');
        $("#notify_IDBoxNote").css('visibility', 'hidden');
        $("#notify_IDBoxFriend").css('visibility', 'hidden');
        $(".Note_index").removeClass("Note_index_active");
        $(".Mess_index").removeClass("Mess_index_active");
        $(".Friend_index").removeClass("Friend_index_active");
    });
    $('.notify_UserHeader,.notify_CssBox').click(function (e) {
        e.stopPropagation(); //Prevents the subpanel ul from closing on click
    });

var notifi_stringDate;
var notifi_formatdate1;
var notifi_formatdate2;
function notify_formatVal(value) {
    return value < 10 ? ('0' + value) : value;
}
function notify_formatDateTime(b) {
    var a = parseInt(b);
    //a = 1277471229150;
    var e = [[11, 'sáng'], [14, 'trưa'], [19, 'chiều']];
    var f = ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'];
    var g = new Date();
    var j = new Date(a);
    var d = Math.floor(g.getTime() / 1000) - Math.floor(a / 1000);
    if (d < 0) {
        return j.getHours() + ':' + notify_formatVal(j.getMinutes()) + ' ' + notify_formatVal(j.getDate()) + '/' + notify_formatVal(j.getMonth() + 1) + '/' + j.getFullYear();
    }
    if (d < 60) {
        return (d == 0 ? 'vài' : d) + ' giây trước';
    }
    if (d < 3600) return Math.floor(d / 60) + ' phút trước';
    if (d < 43200) return Math.floor(d / 3600) + ' tiếng trước';
    var h = j.getHours();
    var m = notify_formatVal(j.getMinutes());
    if (d < 518400) {
        var b = 'tối';
        for (i = 0; i < 3; i++) if (h < e[i][0]) {
            b = e[i][1];
            break;
                                }
        d = (g.getDay() + 7 - j.getDay()) % 7;
        var k = '';
        if (d == 0)
            k = 'hôm nay';
        else {
            return h + ':' + m + ' ' + notify_formatVal(j.getDate()) + '/' + notify_formatVal(j.getMonth() + 1) + '/' + j.getFullYear(); //f[j.getDay()];
        }
        return (h % 12).toString() + ':' + m + ' ' + b + ' ' + k;
    }
    h = notify_formatVal(h);
    return h + ':' + m + ' ' + notify_formatVal(j.getDate()) + '/' +
    notify_formatVal(j.getMonth() + 1) + '/' + j.getFullYear();
}

function ChangeStatic(NotificationId) {
    $.getJSON(domain_notifyHandler + "Notification.ashx?NotificationId=" + NotificationId + "&format=json&jsoncallback=?",
        function(result) {
            $("p#" + result).css("background-color", "#FFFFFF");
            $("p#" + result).css("margin-left", "-4px");
        });
}

//============== Notify lúc online ================

    //========= Tin nhan =========
    var count_message = 0;
    AddMessages = function(iNotificationId, iDestAccountId, CreateTime, sActionText, sUrl, sUrlTitle, sSourceAccountName, sSourceAccountId, sDestAccountName) {
        count_message++;    
        if (count_message != 0) {
            $(".notify_warning_Mess").css('visibility', 'visible');  
            $(".notify_countMess").show();
            $("#notify_IDcountMess").html(""+ count_message +"");
        }                             
    };
//========= Thông báo =========
    var count_note = 0;
    AddNotes = function(iNotificationId, iDestAccountId, CreateTime, sActionText, sUrl, sUrlTitle, sSourceAccountName, sSourceAccountId, sDestAccountName, sRelateAccountId) {
        count_note++;
        if (count_note != 0) {
            $(".notify_warning_Note").css('visibility', 'visible');  
            $(".notify_countNote").show();
            $("#notify_IDcountNote").html(""+ count_note +"");
        }
    };
//========= Ket ban =========
    var count_addFriends = 0;
    AddFriends = function(iNotificationId, iDestAccountId, CreateTime, sActionText, sUrl, sUrlTitle, sSourceAccountName, sSourceAccountId, sDestAccountName) {
        count_addFriends++;
        if (count_addFriends != 0) {
                $(".notify_warning_Friend").css('visibility', 'visible');  
                $(".notify_countFriend").show();
                $("#notify_IDcountFriend").html(""+ count_addFriends +"");
        }
    };
//set ofset notify

    function fixNotifyPossition() {
        var offsetLeft = $(".notify_menu_user_index").offset().left;
        $("#notify_IDBoxMess").css('left', offsetLeft);

        var offsetLeft = $(".notify_menu_user_index").offset().left;
        $("#notify_IDBoxNote").css('left', offsetLeft);
        var offsetLeft = $(".notify_menu_user_index").offset().left;
        $("#notify_IDBoxFriend").css('left', offsetLeft);
    }
//========= Notify lúc đăng nhập =========

//========= Message =========
    function loadMessage() {
        if (messageLoadFlag == false) return;
        messageLoadFlag = false;
    $("#notify_MessageContent").html(mygo_loading);
    $.ajax({
     
        url: domain_notifyHandler + "Notification.ashx",
        dataType: "jsonp",
        data: { type: "1", account_id: mygo_obj.accountId },
       
        success: function (result) {
             $("#notify_MessageContent").html("");
            $.each(result, function (i, val) {
                notifi_stringDate = val.CreateTime;
                notifi_formatdate1 = notifi_stringDate.replace('/Date(', '');
                notifi_formatdate2 = notifi_formatdate1.replace(')/', '');
                var notifi_substring;
                var str = val.SourceAccountName;
                if (str) {
                    if (str.length > 16) {
                        notifi_substring = str.substring(0, 16) + "...";
                    }
                    else {
                        notifi_substring = str.substring(0, 16);
                    }
                }
                else
                    str = val.SourceAccountId;
                if ($("div.notify_cssDivMessAvatar").length < 3) {
                    var strDivMess = "<div id=" + val.NotificationId + " class =\"notify_cssBoxNotify\">";
                    strDivMess += "<div class =\"notify_cssDivMessAvatar\">";
                    strDivMess += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
                    strDivMess += "<img src=\"http://farm01.go.vn/avatar/store/account/" + parseInt((val.SourceAccountId) / 1000000) + "/" + parseInt((val.SourceAccountId) / 1000) + "/" + parseInt((val.SourceAccountId) / 1) + "/" + val.SourceAccountId + ".png.50.50.cache\" class = \"notify_cssMessAvatar\"/>";
                    strDivMess += "</a></div>";
                    strDivMess += "<div class =\"notify_cssMess\">";
                    strDivMess += "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
                    strDivMess += "<span class = \"notify_cssType notify_bold\">" + notifi_substring + "</span></a>";
                    strDivMess += "<span class =\"notify_cssFont\"> " + val.ActionText + " </span>";
                    strDivMess += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=" + replaceByDomain(val.Url) + " >";
                    strDivMess += "<span class =\"notify_cssType\">" + val.UrlTitle + "</span></a>";
                    if (val.ActionText.indexOf("mời bạn tham gia") == -1)
                    strDivMess += "<span class =\"notify_cssFont\"> cho bạn </span><br>";
                    strDivMess += "<div class=\"timedate_tooltip\">";
                    strDivMess += "<img src=\"" + mygo_UrlMedia + "images/icon/mail.png\" width=\"18\" height=\"16\" class=\"icon_tooltip\"/>";
                    strDivMess += "<span class =\"notify_cssDate\">" + notify_formatDateTime(notifi_formatdate2) + "</span></br>";
                    strDivMess += "<div>";
                    strDivMess += "</div>";
                    strDivMess += "</div>";
                    $("#notify_MessageContent").append(strDivMess);

                }
            });
        },
         timeout: 5000 //1 s
    });
    
}

 //==========Note==========
function loadNote() {

    if (noteLoadFlag == false) 
    return;
    noteLoadFlag = false;
    $("#notify_NoteContent").html(mygo_loading);

    $.ajax({
        url: domain_notifyHandler + "Notification.ashx",
        dataType: "jsonp",
        data: { type: "2", account_id: mygo_obj.accountId },
        success: function (result) {
            $("#notify_NoteContent").html("");

            $.each(result, function (i, val) {

                notifi_stringDate = val.CreateTime;
                notifi_formatdate1 = notifi_stringDate.replace('/Date(', '');
                notifi_formatdate2 = notifi_formatdate1.replace(')/', '');
                var notifi_substring;
                var str = val.SourceAccountName;
                if (str) {
                    if (str.length > 20) {
                        notifi_substring = str.substring(0, 20) + "...";
                    }
                    else {
                        notifi_substring = str.substring(0, 20);
                    }
                }
                else
                    str = val.SourceAccountId;
                if ($("div.notify_cssDivNoteAvatar").length < 3) {
                    if ((val.OwnerAccountId != val.DestAccountId) && (val.OwnerAccountId != 0)) {
                        var strDivNote = "<div id=" + val.NotificationId + " class =\"notify_cssBoxNotify\">";
                        strDivNote += "<div class =\"notify_cssDivNoteAvatar\">";
                        strDivNote += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
                        strDivNote += "<img src=\"http://farm01.go.vn/avatar/store/account/" + parseInt((val.SourceAccountId) / 1000000) + "/" + parseInt((val.SourceAccountId) / 1000) + "/" + parseInt((val.SourceAccountId) / 1) + "/"
                            + val.SourceAccountId + ".png.50.50.cache\" class = \"notify_cssNoteAvatar\"/>";
                        strDivNote += "</a></div>";
                        strDivNote += "<div class =\"notify_cssNote\">";
                        strDivNote += "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
                        strDivNote += "<span class =\"notify_cssType notify_bold\">" + notifi_substring + " </span></a>";
                        strDivNote += "<span class =\"notify_cssFont\">" + val.ActionText + " </span>";
                        strDivNote += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"" + replaceByDomain(val.Url) + "\">";
                        strDivNote += "<span class =\"notify_cssType\">" + val.UrlTitle + " </span></a>";
                        if (val.OwnerAccountId < 0) {

                            strDivNote += val.OwnerAccountName;
                        }
                        else {
                            if (val.ActionText.indexOf("tag") == -1 || val.ActionText.indexOf("nhắc") == -1)
                                strDivNote += "<span class =\"notify_cssFont\">của </span>";
                            strDivNote += "<a href=\"http://my.go.vn/?id=" + val.OwnerAccountId + " \">";
                            strDivNote += "<span class =\"notify_cssType\">" + val.RelateName + "</span></a>";
                        }
                        strDivNote += "<div class=\"timedate_tooltip\">";
                        strDivNote += "<img src=\"" + mygo_UrlMedia + "images/icon/icon_lienket.png\" width=\"18\" height=\"17\" class=\"icon_tooltip\"/>";
                        strDivNote += "<span class =\"notify_cssDate\"> " + notify_formatDateTime(notifi_formatdate2) + "</span>";
                        strDivNote += "</div>";
                        strDivNote += "</div>";
                        strDivNote += "</div>";
                        $("#notify_NoteContent").append(strDivNote);


                    }
                    else {
                        if (val.SourceAccountId < 0) {
                            cid = parseInt(Math.abs(val.SourceAccountId) / 1000);
                            ctype = Math.abs(val.SourceAccountId) % 1000;
                            var strDivNotes = "<div id=" + val.NotificationId + " class =\"notify_cssBoxNotify\">";
                            strDivNotes += "<div class =\"notify_cssDivNoteAvatar\">";
                            strDivNotes += '<a onclick=\"ChangeStatic(' + val.NotificationId + ')\" href=\"http://clubs.go.vn/Default.aspx?gtype=' + ctype + '&gid=' + cid + '\">';
                            if (ctype == 35)
                                strDivNotes += "<img src=\"http://farm01.go.vn/fanpage/club/" + ctype + "/" + parseInt((cid) / 1000000) + "/" + parseInt((cid) / 1000) + "/" + cid + ".png.50.50.cache\" class = \"notify_cssNoteAvatar\"/>";
                            else
                                strDivNotes += "<img src=\"http://photoservice.clubs.go.vn/mediastore/club/" + ctype + "/" + parseInt((cid) / 1000000) + "/" + parseInt((cid) / 1000) + "/" + cid + ".png.50.50.cache\" class = \"notify_cssNoteAvatar\"/>";
                            strDivNotes += "</a></div>";
                            strDivNotes += "<div class =\"notify_cssNote\">"; //strDivNotes += val.SourceAccountName+" "
                            strDivNotes += "<a  onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://clubs.go.vn/Default.aspx?gtype=" + ctype + "&gid=" + cid + "\" >";
                            strDivNotes += "<span class =\"notify_cssType notify_bold\">" + val.SourceAccountName + " </span></a>";
                            strDivNotes += "<span class =\"notify_cssFont\">" + val.ActionText + " </span>";
                            strDivNotes += "<div class=\"timedate_tooltip\">";
                            strDivNotes += "<img src=\"" + mygo_UrlMedia + "images/icon/icon_lienket.png\" width=\"18\" height=\"17\" class=\"icon_tooltip\"/>";
                            strDivNotes += "<span class =\"notify_cssDate\">" + notify_formatDateTime(notifi_formatdate2) + "</span>";
                            strDivNotes += "</div>";
                            strDivNotes += "</div>";
                            strDivNotes += "</div>";
                            $("#notify_NoteContent").append(strDivNotes);
                        }
                        else {
                            // binh luan, thong bao
                            var strDivNotes = "<div id=" + val.NotificationId + " class =\"notify_cssBoxNotify\">";
                            strDivNotes += "<div class =\"notify_cssDivNoteAvatar\">";
                            strDivNotes += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\" >";
                            strDivNotes += "<img src=\"http://farm01.go.vn/avatar/store/account/" + parseInt((val.SourceAccountId) / 1000000) + "/" + parseInt((val.SourceAccountId) / 1000) + "/" + parseInt((val.SourceAccountId) / 1) + "/" + val.SourceAccountId + ".png.50.50.cache\" class = \"notify_cssNoteAvatar\"/>";
                            strDivNotes += "</a></div>";
                            strDivNotes += "<div class =\"notify_cssNote\">";
                            strDivNotes += "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\" >";
                            strDivNotes += "<span class =\"notify_cssType notify_bold\">" + notifi_substring + " </span></a>";
                            strDivNotes += "<span class =\"notify_cssFont\">" + val.ActionText + " </span>";
                            strDivNotes += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\"   href=\"" + replaceByDomain(val.Url) + "\">";
                            strDivNotes += "<span class =\"notify_cssType\">" + val.UrlTitle + " </span></a>";
                            if (val.ActionText.indexOf("tag") == -1 || val.ActionText.indexOf("nhắc") == -1) {
                                if (val.OwnerAccountId != 0)
                                    strDivNotes += "<span class =\"notify_cssFont\">của bạn </span>";
                            }

                            strDivNotes += "<div class=\"timedate_tooltip\">";
                            strDivNotes += "<img src=\"" + mygo_UrlMedia + "images/icon/icon_lienket.png\" width=\"18\" height=\"17\" class=\"icon_tooltip\"/>";
                            strDivNotes += "<span class =\"notify_cssDate\">" + notify_formatDateTime(notifi_formatdate2) + "</span>";
                            strDivNotes += "</div>";
                            strDivNotes += "</div>";
                            strDivNotes += "</div>";
                            $("#notify_NoteContent").append(strDivNotes);
                        }
                    }
                }

            });
        },
        timeout: 5000 //1 s
    });
   
}

// ========= Friend =========
function loadFriend() {
    if (friendLoadFlag == false) return;
    friendLoadFlag = false;
    $("#notify_FriendContent").html(mygo_loading);
    $.ajax({
        url: domain_notifyHandler + "Notification.ashx",
        dataType: "jsonp",
        data: { type: "3", account_id: mygo_obj.accountId },
      
        success: function (result) {
            
            $("#notify_FriendContent").html("");
            $.each(result, function (i, val) {
                
                notifi_stringDate = val.CreateTime;
                notifi_formatdate1 = notifi_stringDate.replace('/Date(', '');
                notifi_formatdate2 = notifi_formatdate1.replace('+0700)/', '');
                var notifi_substring;
                var str = val.SourceAccountName;
                if (str) {
                    if (str.length > 16) {
                        notifi_substring = str.substring(0, 16) + "...";
                    }
                    else {
                        notifi_substring = str.substring(0, 16);
                    }
                }
                else
                    str = val.SourceAccountId;
                if ($("div.notify_cssDivFriendAvatar").length < 3) {
                    // ket ban
                    var strDivFriend = "<div id=" + val.NotificationId + " class =\"notify_cssBoxNotify\">";
                    strDivFriend += "<div class =\"notify_cssDivFriendAvatar\">";
                    strDivFriend += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
                    strDivFriend += "<img src=\"http://farm01.go.vn/avatar/store/account/" + parseInt((val.SourceAccountId) / 1000000) + "/" + parseInt((val.SourceAccountId) / 1000) + "/" + parseInt((val.SourceAccountId) / 1) + "/" + val.SourceAccountId + ".png.50.50.cache\" class = \"notify_cssFriendAvatar\"/>";
                    strDivFriend += "</a></div>";
                    strDivFriend += "<div class =\"notify_cssFriend\">";
                    strDivFriend += "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
                    strDivFriend += "<span class=\"notify_cssType notify_bold\">" + notifi_substring + " </span></a>";
                    strDivFriend += "<span class =\"notify_cssFont\">" + val.ActionText + "</span>";
                    strDivFriend += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=" + replaceByDomain(val.Url) + ">";
                    strDivFriend += "<span class=\"notify_cssType\"> " + val.UrlTitle + "</span></a>";
                    strDivFriend += "<span class =\"notify_cssFont\"> với bạn </span><br>";
                    strDivFriend += "<div class=\"timedate_tooltip\">";
                    strDivFriend += "<img src=\"" + mygo_UrlMedia + "images/icon/icon_ketban.png\" width=\"18\" height=\"16\" class=\"icon_tooltip\"/>";
                    strDivFriend += "<span class =\"notify_cssDate\">" + notify_formatDateTime(notifi_formatdate2) + "</span></br>";
                    strDivFriend += "</div>";
                    strDivFriend += "</div>";
                    strDivFriend += "</div>";
                    $("#notify_FriendContent").append(strDivFriend);
                  
                }
            }); //end for each
        },
        timeout: 5000
    });  
}

/* get notify content top 1 auto display 
==========Note==========
*/
function go_getNotifyContent(type) {

    $.ajax({
        url: domain_notifyHandler + "Notification.ashx",
        dataType: "jsonp",
        data: { type: type, account_id: mygo_obj.accountId, count: 1, update: 1 },
        success: function (data) {
            var val = data[0];
            switch (type) {
                case 1: go_notify_showNotifyContent_message(val); break;
                case 2: go_notify_showNotifyContent_note(val); break;
                case 3: go_notify_showNotifyContent_friend(val); break;
                default: break;
            }
        },
        timeout: 5000 //1 s
    });
}
function go_notify_showNotifyContent_message(val) {
    notifi_stringDate = val.CreateTime;
    notifi_formatdate1 = notifi_stringDate.replace('/Date(', '');
    notifi_formatdate2 = notifi_formatdate1.replace(')/', '');
    var notifi_substring;
    var str = val.SourceAccountName;
    if (str==null || str=='') {
        str = val.SourceAccountId;       
    }
           
    var strDivMess = "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
    strDivMess += "<span class = \"notify_cssType notify_bold\">" + str + "</span></a>";
    strDivMess += "<span class =\"notify_cssFont\"> " + val.ActionText + " </span>";
    strDivMess += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=" + replaceByDomain(val.Url) + " >";
    strDivMess += "<span class =\"notify_cssType\">" + val.UrlTitle + "</span></a>";
    if (val.ActionText.indexOf("mời bạn tham gia") == -1)
    strDivMess += "<span class =\"notify_cssFont\"> cho bạn </span><br>";
    go_notify_showNotifyContent_auto(strDivMess);
}
function go_notify_showNotifyContent_friend(val) {
    notifi_stringDate = val.CreateTime;
    notifi_formatdate1 = notifi_stringDate.replace('/Date(', '');
    notifi_formatdate2 = notifi_formatdate1.replace('+0700)/', '');
    var notifi_substring;
    var str = val.SourceAccountName;
     var strDivFriend='';
     if (str == null || str == '') {
         str = val.SourceAccountId;
     }
    strDivFriend += "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
    strDivFriend += "<span class=\"notify_cssType notify_bold\">" + str + " </span></a>";
    strDivFriend += "<span class =\"notify_cssFont\">" + val.ActionText + "</span>";
    strDivFriend += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=" + replaceByDomain(val.Url) + ">";
    strDivFriend += "<span class=\"notify_cssType\"> " + val.UrlTitle + "</span></a>";
    strDivFriend += "<span class =\"notify_cssFont\"> với bạn </span><br>";
    go_notify_showNotifyContent_auto(strDivFriend);
}
function go_notify_showNotifyContent_note(val) {
    notifi_stringDate = val.CreateTime;
    notifi_formatdate1 = notifi_stringDate.replace('/Date(', '');
    notifi_formatdate2 = notifi_formatdate1.replace(')/', '');
    var notifi_substring;var strDivNote = '';
    var str = val.SourceAccountName;
    if (str == null || str == '') {
        str = val.SourceAccountId;
    }
    if ((val.OwnerAccountId != val.DestAccountId) && (val.OwnerAccountId != 0)) {      
        strDivNote += "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\">";
        strDivNote += "<span class =\"notify_cssType notify_bold\">" + str + " </span></a>";
        strDivNote += "<span class =\"notify_cssFont\">" + val.ActionText + " </span>";
        strDivNote += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"" + replaceByDomain(val.Url) + "\">";
        strDivNote += "<span class =\"notify_cssType\">" + val.UrlTitle + " </span></a>";
        if (val.OwnerAccountId < 0) {
            strDivNote += val.OwnerAccountName;
        }
        else {
            if (val.ActionText.indexOf("tag") == -1 || val.ActionText.indexOf("nhắc") == -1)
                strDivNote += "<span class =\"notify_cssFont\">của </span>";
            strDivNote += "<a href=\"http://my.go.vn/?id=" + val.OwnerAccountId + " \">";
            strDivNote += "<span class =\"notify_cssType\">" + val.RelateName + "</span></a>";
        }
    }
    else {
        if (val.SourceAccountId < 0) {
            cid = parseInt(Math.abs(val.SourceAccountId) / 1000);
            ctype = Math.abs(val.SourceAccountId) % 1000;
            strDivNote += val.SourceAccountName + " "; //                            strDivNote += "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://clubs.go.vn/Default.aspx?gtype=" + ctype + "&gid=" + cid + "\" >"

            //                            strDivNote += "<span class =\"notify_cssType notify_bold\">" + notifi_substring + " </span></a>"
            strDivNote += "<span class =\"notify_cssFont\">" + val.ActionText + " </span>";
        }
        else {
            // binh luan, thong bao
            strDivNote += "<a title=\"" + str + "\" onclick=\"ChangeStatic(" + val.NotificationId + ")\" href=\"http://my.go.vn/?id=" + val.SourceAccountId + "\" >";
            strDivNote += "<span class =\"notify_cssType notify_bold\">" + str + " </span></a>";
            strDivNote += "<span class =\"notify_cssFont\">" + val.ActionText + " </span>";
            strDivNote += "<a onclick=\"ChangeStatic(" + val.NotificationId + ")\"  href=" + replaceByDomain(val.Url) + " >";
            strDivNote += "<span class =\"notify_cssType\">" + val.UrlTitle + " </span></a>";
            if (val.ActionText.indexOf("tag") == -1 || val.ActionText.indexOf("nhắc") == -1) {
                if (val.OwnerAccountId != 0)
                    strDivNote += "<span class =\"notify_cssFont\">của bạn </span>";
            }        
        }
    } // end else
    go_notify_showNotifyContent_auto(strDivNote);
} // end function go_notify_showNotifyContent_note
function go_notify_showNotifyContent_auto(strDivNote) {
    
    if (go_notify_isPageLoad) return;
    var elm = "go_notify_showNotifyContent";
    if (document.getElementById(elm)) {
        $("#" + elm).html(strDivNote);
        $("#" + elm).show();
        
        var timeout_hideNotifyContent_auto = setTimeout(function () {
            $("#" + elm).fadeOut("slow");
        }, hideShowNotifyContent);
        $("#" + elm).hover(function () {
            clearTimeout(timeout_hideNotifyContent_auto);
        }, function () {
            timeout_hideNotifyContent_auto = setTimeout(function () {
                $("#" + elm).fadeOut("slow");
            }, hideShowNotifyContent);
        });
    }

}
var appendCssToHead = function(url) {
    if (url) {
        var head = document.getElementsByTagName('head')[0];
        var link = document.createElement('link');
        link.rel = 'stylesheet';
        link.type = 'text/css';
        link.href = url;
        head.appendChild(link);
    }
};
//========= Load Count Notify =========
function goHeader_loadNotify() {
    autoSuggestWithVietnamese();
    if (mygo_obj.accountId != null && mygo_obj.accountId != "" && mygo_obj.accountId > 0) {
        // if (mygo_obj.isRealTime == true) {
        // writeIframe();
        // }

        loadCountNotify();
        fixNotifyPossition();
        // $('#FriendClubCombo').msDropDown();

        setInterval(function () { loadCountNotify(); }, delayloadCountNotify);
    }
    //  bindFeedBackBt();
    var strDivNote = '<div id="go_notify_showNotifyContent" class="s_go_notify_showNotifyContent"></div>';
    $("#notify_HeaderAppend").append(strDivNote);

    setTimeout(function () {
        go_notify_isPageLoad = false;
    }, go_notify_delayPageLoad);

}

function loadCountNotify() {
    $.ajax({
        url: domain_notifyHandler + "CountNotify.ashx",
        dataType: "jsonp",
        data: { type: "2", account_id: mygo_obj.accountId },
        success: function (result) {
            loadCountMessage(result.CountNoteMessage);
            // notify note
            loadCountNote(result.CountNote);
            // notify friend
            loadCountFriend(result.CountFriend);

            go_notify_countOnTitleTab();
        },
        timeout: 5000
    });
   
}
var go_notify_title = document.title;
function go_notify_countOnTitleTab() {
    var number = count_message + count_note + count_addFriends;
    if (number > 0)
        document.title = "(" + number + ") " + go_notify_title;
    else
        document.title = go_notify_title;
}
function go_notify_resetOnTitleTab() {
    document.title = go_notify_title;
}
//========= Load Count Notify Message =========
function loadCountMessage(result) {
    if (result != 0) {
        messageLoadFlag = true;
        $(".notify_warning_Mess").css('visibility', 'visible');  
        $(".notify_countMess").show();
        $("#notify_IDcountMess").html("" + result + "");
        if (result > count_message) {
           
            go_getNotifyContent(1);
        }
         
    }
    else{
        $(".notify_countMess").hide();
       
    }
    count_message = result;     
}
//========= Load Count Notify Note =========
function loadCountNote(result) {
    if (result != 0) {
        noteLoadFlag = true;
        $(".notify_warning_Note").css('visibility', 'visible');  
        $(".notify_countNote").show();
        $("#notify_IDcountNote").html("" + result + "");
        if (result > count_note) {
           
            go_getNotifyContent(2);
        }
           
    }
    else {
        $(".notify_countNote").hide();
    }
    count_note = result;   
}
//========= Load Count Notify Friend =========
function loadCountFriend(result) {
    if (result != 0) {
        friendLoadFlag = true;
        $(".notify_warning_Friend").css('visibility', 'visible');
        $(".notify_countFriend").show();             
        $("#notify_IDcountFriend").html("" + result + "");

        if (result > count_addFriends) {
         
            go_getNotifyContent(3);
        }
       
    }
    else {
        $(".notify_countFriend").hide();
    }
    count_addFriends = result;
}
//========= Reset Count Notify =========

//========= Reset Count Notify Message =========
function notify_resetCountMessage() {
    $.getJSON(domain_notifyHandler + "Notification.ashx?account_id=" + mygo_obj.accountId + "&type=1&StaticToView=1&format=json&jsoncallback=?",
    function(result) { });
    $(".notify_countMess").hide();
    $("#notify_IDcountMess").html("");
    count_message = 0;
    go_notify_countOnTitleTab();
}
//========= Reset Count Notify Note =========
function notify_resetCountNote() {
    $.getJSON(domain_notifyHandler + "Notification.ashx?account_id=" + mygo_obj.accountId + "&type=2&StaticToView=1&format=json&jsoncallback=?",
    function (result) { });
    $(".notify_countNote").hide();
    $("#notify_IDcountNote").html("");
    count_note = 0; go_notify_countOnTitleTab();
}
//========= Reset Count Notify Friend =========
function notify_resetCountFriend() {
    $.getJSON(domain_notifyHandler + "Notification.ashx?account_id=" + mygo_obj.accountId + "&type=3&StaticToView=1&format=json&jsoncallback=?",
    function(result) { });
    $(".notify_countFriend").hide();
    $("#notify_IDcountFriend").html("");
    count_addFriends = 0; go_notify_countOnTitleTab();
}

//Cross Domain iframe
function OnMessageFromChild(message) {
    if (message.length > 0) {
        var parameters = parseParameters(message);
        if (parameters["Type"] == "Chat") {
            addComment(parameters["iFromId"], parameters["sName"], parameters["iToId"], parameters["comment"], parameters["mySelt"]);
        }
        if (parameters["Type"] == "Note") {
            AddNotes(parameters["iNotificationId"], parameters["iDestAccountId"], parameters["CreateTime"], parameters["sActionText"], parameters["sUrl"], parameters["sUrlTitle"], parameters["sSourceAccountName"], parameters["sSourceAccountId"], parameters["sDestAccountName"], parameters["sRelateAccountId"]);
        }
        if (parameters["Type"] == "Friend") {
            AddFriends(parameters["iNotificationId"], parameters["iDestAccountId"], parameters["CreateTime"], parameters["sActionText"], parameters["sUrl"], parameters["sUrlTitle"], parameters["sSourceAccountName"], parameters["sSourceAccountId"], parameters["sDestAccountName"]);
        }
        if (parameters["Type"] == "Message") {
            AddMessages(parameters["iNotificationId"], parameters["iDestAccountId"], parameters["CreateTime"], parameters["sActionText"], parameters["sUrl"], parameters["sUrlTitle"], parameters["sSourceAccountName"], parameters["sSourceAccountId"], parameters["sDestAccountName"]);
        } 
    }
}
function parseParameters(message) {

    var dictionary = new Array();
    message = message + "";
    var pairs = message.split('&@');
    for (keyValuePairIndex in pairs) {
        var nameVal;
        try {
            var obj = pairs[keyValuePairIndex] + "";
            nameVal = obj.split('=');
            dictionary[nameVal[0]] = nameVal[1];
        }
        catch (Error) {

        }
    } return dictionary;

}
function TurnFrameRed() {
    SendMessageToFrame("color=red");
}
function TurnFrameYellow() {
    SendMessageToFrame("color=yellow");
}
function SendMessageToFrame(message) {var elem = document.getElementById('hostFrame');
    elem.contentWindow.location = domain_notifyWeb + 'I-CometRegister.aspx#' + message;
    elem.width = elem.width > 50 ? 50 : 100;
}
//ParentProxy
// Forward message to the top most parent page
function ForwardMessage() {
    var message = document.location.hash;
    if (message.length > 0) {
        message = message.substr(1);
        top.OnMessageFromChild(message);
    }
}
// Hook up the Forward Mesage dependent on browser. FF will only raise the
// resize event on the window / body.
if (window.addEventListener) {
    window.addEventListener('resize', ForwardMessage, false);
} else if (document.body.attachEvent) {
    window.attachEvent('onresize', ForwardMessage);
}
// Ensure ForwardMessage is called once after the page is loaded so that
// any message sent during page load is eventually passsed on. Particularly
// needed if you are looking at resizing content.
setTimeout('ForwardMessage();', 0);
//document.write("<div id='Iframe' style='visibilit:hidden'></div>");
function writeIframe() {
    $("#Iframe").html("<iframe width='0' id='hostFrame' name='hostFrame' height='0' src='" + domain_notifyWeb + "I-CometRegister.aspx?account_id=" + mygo_obj.accountId + "&pathName="+ window.location+"'></iframe>");
}

 function bindFeedBackBt() {    
     linkFeedBackTemp = '';
     if (mygo_obj) {

         if (mygo_obj.feedBack == null) {
             linkFeedBackTemp = feedBackLinkDefault;
         }
         else linkFeedBackTemp = mygo_obj.feedBack;
     }
     else linkFeedBackTemp = feedBackLinkDefault;

     if (linkFeedBackTemp != 'false') {
         go_bt_feedback = '';
         go_bt_feedback = "<div id='go_bt_feedback_right' style='display:block;z-index:1'>";

         go_bt_feedback += "<a href='" + linkFeedBackTemp + "'>";
         go_bt_feedback += "<img src='" + mygo_UrlMedia + "images/button/gopy.gif'/>";
         go_bt_feedback += "</a>";
         go_bt_feedback += "<\/div>";        
         $('#notify_HeaderAppend').append(go_bt_feedback);
     }
 }

 function initMyGoHeader() {
     $("#btnTopSearch").click(function () {
         go_initSearch();
     });
     $("#txtTopSearch").bind('keypress', function (e) {
         if (e.keyCode == 13 && e.shiftKey == 0) {
             go_initSearch();
             return false;
         }
     });
     mygo_focusAndBlur("#txtTopSearch");
     if ((currentLink.indexOf(mygo_friend_Url) != -1) || (currentLink.indexOf(mygo_club_Url) != -1)) {
         $("#FriendClubBox").addClass("notify_friend_index_active");
         //$("#notify_ActiveMVN").addClass("notactivebyClub");
         $("#notify_Active_mvnLog").removeClass("active");
     }
     if (window.dropdowncontent) {
         dropdowncontent.init("FriendClubCurrentLink", "left-bottom", 300, "click");
         dropdowncontent.init("contentlink1", "top-right", 300, "click"); //mouseover
         dropdowncontent.init("contentlink2", "left-bottom", 300, "click");
     }
    
     /* fix PNG */
     if (navigator.userAgent.indexOf('MSIE 6.0') != -1) {
         try {
             if (window.DD_belatedPNG)
                 DD_belatedPNG.fix('#notify_Active_mvnLog, .notify_friend_index a, .notify_icon_index a, .notify_drop_index a,.png_bg');
         } catch (ex) { }
     }
 }


 $(document).ready(function () {

     initMyGoHeader();
     try {
         goHeader_loadNotify();
     } catch (e) {

     }
 });

