﻿var sEnCodeUrl = '';
function EnCodeUrl(sUrl)
{
    if(sUrl.indexOf('&') > 0 || sUrl.indexOf('=') > 0 )
    {
        if(sUrl.indexOf('&') > 0)
            sUrl = sUrl.replace("&","@@@");
        if(sUrl.indexOf('=') > 0)
            sUrl = sUrl.replace("=","@_@");
            
        sEnCodeUrl = sUrl;
        
        EnCodeUrl(sUrl);
    }
    else
    {
        return;
    }
}

function SaveUserBrowseHistory(sUserHisCategory, sUserHisTitle, sIdentity, bIsLoadList, bIsSaveList)
{
    EnCodeUrl(top.location.href);
    if(sEnCodeUrl == '')
    {
        sEnCodeUrl = top.location.href;
    }
    
    var oIframe = document.getElementById("UserBrowseHistory");
    if(bIsLoadList == 'False')
    {
        oIframe.height = 0;
    }
    sUserHisCategory = sUserHisCategory.replace(",","，");
    sUserHisTitle = sUserHisTitle.replace(",","，");
    oIframe.src = '/UserData/UserData_iFrame.htm?UserHisCategory=' + escape(sUserHisCategory) + '&UserHisTitle=' + escape(sUserHisTitle) + '&UserHisTopUrl=' + escape(sEnCodeUrl) + '&sUserHisIdentity=' + escape(sIdentity) + '&IsLoadList=' + escape(bIsLoadList) + '&IsSaveList=' + escape(bIsSaveList);
    //alert(oIframe.src);
}
