/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor. 
 */
    
function changeBg(obj)
{    
    var idTabOld=document.getElementById("selectTab").value;            
    document.getElementById(idTabOld).style.backgroundColor="#59933F";
    document.getElementById(idTabOld).style.color="white";    
    obj.style.backgroundColor="white";
    obj.style.color="black";
    document.getElementById("selectTab").value=obj.id;
    document.getElementById(idTabOld+"Content").style.display="none";
    document.getElementById(obj.id+"Content").style.display="block";
    document.getElementById("SlideItMoo1_outer").style.width="670px";
    document.getElementById("SlideItMoo2_outer").style.width="670px";
    document.getElementById("SlideItMoo3_outer").style.width="670px";
    document.getElementById("SlideItMoo4_outer").style.width="670px";
    document.getElementById("SlideItMoo5_outer").style.width="670px";    
}
function loadQuickLinkProductAjax(url,idContent)
{
    var xmlHttp = getXMLHTTP();
    if(xmlHttp == null){
        alert("not support ajax");
        return;
    }
    xmlHttp.onreadystatechange = function(){
        if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
            var result = xmlHttp.responseText;            
            document.getElementById(idContent).innerHTML=result;
        }
    }    
    xmlHttp.open("GET", url, true);
    xmlHttp.send(null);
}
function getXMLHTTP()
{
    if(window.XMLHttpRequest){
        return new XMLHttpRequest();
    }
    if(window.ActiveXObject){
        return new ActiveXObject("Microsoft.XMLHTTP");
    }
    return null;
}
function changeBG(obj,color)
{    
    if(color=="white") obj.style.color="black";       
    else  obj.style.color="white";            
    obj.style.backgroundColor=color;
}
function show(id)
{
    document.getElementById(id).style.display="";
}
function hidden(id)
{    
    document.getElementById(id).style.display="none";
}
function showorhidden(id)
{    
    if(document.getElementById(id).style.display=="none")
        show(id);
    else hidden(id);    
}
function setValueForInput(id,val)
{
    document.getElementById(id).value=val;
}
function changeValueBg(id,value1, value2){
    document.getElementById(id).style.color = value1;
    document.getElementById(id).style.backgroundImage = value2;
}
function showDivMenuHidden(idDiv,inputhidden)
{
    hidden("browserMenu");    
    show(idDiv);
    setValueForInput(inputhidden,"true");
    if (idDiv == 'browserMenu'){
        changeValueBg('browseProducts','#333', 'url(\'/images/bg/bgBrowse.jpg\')');
    } else if (idDiv == 'browserMenuB'){
        changeValueBg('browseBuyers','#333', 'url(\'/images/bg/bgBrowse2.jpg\')');
    }
//backgroundColor:#F0F0F0;
}

function showDivMenuHidden1(idDiv,inputhidden)
{
    hidden("browserMenu");
    //show(idDiv);
    setValueForInput(inputhidden,"true");
    //document.getElementById("autoComplete").style.display = "block";
    //showRecentSearch();
//backgroundColor:#F0F0F0;
}
function test1(obj,idDiv,inputhidden)
{
    hidden("browserMenu");
    show(idDiv);
    setValueForInput(inputhidden,"true");
    obj.style.backgroundColor="white";
//backgroundColor:#F0F0F0;
}

function test2(obj,idDiv,inputhidden)
{
    hidden("browserMenu");
    show(idDiv);
    setValueForInput(inputhidden,"true");
    obj.style.backgroundColor="#F0F9E5";
//backgroundColor:#F0F0F0;
}
function delay(iddiv,idout,idhidden)
{   
    setValueForInput(idout,"false");    
    setTimeout("checkConditionHidden('"+iddiv+"','"+idhidden+"','"+idout+"')",100);
    document.getElementById("autoComplete").style.display = "none";
}
function checkConditionHidden(idelement,inputhidden,idhiddenout)
{
    var obj=document.getElementById(inputhidden);
    if(obj.value=="false")
    {
        if(document.getElementById(idhiddenout).value=="false")
        {
            var idUl=document.getElementById("mainCateSelect").value;            
            if(idUl!=""){
                hidden(idUl);
            }
            document.getElementById("mainCateSelect").value="";
            hidden(idelement);
            if (idelement == 'browserMenu'){
                changeValueBg('browseProducts','#FFF', 'url(\'/images/bg/bgBrowse_a.jpg\')');
            } else {
                changeValueBg('browseBuyers','#FFF', 'url(\'/images/bg/bgBrowse2_a.jpg\')');
            }
        }
    }
}
function hideAutoComplete()
{
    document.getElementById("autoComplete").style.display = "none";
}
function showAutoComplete()
{
    document.getElementById("autoComplete").style.display = "block";
}
function clickMainCate(id)
{
    showorhidden(id);
    var obj=document.getElementById("mainCateSelect");
    if(obj!=null)
    {
        if(obj.value!="" && obj.value!=id)
        {
            hidden(obj.value);
        }
        obj.value=id;
    }
}

function setValue(obj,idlist,color,val,language)
{
    changeBG(obj,color);
    showorhidden(idlist)
    document.getElementById(idlist+"Label").innerHTML=obj.innerHTML;
    document.getElementById(idlist+"Hidden").value=val;//
    var txtPage=document.getElementById("dropdownPageMenuHidden").value;
    var txtCateId=document.getElementById("dropdownFilterMenuHidden").value;
    var txtSortBy=document.getElementById("dropdownSortMenuHidden").value;
    
    if(idlist!="dropdownPageMenu")
    {
        txtPage=1;
        document.getElementById("dropdownPageMenuLabel").innerHTML="1";
        document.getElementById("dropdownPageMenuHidden").value="1";        
        if(idlist!="dropdownSortMenu")
        {
            txtSortBy="ascent";
            document.getElementById("dropdownSortMenuLabel").innerHTML="Most recommended";
            document.getElementById("dropdownSortMenuHidden").value="ascent";//countBuyLeadHomePage
            //set number of page againt
            var url="/countBuyLeadHomePage?txtCateId="+txtCateId+"&language="+language;
            loadQuickLinkProductAjax(url,"dropdownPageMenu");
        }
    }    
    var url1="/loadBuyLeadHomePage?txtPage="+txtPage+"&txtCateId="+txtCateId+"&txtSortBy="+txtSortBy+"&language="+language;
    loadQuickLinkProductAjax(url1,"listBuyLeads");
}

function setTextBoxSearchValue(obj,eventElement)
{
    var defaultval=document.getElementById("defaultValueSearch").value;
    if(eventElement=="onblur")
    {
        if(obj.value=="") obj.value=defaultval;
    }
    else
    {
        if(obj.value==defaultval)
        {
            obj.value="";
        }
        var type = document.getElementById("searchParam").value;
        if (type=="Product")
        {
            document.getElementById("proAuto").style.display = "block";
            document.getElementById("buyAuto").style.display = "none";
        }else
        {
            document.getElementById("proAuto").style.display = "none";
            document.getElementById("buyAuto").style.display = "block";

        }
    }    
    if(eventElement=='onfocus'){
        document.getElementById("autoComplete").style.display = "block";
        showRecentSearch();
    }
}
function changeStyleMenuSearch(id)
{    
//    obj.setAttribute("className","tabSearchMenu2");
//    document.getElementById(id).setAttribute("className", "tabSearchMenu");
//    obj.setAttribute("class","tabSearchMenu2");
//    document.getElementById(id).setAttribute("class", "tabSearchMenu");  
    if(id=="tabSearchProduct")
    {
        setValueForInput("searchParam","Product");
        document.getElementById("proAuto").style.display = "block";
        document.getElementById("buyAuto").style.display = "none";
        document.getElementById("autoProductCompleteTitle").style.display = "block";
        document.getElementById("autoBuyLeadCompleteTitle").style.display = "none";

    }
    else
    {
        setValueForInput("searchParam","BuyLead");
        document.getElementById("proAuto").style.display = "none";
        document.getElementById("buyAuto").style.display = "block";
        document.getElementById("autoProductCompleteTitle").style.display = "none";
        document.getElementById("autoBuyLeadCompleteTitle").style.display = "block";
    }
}
function changeBorder(obj,eventElement)
{
    if(eventElement=="in") 
    {
        //obj.style.borderTop="1px solid #007940";
        obj.style.border="1px solid #cccccc";
    }
    else
    {        
        obj.style.borderTop="1px dashed #E3ECD5";
        obj.style.borderBottom="1px dashed #F0F9E5";
        obj.style.borderLeft="1px dashed #F0F9E5";
        obj.style.borderRight="1px dashed #F0F9E5";
    }
}
function changeColor(obj,eventElement)
{
    if(eventElement=="in")
    {
        //obj.style.height="14px";
        obj.style.color="#414141";
       
    }
    else
    {
        //obj.style.height="14px";
        obj.style.color="#007940";
       
    }
}
function runScriptSearch(e) {
    if (e.keyCode == 13) {
               
}   
}
function openLiveSupport(obj,el)
{
    obj.style.display="none";
    document.getElementById(el).style.display="";
    slideUD('liveChat',0,224,40,'down');    
}
function closeLiveSupport(obj,el)
{
    obj.style.display="none";
    document.getElementById(el).style.display="";
    slideUD('liveChat',224,0,40,'up');
}
function slideFollowMargin(id,begin,end,slideTime,updown){    
    var count=begin;    
    var time=1;
    if(updown=="up"){
        //document.getElementById(id).style.marginTop=end+"px;";
        document.getElementById(id).style.display="";
        count=end;
        while(count>=begin){
            setTimeout("slideMargin('"+id+"',"+count+")",time*slideTime);
            --count;
            ++time;
        }
    }else{
        //document.getElementById(id).style.marginTop=begin+"px;";
        document.getElementById(id).style.display="";
        count=begin;
        while(count<=end){
            setTimeout("slideMargin('"+id+"',"+count+")",time*slideTime);
            ++count;
            ++time;
        }
    }    
}
function slideUD(id, beginHeight,endHeight ,slideTime,slideType) {
    if(beginHeight==0)
    {
        document.getElementById(id).style.height="0px";
        document.getElementById(id).style.display="";
    }
    var times=10;
    var count = slideTime * times;
    var height = beginHeight;
    var delta;// current height
    if(slideType=='down') delta=endHeight/times;
    else delta=(beginHeight-endHeight)/times;
    var i=1;
    while(count>=0)
    {
        setTimeout("slide('"+id+"',"+height+")",i*slideTime);
        count=count-slideTime;
        if(slideType=='down') height+=delta;
        else height-=delta;
        ++i;
        if(height==endHeight) break;
    }
    if(endHeight==0)
    {
        setTimeout("document.getElementById('"+id+"').style.display=\"none\";",i*slideTime);
    }
}
function slide(id,height) {
    var el=document.getElementById(id);
    el.style.height=height+"px";
}
function slideMargin(id,height) {
    var el=document.getElementById(id);
    el.style.marginTop=height+"px";
}
String.prototype.replaceAll = function(
    strTarget, // The substring you want to replace
    strSubString // The string you want to replace in.
    ){
    var strText = this;
    var intIndexOfMatch = strText.indexOf( strTarget );

    // Keep looping while an instance of the target string
    // still exists in the string.
    while (intIndexOfMatch != -1){
        // Relace out the current instance.
        strText = strText.replace( strTarget, strSubString )

        // Get the index of any next matching substring.
        intIndexOfMatch = strText.indexOf( strTarget );
    }

    // Return the updated string with ALL the target strings
    // replaced out with the new substring.
    return( strText );
}
function submitFormSearch(lang)
{
    if(document.getElementById("marketAvailability")!=null){
        document.getElementById("marketAvailability").value="";
    }
    var defaultValueSearch=document.getElementById("defaultValueSearch").value;
    if(document.getElementById("key").value=="" || document.getElementById("key").value==defaultValueSearch)
    {
        return false;
       
    }
    var tempValue = document.getElementById("key").value;

    tempValue = tempValue.replaceAll(" ","");
    if(tempValue=="")
    {
        return false;
    }
    var searchParam=document.getElementById("searchParam").value;
    var url="/searchControl";
    if(searchParam=="Product")
    {
        //        url="/SearchProduct?searchParam=Product&categoryid="+categoryId+"&countryid="+countryId+"&keyword="+keyword+"&language="+lang;
        url="/searchControl";
    }
    else
    {
        //        url="/BuyLeadsSearch?searchParam=BuyLead&categoryid="+categoryId+"&countryid="+countryId+"&keyword="+keyword+"&language="+lang;
        url="/searchControl";
    }
    
    var keyword = document.getElementById("key").value;
    keyword = keyword.replace(/[-!<>,#\$%\^\?\&\*\(\)_+=\/\\"'`~\.']/gi," ");    
    while (keyword.indexOf("  ")>=0)
    {
        keyword = keyword.replaceAll("  ", " ");
    }
    while (keyword.indexOf(" ")>=0)
    {
        keyword = keyword.replaceAll(" ", "-");
    }
    if (keyword[0]=="-")
    {
        keyword = keyword.substr(1);
    }
    if (keyword[keyword.length-1]=="-")
    {
        keyword = keyword.substr(0,keyword.length-1);
    }
    document.getElementById("keyword").value = keyword;
    var formSearch=document.getElementById("searchForm");  
    formSearch.action=url;   
    formSearch.submit();
}
function autoPaddingImage(obj,defaultSize)
{    
    var heightImg=obj.height;    
    var widthImg=obj.width;
    if(heightImg==0)
    {
        var imgTemp=new Image();
        imgTemp.src=obj.src;
        heightImg=imgTemp.height;
        widthImg=imgTemp.width;
    }
    if(widthImg>heightImg&&widthImg>defaultSize)
    {
        heightImg=heightImg/(widthImg/defaultSize);//height after scaled
    }
    if(heightImg<defaultSize && heightImg>0)
    {
        obj.style.paddingTop=(defaultSize-heightImg)/2+"px";
    }
    obj.alt=(defaultSize-heightImg)/2+"px";
}
function initLanguageVN() {

    //    var paramURL = document.location.href;
    //    alert(paramURL);

    var urlShowSubCategory = "/show-category/";
    var urlShowSubCategoryVN = "/vn/show-category/";
    var urlShowSubCategoryCN = "/cn/show-category/";

    var urlBuyLeadDirectENByCat = "/buyleads-directory/";
    var urlBuyLeadDirectVNByCat = "/vn/buyleads-directory/";
    var urlBuyLeadDirectCNByCat = "/cn/buyleads-directory/";

    var urlBuyLeadDirectEN = "/buyleads-directory";
    var urlBuyLeadDirectVN = "/vn/buyleads-directory";
    var urlBuyLeadDirectCN = "/cn/buyleads-directory";

    var strPro_DirectEN="/product-directory";
    var strPro_DirectCN="/cn/product-directory";
    var strPro_DirectVN ="/vn/product-directory";


    var strProDirectEN="/product-directory/";
    var strProDirectCN="/cn/product-directory/";
    var strProDirectVN ="/vn/product-directory/";


    var strProCatEN="/product-category/";
    var strProCatCN="/cn/product-category/";
    var strProCatVN ="/vn/product-category/";

    var strBuyCatEN="/buylead-category/";
    var strBuyCatCN="/cn/buylead-category/";
    var strBuyCatVN ="/vn/buylead-category/";

    var strBuyLeadsVN ="/vn/Buying-leads/";
    var strBuyLeadsCN ="/cn/Buying-leads/";
    var strBuyLeadsEN ="/Buying-leads/";

    var strProductVN ="/vn/Product";
    var strProductCN="/cn/Product";
    var strProductEN="/Product";


   

    var ENLanguage ="?language=en";
    var CNLanguage ="?language=cn";

    var paramURL = document.location.href;
    if(paramURL.lastIndexOf("#") >=0){
        paramURL = paramURL.substring(0, paramURL.lastIndexOf("#"));
    }
    var newParamURL ="";
    var strCNName="";
    var strENName ="";
    var strVNName= "";

    var strSearch = "/Search/";
    //Control Search
    if(paramURL.indexOf(strSearch) >=0){
        if (paramURL.indexOf("/cn/")>=0)
        {
            newParamURL = paramURL.replace("/cn/","/vn/");
            location.href = newParamURL;
        }
        else if (paramURL.indexOf("/en/")>=0)
        {
            newParamURL = paramURL.replace("/en/","/vn/");
            location.href = newParamURL;
        }else
        {
            return false;

        }




    }


    //Control Show product of subcategory
    if(paramURL.indexOf(urlShowSubCategoryCN) >=0){
        newParamURL = paramURL.replace(urlShowSubCategoryCN, urlShowSubCategoryVN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlShowSubCategory) >=0){
        newParamURL = paramURL.replace(urlShowSubCategory, urlShowSubCategoryVN);
        location.href =  newParamURL;
        return;
    }

    //Control BuyLead_direction by Cat
    if(paramURL.indexOf(urlBuyLeadDirectCNByCat) >=0){
        newParamURL = paramURL.replace(urlBuyLeadDirectCNByCat, urlBuyLeadDirectVNByCat);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlBuyLeadDirectENByCat) >=0){
        newParamURL = paramURL.replace(urlBuyLeadDirectENByCat, urlBuyLeadDirectVNByCat);
        location.href =  newParamURL;
        return;
    }

    //Control BuyLead_direction
    if(paramURL.indexOf(urlBuyLeadDirectCN) >=0){
        newParamURL = paramURL.replace(urlBuyLeadDirectCN, urlBuyLeadDirectVN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlBuyLeadDirectEN) >=0){
        newParamURL = paramURL.replace(urlBuyLeadDirectEN, urlBuyLeadDirectVN);
        location.href =  newParamURL;
        return;
    }

    //Control Product_direction
    if(paramURL.indexOf(strPro_DirectCN) >=0){
        newParamURL = paramURL.replace(strPro_DirectCN, strPro_DirectVN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strPro_DirectEN) >=0){
        newParamURL = paramURL.replace(strPro_DirectEN, strPro_DirectVN);
        location.href =  newParamURL;
        return;
    }
    //Control Product_direction detail
    if(paramURL.indexOf(strProDirectCN) >=0){
        newParamURL = paramURL.replace(strProDirectCN, strProDirectVN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProDirectEN) >=0){
        newParamURL = paramURL.replace(strProDirectEN, strProDirectVN);
        location.href =  newParamURL;
        return;
    }
    //CONTROL PRODUCT - CATEGORIES
    if(paramURL.indexOf(strProCatCN) >=0){
        newParamURL = paramURL.replace(strProCatCN, strProCatVN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProCatEN) >=0){
        newParamURL = paramURL.replace(strProCatEN, strProCatVN);
        location.href =  newParamURL;
        return;
    }
    //END CONTROL PRODUCT - CATEGORIES

    //CONTROL BUYLEAD - CATEGORIES
    if(paramURL.indexOf(strBuyCatCN) >=0){
        newParamURL = paramURL.replace(strBuyCatCN, strBuyCatVN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strBuyCatEN) >=0){
        newParamURL = paramURL.replace(strBuyCatEN, strBuyCatVN);
        location.href =  newParamURL;
        return;
    }    
    //END CONTROL BUYLEAD - CATEGORIES

    //CONTROL BUYLEADS

    if(paramURL.indexOf(strBuyLeadsCN) >=0){
        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;

        newParamURL = paramURL.replace(strBuyLeadsCN, strBuyLeadsVN);

        if(strCNName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) +"/"+ strVNName + ".html";
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strBuyLeadsEN) >=0){
        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;
        newParamURL = paramURL.replace(strBuyLeadsEN, strBuyLeadsVN);
        if(strENName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) +"/"+ strVNName + ".html";
        location.href =  newParamURL;
        return;
    }
    //END CONTROL BUYLEADS
    //CONTROL PRODUCTS
    if(paramURL.indexOf(strProductCN) >=0){
        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;
        newParamURL = paramURL.replace(strProductCN, strProductVN);
        if(strCNName!=null){
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) +"/"+ strVNName + ".html";
        }
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProductEN) >=0){
        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;
        newParamURL = paramURL.replace(strProductEN, strProductVN);
        if(strENName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) +"/"+ strVNName + ".html";
        location.href = newParamURL;
        return;
    }
    //END CONTROL PRODUCTS

    if(paramURL.indexOf(ENLanguage)>=0 ){
        //        newParamURL = paramURL.substring(0, paramURL.indexOf(ENLanguage)) +"?language=vn";
        newParamURL = paramURL.replace(ENLanguage, "?language=vn");

        location.href = newParamURL;
    } else if(paramURL.indexOf(CNLanguage)>=0 ) {
        //        newParamURL = paramURL.substring(0, paramURL.indexOf(CNLanguage)) +"?language=vn";
        newParamURL = paramURL.replace(CNLanguage, "?language=vn");
        location.href =  newParamURL;
    } else {
        if(paramURL.indexOf("language=")>0){
            var filtered_url = paramURL.replace("language=en","language=vn");
            filtered_url = filtered_url.replace("language=cn","language=vn");
            location.href = filtered_url;
        }else if(paramURL.indexOf("?")>0){
            location.href = paramURL + "&language=vn";
        }else if(paramURL.indexOf("/en")>0){

            var strURLVN = paramURL.replace("/en","/vn");
            location.href = strURLVN;
        }else if(paramURL.indexOf("/cn")>0){

            var strURLCN = paramURL.replace("/cn","/vn");
            location.href = strURLCN;
        }else if(paramURL == "http://www.vigogo.com/" || paramURL == "http://localhost:8083/"){
            location.href=paramURL+"vn";
        }else {
            location.href=paramURL+"?language=vn";
        }
    }
}
function initLanguageCN() {

    //    var paramURL = document.location.href;
    //    alert(paramURL);

    var urlShowSubCategory = "/show-category/";
    var urlShowSubCategoryVN = "/vn/show-category/";
    var urlShowSubCategoryCN = "/cn/show-category/";

    var urlBuyLeadDirectENByCat = "/buyleads-directory/";
    var urlBuyLeadDirectVNByCat = "/vn/buyleads-directory/";
    var urlBuyLeadDirectCNByCat = "/cn/buyleads-directory/";

    var urlBuyLeadDirectEN = "/buyleads-directory";
    var urlBuyLeadDirectVN = "/vn/buyleads-directory";
    var urlBuyLeadDirectCN = "/cn/buyleads-directory";


    var strPro_DirectEN="/product-directory";
    var strPro_DirectCN="/cn/product-directory";
    var strPro_DirectVN ="/vn/product-directory";

    var strProDirectEN="/product-directory/";
    var strProDirectCN="/cn/product-directory/";
    var strProDirectVN ="/vn/product-directory/";

    var strProCatEN="/product-category/";
    var strProCatCN="/cn/product-category/";
    var strProCatVN="/vn/product-category/";
    var strBuyCatEN="/buylead-category/";
    var strBuyCatCN="/cn/buylead-category/";
    var strBuyCatVN ="/vn/buylead-category/";

    var strBuyLeadsVN ="/vn/Buying-leads/";
    var strBuyLeadsCN ="/cn/Buying-leads/";
    var strBuyLeadsEN ="/Buying-leads/";

    var strProductVN ="/vn/Product";
    var strProductCN="/cn/Product";
    var strProductEN="/Product";

    var ENLanguage ="?language=en";
    var VNLanguage ="?language=vn";

    var paramURL = document.location.href;
    if(paramURL.lastIndexOf("#") >=0){
        paramURL = paramURL.substring(0, paramURL.lastIndexOf("#"));
    }
    var newParamURL ="";
    var strCNName="";
    var strENName ="";
    var strVNName= "";


    var strSearch = "/Search/";
    //Control Search
    if(paramURL.indexOf(strSearch) >=0){
        if (paramURL.indexOf("/vn/")>=0)
        {
            newParamURL = paramURL.replace("/vn/","/cn/");
            location.href = newParamURL;
        }
        else if (paramURL.indexOf("/en/")>=0)
        {
            newParamURL = paramURL.replace("/en/","/cn/");
            location.href = newParamURL;
        }else
        {
            return false;

        }




    }

    //Control Show product of subcategory
    if(paramURL.indexOf(urlShowSubCategoryVN) >=0){
        newParamURL = paramURL.replace(urlShowSubCategoryVN, urlShowSubCategoryCN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlShowSubCategory) >=0){
        newParamURL = paramURL.replace(urlShowSubCategory, urlShowSubCategoryCN);
        location.href =  newParamURL;
        return;
    }
    //Control BuyLead_direction by Cat
    if(paramURL.indexOf(urlBuyLeadDirectVNByCat) >=0){
        newParamURL = paramURL.replace(urlBuyLeadDirectVNByCat, urlBuyLeadDirectCNByCat);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlBuyLeadDirectENByCat) >=0){
        newParamURL = paramURL.replace(urlBuyLeadDirectENByCat, urlBuyLeadDirectCNByCat);
        location.href =  newParamURL;
        return;
    }
    //Control BuyLead_direction
    if(paramURL.indexOf(urlBuyLeadDirectVN) >=0){
        newParamURL = paramURL.replace(urlBuyLeadDirectVN, urlBuyLeadDirectCN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlBuyLeadDirectEN) >=0){
        newParamURL = paramURL.replace(urlBuyLeadDirectEN, urlBuyLeadDirectCN);
        location.href =  newParamURL;
        return;
    }

    //Control Product_direction

    if(paramURL.indexOf(strPro_DirectVN) >=0){
        newParamURL = paramURL.replace(strPro_DirectVN, strPro_DirectCN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strPro_DirectEN) >= 0){
        newParamURL = paramURL.replace(strPro_DirectEN, strPro_DirectCN);
        location.href =  newParamURL;
        return;
    }

    //Control Product_direction detail

    if(paramURL.indexOf(strProDirectVN) >=0){
        newParamURL = paramURL.replace(strProDirectVN, strProDirectCN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProDirectEN) >= 0){
        newParamURL = paramURL.replace(strProDirectEN, strProDirectCN);
        location.href =  newParamURL;
        return;
    }
    //CONTROL PRODUCT - CATEGORIES
    if(paramURL.indexOf(strProCatVN) >=0){
        newParamURL = paramURL.replace(strProCatVN, strProCatCN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProCatEN) >=0){
        newParamURL = paramURL.replace(strProCatEN, strProCatCN);
        location.href =  newParamURL;
        return;
    }
    //END CONTROL PRODUCT - CATEGORIES

    //CONTROL Buylead - CATEGORIES
    if(paramURL.indexOf(strBuyCatVN) >=0){
        newParamURL = paramURL.replace(strBuyCatVN, strBuyCatCN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strBuyCatEN) >=0){
        newParamURL = paramURL.replace(strBuyCatEN, strBuyCatCN);
        location.href =  newParamURL;
        return;
    }
    //END Buylead PRODUCT - CATEGORIES

    //CONTROL BUYLEADS

    if(paramURL.indexOf(strBuyLeadsVN) >=0){
        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;

        newParamURL = paramURL.replace(strBuyLeadsVN, strBuyLeadsCN);
        if(strVNName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) +"/"+ strCNName + ".html";
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strBuyLeadsEN) >=0){
        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;
        newParamURL = paramURL.replace(strBuyLeadsEN, strBuyLeadsCN);
        if(strENName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) +"/"+ strCNName + ".html";
        location.href =  newParamURL;
        return;
    }
    //END CONTROL BUYLEADS
    //CONTROL PRODUCTS
    if(paramURL.indexOf(strProductVN) >=0){
        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;
        newParamURL = paramURL.replace(strProductVN, strProductCN);
        if(strVNName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) +"/"+ strCNName + ".html";
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProductEN) >=0){
        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;
        newParamURL = paramURL.replace(strProductEN, strProductCN);
        if(strENName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) +"/"+ strCNName + ".html";
        location.href = newParamURL;
        return;
    }
    //END CONTROL PRODUCTS
    if(paramURL.indexOf(ENLanguage)>=0 ){
        //        newParamURL = paramURL.substring(0, paramURL.indexOf(ENLanguage)) +"?language=vn";
        newParamURL = paramURL.replace(ENLanguage, "?language=cn");
        location.href = newParamURL;
    } else if(paramURL.indexOf(VNLanguage)>=0 ) {
        //newParamURL = paramURL.substring(0, paramURL.indexOf(VNLanguage)) +"?language=cn";
        newParamURL = paramURL.replace(VNLanguage, "?language=cn");
        location.href =  newParamURL;
    } else {
        if(paramURL.indexOf("language=")>0){
            var filtered_url = paramURL.replace("language=en","language=cn");
            filtered_url = filtered_url.replace("language=vn","language=cn");
            location.href = filtered_url;
        }else if(paramURL.indexOf("?")>0){
            location.href = paramURL + "&language=cn";
        }else if(paramURL.indexOf("/en")>0){
            var strURLVN = paramURL.replace("/en","/cn");
            location.href = strURLVN;
        }else if(paramURL.indexOf("/vn")>0){
            var strURLCN = paramURL.replace("/vn","/cn");
            location.href = strURLCN;
        }else if(paramURL == "http://www.vigogo.com/" || paramURL == "http://localhost:8083/"){
            location.href=paramURL+"cn";
        }else {
            location.href=paramURL+"?language=cn";
        }
    }
}
function initLanguageEN() {
    //    var paramURL = document.location.href;
    //    alert(paramURL);

    var urlShowSubCategory = "/show-category/";
    var urlShowSubCategoryVN = "/vn/show-category/";
    var urlShowSubCategoryCN = "/cn/show-category/";

    var urlBuyLeadDirectENByCat = "/buyleads-directory/";
    var urlBuyLeadDirectVNByCat = "/vn/buyleads-directory/";
    var urlBuyLeadDirectCNByCat = "/cn/buyleads-directory/";

    var urlBuyLeadDirectEN = "/buyleads-directory";
    var urlBuyLeadDirectVN = "/vn/buyleads-directory";
    var urlBuyLeadDirectCN = "/cn/buyleads-directory";

    var strPro_DirectEN="/product-directory";
    var strPro_DirectCN="/cn/product-directory";
    var strPro_DirectVN ="/vn/product-directory";

    var strProDirectEN="/product-directory/";
    var strProDirectCN="/cn/product-directory/";
    var strProDirectVN ="/vn/product-directory/";

    var strProCatEN="/product-category/";
    var strProCatCN="/cn/product-category/";
    var strProCatVN ="/vn/product-category/";
    var strBuyCatEN="/buylead-category/";
    var strBuyCatCN="/cn/buylead-category/";
    var strBuyCatVN ="/vn/buylead-category/";
    
    var strBuyLeadsVN ="/vn/Buying-leads/";
    var strBuyLeadsCN ="/cn/Buying-leads/";
    var strBuyLeads ="/Buying-leads/";

    var strProductVN ="/vn/Product";
    var strProductCN="/cn/Product";
    var strProductEN="/Product";

    var CNLanguage ="?language=cn";
    var VNLanguage ="?language=vn";
    var paramURL = document.location.href;

    if(paramURL.lastIndexOf("#") >=0)
        paramURL = paramURL.substring(0, paramURL.lastIndexOf("#"));
    var newParamURL ="";
    var strCNName="";
    var strENName ="";
    var strVNName= "";

    var strSearch = "/Search/";
    //Control Search
    if(paramURL.indexOf(strSearch) >=0){
        if (paramURL.indexOf("/cn/")>=0)
        {
            newParamURL = paramURL.replace("/cn/","/en/");
            location.href = newParamURL;
        }
        else if (paramURL.indexOf("/vn/")>=0)
        {
            newParamURL = paramURL.replace("/vn/","/en/");
            location.href = newParamURL;
                
        }else
        {
            return false;
        }




    }


    //Control Show product of subcategory
    if(paramURL.indexOf(urlShowSubCategoryCN) >=0){

        newParamURL = paramURL.replace(urlShowSubCategoryCN, urlShowSubCategory);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlShowSubCategoryVN) >=0){

        newParamURL = paramURL.replace(urlShowSubCategoryVN, urlShowSubCategory);
        location.href =  newParamURL;
        return;
    }
    //Control BuyLead_direction by Cat
    if(paramURL.indexOf(urlBuyLeadDirectCNByCat) >=0){

        newParamURL = paramURL.replace(urlBuyLeadDirectCNByCat, urlBuyLeadDirectENByCat);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlBuyLeadDirectVNByCat) >=0){

        newParamURL = paramURL.replace(urlBuyLeadDirectVNByCat, urlBuyLeadDirectENByCat);
        location.href =  newParamURL;
        return;
    }
    //Control BuyLead_direction
    if(paramURL.indexOf(urlBuyLeadDirectCN) >=0){

        newParamURL = paramURL.replace(urlBuyLeadDirectCN, urlBuyLeadDirectEN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(urlBuyLeadDirectVN) >=0){

        newParamURL = paramURL.replace(urlBuyLeadDirectVN, urlBuyLeadDirectEN);
        location.href =  newParamURL;
        return;
    }
    //Control Product_direction
    if(paramURL.indexOf(strPro_DirectCN) >=0){

        newParamURL = paramURL.replace(strPro_DirectCN, strPro_DirectEN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strPro_DirectVN) >=0){

        newParamURL = paramURL.replace(strPro_DirectVN, strPro_DirectEN);
        location.href =  newParamURL;
        return;
    }

    //Control Product_direction DETAIL
    if(paramURL.indexOf(strProDirectCN) >=0){

        newParamURL = paramURL.replace(strProDirectCN, strProDirectEN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProDirectVN) >=0){

        newParamURL = paramURL.replace(strProDirectVN, strProDirectEN);
        location.href =  newParamURL;
        return;
    }

    //CONTROL PRODUCT - CATEGORIES
    if(paramURL.indexOf(strProCatCN) >=0){

        newParamURL = paramURL.replace(strProCatCN, strProCatEN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProCatVN) >=0){

        newParamURL = paramURL.replace(strProCatVN, strProCatEN);
        location.href =  newParamURL;
        return;
    }
    //CONTROL Buylead - CATEGORIES
    if(paramURL.indexOf(strBuyCatCN) >=0){

        newParamURL = paramURL.replace(strBuyCatCN, strBuyCatEN);
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strBuyCatVN) >=0){

        newParamURL = paramURL.replace(strBuyCatVN, strBuyCatEN);
        location.href =  newParamURL;
        return;
    }
    //END CONTROL PRODUCT - CATEGORIES

    if(paramURL.indexOf(strBuyLeadsVN) >=0){

        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;

        newParamURL = paramURL.replace(strBuyLeadsVN, strBuyLeads);
        if(strVNName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) + "/"+ strENName +".html";
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strBuyLeadsCN) >=0){

        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;

        newParamURL = paramURL.replace(strBuyLeadsCN, strBuyLeads);
        if(strCNName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) + "/"+ strENName +".html";
        location.href = newParamURL;
        return;
    }
    //END CONTROL BUYLEADS
    //CONTROL PRODUCTS
    if(paramURL.indexOf(strProductVN) >=0){

        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;

        newParamURL = paramURL.replace(strProductVN, strProductEN);
        if(strVNName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) + "/"+ strENName +".html";
        location.href = newParamURL;
        return;
    }else if(paramURL.indexOf(strProductCN) >=0){

        strCNName = document.getElementById("strCNName").value;
        strENName = document.getElementById("strENName").value;
        strVNName = document.getElementById("strVNName").value;

        newParamURL = paramURL.replace(strProductCN, strProductEN);
        if(strCNName!=null)
            newParamURL = newParamURL.substring(0, newParamURL.lastIndexOf("/")) + "/"+ strENName +".html";
        location.href = newParamURL;
        return;
    }
    //END CONTROL PRODUCT
    if(paramURL.indexOf(CNLanguage)>=0 ){
        //        newParamURL = paramURL.substring(0, paramURL.indexOf(CNLanguage)) ;

        newParamURL = paramURL.replace(CNLanguage, "?language=en");
        location.href = newParamURL;
    } else if(paramURL.indexOf(VNLanguage)>=0 ) {
        //      newParamURL = paramURL.substring(0, paramURL.indexOf(VNLanguage)) ;

        newParamURL = paramURL.replace(VNLanguage, "?language=en");
        location.href = newParamURL;
    } else {
        if(paramURL.indexOf("language=")>0){

            var filtered_url = paramURL.replace("language=vn","language=en");
            filtered_url = filtered_url.replace("language=cn","language=en");
            location.href = filtered_url;
        }else if(paramURL.indexOf("?")>0){

            location.href = paramURL + "&language=en";
        }else if(paramURL.indexOf("/vn/")==paramURL.length-4){
            var strURLVN = paramURL.replace("/vn","");
            location.href = strURLVN;
        }else if(paramURL.indexOf("/cn/")==paramURL.length-4){
            var strURLVN = paramURL.replace("/cn","");
            location.href = strURLVN;
        }else if(paramURL.indexOf("/vn")>0){
            var strURLVN = paramURL.replace("/vn","/en");
            location.href = strURLVN;
        }else if(paramURL.indexOf("/cn")>0){
            var strURLCN = paramURL.replace("/cn","/en");
            location.href = strURLCN;
        }else {
            location.href=paramURL+"?language=en";
        }
    }
}
function changeMenuMember(obj,bgcolor)
{
    if(obj.id!="menuSelect")
    {
        obj.parentNode.style.backgroundColor=bgcolor;
    }
}

function findAndReplace(numberOfPosition, url ,stringToReplace,callCountryNumber)
{

    if (url.indexOf("/Search/")>=0)
    {
        var abc = url.indexOf("/Search/");
        var begin = abc+1;
        var j;
        var temp;
        for(j=0;j<numberOfPosition;j++)
        {
            var idx = url.indexOf("/",begin);
            begin = idx+1;
            temp = url.substring(begin);
        }
        var nextIdx = temp.indexOf("/");
        var value = temp.substring(0,nextIdx);
        var newTemp = temp.replace(value,stringToReplace);
        url = url.replace(temp,newTemp);
        return url;
    }else
    {
        if(callCountryNumber==null||callCountryNumber==1){
            var isGroupId=false;
            var isCateId=false;
            var isCountryId=false;
            if(callCountryNumber==1){
                isCountryId=true;
            }

            if(stringToReplace.indexOf("CA")>-1){
                isCateId=true;
            }else if(stringToReplace.indexOf("GR")>-1){
                isGroupId=true;
            }

            var countryParam="";
            if(isCountryId){

                if(url.indexOf("countryid")==-1){
                    countryParam="&countryid="+stringToReplace;
                }else{
                    url=url.substring(0,url.indexOf("countryid")-1);
                    countryParam="&countryid="+stringToReplace;

                }
            }


            if(isCountryId){

                url=url+countryParam;
            }else{
                 url=url.substr(0,url.indexOf("?"));
                if(isCateId){
                    url=url+"?categoryid="+stringToReplace;
                }else if(isGroupId){
                    url=url+"?groupid="+stringToReplace;
                }
            }
        }
        return url;

    }
}

function goPrev()
{
    var url = location.toString();
    if (url.indexOf("/Search/")>-1)
    {
        var page = parseInt(getSearchValue(11, url));
        page-=1;
        url = findAndReplace(11, url, page);
        location = url;
    }

}
function goNext()
{
 
    var url = location.toString();
    if (url.indexOf("/Search/")>-1)
    {
        var page = parseInt(getSearchValue(11, url));
        page+=1;
        url = findAndReplace(11, url, page);
        location = url;
    }
    
}
function goToPage(page)
{
    var url = location.toString();
    if (url.indexOf("/Search/")>-1)
    {
        url = findAndReplace(11, url, page);
        location = url;
    }
}

function getSearchValue(numberOfPosition, url)
{
    if (url.indexOf("/Search/")>=0)
    {
        var abc = url.indexOf("/Search/");
        var begin = abc+1;
        var j;
        var temp;
        for(j=0;j<numberOfPosition;j++)
        {
            var idx = url.indexOf("/",begin);
            begin = idx+1;
            temp = url.substring(begin);
        }
        var nextIdx = temp.indexOf("/");
        var value = temp.substring(0,nextIdx);
        return value;
    }else
    {
        return false;
    }
   
}

function getXMLHTTP()
{
    if(window.XMLHttpRequest){
        return new XMLHttpRequest();
    }
    if(window.ActiveXObject){
        return new ActiveXObject("Microsoft.XMLHTTP");
    }
    return null;
}

function productCheck(cbx)
{
    var value = cbx.value;
    var url = location.toString();
    var path;
    var xmlHttp;
    if (url.indexOf("/Search/Product/")>-1||url.indexOf("/Search/Group-product/")>-1)
    {  
        xmlHttp = getXMLHTTP();
        if(xmlHttp == null){
            alert("Your browser doesn't support ajax");
            return;
        }
        xmlHttp.onreadystatechange = function(){
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
                var result = xmlHttp.responseText;
                result=trimRightSpace(result)
                document.getElementById("proView1").innerHTML = result;
                
                if (parseInt(result)==0){
                    document.getElementById("unchkContact").style.display='block';
                    document.getElementById("chkContact").style.display='none';
                }else if(parseInt(result)>0){
                    document.getElementById("unchkContact").style.display="none";
                    document.getElementById("chkContact").style.display='block';
                }
            }
        }
        if (cbx.checked == true)
        {
            path = "/loadCheckedPro.jsp?action=add&value=" + value;
        }else
        {
            path = "/loadCheckedPro.jsp?action=remove&value=" + value;
        }
        //                var url = "/loadCheckedPro?action=add" + productId;
        xmlHttp.open("GET", path, null);
        xmlHttp.send(null);
    }else if (url.indexOf("/Search/BuyLead/")>-1)
    {
        xmlHttp = getXMLHTTP();
        if(xmlHttp == null){
            alert("Your browser doesn't support ajax");
            return;
        }
        xmlHttp.onreadystatechange = function(){
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
                var result = xmlHttp.responseText;
                result=trimRightSpace(result)+"";
                document.getElementById("reqView").innerHTML = result;
                if (parseInt(result)==0){
                    document.getElementById("unchkContact").style.display='block';
                    document.getElementById("chkContact").style.display='none';
                }else if(parseInt(result)>0){
                    document.getElementById("unchkContact").style.display="none";
                    document.getElementById("chkContact").style.display='block';
                }
            }
        }
        if (cbx.checked == true)
        {
            path = "/loadCheckedBuy.jsp?action=add&value=" + value;
        }else
        {
            path = "/loadCheckedBuy.jsp?action=remove&value=" + value;
        }
        //                var url = "/loadCheckedPro?action=add" + productId;
        xmlHttp.open("GET", path, true);
        xmlHttp.send(true);
    }
}



function getGoToPage(obj,page)
{
    var url = location.toString();
    if (url.indexOf("/Search/")>-1)
    {
        url = findAndReplace(11, url, page);
        obj.href=url;
    }
}

function trimRightSpace(str)
{
    var length=str.length-1;
    while(length>=0&&str.charAt(length)==' ')
    {
	length--;
    }
    return str.substr(0,length+1);
}

function getGoPrev(obj,isNonKeyword){
    var url = location.toString();
    if (url.indexOf("/Search/")>-1)
    {
        var page=0;
        if(isNonKeyword!=null&&isNonKeyword!=undefined&&isNonKeyword!=true){
            page = parseInt(getSearchValue(11, url));
        }else{
            page = parseInt(getSearchValue(12, url));
        }
        page-=1;
        if(isNonKeyword!=null&&isNonKeyword!=undefined&&isNonKeyword!=true){
            url = findAndReplace(11, url, page);
        }else{
             url = findAndReplace(12, url, page);
        }
        obj.href = url;
    }
}

function getGoNext(obj,isNonKeyword)
{
    var url = location.toString();
    if (url.indexOf("/Search/")>-1)
    {
        var page=0;
        if(isNonKeyword!=null&&isNonKeyword!=undefined&&isNonKeyword!=true){
            page = parseInt(getSearchValue(11, url));
        }else{
            page = parseInt(getSearchValue(12, url));
        }
        page+=1;
        if(isNonKeyword!=null&&isNonKeyword!=undefined&&isNonKeyword!=true){
            url = findAndReplace(11, url, page);
        }else{
             url = findAndReplace(12, url, page);
        }
        obj.href=url;
    }

}

function changeColorBlock(obj,borderColor,backgroundColor,fontColor){
    obj.style.background=backgroundColor;
    obj.style.borderColor=borderColor;
    obj.style.color=fontColor;
}

function changeColorPage(obj,eventMouseName){

    if(eventMouseName=="over")
        changeColorBlock(obj,"#637EB0","#C2D7EE","#5B76AE");
    else
        changeColorBlock(obj,"#768BB9","#EEF3FB","#000000");

}


function changeColorBackground(obj,colorBackground){
    if(obj!=null)
        obj.style.background=colorBackground;
}

function showDivMenuCart(idTab,idContent){
    var contentTab=document.getElementById(idTab);
    contentTab.style.color="black";
    contentTab.style.backgroundImage = "url('/images/bg/bgBrowse.jpg')";

    var contentMenu=document.getElementById(idContent);
    contentMenu.style.display="";
}

function hiddenDivMenuCart(idTab,idContent){
     var contentTab=document.getElementById(idTab);
     contentTab.style.color="white";
      contentTab.style.backgroundImage ="url('/images/bg/bgBrowse_a.jpg')";
    var contentMenu=document.getElementById(idContent);
  
    contentMenu.style.display="none";
}
