﻿    function trackLSB(type) 
    { 
    clearDefaultSearchLable();
    if (typeof dcsMultiTrack == "function") 
    { 
    var qu = document.getElementById("msviLSBtbox").value; 
    //alert(qu);
    var dcsuri = "results.aspx"; 
    var dcssip, ti; 
    if (type == "Site") 
    { 
    dcssip = "search.microsoft.com"; 
    ti = "SearchButton: OnSite"; } 
    else if (type == "Web") 
    { 
    dcssip = "bing.com"; ti = "SearchButton: Web"; 
    } 
    dcsMultiTrack("DCS.dcsuri", dcsuri, "DCS.dcssip", dcssip, "WT.ti", ti, "WT.dl", "2", "WT.z_srch_t", qu, "DCS.dcsqry", "", "WT.ad", "", "WT.mc_id", ""); 
    wtflag = true; 
    DCS.dcsuri=DCS.dcssip=DCS.dcsqry=WT.ti=WT.z_srch_t="";
    } 
    }

var isInputqu = false;
var searchBoxWidthWithKievLogo = 0;
var searchBoxWidthWithoutKievLogo = 0;
function clearDefaultSearchLable()
{
var searchBox = document.getElementById("msviLSBtbox");
if(!isInputqu)
{
    searchBox.value = "";
}
}
var kievImageWidth = 0;

function searchBoxFocused(defaultSearchLabel)
{
//alert("in focus");
    var searchBoxInput = document.getElementById("msviLSBtbox");
    var kievImage = document.getElementById("msviLSBlogo");
    //alert(defaultSearchLabel);
    if(searchBoxInput.value == defaultSearchLabel)
    {
        searchBoxInput.value = '';
//        if(kievImageWidth == 0)
//        {
//            kievImageWidth = kievImage.clientWidth;
//        }
//        searchBoxInput.style.fontStyle = '';
//        searchBoxInput.style.color='#000000';
//        kievImage.style.width = '1px';
//        if(searchBoxWidthWithKievLogo == 0)
//        {
//            searchBoxWidthWithKievLogo = searchBoxInput.style.width;
//            searchBoxWidthWithoutKievLogo = searchBoxInput.clientWidth + (kievImageWidth - 1);
//        }
     }
        searchBoxInput.style.right="23px";
        searchBoxInput.style.width = "212px"; //245
        kievImage.style.width="0px";
       isInputqu=true;
   
}

function searchBoxBlur(defaultSearchLabel)
{
//alert("in blur");
    var searchBoxInput = document.getElementById("msviLSBtbox");
    var kievImage = document.getElementById("msviLSBlogo");
    if(searchBoxInput.value.replace(/(^\s*)|(\s*$)/g, '')=='') 
    {
          searchBoxInput.value=defaultSearchLabel;
//        searchBoxInput.style.fontStyle ='Italic';
//        searchBoxInput.style.color = "#a1a1a1";
//        kievImage.style.width = kievImageWidth;
//        searchBoxInput.style.right="70px";
//        searchBoxInput.style.width = searchBoxWidthWithKievLogo+"px";
//        alert(searchBoxInput.style.width);
        
        searchBoxInput.style.right="80px";
        searchBoxInput.style.width = "160px";
        kievImage.style.width="47px";
        isInputqu = false;
     }
     else
     {
        isInputqu = true;
     }
          
}