
    $(document).ready(function () {
        //        $('.columnb').mouseover(function () {
        //            $('#privSaf').css('display', 'none');
        //        });
        ////        $('.columnb').mouseout(function () {
        //            $('#privSaf').css('display', 'block');
        //        });
        $('.columnbx').mouseover(function () {
            $('#privSaf').css('display', 'block');
            $('#community').css('display', 'block');

        });
        //        $('.columnbx').mouseout(function () {
        //            $('#colordatag').css('color', 'red');
        //        });
        //     $('#focus').mouseover(function () {
        //         $('#colordatag').css('color', 'gray');
        //            $('#privSaf').css('display', 'block');
        //  });

        $('#ctl00_pageHeader_A4').hover(
                 function () {

                     $('#A2').addClass('navfocus');
                     $('#im1').addClass('imgshow');



                 }
                 ,
                 function () {
                     $('#A2').removeClass('navfocus');
                     $('#im1').removeClass('imgshow');

                 }
                );
        $('#ctl00_pageHeader_A5').hover(
                 function () {

                     $('#A7').addClass('navfocus');
                     $('#im2').addClass('imgshow');



                 }
                 ,
                 function () {
                     $('#A7').removeClass('navfocus');
                     $('#im2').removeClass('imgshow');

                 }
                );


    });
    //function bodyOnload() {
    window.onload = function () {
        document.getElementById('iptSearchTextBox').value = 'Search CorporateCitizenship';
        // document.getElementById('Search_box').value = '';
    }


    // JScript source code
    var inter = undefined; var ScopeItems = function ()
    { }
    ScopeItems.InvestorRelation = "Search CorporateCitizenship"; ScopeItems.Microsoft = "Search Microsoft.com"; ScopeItems.Internet = "Search the Web";
    var currentScopeItem = ScopeItems.InvestorRelation;
    function OnClick_ScopeButton() {
        ChangeScopeAreaStatus();
    }
    function OnMouseOver_ScopeArea() {
        document.getElementById("divScope").style.display = "block";
        if (inter) {
            clearTimeout(inter);
            inter = undefined;
        }
    }
    function OnMouseOut_ScopeArea() {
        if (window.event)
            event.cancelBubble = true;
        var a = function () {
            inter = undefined;
            HideScopeArea();
        };
        if (document.getElementById("divScope").style.display != "none" && !inter)
            inter = setTimeout(a, 500);
    }
    function HideScopeArea() {
        var scopeArea = document.getElementById("divScope");
        scopeArea.style.display = "none";
    }
    function ChangeScopeAreaStatus() {
        var scopeArea = document.getElementById("divScope");
        if (scopeArea.style.display == "none")
            scopeArea.style.display = "block";
        else
            scopeArea.style.display = "none";
    }
    function OnMouseOver_ScopeItem(sender) {
        sender.style.backgroundColor = "#BDDBEF";
    }
    function OnMouseOut_ScopeItem(sender) {
        sender.style.backgroundColor = "white";
    }
    function OnClick_ScopeItem(sender, anchor) {
        this.ResetScopeItemsStyle(); sender.className = "selectedItem";
        var title = document.getElementById(anchor).title; document.getElementById("iptSubmit").title = title; currentScopeItem = title;
        var value = document.getElementById("iptSearchTextBox").value;
        if (value.replace(/(^\s*)|(\s*$)/g, "") != "" && value != ScopeItems.InvestorRelation && value != ScopeItems.Microsoft && value != ScopeItems.Internet) {
            document.getElementById("iptSearchTextBox").value = value;
        }
        else {
            document.getElementById("iptSearchTextBox").value = title;
            chagnedSearchBoxStyleToEmpty();
        }
        HideScopeArea();
    }
    function ResetScopeItemsStyle() {
        document.getElementById("divItemIR").className = "unselectedItem";
        document.getElementById("divItemMro").className = "unselectedItem";
        //        document.getElementById("divItemInter").className = "unselectedItem";
    }
    function OnFocus_SearchBox() {
        var objSearch = document.getElementById("iptSearchTextBox");
        if (objSearch.value == ScopeItems.InvestorRelation || objSearch.value == ScopeItems.Microsoft || objSearch.value == ScopeItems.Internet) {
            objSearch.value = "";
            changeSearchBoxStyle();
        }
        else
            chagnedSearchBoxStyleToNormal();
    }
    function OnBlur_SearchBox() {
        var sb = document.getElementById("iptSearchTextBox");
        if (sb.value.replace(/(^\s*)|(\s*$)/g, "") == "") {
            if (currentScopeItem == ScopeItems.InvestorRelation)
                sb.value = ScopeItems.InvestorRelation;
            else if (currentScopeItem == ScopeItems.Microsoft)
                sb.value = ScopeItems.Microsoft;
            else if (currentScopeItem == ScopeItems.Internet)
                sb.value = ScopeItems.Internet; changeSearchBoxStyle();
        }
        else if (sb.value == ScopeItems.InvestorRelation || sb.value == ScopeItems.Microsoft || sb.value == ScopeItems.Internet)
            changeSearchBoxStyle();
    }
    function chagnedSearchBoxStyleToEmpty() {
        var sb = document.getElementById("iptSearchTextBox");
        sb.className = "searchBox_Empty";
    }
    function chagnedSearchBoxStyleToNormal() {
        var sb = document.getElementById("iptSearchTextBox");
        sb.className = "searchBox_Normal";
    }
    function changeSearchBoxStyle() {
        var sb = document.getElementById("iptSearchTextBox");
        if (sb.className == "searchBox_Empty")
            sb.className = "searchBox_Normal";
        else
            sb.className = "searchBox_Empty";
    }
    function encodeKeyword(str) {
        return escape(str).replace(/\+/g, '%2B').replace(/\"/g, '%22').replace(/\'/g, '%27').replace(/\//g, '%2F');
    }
    var SearchURL = function ()
    { }
    SearchURL.irSiteUrl = "http://search.microsoft.com/Results.aspx";
    // SearchURL.microsoftSiteUrl = "http://search.microsoft.com/Results.aspx";
    //SearchURL.microsoftSiteUrl = "http://search.microsoft.com/results.aspx?mkt=en-US&setlang=en-US&q=";
    SearchURL.internetUrl = "http://www.bing.com/search";
    var irSiteUrlFormat = "?q={$q}&mkt=en-US&FORM=QBME1&l=1&refradio=0&qsc0=0";
    var microsoftsSiteUrlFormat = "??mkt=en-US&q={$q}&FORM=QBME1&l=1&refradio=0&qsc0=0";
    var internetUrlFormat = "?FORM=MSSBMN&q={$q}";
    var microsoftUrl = "http://search.microsoft.com/results.aspx?mkt=en-US&setlang=en-US&q=";


    function OnClick_SearchButton() {
        var keyword = document.getElementById("iptSearchTextBox").value;
        if (currentScopeItem == ScopeItems.InvestorRelation) {
            if (keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.InvestorRelation && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Microsoft && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Internet)
                window.location.href = SearchURL.irSiteUrl + irSiteUrlFormat.replace("{$q}", encodeKeyword(keyword) + " (site:http://www.microsoft.com/about/corporatecitizenship/)");
            else
                window.location.href = SearchURL.irSiteUrl + irSiteUrlFormat.replace("{$q}", " (site:http://www.microsoft.com/about/corporatecitizenship/)");
        }
        else if (currentScopeItem == ScopeItems.Microsoft) {
            if (keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.InvestorRelation && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Microsoft && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Internet) {
                //window.location.href = SearchURL.microsoftSiteUrl + microsoftsSiteUrlFormat.replace("{$q}", encodeKeyword(keyword));
                window.location = microsoftUrl + keyword;
            }
            else
                window.location.href = SearchURL.microsoftSiteUrl + microsoftsSiteUrlFormat.replace("{$q}", "");
        }
        else {
            if (keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.InvestorRelation && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Microsoft && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Internet)
                window.location.href = SearchURL.internetUrl + internetUrlFormat.replace("{$q}", encodeKeyword(keyword));
            else
                window.location.href = SearchURL.internetUrl + internetUrlFormat.replace("{$q}", "");
        }
    }
    //    function OnClick_WebSearchButton() 
    //    {
    //        var keyword = document.getElementById("iptSearchTextBox").value;
    //        if (currentScopeItem == ScopeItems.InvestorRelation) 
    //        {
    //            if (keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.InvestorRelation && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Microsoft && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Internet)
    //                window.location.href = SearchURL.internetUrl + internetUrlFormat.replace("{$q}", encodeKeyword(keyword));
    //            else 
    //                window.location.href = SearchURL.internetUrl + internetUrlFormat.replace("{$q}", "");
    //        }
    //        else if (currentScopeItem == ScopeItems.Microsoft)
    //         {
    //            if (keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.InvestorRelation && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Microsoft && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Internet)
    //                window.location.href = SearchURL.internetUrl + internetUrlFormat.replace("{$q}", encodeKeyword(keyword));
    //            else 
    //                 window.location.href = SearchURL.internetUrl + internetUrlFormat.replace("{$q}", "");
    //        }
    //        else {
    //            if (keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.InvestorRelation && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Microsoft && keyword.replace(/(^\s*)|(\s*$)/g, "") != ScopeItems.Internet)
    //                window.location.href = SearchURL.internetUrl + internetUrlFormat.replace("{$q}", encodeKeyword(keyword));
    //            else 
    //                window.location.href = SearchURL.internetUrl + internetUrlFormat.replace("{$q}", "");
    //        } 
    //    }

  


    //function bodyOnload() {
    //    window.onload = function() {
    //        document.getElementById('msviLSBtbox').value = 'Search Microsoft.com';
    //        // document.getElementById('Search_box').value = '';
    //    }


    //    function Search() {
    //        if (document.getElementById('edu_option').value == "true") {
    //            var searchText = document.getElementById('Search_box').value;
    //            if (searchText != '') {
    //                var url = "http://search.microsoft.com/results.aspx?q=" + document.getElementById('Search_box').value + "&l=en&s100=on&OtherSite=http%3a%2f%2fwww.microsoft.com%2feducation&mkt=en-US";
    //                window.location = url;
    //            }
    //            else {
    //                //alert('Please enter search text');
    //                var url = "http://search.microsoft.com/results.aspx?q=&l=en&s100=on&OtherSite=http%3a%2f%2fwww.microsoft.com%2feducation&mkt=en-US";
    //                window.location = url;
    //            }
    //        }
    //        else {
    //            var searchText = document.getElementById('Search_box').value;
    //            if (searchText != '') {
    //                var url = "http://search.microsoft.com/results.aspx?q=" + document.getElementById('Search_box').value + "&l=en&s100=on&OtherSite=http%3a%2f%2fwww.microsoft.com&mkt=en-US";
    //                window.location = url;
    //            }
    //            else {
    //                //alert('Please enter search text');
    //                var url = "http://search.microsoft.com/results.aspx?q=&l=en&s100=on&OtherSite=http%3a%2f%2fwww.microsoft.com&mkt=en-US";
    //                window.location = url;

    //            }
    //        }
    //    }

    function SiteSearch() {
        //debugger;
        var searchText = document.getElementById('msviLSBtbox').value;
        if (searchText != '' && searchText != 'Search Microsoft.com') {
            //searchText = document.getElementById('msviLSBtbox').value + "&mkt=en-US&FORM=QBME1&l=1&refradio=0&qsc0=0";
            var appendUrl = "&mkt=en-US&FORM=QBME1&l=1&refradio=0&qsc0=0";
            var url = "http://search.microsoft.com/results.aspx?mkt=en-US&setlang=en-US&q=" + searchText + appendUrl;
            window.location = url;
            //document.write = searchText;
        }
        else {
            var url = "http://search.microsoft.com/?mkt=en-us&form=MSSBMNS";
            window.location = url;
        }
    }

    function searchBoxFocus() {
        document.getElementById('msviLSBtbox').value = '';
        document.getElementById('msviLSBlogo').style.display = 'none';
        document.getElementById('msviLSBtbox').style.fontStyle = '';
        document.getElementById('msviLSBtbox').style.color = "#000000";
        var browserName = navigator.appName;
        if (browserName == "Netscape") {
            document.getElementById('msviLSBtbox').style.width = "273";
        }
        else {
            document.getElementById('msviLSBtbox').style.width = "267";
        }
    }

    function searchLostFocus() {
        //debugger;
        var searchTextVal = document.getElementById('msviLSBtbox').value;
        if (searchTextVal != '' && searchTextVal != 'Search Microsoft.com' && searchTextVal != null) {
            document.getElementById('msviLSBlogo').style.display = 'none';
        }
        else {
            document.getElementById('msviLSBtbox').value = 'Search Microsoft.com';
            document.getElementById('msviLSBlogo').style.display = '';
            document.getElementById('msviLSBtbox').style.fontStyle = 'Italic';
            document.getElementById('msviLSBtbox').style.color = "#a1a1a1";
            document.getElementById('msviLSBtbox').style.width = "220";
        }
    }

    function hideImage() {
        //document.getElementById('privSaf').style.display = 'none';
    }


